Ejemplo n.º 1
0
 public synchronized void clearDebri(Room room, int taskCode) {
   Tick almostTock = null;
   TockClient C = null;
   ItemTicker I = null;
   Iterator<TockClient> roomSet;
   MOB mob = null;
   for (Iterator<Tick> e = tickGroups(); e.hasNext(); ) {
     almostTock = e.next();
     roomSet = almostTock.getLocalItems(taskCode, room);
     if (roomSet != null)
       for (; roomSet.hasNext(); ) {
         C = (TockClient) roomSet.next();
         if (C.clientObject instanceof ItemTicker) {
           I = (ItemTicker) C.clientObject;
           almostTock.delTicker(C);
           I.setProperLocation(null);
         } else if (C.clientObject instanceof MOB) {
           mob = (MOB) C.clientObject;
           if ((mob.isMonster()) && (!room.isInhabitant(mob))) {
             mob.destroy();
             almostTock.delTicker(C);
           }
         }
       }
   }
 }
Ejemplo n.º 2
0
 public void rejuv(Room here, int tickID) {
   Tick almostTock = null;
   TockClient C = null;
   Tickable E2 = null;
   boolean doItems = ((tickID == 0) || (tickID == Tickable.TICKID_ROOM_ITEM_REJUV));
   boolean doMobs = ((tickID == 0) || (tickID == Tickable.TICKID_MOB));
   for (Iterator<Tick> e = tickGroups(); e.hasNext(); ) {
     almostTock = e.next();
     try {
       for (Iterator i = almostTock.tickers(); i.hasNext(); ) {
         C = (TockClient) i.next();
         E2 = C.clientObject;
         if ((doItems)
             && (E2 instanceof ItemTicker)
             && ((here == null) || (((ItemTicker) E2).properLocation() == here))) {
           C.tickDown = 0;
           if (Tick.tickTicker(C, false)) almostTock.delTicker(C);
         } else if ((doMobs)
             && (E2 instanceof MOB)
             && (((MOB) E2).amDead())
             && ((here == null) || (((MOB) E2).getStartRoom() == here))
             && (((MOB) E2).baseEnvStats().rejuv() > 0)
             && (((MOB) E2).baseEnvStats().rejuv() < Integer.MAX_VALUE)
             && (((MOB) E2).envStats().rejuv() > 0)) {
           C.tickDown = 0;
           ((MOB) E2).envStats().setRejuv(0);
           if (Tick.tickTicker(C, false)) almostTock.delTicker(C);
         }
       }
     } catch (NoSuchElementException ex) {
     }
   }
 }
Ejemplo n.º 3
0
 public boolean deleteTick(Tickable E, int tickID) {
   Tick almostTock = null;
   Iterator set = null;
   for (Iterator<Tick> e = tickGroups(); e.hasNext(); ) {
     almostTock = e.next();
     set = almostTock.getTickSet(E, tickID);
     for (; set.hasNext(); ) almostTock.delTicker((TockClient) set.next());
   }
   return false;
 }
Ejemplo n.º 4
0
 public void tickAllTickers(Room here) {
   Tick almostTock = null;
   TockClient C = null;
   Tickable E2 = null;
   for (Iterator<Tick> e = tickGroups(); e.hasNext(); ) {
     almostTock = e.next();
     try {
       for (Iterator<TockClient> i = almostTock.tickers(); i.hasNext(); ) {
         C = i.next();
         E2 = C.clientObject;
         if (here == null) {
           if (Tick.tickTicker(C, false)) almostTock.delTicker(C);
         } else if (isHere(E2, here)) {
           if (Tick.tickTicker(C, isSuspended)) almostTock.delTicker(C);
         } else if ((E2 instanceof Ability) && (isHere(((Ability) E2).affecting(), here))) {
           if (Tick.tickTicker(C, isSuspended)) almostTock.delTicker(C);
         }
       }
     } catch (NoSuchElementException ex) {
     }
   }
 }