forked from External/mage
Convert SpellAbility keywords to costs tag system
This commit is contained in:
parent
f3d5faf199
commit
ad873863fa
6 changed files with 9 additions and 62 deletions
|
|
@ -4,11 +4,8 @@ package mage.abilities.condition.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.keyword.SurgeAbility;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -20,15 +17,6 @@ public enum SurgedCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (source.getAbilityType() == AbilityType.TRIGGERED) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> surgeActivations = (ArrayList) game.getState().getValue(SurgeAbility.SURGE_ACTIVATION_VALUE_KEY + source.getSourceId());
|
||||
if (surgeActivations != null) {
|
||||
return surgeActivations.contains(game.getState().getZoneChangeCounter(source.getSourceId()) - 1);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return source instanceof SurgeAbility;
|
||||
}
|
||||
return CardUtil.checkSourceCostsTagExists(game, source, SurgeAbility.SURGE_ACTIVATION_VALUE_KEY);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue