StaticAbilityMustAttack improve getDefinedEntities

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

View File

@@ -24,17 +24,19 @@ 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);
if (e instanceof Player) { for (GameEntity e : def) {
Player attackPl = (Player) e; if (e instanceof Player) {
if (!game.getPhaseHandler().isPlayerTurn(attackPl)) { // CR 506.2 Player attackPl = (Player) e;
entityList.add(e); if (!game.getPhaseHandler().isPlayerTurn(attackPl)) { // CR 506.2
} entityList.add(e);
} else if (e instanceof Card) { }
Card attackPW = (Card) e; } else if (e instanceof Card) {
if (!game.getPhaseHandler().isPlayerTurn(attackPW.getController())) { // CR 506.2 Card attackPW = (Card) e;
entityList.add(e); if (!game.getPhaseHandler().isPlayerTurn(attackPW.getController())) { // CR 506.2
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