Exemple #1
0
 public void setMiscText(String text) {
   super.setMiscText(text);
   if (!(affected instanceof MOB)) {
     Vector parms = CMParms.parse(text.toUpperCase());
     unLocatable = parms.contains("UNLOCATABLE");
   }
 }
 @Override
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   super.executeMsg(myHost, msg);
   if ((reRollFlag)
       && (affected instanceof MOB)
       && (msg.sourceMinor() == CMMsg.TYP_LOOK)
       && (msg.source() == affected)) {
     final MOB M = msg.source();
     if ((M.session() != null) && (M.playerStats() != null)) {
       final Ability me = this;
       CMLib.threads()
           .executeRunnable(
               new Runnable() {
                 @Override
                 public void run() {
                   try {
                     CMLib.login()
                         .promptBaseCharStats(
                             M.playerStats().getTheme(), M, 300, M.session(), bonusPointsPerStat);
                     M.recoverCharStats();
                     if (rePickClass)
                       M.baseCharStats()
                           .setCurrentClass(
                               CMLib.login()
                                   .promptCharClass(M.playerStats().getTheme(), M, M.session()));
                     M.recoverCharStats();
                     M.delEffect(me);
                     M.baseCharStats().getCurrentClass().grantAbilities(M, false);
                   } catch (final IOException e) {
                   }
                 }
               });
     }
   }
 }
 @Override
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   super.executeMsg(myHost, msg);
   if (((msg.sourceMinor() == CMMsg.TYP_SHUTDOWN)
           || ((msg.targetMinor() == CMMsg.TYP_EXPIRE) && (msg.target() == affected))
           || (msg.sourceMinor() == CMMsg.TYP_ROOMRESET))
       && (affected instanceof Room)) {
     updateLot(null);
     final Vector mobs = new Vector();
     Room R = (Room) affected;
     if (R != null) {
       synchronized (("SYNC" + R.roomID()).intern()) {
         R = CMLib.map().getRoom(R);
         for (int m = 0; m < R.numInhabitants(); m++) {
           final MOB M = R.fetchInhabitant(m);
           if ((M != null)
               && (M.isSavable())
               && (M.getStartRoom() == R)
               && ((M.basePhyStats().rejuv() == 0)
                   || (M.basePhyStats().rejuv() == PhyStats.NO_REJUV))) {
             CMLib.catalog().updateCatalogIntegrity(M);
             mobs.addElement(M);
           }
         }
         if (!CMSecurity.isSaveFlag(CMSecurity.SaveFlag.NOPROPERTYMOBS))
           CMLib.database().DBUpdateTheseMOBs(R, mobs);
       }
     }
   }
 }
 @Override
 public void executeMsg(Environmental affecting, CMMsg msg) {
   super.executeMsg(affecting, msg);
   if (msg.amITarget(affecting)) {
     boolean activated = false;
     if (affecting instanceof MOB) {
       if ((msg.targetMajor(CMMsg.MASK_MALICIOUS)) && (!msg.source().isMonster()))
         activated = true;
     } else if ((affecting instanceof Food) || (affecting instanceof Drink)) {
       if ((msg.targetMinor() == CMMsg.TYP_EAT) || (msg.targetMinor() == CMMsg.TYP_DRINK))
         activated = true;
     } else if ((affecting instanceof Armor) || (affecting instanceof Weapon)) {
       if ((msg.targetMinor() == CMMsg.TYP_WEAR)
           || (msg.targetMinor() == CMMsg.TYP_HOLD)
           || (msg.targetMinor() == CMMsg.TYP_WIELD)) activated = true;
     } else if (affecting instanceof Item) {
       if ((msg.targetMinor() == CMMsg.TYP_GET)
           || (msg.targetMinor() == CMMsg.TYP_PUSH)
           || (msg.targetMinor() == CMMsg.TYP_PULL)) activated = true;
     } else activated = true;
     if (activated) {
       synchronized (killTrigger) {
         killTrigger[0] = true;
         if (!CMLib.threads().isTicking(this, Tickable.TICKID_MISCELLANEOUS))
           CMLib.threads().startTickDown(this, Tickable.TICKID_MISCELLANEOUS, 500, 1);
       }
     }
   }
 }
 @Override
 public void setAffectedOne(Physical P) {
   super.setAffectedOne(P);
   if (P == null) {
     removeMyAffectsFromLastMOB();
     finalize();
   }
 }
 @Override
 public void setMiscText(String newMiscText) {
   super.setMiscText(newMiscText);
   final String maskStr = CMParms.getParmStr(newMiscText, "mask", "");
   mask = null;
   if ((maskStr != null) && (maskStr.trim().length() > 0))
     mask = CMLib.masking().getPreCompiledMask(maskStr);
 }
 @Override
 public void executeMsg(Environmental host, CMMsg msg) {
   if ((affected instanceof Room) || (affected instanceof Area)) {
     if ((msg.targetMinor() == CMMsg.TYP_LEAVE) || (msg.sourceMinor() == CMMsg.TYP_RECALL))
       removeMyAffectsFrom(msg.source());
     if (msg.targetMinor() == CMMsg.TYP_ENTER)
       addMeIfNeccessary(msg.source(), msg.source(), true, 0, maxTicks);
   }
   super.executeMsg(host, msg);
 }
 @Override
 public void setMiscText(String newText) {
   super.setMiscText(newText);
   spellV = null;
   compiledMask = null;
   lastMOB = null;
   chanceToHappen = -1;
   maxTicks = -1;
   final String maskString = getMaskString(newText);
   if (maskString.length() > 0) compiledMask = CMLib.masking().getPreCompiledMask(maskString);
 }
