コード例 #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.tell("You have a sinking feeling that your water walking ability is gone.");
  }
コード例 #2
0
 public void executeMsg(Environmental myHost, CMMsg msg) {
   super.executeMsg(myHost, msg);
   if ((affected instanceof Item)
       && (((Item) affected).owner() instanceof Room)
       && (((Room) ((Item) affected).owner()).isContent((Item) affected))
       && (msg.sourceMinor() == CMMsg.TYP_SPEAK)
       && (invoker != null)
       && (invoker.location() != ((Room) ((Item) affected).owner()))
       && (msg.othersMessage() != null)) invoker.executeMsg(invoker, msg);
 }
コード例 #3
0
  @Override
  public void unInvoke() {
    // undo the affects of this spell
    if (!(affected instanceof MOB)) return;
    final MOB mob = (MOB) affected;

    super.unInvoke();

    if (canBeUninvoked()) mob.tell(L("Your strange cross-fertility subsides."));
  }
コード例 #4
0
 @Override
 public void affectCharState(MOB affected, CharState affectableState) {
   super.affectCharState(affected, affectableState);
   if (affected == null) return;
   affectableState.setMovement(
       (int)
           Math.round(
               CMath.div(
                   affectableState.getMovement(), drawups + (0.1 * super.getX1Level(invoker())))));
 }
コード例 #5
0
 public void executeMsg(final Environmental myHost, final CMMsg msg) {
   super.executeMsg(myHost, msg);
   if ((affected != null)
       && (affected instanceof MOB)
       && (msg.amISource((MOB) affected) || msg.amISource(((MOB) affected).amFollowing()))
       && (msg.sourceMinor() == CMMsg.TYP_QUIT)) {
     unInvoke();
     if (msg.source().playerStats() != null) msg.source().playerStats().setLastUpdated(0);
   }
 }
コード例 #6
0
 public void affectEnvStats(Environmental affected, EnvStats affectableStats) {
   super.affectEnvStats(affected, affectableStats);
   if (affected instanceof MOB) {
     MOB mob = (MOB) affected;
     if (triggerNow
         || ((mob.location() != null)
             && ((mob.location().domainType() == Room.DOMAIN_OUTDOORS_WATERSURFACE)
                 || (mob.location().domainType() == Room.DOMAIN_INDOORS_WATERSURFACE))))
       affectableStats.setDisposition(affectableStats.disposition() | EnvStats.IS_FLYING);
   }
 }
コード例 #7
0
 @Override
 public void unInvoke() {
   // undo the affects of this spell
   if (affected == null) return;
   if (canBeUninvoked()) {
     final Room R = CMLib.map().roomLocation(affected);
     if ((R != null) && (CMLib.flags().isInTheGame(affected, true)))
       R.showHappens(CMMsg.MSG_OK_VISUAL, L("The piercing moon sets."));
   }
   super.unInvoke();
 }
コード例 #8
0
  @Override
  public void executeMsg(final Environmental myHost, final CMMsg msg) {
    super.executeMsg(myHost, msg);
    // the sex rules
    if (!(affected instanceof MOB)) return;

    final MOB myChar = (MOB) affected;
    if (msg.target() instanceof MOB) {
      final MOB mate = (MOB) msg.target();
      if ((msg.amISource(myChar))
          && (msg.tool() instanceof Social)
          && (msg.tool().Name().equals("MATE <T-NAME>") || msg.tool().Name().equals("SEX <T-NAME>"))
          && (msg.sourceMinor() != CMMsg.TYP_CHANNEL)
          && (myChar.charStats().getStat(CharStats.STAT_GENDER)
              != mate.charStats().getStat(CharStats.STAT_GENDER))
          && ((mate.charStats().getStat(CharStats.STAT_GENDER) == ('M'))
              || (mate.charStats().getStat(CharStats.STAT_GENDER) == ('F')))
          && ((myChar.charStats().getStat(CharStats.STAT_GENDER) == ('M'))
              || (myChar.charStats().getStat(CharStats.STAT_GENDER) == ('F')))
          && (!mate.charStats().getMyRace().canBreedWith(myChar.charStats().getMyRace()))
          && (myChar.location() == mate.location())
          && (myChar
                  .fetchWornItems(
                      Wearable.WORN_LEGS | Wearable.WORN_WAIST, (short) -2048, (short) 0)
                  .size()
              == 0)
          && (mate.fetchWornItems(
                      Wearable.WORN_LEGS | Wearable.WORN_WAIST, (short) -2048, (short) 0)
                  .size()
              == 0)
          && ((mate.charStats().getStat(CharStats.STAT_AGE) == 0)
              || ((mate.charStats().ageCategory() > Race.AGE_CHILD)
                  && (mate.charStats().ageCategory() < Race.AGE_OLD)))
          && ((myChar.charStats().getStat(CharStats.STAT_AGE) == 0)
              || ((myChar.charStats().ageCategory() > Race.AGE_CHILD)
                  && (myChar.charStats().ageCategory() < Race.AGE_OLD)))) {
        MOB female = myChar;
        MOB male = mate;
        if ((mate.charStats().getStat(CharStats.STAT_GENDER) == ('F'))) {
          female = mate;
          male = myChar;
        }
        final Ability A = CMClass.getAbility("Pregnancy");
        if ((A != null)
            && (female.fetchAbility(A.ID()) == null)
            && (female.fetchEffect(A.ID()) == null)) {
          A.invoke(male, female, true, 0);
          unInvoke();
        }
      }
    }
  }
