mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Slightly improved DestroyAi for Strip Mine and Wasteland (AI should not sac-destroy a land unless it has a mana-producing land to replace it with, as well as at least a couple lands in the hand and on the battlefield combined, or enough mana-producing lands on the battlefield in general, otherwise it's too risky to mana-lock yourself early in the game). Further improvements are welcome.
This commit is contained in:
@@ -63,6 +63,17 @@ public class DestroyAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Special logic not related to targeting
|
||||
if ("LandForLand".equals(logic)) {
|
||||
// Strip Mine and Wasteland
|
||||
int numLandsInHand = CardLists.filter(ai.getCardsIn(ZoneType.Hand), CardPredicates.Presets.LANDS_PRODUCING_MANA).size();
|
||||
int numLandsOTB = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.LANDS_PRODUCING_MANA).size();
|
||||
|
||||
// TODO: improve this logic
|
||||
boolean isViable = numLandsInHand > 0 && numLandsInHand + numLandsOTB > 2;
|
||||
if (!isViable) { return false; }
|
||||
}
|
||||
|
||||
// Targeting
|
||||
if (abTgt != null) {
|
||||
sa.resetTargets();
|
||||
|
||||
Reference in New Issue
Block a user