PlayAi tweak (#3127)

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2023-05-17 12:37:18 +02:00
committed by GitHub
parent 345db4e2c7
commit b397be8cea
4 changed files with 8 additions and 5 deletions

View File

@@ -153,11 +153,14 @@ public class PlayAi extends SpellAbilityAi {
// TODO needs to be aligned for MDFC along with getAbilityToPlay so the knowledge
// of which spell was the reason for the choice can be used there
for (SpellAbility s : AbilityUtils.getBasicSpellsFromPlayEffect(c, ai, state)) {
if (!(s instanceof Spell)) {
if (!sa.matchesValidParam("ValidSA", s)) {
continue;
}
if (s instanceof LandAbility) {
// might want to run some checks here but it's rare anyway
return true;
}
Spell spell = (Spell) s;
s.setActivatingPlayer(ai, true);
if (params != null && params.containsKey("CMCLimit")) {
Integer cmcLimit = (Integer) params.get("CMCLimit");
if (spell.getPayCosts().getTotalMana().getCMC() > cmcLimit)

View File

@@ -4,7 +4,7 @@ Types:Legendary Artifact
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Permanent.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigEnergy | TriggerDescription$ Whenever a permanent you control is put into a graveyard, you get {E} (an energy counter).
SVar:TrigEnergy:DB$ PutCounter | Defined$ You | CounterType$ ENERGY | CounterNum$ 1
A:AB$ PeekAndReveal | Cost$ T PayEnergy<6> | Defined$ You | PeekAmount$ 6 | NoReveal$ True | RememberPeeked$ True | SubAbility$ DBPlay | SpellDescription$ Look at the top six cards of your library. You may cast a spell from among them without paying its mana cost. Put the rest on the bottom of your library in a random order.
SVar:DBPlay:DB$ Play | ValidZone$ Library | Valid$ Card.IsRemembered+nonLand | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ 1 | ForgetPlayed$ True | SubAbility$ DBRestRandomOrder
SVar:DBPlay:DB$ Play | ValidZone$ Library | Valid$ Card.IsRemembered | ValidSA$ Spell | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ 1 | ForgetPlayed$ True | SubAbility$ DBRestRandomOrder
SVar:DBRestRandomOrder:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered | Origin$ Library | Destination$ Library | LibraryPosition$ -1 | RandomOrder$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
Oracle:Whenever a permanent you control is put into a graveyard, you get {E} (an energy counter).\n{T}, Pay {E}{E}{E}{E}{E}{E}: Look at the top six cards of your library. You may cast a spell from among them without paying its mana cost. Put the rest on the bottom of your library in a random order.

View File

@@ -2,7 +2,7 @@ Name:Zask, Skittering Swarmlord
ManaCost:3 G G
Types:Legendary Creature Insect
PT:5/5
S:Mode$ Continuous | Affected$ Land.YouOwn,Insect.YouOwn | MayPlay$ True | AffectedZone$ Graveyard | Description$ You may play lands and cast Insect spells from your graveyard.
S:Mode$ Continuous | Affected$ Land.YouOwn,Insect.YouOwn | ValidAfterStack$ Spell.Insect | MayPlay$ True | AffectedZone$ Graveyard | Description$ You may play lands and cast Insect spells from your graveyard.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Insect.YouCtrl+Other | Execute$ TrigChange | TriggerDescription$ Whenever another Insect you control dies, put it on the bottom of its owner's library, then mill two cards. (Put the top two cards of your library into your graveyard.)
SVar:TrigChange:DB$ ChangeZone | Defined$ TriggeredNewCardLKICopy | Origin$ Graveyard | Destination$ Library | LibraryPosition$ -1 | SubAbility$ DBMill
SVar:DBMill:DB$ Mill | NumCards$ 2

View File

@@ -5,7 +5,7 @@ PT:5/4
K:Trample
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigPeek | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, look at the top card of your library. You may play a land from the top of your library or cast a spell with mana value less than or equal to the damage dealt from the top of your library without paying its mana cost. If you don't, put that card into your hand.
SVar:TrigPeek:DB$ PeekAndReveal | PeekAmount$ 1 | NoReveal$ True | RememberPeeked$ True | SubAbility$ DBPlay
SVar:DBPlay:DB$ Play | Optional$ True | ValidZone$ Library | Defined$ Remembered | ValidSA$ SpellAbility.Land,Spell.cmcLEX | WithoutManaCost$ True | ForgetPlayed$ True | SubAbility$ DBChangeZone
SVar:DBPlay:DB$ Play | Optional$ True | Defined$ Remembered | ValidSA$ SpellAbility.Land,Spell.cmcLEX | WithoutManaCost$ True | ForgetPlayed$ True | SubAbility$ DBChangeZone
SVar:DBChangeZone:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:TriggerCount$DamageAmount