コード例 #9
0
  @Override
  public void executeMsg(final Environmental myHost, final CMMsg msg) {
    super.executeMsg(myHost, msg);
    if (!(affected instanceof MOB)) return;
    final MOB mob = (MOB) affected;

    if ((msg.amISource(mob))
        && (!CMath.bset(msg.sourceMajor(), CMMsg.MASK_CHANNEL))
        && ((CMath.bset(msg.sourceMajor(), CMMsg.MASK_MOVE))
            || (CMath.bset(msg.sourceMajor(), CMMsg.MASK_HANDS))
            || (CMath.bset(msg.sourceMajor(), CMMsg.MASK_MOUTH)))) unInvoke();
    return;
  }
コード例 #10
0
 public void unInvoke() {
   if ((affected instanceof MOB) && (myChants != null)) {
     Vector V = myChants;
     myChants = null;
     for (int i = 0; i < V.size(); i++) {
       Ability A = (Ability) V.elementAt(i);
       if ((A.affecting() != null) && (A.ID().equals(ID())) && (A.affecting() instanceof Item)) {
         Item I = (Item) A.affecting();
         I.delEffect(A);
       }
     }
   }
   super.unInvoke();
 }
コード例 #11
0
 @Override
 public void unInvoke() {
   if (!(affected instanceof MOB)) return;
   final MOB mob = (MOB) affected;
   super.unInvoke();
   if (canBeUninvoked()) {
     if (!mob.amDead()) {
       if (mob.location() != null)
         mob.location()
             .show(mob, null, CMMsg.MSG_OK_ACTION, L("<S-NAME> end(s) <S-HIS-HER> hibernation."));
       else mob.tell(L("Your hibernation ends."));
     }
   }
 }
コード例 #12
0
  @Override
  public void unInvoke() {
    // undo the affects of this spell
    if (!(affected instanceof MOB)) return;
    final MOB mob = (MOB) affected;
    final List<Ability> poisonAffects = this.poisonAffects;
    super.unInvoke();

    if (canBeUninvoked() && (poisonAffects != null)) {
      mob.tell(L("The poisons in your system are reviving."));
      for (Ability A : poisonAffects) {
        mob.addEffect(A);
        A.setAffectedOne(mob);
      }
      this.poisonAffects = null;
    }
  }
コード例 #13
0
 @Override
 public void unInvoke() {
   Item I = null;
   if (affected instanceof Item) I = (Item) affected;
   super.unInvoke();
   if ((canBeUninvoked())
       && (I != null)
       && (I.owner() instanceof MOB)
       && (!I.amWearingAt(Wearable.IN_INVENTORY))) {
     final MOB mob = (MOB) I.owner();
     if ((!mob.amDead()) && (CMLib.flags().isInTheGame(mob, false))) {
       mob.tell(L("@x1 loosens its grip on your neck and falls off.", I.name(mob)));
       I.setRawWornCode(0);
       mob.location().moveItemTo(I, ItemPossessor.Expire.Player_Drop);
     }
   }
 }
コード例 #14
0
  @Override
  public void unInvoke() {
    // undo the affects of this spell
    if (!(affected instanceof MOB)) return;
    final MOB mob = (MOB) affected;

    super.unInvoke();

    if (canBeUninvoked())
      if ((mob.location() != null)
          && (!mob.amDead())
          && (mob.getWearPositions(Wearable.WORN_FEET) > 0)) {
        spreadImmunity(mob);
        mob.location()
            .show(
                mob,
                null,
                CMMsg.MSG_OK_VISUAL,
                L("The fungus on <S-YOUPOSS> feet dies and falls off."));
      }
  }
コード例 #15
0
  public void unInvoke() {
    // undo the affects of this spell
    if (!(affected instanceof MOB)) return;
    MOB mob = (MOB) affected;

    super.unInvoke();

    if ((canBeUninvoked() && (!mob.amDead()))) {
      mob.location().show(mob, null, CMMsg.MSG_OK_VISUAL, "<S-YOUPOSS> natural-will returns.");
      if (mob.amFollowing() != null) CMLib.commands().postFollow(mob, null, false);
      CMLib.commands().postStand(mob, true);
      if (mob.isMonster()) {
        if ((CMLib.dice().rollPercentage() > 50)
            || ((mob.getStartRoom() != null)
                && (mob.getStartRoom().getArea() != mob.location().getArea())
                && (CMLib.flags().isAggressiveTo(mob, null)
                    || (invoker == null)
                    || (!mob.location().isInhabitant(invoker)))))
          CMLib.tracking().wanderAway(mob, true, true);
        else if ((invoker != null) && (invoker != mob)) mob.setVictim(invoker);
      }
    }
  }
コード例 #16
0
 public void executeMsg(Environmental myHost, CMMsg msg) {
   super.executeMsg(myHost, msg);
   if (triggerNow) triggerNow = false;
 }