@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())))));
 }
  @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."));
  }
 @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();
 }
  @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();
        }
      }
    }
  }
  @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;
  }
 @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."));
     }
   }
 }
  @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;
    }
  }
 @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);
     }
   }
 }
  @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."));
      }
  }
Beispiel #10
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.amDead())) {
      mob.location().show(mob, null, CMMsg.MSG_OK_VISUAL, L("<S-YOUPOSS> free-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);
      }
    }
  }