Compare commits

...

1 Commits

Author SHA1 Message Date
Hans Mackowiak
0f3a9cd22e AbilityUtils: add Precalc Option 2025-08-23 16:28:57 +02:00
8 changed files with 13 additions and 7 deletions

View File

@@ -1328,6 +1328,12 @@ public class AbilityUtils {
game.getTriggerHandler().resetActiveTriggers();
}
if (sa.hasParam("Precalc")) {
for (String s : sa.getParam("Precalc").split(",")) {
sa.setSVar(s, String.valueOf(calculateAmount(sa.getHostCard(), s, sa)));
}
}
resolvePreAbilities(sa, game);
// count times ability resolves this turn

View File

@@ -3,7 +3,7 @@ ManaCost:R W
Types:Legendary Artifact Creature Toy
PT:1/3
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigDamageAll | TriggerDescription$ Whenever CARDNAME attacks, it deals X damage to each opponent and you gain X life, where X is the number of creatures you control with power 2 or less.
SVar:TrigDamageAll:DB$ DamageAll | ValidPlayers$ Player.Opponent | NumDmg$ X | SubAbility$ DBGainLife
SVar:TrigDamageAll:DB$ DamageAll | ValidPlayers$ Player.Opponent | NumDmg$ X | Precalc$ X | SubAbility$ DBGainLife
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ X
SVar:X:Count$Valid Creature.YouCtrl+powerLE2
Oracle:Whenever Arabella, Abandoned Doll attacks, it deals X damage to each opponent and you gain X life, where X is the number of creatures you control with power 2 or less.

View File

@@ -1,7 +1,7 @@
Name:Camaraderie
ManaCost:4 G W
Types:Sorcery
A:SP$ GainLife | Defined$ You | LifeAmount$ X | SubAbility$ DBDraw | SpellDescription$ You gain X life and draw X cards, where X is the number of creatures you control.
A:SP$ GainLife | Defined$ You | LifeAmount$ X | Precalc$ X | SubAbility$ DBDraw | SpellDescription$ You gain X life and draw X cards, where X is the number of creatures you control.
SVar:DBDraw:DB$ Draw | NumCards$ X | SubAbility$ DBPumpAll
SVar:DBPumpAll:DB$ PumpAll | ValidCards$ Creature.YouCtrl | NumAtt$ +1 | NumDef$ +1 | SpellDescription$ Creatures you control get +1/+1 until end of turn.
SVar:X:Count$Valid Creature.YouCtrl

View File

@@ -3,7 +3,7 @@ ManaCost:3 B B
Types:Creature Vampire Knight
PT:4/4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters, you draw X cards and you lose X life, where X is the number of Vampires you control.
SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ X | SubAbility$ DBLoseLife
SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ X | Precalc$ X | SubAbility$ DBLoseLife
SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ X
SVar:X:Count$Valid Vampire.YouCtrl
DeckHints:Type$Vampire

View File

@@ -3,7 +3,7 @@ ManaCost:3 B
Types:Creature Zombie Wizard
PT:4/2
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME dies, you draw X cards and you lose X life, where X is the number of creature cards in target player's graveyard.
SVar:TrigDraw:DB$ Draw | Defined$ TriggeredCardController | ValidTgts$ Player | TgtPrompt$ Choose target player | NumCards$ X | SubAbility$ DBLoseLife
SVar:TrigDraw:DB$ Draw | Defined$ TriggeredCardController | ValidTgts$ Player | TgtPrompt$ Choose target player | NumCards$ X | Precalc$ X | SubAbility$ DBLoseLife
SVar:DBLoseLife:DB$ LoseLife | Defined$ TriggeredCardController | LifeAmount$ X
SVar:X:TargetedPlayer$ValidGraveyard Creature.YouOwn
AI:RemoveDeck:All

View File

@@ -1,7 +1,7 @@
Name:Sanguimancy
ManaCost:4 B
Types:Sorcery
A:SP$ Draw | NumCards$ X | SubAbility$ DBLoseLife | SpellDescription$ You draw X cards and you lose X life, where X is your devotion to black.
A:SP$ Draw | NumCards$ X | Precalc$ X | SubAbility$ DBLoseLife | SpellDescription$ You draw X cards and you lose X life, where X is your devotion to black.
SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ X
SVar:X:Count$Devotion.Black
AI:RemoveDeck:All

View File

@@ -2,7 +2,7 @@ Name:Stinging Study
ManaCost:4 B
Types:Instant
A:SP$ ChooseCard | Choices$ Card.IsCommander+YouOwn | ChoiceZone$ Command,Battlefield | Mandatory$ True | ChoiceTitle$ Choose a commander you own | SubAbility$ DBDraw | SpellDescription$ You draw X cards and you lose X life, where X is the mana value of a commander you own on the battlefield or in the command zone.
SVar:DBDraw:DB$ Draw | NumCards$ X | SubAbility$ DBLoseLife
SVar:DBDraw:DB$ Draw | NumCards$ X | Precalc$ X | SubAbility$ DBLoseLife
SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ X
SVar:X:ChosenCard$CardManaCost
AI:RemoveDeck:NonCommander

View File

@@ -5,7 +5,7 @@ PT:2/4
A:AB$ Pump | Cost$ U R W | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBGainControl | AILogic$ DonateTargetPerm | SpellDescription$ Target opponent gains control of target permanent you control. | StackDescription$ None
SVar:DBGainControl:DB$ GainControl | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent that you control | NewController$ ParentTarget
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ GainLife | TriggerDescription$ At the beginning of your upkeep, you gain X life and draw X cards, where X is the number of permanents you own that your opponents control.
SVar:GainLife:DB$ GainLife | LifeAmount$ X | SubAbility$ DBDraw
SVar:GainLife:DB$ GainLife | LifeAmount$ X | Precalc$ X | SubAbility$ DBDraw
SVar:DBDraw:DB$ Draw | NumCards$ X
SVar:X:Count$Valid Permanent.YouOwn+OwnerDoesntControl
AI:RemoveDeck:All