コード例 #1
0
ファイル: Prayer_Atonement.java プロジェクト: Cocanuta/Marble
  public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) {
    MOB target = this.getTarget(mob, commands, givenTarget);
    if (target == null) return false;

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

    boolean success = proficiencyCheck(mob, 0, auto);
    CMMsg msg2 = null;
    if ((mob != target) && (!mob.getGroupMembers(new HashSet<MOB>()).contains(target)))
      msg2 =
          CMClass.getMsg(
              mob,
              target,
              this,
              verbalCastCode(mob, target, auto) | CMMsg.MASK_MALICIOUS,
              "<T-NAME> do(es) not seem to like <S-NAME> messing with <T-HIS-HER> head.");

    if (success && (CMLib.factions().getFaction(CMLib.factions().AlignID()) != null)) {
      // 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
                  ? "<T-NAME> feel(s) more good."
                  : "^S<S-NAME> " + prayWord(mob) + " to atone <T-NAMESELF>!^?"));
      if ((mob.location().okMessage(mob, msg))
          && ((msg2 == null) || (mob.location().okMessage(mob, msg2)))) {
        mob.location().send(mob, msg);
        if ((msg.value() <= 0) && ((msg2 == null) || (msg2.value() <= 0))) {
          target.tell("Good, pure thoughts fill your head.");
          int evilness = CMLib.dice().roll(10, adjustedLevel(mob, asLevel), 0);
          CMLib.factions().postFactionChange(target, this, CMLib.factions().AlignID(), evilness);
        }
        if (msg2 != null) mob.location().send(mob, msg2);
      }
    } else {
      if ((msg2 != null) && (mob.location().okMessage(mob, msg2))) mob.location().send(mob, msg2);
      return beneficialWordsFizzle(
          mob,
          target,
          "<S-NAME> point(s) at <T-NAMESELF> and " + prayWord(mob) + ", but nothing happens.");
    }

    // return whether it worked
    return success;
  }
コード例 #2
0
ファイル: InvisibleStalker.java プロジェクト: Cocanuta/Marble
  public InvisibleStalker() {
    super();
    Random randomizer = new Random(System.currentTimeMillis());

    username = "******";
    setDescription("A shimmering blob of energy.");
    setDisplayText("An invisible stalker hunts here.");
    CMLib.factions().setAlignment(this, Faction.ALIGN_NEUTRAL);
    setMoney(0);
    basePhyStats.setWeight(10 + Math.abs(randomizer.nextInt() % 10));

    baseCharStats().setStat(CharStats.STAT_INTELLIGENCE, 12 + Math.abs(randomizer.nextInt() % 3));
    baseCharStats().setStat(CharStats.STAT_STRENGTH, 20);
    baseCharStats().setStat(CharStats.STAT_DEXTERITY, 13);

    basePhyStats().setDamage(16);
    basePhyStats().setSpeed(1.0);
    basePhyStats().setAbility(0);
    basePhyStats().setLevel(4);
    basePhyStats().setArmor(0);
    basePhyStats().setDisposition(basePhyStats().disposition() | PhyStats.IS_INVISIBLE);

    baseState.setHitPoints(CMLib.dice().roll(basePhyStats().level(), 20, basePhyStats().level()));

    addBehavior(CMClass.getBehavior("Aggressive"));
    addBehavior(CMClass.getBehavior("Mobile"));

    recoverMaxState();
    resetToMaxState();
    recoverPhyStats();
    recoverCharStats();
  }
コード例 #3
0
ファイル: HeavenlyServent.java プロジェクト: Cocanuta/Marble
  public HeavenlyServent() {
    super();

    Random randomizer = new Random(System.currentTimeMillis());

    username = "******";
    setDescription(
        "An angelic form in gowns of white, with golden hair, and an ever present smile.");
    setDisplayText("A servant of the Archons is running errands.");
    CMLib.factions().setAlignment(this, Faction.ALIGN_NEUTRAL);
    setMoney(0);
    basePhyStats.setWeight(20 + Math.abs(randomizer.nextInt() % 55));
    setWimpHitPoint(2);

    addBehavior(CMClass.getBehavior("Mobile"));
    addBehavior(CMClass.getBehavior("MudChat"));

    basePhyStats().setDamage(25);

    basePhyStats().setAbility(0);
    basePhyStats().setLevel(10);
    basePhyStats().setArmor(0);
    baseCharStats().setMyRace(CMClass.getRace("Human"));
    baseCharStats().getMyRace().startRacing(this, false);

    baseState.setHitPoints(CMLib.dice().roll(basePhyStats().level(), 20, basePhyStats().level()));

    recoverMaxState();
    resetToMaxState();
    recoverPhyStats();
    recoverCharStats();
  }