cleanup AbilityType for easier check that an ability is an activated ability (#12153)

* cleanup AbilityType

* further cleanup

* cleanup instanceof

* tweak formatting

* rework Rex

* fix mistake in PlayerImpl

* cleanup 'instanceof' for 'ActivatedManaAbilityImpl'
This commit is contained in:
Susucre 2024-05-04 04:13:34 +02:00 committed by GitHub
parent 62cc49ffa3
commit 85cad4ff1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
118 changed files with 486 additions and 574 deletions

View file

@ -12,7 +12,6 @@ import mage.abilities.keyword.*;
import mage.cards.Card;
import mage.cards.Cards;
import mage.choices.Choice;
import mage.constants.AbilityType;
import mage.constants.Outcome;
import mage.constants.RangeOfInfluence;
import mage.counters.CounterType;
@ -1082,7 +1081,7 @@ public class ComputerPlayer6 extends ComputerPlayer {
private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
// pass or casting two times a spell multiple times on hand is ok
if (action instanceof PassAbility || action instanceof SpellAbility || action.getAbilityType() == AbilityType.MANA) {
if (action instanceof PassAbility || action instanceof SpellAbility || action.isManaAbility()) {
return false;
}
int newVal = GameStateEvaluator2.evaluate(playerId, sim).getTotalScore();

View file

@ -11,7 +11,6 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.VariableManaCost;
import mage.abilities.effects.Effect;
import mage.cards.Card;
import mage.constants.AbilityType;
import mage.game.Game;
import mage.game.combat.Combat;
import mage.game.events.GameEvent;
@ -100,7 +99,7 @@ public final class SimulatedPlayer2 extends ComputerPlayer {
List<ActivatedAbility> playables = game.getPlayer(playerId).getPlayable(game, isSimulatedPlayer);
playables = filterAbilities(game, playables, suggested);
for (ActivatedAbility ability : playables) {
if (ability.getAbilityType() == AbilityType.MANA) {
if (ability.isManaAbility()) {
continue;
}
List<Ability> options = game.getPlayer(playerId).getPlayableOptions(ability, game);