mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Improve AnimateAi for Clan Guildmage.
This commit is contained in:
@@ -340,6 +340,14 @@ public class AnimateAi extends SpellAbilityAi {
|
||||
|
||||
// select the worst of the best
|
||||
final Card worst = ComputerUtilCard.getWorstAI(maxList);
|
||||
if (worst.isLand()) {
|
||||
// e.g. Clan Guildmage, make sure we're not using the same land we want to animate to activate the ability
|
||||
this.holdAnimatedTillMain2(ai, worst);
|
||||
if (!ComputerUtilMana.canPayManaCost(sa, ai, 0)) {
|
||||
this.releaseHeldTillMain2(ai, worst);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.rememberAnimatedThisTurn(ai, worst);
|
||||
sa.getTargets().add(worst);
|
||||
return true;
|
||||
@@ -564,4 +572,12 @@ public class AnimateAi extends SpellAbilityAi {
|
||||
public static boolean isAnimatedThisTurn(Player ai, Card c) {
|
||||
return AiCardMemory.isRememberedCard(ai, c, AiCardMemory.MemorySet.ANIMATED_THIS_TURN);
|
||||
}
|
||||
|
||||
private void holdAnimatedTillMain2(Player ai, Card c) {
|
||||
AiCardMemory.rememberCard(ai, c, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_MAIN2);
|
||||
}
|
||||
|
||||
private void releaseHeldTillMain2(Player ai, Card c) {
|
||||
AiCardMemory.forgetCard(ai, c, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_MAIN2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user