@Override
 protected Item buildMyPlant(MOB mob, Room room) {
   final int code = material & RawMaterial.RESOURCE_MASK;
   final Item newItem = CMClass.getBasicItem("GenItem");
   final String name =
       CMLib.english().startWithAorAn(RawMaterial.CODES.NAME(code).toLowerCase() + " tree");
   newItem.setName(name);
   newItem.setDisplayText(L("@x1 grows here.", newItem.name()));
   newItem.setDescription("");
   newItem.basePhyStats().setWeight(10000);
   CMLib.flags().setGettable(newItem, false);
   newItem.setMaterial(material);
   newItem.setSecretIdentity(mob.Name());
   newItem.setMiscText(newItem.text());
   room.addItem(newItem);
   final Chant_SummonTree newChant = new Chant_SummonTree();
   newItem.basePhyStats().setLevel(10 + newChant.getX1Level(mob));
   newItem.setExpirationDate(0);
   room.showHappens(
       CMMsg.MSG_OK_ACTION,
       L("a tall, healthy @x1 tree sprouts up.", RawMaterial.CODES.NAME(code).toLowerCase()));
   room.recoverPhyStats();
   newChant.plantsLocationR = room;
   newChant.littlePlantsI = newItem;
   if (CMLib.law().doesOwnThisLand(mob, room)) {
     newChant.setInvoker(mob);
     newChant.setMiscText(mob.Name());
     newItem.addNonUninvokableEffect(newChant);
   } else newChant.beneficialAffect(mob, newItem, 0, (newChant.adjustedLevel(mob, 0) * 240) + 450);
   room.recoverPhyStats();
   return newItem;
 }
Exemple #2
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();
     }
   }
 }