Exemple #9
0
 @Override
 public void setMiscText(String txt) {
   noFollow = false;
   noSneak = false;
   final Vector<String> parms = CMParms.parse(txt.toUpperCase());
   String s;
   for (final Enumeration<String> p = parms.elements(); p.hasMoreElements(); ) {
     s = p.nextElement();
     if ("NOFOLLOW".startsWith(s)) noFollow = true;
     else if (s.startsWith("NOSNEAK")) noSneak = true;
   }
   super.setMiscText(txt);
 }
Exemple #10
0
 public void affectEnvStats(Environmental affected, EnvStats affectableStats) {
   super.affectEnvStats(affected, affectableStats);
   if (affected instanceof MOB) {
     affectableStats.setSensesMask(affectableStats.sensesMask() | EnvStats.CAN_SEE_HIDDEN);
     if (ticksSinceLoss > 30)
       affectableStats.setDisposition(affectableStats.disposition() | EnvStats.IS_HIDDEN);
   } else {
     if (unLocatable)
       affectableStats.setSensesMask(affectableStats.sensesMask() | EnvStats.SENSE_UNLOCATABLE);
     if (affected instanceof Item) {
       if ((((Item) affected).owner() != null) && (((Item) affected).owner() instanceof Room))
         affectableStats.setDisposition(affectableStats.disposition() | EnvStats.IS_HIDDEN);
     } else affectableStats.setDisposition(affectableStats.disposition() | EnvStats.IS_HIDDEN);
   }
 }
 @Override
 public void setMiscText(String newMiscText) {
   super.setMiscText(newMiscText);
   bonusPointsPerStat = CMParms.getParmInt(newMiscText, "BONUSPOINTS", 0);
   rePickClass = CMParms.getParmBool(newMiscText, "PICKCLASS", false);
 }
 @Override
 public void setMiscText(String newMiscText) {
   super.setMiscText(newMiscText);
 }
Exemple #13
0
 public void affectCharStats(MOB affected, CharStats affectableStats) {
   super.affectCharStats(affected, affectableStats);
   affectableStats.setStat(
       CharStats.STAT_SAVE_DETECTION,
       100 + affectableStats.getStat(CharStats.STAT_SAVE_DETECTION));
 }