コード例 #1
0
ファイル: Thief_Listen.java プロジェクト: Cocanuta/Marble
  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();
  }
コード例 #2
0
ファイル: Thief_Squatting.java プロジェクト: Cocanuta/Marble
 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);
 }
コード例 #3
0
 @Override
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   if ((msg.targetMinor() == CMMsg.TYP_ENTER)
       && (msg.target() == affected)
       && (msg.source() != invoker())
       && (!msg.source().Name().equals(text()))
       && (!sprung)
       && (invoker() != null)
       && (invoker().mayIFight(msg.source()))
       && ((canBeUninvoked())
           || (!CMLib.law().doesHavePriviledgesHere(msg.source(), (Room) affected)))
       && (CMLib.dice().rollPercentage()
           > msg.source().charStats().getSave(CharStats.STAT_SAVE_TRAPS)))
     CMLib.combat().postDeath(invoker(), msg.source(), msg);
   super.executeMsg(myHost, msg);
 }
コード例 #4
0
ファイル: Thief_Safehouse.java プロジェクト: Cocanuta/Marble
 public void executeMsg(Environmental host, CMMsg msg) {
   super.executeMsg(host, msg);
   if ((canBeUninvoked()) && (invoker() != null) && (invoker().location() != affected)) unInvoke();
 }