Пример #1
0
 public static Item buildPlant(MOB mob, Room room) {
   Item newItem = CMClass.getItem("GenItem");
   newItem.setMaterial(RawMaterial.RESOURCE_GREENS);
   switch (CMLib.dice().roll(1, 5, 0)) {
     case 1:
       newItem.setName("some happy flowers");
       newItem.setDisplayText("some happy flowers are growing here.");
       newItem.setDescription("Happy flowers with little red and yellow blooms.");
       break;
     case 2:
       newItem.setName("some happy weeds");
       newItem.setDisplayText("some happy weeds are growing here.");
       newItem.setDescription("Long stalked little plants with tiny bulbs on top.");
       break;
     case 3:
       newItem.setName("a pretty fern");
       newItem.setDisplayText("a pretty fern is growing here.");
       newItem.setDescription("Like a tiny bush, this dark green plant is lovely.");
       break;
     case 4:
       newItem.setName("a patch of sunflowers");
       newItem.setDisplayText("a patch of sunflowers is growing here.");
       newItem.setDescription("Happy flowers with little yellow blooms.");
       break;
     case 5:
       newItem.setName("a patch of bluebonnets");
       newItem.setDisplayText("a patch of bluebonnets is growing here.");
       newItem.setDescription("Happy flowers with little blue and purple blooms.");
       break;
   }
   Chant_SummonPlants newChant = new Chant_SummonPlants();
   newItem.basePhyStats().setLevel(10 + (10 * newChant.getX1Level(mob)));
   newItem.basePhyStats().setWeight(1);
   newItem.setSecretIdentity(mob.Name());
   newItem.setMiscText(newItem.text());
   room.addItem(newItem);
   newItem.setExpirationDate(0);
   room.showHappens(CMMsg.MSG_OK_ACTION, "Suddenly, " + newItem.name() + " sprout(s) up here.");
   newChant.PlantsLocation = room;
   newChant.littlePlants = newItem;
   if (CMLib.law().doesOwnThisProperty(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;
 }