mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
AbilityUtils: add Precalc Option
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user