mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
TokenAi: do not create Token that can't block in Response
This commit is contained in:
@@ -26,6 +26,7 @@ import forge.game.Game;
|
||||
import forge.game.GameEntity;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.cost.Cost;
|
||||
@@ -144,7 +145,13 @@ public class StaticAbilityCantAttackBlock {
|
||||
}
|
||||
|
||||
public static boolean cantBlockBy(final Card attacker, final Card blocker) {
|
||||
for (final Card ca : attacker.getGame().getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) {
|
||||
CardCollection list = new CardCollection(attacker.getGame().getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES));
|
||||
// add attacker and blocker in case of LKI
|
||||
list.add(attacker);
|
||||
if (blocker != null) {
|
||||
list.add(blocker);
|
||||
}
|
||||
for (final Card ca : list) {
|
||||
for (final StaticAbility stAb : ca.getStaticAbilities()) {
|
||||
if (!stAb.checkConditions(CantBlockByMode)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user