Limit AI to cast Green Sun's Zenith for all its mana#9962
Limit AI to cast Green Sun's Zenith for all its mana#9962kojotak wants to merge 2 commits intoCard-Forge:masterfrom
Conversation
| if (root.costHasManaX()) { | ||
| val = ComputerUtilMana.determineLeftoverMana(root, ai, effect); | ||
|
|
||
| if (sa.hasParam("AIMaxTgtCost")) { |
There was a problem hiding this comment.
too unflexible / think bigger - just allow scripters to provide the maximum value for good measure:
SVar:Y:Count$ValidLibrary Creature.YouOwn$GreatestCardManaCost
| ManaCost:X G G | ||
| Types:Sorcery | ||
| A:SP$ ChangeZone | ChangeType$ Creature.YouCtrl+cmcLEX | Hidden$ True | Origin$ Library | OriginAlternative$ Graveyard | Destination$ Battlefield | ShuffleNonMandatory$ True | SubAbility$ DBPump | SpellDescription$ Search your library and/or graveyard for a creature card with mana value X or less and put it onto the battlefield. If you search your library this way, shuffle. | ||
| A:SP$ ChangeZone | ChangeType$ Creature.YouCtrl+cmcLEX | Hidden$ True | Origin$ Library | OriginAlternative$ Graveyard | Destination$ Battlefield | ShuffleNonMandatory$ True | SubAbility$ DBPump | AIMaxTgtCost$ MaxCMC | SpellDescription$ Search your library and/or graveyard for a creature card with mana value X or less and put it onto the battlefield. If you search your library this way, shuffle. |
There was a problem hiding this comment.
this one should probably consider an additional SVar in case you'd get really close to 10 and the secondary effect is worth it
|
This will take me more time than expected 🙈 "Much to learn, I have" I still can not figure it out how to properly script the condition of limiting the library search by available mana - so there is an ugly |
|
hmn, this looked ok now mostly:
|
Yes, I agree, but this will fix the issue #6720 only if available mana is > most expensive creature in library. That's the situation from the screenshot of this PR (available mana = 5, max payable CMC = 2, X is set to 2 ✅). When the library contains creature with higher CMC (for example Apex devastor CMC=10), then ComputerUtilCost resolves X to 5, all available mana is used and creature with only CMC = 2 is put into battlefield.
Thanks, I've finally found that too, but without luck. AI is still casting it in main2 despite having mana and multiple creatures in play (which can benefit from the +X/+X). I don't give up. Yet 😉 |
An attempt to fix #6720 by allowing to limit the maximum mana cost X. It works for instant/sorcery, but doesn't work for a creature (
Rocco, Cabaretti Caterer). Is there a better way, for example usingSVar:AIPreference:AIMaxTgtCost?An example of Green sun's zenith cast with X=2, which is the max CMC of all creatures in a library: