mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- AI will not use Dash if it can cast the creature normally
This commit is contained in:
@@ -5,6 +5,7 @@ import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.ai.ComputerUtil;
|
||||
import forge.ai.ComputerUtilCard;
|
||||
import forge.ai.ComputerUtilCost;
|
||||
import forge.ai.SpellAbilityAi;
|
||||
import forge.game.Game;
|
||||
import forge.game.card.Card;
|
||||
@@ -65,6 +66,10 @@ public class PermanentCreatureAi extends SpellAbilityAi {
|
||||
if (sa.isDash()) {
|
||||
//only checks that the dashed creature will attack
|
||||
if (ph.isPlayerTurn(aiPlayer) && ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) {
|
||||
if (ComputerUtilCost.canPayCost(sa.getHostCard().getSpellPermanent(),aiPlayer)) {
|
||||
//do not dash if creature can be played normally
|
||||
return false;
|
||||
}
|
||||
Card dashed = CardFactory.copyCard(sa.getHostCard(), true);
|
||||
dashed.setSickness(false);
|
||||
return ComputerUtilCard.doesSpecifiedCreatureAttackAI(aiPlayer, dashed);
|
||||
|
||||
Reference in New Issue
Block a user