Convert SpellAbility keywords to costs tag system

This commit is contained in:
Steven Knipe 2023-11-16 14:39:13 -08:00
parent f3d5faf199
commit ad873863fa
6 changed files with 9 additions and 62 deletions

View file

@ -10,8 +10,6 @@ import mage.constants.SpellAbilityType;
import mage.constants.Zone;
import mage.game.Game;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
@ -55,15 +53,9 @@ public class SpectacleAbility extends SpellAbility {
}
@Override
@SuppressWarnings("unchecked")
public boolean activate(Game game, boolean noMana) {
if (super.activate(game, noMana)) {
List<Integer> spectacleActivations = (List<Integer>) game.getState().getValue(SPECTACLE_ACTIVATION_VALUE_KEY + getSourceId());
if (spectacleActivations == null) {
spectacleActivations = new ArrayList<>(); // zoneChangeCounter
game.getState().setValue(SPECTACLE_ACTIVATION_VALUE_KEY + getSourceId(), spectacleActivations);
}
spectacleActivations.add(game.getState().getZoneChangeCounter(getSourceId()));
this.setCostsTag(SPECTACLE_ACTIVATION_VALUE_KEY,null);
return true;
}
return false;