@Override
 public void affectPhyStats(Physical affected, PhyStats affectableStats) {
   super.affectPhyStats(affected, affectableStats);
   if (affected == null) return;
   if (levelsDown < 0) return;
   final int attacklevel = affectableStats.attackAdjustment() / affectableStats.level();
   affectableStats.setLevel(affectableStats.level() - (levelsDown * direction));
   if (affectableStats.level() <= 0) {
     levelsDown = -1;
     CMLib.combat().postDeath(invoker(), (MOB) affected, null);
   }
   affectableStats.setAttackAdjustment(
       affectableStats.attackAdjustment() - (attacklevel * (levelsDown * direction)));
 }
  @Override
  public void affectPhyStats(Physical affected, PhyStats affectableStats) {
    super.affectPhyStats(affected, affectableStats);
    if (affected == null) return;
    if (!(affected instanceof MOB)) return;
    final MOB mob = (MOB) affected;

    if (mob == invoker) return;

    final int xlvl = super.getXLEVELLevel(invoker());
    if (CMLib.flags().isEvil(mob)) {
      affectableStats.setArmor(affectableStats.armor() - 15 - (6 * xlvl));
      affectableStats.setAttackAdjustment(affectableStats.attackAdjustment() + 20 + (4 * xlvl));
    } else if (CMLib.flags().isGood(mob)) {
      affectableStats.setArmor(affectableStats.armor() + 15 + (6 * xlvl));
      affectableStats.setAttackAdjustment(affectableStats.attackAdjustment() - 20 - (4 * xlvl));
    }
  }
Beispiel #3
0
 @Override
 public void affectPhyStats(Physical affected, PhyStats affectableStats) {
   if ((whom != null) && (song != null)) {
     final Hashtable<Integer, Integer> H = getSongBenefits(song);
     for (final Enumeration<Integer> e = H.keys(); e.hasMoreElements(); ) {
       final Integer I = e.nextElement();
       final String[] chk = stuff[I.intValue()];
       if ((chk != null) && (chk[1].startsWith("e"))) {
         int ticks = H.get(I).intValue();
         if (ticks <= 0) ticks = 1;
         switch (chk[2].charAt(0)) {
           case 'a':
             if (ticks > 25) ticks = 25;
             affectableStats.setAttackAdjustment(
                 affectableStats.attackAdjustment() + ticks + getXLEVELLevel(invoker()));
             break;
           default:
             break;
         }
       }
     }
   }
 }