public List<Ability> returnOffensiveAffects(Physical fromMe) { final Vector offenders = new Vector(); for (int a = 0; a < fromMe.numEffects(); a++) // personal { final Ability A = fromMe.fetchEffect(a); if ((A != null) && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_POISON)) offenders.addElement(A); } return offenders; }
public static java.util.List<Ability> returnOffensiveAffects(Physical fromMe) { final MOB newMOB = CMClass.getFactoryMOB(); newMOB.setLocation(CMLib.map().roomLocation(fromMe)); final List<Ability> offenders = new Vector<Ability>(); for (int a = 0; a < fromMe.numEffects(); a++) // personal { final Ability A = fromMe.fetchEffect(a); if ((A != null) && (A.canBeUninvoked())) { try { newMOB.recoverPhyStats(); A.affectPhyStats(newMOB, newMOB.phyStats()); if (CMLib.flags().isInvisible(newMOB) || CMLib.flags().isHidden(newMOB)) offenders.add(A); } catch (final Exception e) { } } } newMOB.destroy(); return offenders; }