Esempio n. 1
0
  public void unInvoke() {
    // undo the affects of this spell
    if ((affected == null) || (!(affected instanceof MOB))) return;
    MOB mob = (MOB) affected;
    super.unInvoke();

    if ((canBeUninvoked()) && (mob.location() != null)) {
      if ((failed)
          || (!CMLib.flags().isSitting(mob))
          || (room == null)
          || (title == null)
          || (mob.location() != room)) mob.tell("You are no longer squatting.");
      else if (title.landOwner().length() > 0) {
        mob.tell(
            "Your squat has succeeded.  This property no longer belongs to "
                + title.landOwner()
                + ".");
        title.setLandOwner("");
        title.updateTitle();
        title.updateLot(null);
      } else if (title.landOwner().length() > 0) {
        mob.tell("Your squat has succeeded.  This property now belongs to you.");
        title.setLandOwner(mob.Name());
        title.updateTitle();
        title.updateLot(new XVector(mob.name()));
      }
    }
    failed = false;
  }
Esempio n. 2
0
  public void executeMsg(final Environmental myHost, final CMMsg msg) {
    super.executeMsg(myHost, msg);
    if ((affected != null)
        && (affected instanceof Room)
        && (invoker() != null)
        && (invoker().location() != null)
        && (sourceRoom != null)
        && (!invoker().isInCombat())
        && (invoker().location() == sourceRoom)) {
      if (invoker().location() == room) {
        if ((msg.sourceMinor() == CMMsg.TYP_SPEAK)
            && (msg.othersCode() == CMMsg.NO_EFFECT)
            && (msg.othersMessage() == null)
            && (msg.sourceMessage() != null)
            && (!msg.amISource(invoker()))
            && (!msg.amITarget(invoker()))
            && (!lastSaid.equals(msg.sourceMessage()))) {
          lastSaid = msg.sourceMessage();
          if ((invoker().phyStats().level() + (getXLEVELLevel(invoker()) * 10))
              > msg.source().phyStats().level())
            invoker().tell(msg.source(), msg.target(), msg.tool(), msg.sourceMessage());
          else
            invoker()
                .tell(
                    msg.source(),
                    null,
                    null,
                    "<S-NAME> said something, but you couldn't quite make it out.");
        }
      } else if ((msg.sourceMinor() == CMMsg.TYP_SPEAK)
          && (msg.othersMinor() == CMMsg.TYP_SPEAK)
          && (msg.othersMessage() != null)
          && (msg.sourceMessage() != null)
          && (!lastSaid.equals(msg.sourceMessage()))) {
        lastSaid = msg.sourceMessage();
        if ((invoker().phyStats().level() + (getXLEVELLevel(invoker()) * 10))
            > msg.source().phyStats().level())
          invoker().tell(msg.source(), msg.target(), msg.tool(), msg.sourceMessage());
        else
          invoker()
              .tell(
                  msg.source(),
                  null,
                  null,
                  "<S-NAME> said something, but you couldn't quite make it out.");
      }

    } else unInvoke();
  }
Esempio n. 3
0
 public void executeMsg(Environmental host, CMMsg msg) {
   if (affected instanceof MOB) {
     MOB mob = (MOB) affected;
     if ((msg.source() == mob)
         && (msg.target() == mob.location())
         && (msg.targetMinor() == CMMsg.TYP_LEAVE)) {
       failed = true;
       unInvoke();
     } else if ((CMLib.flags().isStanding(mob)) || (mob.location() != room)) {
       failed = true;
       unInvoke();
     }
   }
   super.executeMsg(host, msg);
 }
Esempio n. 4
0
 public void executeMsg(Environmental host, CMMsg msg) {
   super.executeMsg(host, msg);
   if ((canBeUninvoked()) && (invoker() != null) && (invoker().location() != affected)) unInvoke();
 }