mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +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;
|
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
|
// Targeting
|
||||||
if (abTgt != null) {
|
if (abTgt != null) {
|
||||||
sa.resetTargets();
|
sa.resetTargets();
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ Name:Strip Mine
|
|||||||
ManaCost:no cost
|
ManaCost:no cost
|
||||||
Types:Land
|
Types:Land
|
||||||
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool.
|
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool.
|
||||||
A:AB$ Destroy | ValidTgts$ Land | TgtPrompt$ Select target land. | Cost$ T Sac<1/CARDNAME> | SpellDescription$ Destroy target land.
|
A:AB$ Destroy | ValidTgts$ Land | TgtPrompt$ Select target land. | Cost$ T Sac<1/CARDNAME> | AILogic$ LandForLand | SpellDescription$ Destroy target land.
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/strip_mine.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/strip_mine.jpg
|
||||||
Oracle:{T}: Add {C} to your mana pool.\n{T}, Sacrifice Strip Mine: Destroy target land.
|
Oracle:{T}: Add {C} to your mana pool.\n{T}, Sacrifice Strip Mine: Destroy target land.
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ Name:Wasteland
|
|||||||
ManaCost:no cost
|
ManaCost:no cost
|
||||||
Types:Land
|
Types:Land
|
||||||
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool.
|
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool.
|
||||||
A:AB$ Destroy | ValidTgts$ Land.nonBasic | TgtPrompt$ Select target nonbasic land. | Cost$ T Sac<1/CARDNAME> | SpellDescription$ Destroy target nonbasic land.
|
A:AB$ Destroy | ValidTgts$ Land.nonBasic | TgtPrompt$ Select target nonbasic land. | Cost$ T Sac<1/CARDNAME> | AILogic$ LandForLand | SpellDescription$ Destroy target nonbasic land.
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/wasteland.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/wasteland.jpg
|
||||||
Oracle:{T}: Add {C} to your mana pool.\n{T}, Sacrifice Wasteland: Destroy target nonbasic land.
|
Oracle:{T}: Add {C} to your mana pool.\n{T}, Sacrifice Wasteland: Destroy target nonbasic land.
|
||||||
|
|||||||
Reference in New Issue
Block a user