コード例 #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();
  }