mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- AttachAI shouldn't assume it targets
This commit is contained in:
@@ -1047,8 +1047,11 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
return null;
|
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.
|
// 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
|
// I believe this is the only case where mandatory will be true, so just
|
||||||
// check that when starting that work
|
// check that when starting that work
|
||||||
@@ -1058,6 +1061,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
} else {
|
} else {
|
||||||
list = CardLists.filter(list, Predicates.not(CardPredicates.isProtectedFrom(attachSource)));
|
list = CardLists.filter(list, Predicates.not(CardPredicates.isProtectedFrom(attachSource)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user