StaticAbilityMustAttack improve getDefinedEntities

This commit is contained in:
Northmoc
2022-04-22 19:14:25 -04:00
parent 6be4c1b670
commit 48e8dd3eba

View File

@@ -24,8 +24,9 @@ public class StaticAbilityMustAttack {
} }
if (stAb.matchesValidParam(stAb.getParam("ValidCreature"), attacker)) { if (stAb.matchesValidParam(stAb.getParam("ValidCreature"), attacker)) {
if (stAb.hasParam("MustAttack")) { if (stAb.hasParam("MustAttack")) {
GameEntity e = AbilityUtils.getDefinedEntities(attacker, stAb.getParam("MustAttack"), List<GameEntity> def = AbilityUtils.getDefinedEntities(stAb.getHostCard(),
stAb).get(0); stAb.getParam("MustAttack"), stAb);
for (GameEntity e : def) {
if (e instanceof Player) { if (e instanceof Player) {
Player attackPl = (Player) e; Player attackPl = (Player) e;
if (!game.getPhaseHandler().isPlayerTurn(attackPl)) { // CR 506.2 if (!game.getPhaseHandler().isPlayerTurn(attackPl)) { // CR 506.2
@@ -37,6 +38,7 @@ public class StaticAbilityMustAttack {
entityList.add(e); entityList.add(e);
} }
} }
}
} else { // if the list is only the attacker, the attacker must attack, but no specific entity } else { // if the list is only the attacker, the attacker must attack, but no specific entity
entityList.add(attacker); entityList.add(attacker);
} }