Exemplo n.º 1
0
  public void setTrapped(Environmental myThang, Trap theTrap, boolean isTrapped) {
    for (int a = 0; a < myThang.numEffects(); a++) {
      Ability A = myThang.fetchEffect(a);
      if ((A != null) && (A instanceof Trap)) A.unInvoke();
    }

    if ((isTrapped) && (myThang.fetchEffect(theTrap.ID()) == null)) myThang.addEffect(theTrap);
  }
Exemplo n.º 2
0
 public Trap fetchMyTrap(Environmental myThang) {
   if (myThang == null) return null;
   Ability A = null;
   for (int a = 0; a < myThang.numEffects(); a++) {
     A = myThang.fetchEffect(a);
     if ((A != null) && (A instanceof Trap)) return (Trap) A;
   }
   return null;
 }
Exemplo n.º 3
0
 public void extinguish(MOB source, Environmental target, boolean mundane) {
   if (target instanceof Room) {
     Room R = (Room) target;
     for (int m = 0; m < R.numInhabitants(); m++) {
       MOB M = R.fetchInhabitant(m);
       if (M != null) extinguish(source, M, mundane);
     }
     for (int i = 0; i < R.numItems(); i++) {
       Item I = R.fetchItem(i);
       if (I != null) extinguish(source, I, mundane);
     }
     return;
   }
   for (int a = target.numEffects() - 1; a >= 0; a--) {
     Ability A = target.fetchEffect(a);
     if ((A != null)
         && ((!mundane)
             || ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_PROPERTY))) {
       if ((CMath.bset(A.flags(), Ability.FLAG_HEATING) && (!mundane))
           || (CMath.bset(A.flags(), Ability.FLAG_FIREBASED))
           || ((A.ID().equalsIgnoreCase("Spell_SummonElemental")
               && A.text().toUpperCase().indexOf("FIRE") >= 0))) A.unInvoke();
     }
   }
   if ((target instanceof MOB) && (!mundane)) {
     MOB tmob = (MOB) target;
     if (tmob.charStats().getMyRace().ID().equals("FireElemental"))
       CMLib.combat().postDeath(source, (MOB) target, null);
     for (int i = 0; i < tmob.inventorySize(); i++) {
       Item I = tmob.fetchInventory(i);
       if (I != null) extinguish(tmob, I, mundane);
     }
   }
   if ((target instanceof Light) && (((Light) target).isLit())) {
     ((Light) target).tick(target, Tickable.TICKID_LIGHT_FLICKERS);
     ((Light) target).light(false);
   }
 }