foul-magics/Mage/src/main/java/mage/counters/AbilityCounter.java
jimga150 07915394c7
[REX] Implement Indominus Rex, Alpha (#12119)
* Implement Indominus Rex, Alpha

* Add draw ability

* Add test

* Add draw verification

* fix errant comment

* null check

* switch to EntersBattlefieldAbility

* Fix test, dont have to pick triggers now

* use AsEntersBattlefieldAbility

* move tests and rename

* use appliedEffects in addCounter call

* change AI hint

* use game in getAbilities call

* make ability text static, remove counter check

* add comments on ability cards and add test case with subset of checked abilities

* Update order of operations--discard, then add counters

* add more tests (Nullhide Ferox, Madness)

* check cards after move to graveyard

* test for graveyard movement

* check for hexproof base class and add test

* refactor Indominus to make ability counters for each ability it comes across that is an instance of one of the checked abilites (counting HexproofBaseAbility)

* remove commented code
2024-05-04 23:25:35 -04:00

34 lines
716 B
Java

package mage.counters;
import mage.abilities.Ability;
/**
* @author TheElk801
*/
public class AbilityCounter extends Counter {
private final Ability ability;
public AbilityCounter(Ability ability, int count) {
super(makeName(ability.getRule()), count);
this.ability = ability;
}
private AbilityCounter(final AbilityCounter counter) {
super(counter);
this.ability = counter.ability;
}
public Ability getAbility() {
return ability;
}
@Override
public AbilityCounter copy() {
return new AbilityCounter(this);
}
private static String makeName(String name) {
return name.replaceAll(" <i>.*<\\/i>", "");
}
}