@Override public void executeMsg(final Environmental myHost, final CMMsg msg) { super.executeMsg(myHost, msg); if (affected == null) { this.unInvoke(); return; } if (affected instanceof Item) { final Item body = (Item) affected; if (msg.amITarget(body)) { if ((msg.targetMinor() == CMMsg.TYP_OPEN) || (msg.targetMinor() == CMMsg.TYP_GIVE) || (msg.targetMinor() == CMMsg.TYP_GET) || (msg.targetMinor() == CMMsg.TYP_JUSTICE) || (msg.targetMinor() == CMMsg.TYP_GENERAL) || (msg.targetMinor() == CMMsg.TYP_LOCK) || (msg.targetMinor() == CMMsg.TYP_PULL) || (msg.targetMinor() == CMMsg.TYP_PUSH) || (msg.targetMinor() == CMMsg.TYP_UNLOCK)) { this.spring(msg.source()); return; } } } }
public void affectEnvStats(Environmental affected, EnvStats affectableStats) { super.affectEnvStats(affected, affectableStats); if (affected == null) return; if (!(affected instanceof MOB)) return; affectableStats.setSensesMask(affectableStats.sensesMask() | EnvStats.CAN_NOT_MOVE); }
@Override public void unInvoke() { if (!(affected instanceof MOB)) return; final MOB mob = (MOB) affected; super.unInvoke(); if (canBeUninvoked()) mob.tell(L("You stop pondering life and the mysteries of the universe.")); }
public void unInvoke() { // undo the affects of this spell if ((affected == null) || (!(affected instanceof MOB))) return; MOB mob = (MOB) affected; super.unInvoke(); if (canBeUninvoked()) mob.tell("The paralysis eases out of your muscles."); }
@Override public void unInvoke() { if (affected == null) return; final MOB mob = (MOB) affected; if (canBeUninvoked()) { if (!mob.amDead()) spreadImmunity(mob); mob.tell(L("The contagion fades.")); } super.unInvoke(); }
@Override public void unInvoke() { // undo the affects of this spell if (!(affected instanceof MOB)) return; final MOB mob = (MOB) affected; super.unInvoke(); if (canBeUninvoked()) mob.tell(L("The unholy word has been spoken.")); }
@Override public void unInvoke() { // undo the affects of this spell if (!(affected instanceof MOB)) return; final MOB mob = (MOB) affected; super.unInvoke(); if (canBeUninvoked()) mob.tell(L("The aura of fire healing around you fades.")); }
@Override public void unInvoke() { // undo the affects of this spell if (!(affected instanceof MOB)) return; final MOB mob = (MOB) affected; super.unInvoke(); if (canBeUninvoked()) mob.tell(L("Your natural defences against curses take over.")); }
@Override public void unInvoke() { // undo the affects of this spell if ((affected == null) || (!(affected instanceof Room))) return; final Room R = (Room) affected; super.unInvoke(); if (canBeUninvoked()) R.showHappens(CMMsg.MSG_OK_VISUAL, L("The harmful aura around you fades.")); }
@Override public void affectCharStats(MOB affected, CharStats affectableStats) { super.affectCharStats(affected, affectableStats); if ((invoker() != null) && (affected != invoker()) && (CMLib.flags().isEvil(invoker()))) { affectableStats.setStat( CharStats.STAT_CHARISMA, affectableStats.getStat(CharStats.STAT_CHARISMA) - (adjustedLevel(invoker(), 0) / 5)); if (affectableStats.getStat(CharStats.STAT_CHARISMA) <= 0) affectableStats.setStat(CharStats.STAT_CHARISMA, 1); } }
@Override public void unInvoke() { // undo the affects of this spell if (!(affected instanceof MOB)) return; final MOB M = (MOB) affected; super.unInvoke(); if ((canBeUninvoked()) && (M != null) && (!M.amDead()) && (M.location() != null)) M.location() .show(M, null, CMMsg.MSG_OK_VISUAL, L("The aura of strife around <S-NAME> fades.")); }
@Override public void affectCharStats(MOB affected, CharStats affectableStats) { super.affectCharStats(affected, affectableStats); int increase = 1; if (affectableStats.getCurrentClass().baseClass().equals("Fighter")) increase = 1; else if (affectableStats.getCurrentClass().baseClass().equals("Mage")) increase = 2; else if (affectableStats.getCurrentClass().baseClass().equals("Thief")) increase = 1; else if (affectableStats.getCurrentClass().baseClass().equals("Bard")) increase = 1; else if (affectableStats.getCurrentClass().baseClass().equals("Cleric")) increase = 3; else if (affectableStats.getCurrentClass().baseClass().equals("Druid")) increase = 3; increase += (super.getXLEVELLevel(invoker()) + 2) / 3; affectableStats.setStat( CharStats.STAT_WISDOM, affectableStats.getStat(CharStats.STAT_WISDOM) + increase); }
public void unInvoke() { if (canBeUninvoked()) { if (newRoom != null) { newRoom.showHappens(CMMsg.MSG_OK_VISUAL, "The divine gateway closes."); newRoom.rawDoors()[Directions.GATE] = null; newRoom.setRawExit(Directions.GATE, null); } if (oldRoom != null) { oldRoom.showHappens(CMMsg.MSG_OK_VISUAL, "The divine gateway closes."); oldRoom.rawDoors()[Directions.GATE] = null; oldRoom.setRawExit(Directions.GATE, null); } } super.unInvoke(); }
@Override public void unInvoke() { final Physical P = affected; super.unInvoke(); if ((P instanceof MOB) && (this.canBeUninvoked) && (this.unInvoked)) { if ((!P.amDestroyed()) && (((MOB) P).amFollowing() == null)) { final Room R = CMLib.map().roomLocation(P); if (CMLib.law().getLandOwnerName(R).length() == 0) { if (!CMLib.law().doesHavePriviledgesHere(invoker(), R)) { if ((R != null) && (!((MOB) P).amDead())) R.showHappens(CMMsg.MSG_OK_ACTION, P, L("<S-NAME> wander(s) off.")); P.destroy(); } } } } }
@Override public void affectPhyStats(Physical affected, PhyStats affectableStats) { super.affectPhyStats(affected, affectableStats); if (affected == null) return; if (!(affected instanceof MOB)) return; final MOB mob = (MOB) affected; if (mob == invoker) return; final int xlvl = super.getXLEVELLevel(invoker()); if (CMLib.flags().isEvil(mob)) { affectableStats.setArmor(affectableStats.armor() - 15 - (6 * xlvl)); affectableStats.setAttackAdjustment(affectableStats.attackAdjustment() + 20 + (4 * xlvl)); } else if (CMLib.flags().isGood(mob)) { affectableStats.setArmor(affectableStats.armor() + 15 + (6 * xlvl)); affectableStats.setAttackAdjustment(affectableStats.attackAdjustment() - 20 - (4 * xlvl)); } }
@Override public void affectCharStats(MOB affectedMOB, CharStats affectedStats) { super.affectCharStats(affectedMOB, affectedStats); affectedStats.setStat( CharStats.STAT_SAVE_UNDEAD, affectedStats.getStat(CharStats.STAT_SAVE_UNDEAD) + 10); }
@Override public void setAffectedOne(Physical affected) { super.setAffectedOne(affected); }
@Override public void unInvoke() { final MOB M = (MOB) affected; super.unInvoke(); if (canBeUninvoked()) M.tell(L("Your compelled faith is finally subsided.")); }
@Override public void executeMsg(Environmental host, CMMsg msg) { super.executeMsg(host, msg); if ((affected instanceof Item) && (text().length() > 0)) { final Item I = (Item) affected; if ((msg.sourceMinor() == CMMsg.TYP_SPEAK) && (msg.target() == I) && ((msg.source() == I.owner()) || (I.owner() instanceof Room)) && (msg.sourceMessage() != null) && (CMLib.english() .containsString( CMStrings.getSayFromMessage(msg.sourceMessage()).toUpperCase(), "REFUGE"))) { final Room newRoom = this.getRefuge(I); if ((newRoom != null) && (newRoom != msg.source().location())) { final Set<MOB> h = properTargets(msg.source(), null, false); if (h == null) return; final Room thisRoom = msg.source().location(); final Ability thisA = this; msg.addTrailerRunnable( new Runnable() { @Override public void run() { for (final Object element : h) { final MOB follower = (MOB) element; final CMMsg enterMsg = CMClass.getMsg( follower, newRoom, thisA, CMMsg.MSG_ENTER, null, CMMsg.MSG_ENTER, null, CMMsg.MSG_ENTER, L( "<S-NAME> appears in a puff of smoke.@x1", CMLib.protocol().msp("appear.wav", 10))); final CMMsg leaveMsg = CMClass.getMsg( follower, thisRoom, thisA, CMMsg.MSG_LEAVE | CMMsg.MASK_MAGIC, L("<S-NAME> disappear(s) in a puff of smoke.")); if (thisRoom.okMessage(follower, leaveMsg) && newRoom.okMessage(follower, enterMsg)) { if (follower.isInCombat()) { CMLib.commands().postFlee(follower, ("NOWHERE")); follower.makePeace(); } thisRoom.send(follower, leaveMsg); newRoom.bringMobHere(follower, false); newRoom.send(follower, enterMsg); follower.tell(L("\n\r\n\r")); CMLib.commands().postLook(follower, true); } } } }); unInvoke(); } } } }