mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- AttachAI shouldn't assume it targets
This commit is contained in:
@@ -1047,8 +1047,11 @@ public class AttachAi extends SpellAbilityAi {
|
||||
return null;
|
||||
}
|
||||
|
||||
CardCollection list = CardLists.getValidCards(aiPlayer.getGame().getCardsIn(tgt.getZone()), tgt.getValidTgts(), sa.getActivatingPlayer(), attachSource);
|
||||
|
||||
CardCollection list = null;
|
||||
if (tgt == null) {
|
||||
list = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("Defined"), sa);
|
||||
} else {
|
||||
list = CardLists.getValidCards(aiPlayer.getGame().getCardsIn(tgt.getZone()), tgt.getValidTgts(), sa.getActivatingPlayer(), attachSource);
|
||||
// TODO If Attaching without casting, don't need to actually target.
|
||||
// I believe this is the only case where mandatory will be true, so just
|
||||
// check that when starting that work
|
||||
@@ -1058,6 +1061,7 @@ public class AttachAi extends SpellAbilityAi {
|
||||
} else {
|
||||
list = CardLists.filter(list, Predicates.not(CardPredicates.isProtectedFrom(attachSource)));
|
||||
}
|
||||
}
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user