예제 #1
0
 @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;
       }
     }
   }
 }
예제 #2
0
  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);
  }
예제 #3
0
  @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."));
  }
예제 #4
0
  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.");
  }
예제 #5
0
 @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();
 }
예제 #6
0
  @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."));
  }
예제 #7
0
  @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."));
  }
예제 #8
0
  @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."));
  }
예제 #9
0
  @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."));
  }
예제 #10
0
 @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);
   }
 }
예제 #11
0
  @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."));
  }
예제 #12
0
 @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);
 }
예제 #13
0
 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();
 }
예제 #14
0
 @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();
         }
       }
     }
   }
 }
예제 #15
0
  @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));
    }
  }
예제 #16
0
 @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);
 }
예제 #17
0
 @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."));
 }
예제 #19
0
 @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();
       }
     }
   }
 }