mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
StaticAbilityMustAttack improve getDefinedEntities
This commit is contained in:
@@ -24,17 +24,19 @@ public class StaticAbilityMustAttack {
|
||||
}
|
||||
if (stAb.matchesValidParam(stAb.getParam("ValidCreature"), attacker)) {
|
||||
if (stAb.hasParam("MustAttack")) {
|
||||
GameEntity e = AbilityUtils.getDefinedEntities(attacker, stAb.getParam("MustAttack"),
|
||||
stAb).get(0);
|
||||
if (e instanceof Player) {
|
||||
Player attackPl = (Player) e;
|
||||
if (!game.getPhaseHandler().isPlayerTurn(attackPl)) { // CR 506.2
|
||||
entityList.add(e);
|
||||
}
|
||||
} else if (e instanceof Card) {
|
||||
Card attackPW = (Card) e;
|
||||
if (!game.getPhaseHandler().isPlayerTurn(attackPW.getController())) { // CR 506.2
|
||||
entityList.add(e);
|
||||
List<GameEntity> def = AbilityUtils.getDefinedEntities(stAb.getHostCard(),
|
||||
stAb.getParam("MustAttack"), stAb);
|
||||
for (GameEntity e : def) {
|
||||
if (e instanceof Player) {
|
||||
Player attackPl = (Player) e;
|
||||
if (!game.getPhaseHandler().isPlayerTurn(attackPl)) { // CR 506.2
|
||||
entityList.add(e);
|
||||
}
|
||||
} else if (e instanceof Card) {
|
||||
Card attackPW = (Card) 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
|
||||
|
||||
Reference in New Issue
Block a user