Beispiel #1
0
  public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) {
    Physical target = getAnyTarget(mob, commands, givenTarget, Wearable.FILTER_ANY);
    if (target == null) return false;

    if (!super.invoke(mob, commands, givenTarget, auto, asLevel)) return false;

    boolean success = proficiencyCheck(mob, 0, auto);

    if (success) {
      // it worked, so build a copy of this ability,
      // and add it to the affects list of the
      // affected MOB.  Then tell everyone else
      // what happened.
      CMMsg msg =
          CMClass.getMsg(
              mob,
              target,
              this,
              verbalCastCode(mob, target, auto),
              auto ? "" : "^S<S-NAME> " + prayWord(mob) + " to extinguish <T-NAMESELF>.^?");
      if (mob.location().okMessage(mob, msg)) {
        mob.location().send(mob, msg);
        CMLib.utensils().extinguish(mob, target, false);
        target.recoverPhyStats();
        mob.location().recoverRoomStats();
      }
    } else
      return beneficialWordsFizzle(
          mob,
          target,
          "<S-NAME> " + prayWord(mob) + " to extinguish <T-NAMESELF>, but nothing happens.");
    // return whether it worked
    return success;
  }