mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Slight further improvement to PlayAi for Hideaway (might also consider improving for untargeted sorceries or sorceries with available legal targets, but that's iffy).
This commit is contained in:
@@ -3,6 +3,7 @@ package forge.ai.ability;
|
||||
import com.google.common.base.Predicate;
|
||||
import forge.ai.*;
|
||||
import forge.card.CardStateName;
|
||||
import forge.card.CardTypeView;
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
@@ -55,6 +56,16 @@ public class PlayAi extends SpellAbilityAi {
|
||||
return ComputerUtil.targetPlayableSpellCard(ai, cards, sa, sa.hasParam("WithoutManaCost"));
|
||||
}
|
||||
|
||||
if (source != null && source.hasKeyword("Hideaway") && source.hasRemembered()) {
|
||||
// AI is not very good at playing non-permanent spells this way, at least yet
|
||||
// (might be possible to enable it for Sorceries in Main1/Main2 if target is available,
|
||||
// but definitely not for most Instants)
|
||||
Card rem = (Card) source.getFirstRemembered();
|
||||
CardTypeView t = rem.getState(CardStateName.Original).getType();
|
||||
|
||||
return t.isPermanent() && !t.isLand();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user