Пример #1
0
 public void outfit(MOB mob, Vector items) {
   if ((mob == null) || (items == null) || (items.size() == 0)) return;
   for (int i = 0; i < items.size(); i++) {
     Item I = (Item) items.elementAt(i);
     if (mob.fetchInventory("$" + I.name() + "$") == null) {
       I = (Item) I.copyOf();
       I.text();
       I.recoverEnvStats();
       mob.addInventory(I);
       if (I.whereCantWear(mob) <= 0) I.wearIfPossible(mob);
       if (((I instanceof Armor) || (I instanceof Weapon))
           && (I.amWearingAt(Wearable.IN_INVENTORY))) I.destroy();
     }
   }
 }