Dragon's Maze Spoiler Season
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
69 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
Re: Dragon's Maze Spoiler Season
by ZzzzSleep » 17 Apr 2013, 22:29
It's Warleader's Helix! It's like Lightning Helix turned up to 4!
- Warleader's Helix | Open
- Code: Select all
Name:Warleader's Helix
ManaCost:2 R W
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 2 R W | Tgt$ TgtCP | NumDmg$ 4 | SubAbility$ DBGainLife | SpellDescription$ CARDNAME deals 4 damage to target creature or player and you gain 4 life.
SVar:DBGainLife:DB$GainLife | LifeAmount$ 4
Re: Dragon's Maze Spoiler Season
by swordshine » 18 Apr 2013, 00:26
CARDNAME is more accurate because some other cards may copy this ability. The name would be changed by using CARDNAME.ZzzzSleep wrote:It's Warleader's Helix! It's like Lightning Helix turned up to 4!Edit: while looking at Lightning Helix as a template, I noticed that (in v1.3.11 at least) it is referring to itself in the SpellDescription as Lightning Helix instead of CARDNAME. Not sure if it makes much difference really though...
- Warleader's Helix | Open
- Code: Select all
Name:Warleader's Helix
ManaCost:2 R W
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 2 R W | Tgt$ TgtCP | NumDmg$ 4 | SubAbility$ DBGainLife | SpellDescription$ CARDNAME deals 4 damage to target creature or player and you gain 4 life.
SVar:DBGainLife:DB$GainLife | LifeAmount$ 4
"Tgt$ TgtCP" is not used in Forge now. We replaced it with "ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player".
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Dragon's Maze Spoiler Season
by swordshine » 18 Apr 2013, 04:13
Pyrewild Shaman has a trigger "Whenever one or more creatures you control deal combat damage to a player", something like Nature's Will and Thunderblade Charge.
Edit: Here is a possible script using StoreSVar.
Edit: Here is a possible script using StoreSVar.
- Pyrewild Shaman | Open
- Code: Select all
Name:Pyrewild Shaman
ManaCost:2 R
Types:Creature Goblin Shaman
PT:3/1
A:AB$ Pump | Cost$ 1 R Discard<1/CARDNAME> | ActivationZone$ Hand | PrecostDesc$ Bloodrush - | ValidTgts$ Creature.attacking | TgtPrompt$ Select target attacking creature | NumAtt$ +3 | NumDef$ +1 | SpellDescription$ Target attacking creature gets +3/+1 until end of turn.
T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigStore | Static$ True
SVar:TrigStore:AB$ StoreSVar | Cost$ 0 | SVar$ CheckCombatDamageDone | Type$ Number | Expression$ 1
T:Mode$ Always | Execute$ TrigReturn | CheckSVar$ CheckCombatDamageDone | SVarCompare$ GE1 | TriggerZones$ Graveyard | TriggerDescription$ Whenever one or more creatures you control deal combat damage to a player, if CARDNAME is in your graveyard, you may pay 3. If you do, return CARDNAME to your hand.
SVar:TrigReturn:AB$ ChangeZone | Cost$ 3 | Origin$ Graveyard | Destination$ Hand | Defined$ Self | SubAbility$ DBReset
T:Mode$ Phase | Phase$ First Strike Damage | ValidPlayer$ You | Execute$ DBReset | Static$ True
T:Mode$ Phase | Phase$ Combat Damage | ValidPlayer$ You | Execute$ DBReset | Static$ True
SVar:DBReset:DB$ StoreSVar | SVar$ CheckCombatDamageDone | Type$ Number | Expression$ 0
SVar:CheckCombatDamageDone:Number$0
SVar:PlayMain1:TRUE
SVar:Picture:http://www.wizards.com.sixxs.org/global/images/magic/general/pyrewild_shaman.jpg
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Dragon's Maze Spoiler Season
by moomarc » 18 Apr 2013, 16:43
Is there any particular reason why you're storing the svar instead of just executing the change zone directly off the combat damage trigger? Is it to prevent multiple triggers hitting the stack potentially allowing you to cast it between each stack entry resolve?swordshine wrote:Pyrewild Shaman has a trigger "Whenever one or more creatures you control deal combat damage to a player", something like Nature's Will and Thunderblade Charge.
Edit: Here is a possible script using StoreSVar.Please have a look whether I made it correctly.
- Pyrewild Shaman | Open
- Code: Select all
Name:Pyrewild Shaman
ManaCost:2 R
Types:Creature Goblin Shaman
PT:3/1
A:AB$ Pump | Cost$ 1 R Discard<1/CARDNAME> | ActivationZone$ Hand | PrecostDesc$ Bloodrush - | ValidTgts$ Creature.attacking | TgtPrompt$ Select target attacking creature | NumAtt$ +3 | NumDef$ +1 | SpellDescription$ Target attacking creature gets +3/+1 until end of turn.
T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigStore | Static$ True
SVar:TrigStore:AB$ StoreSVar | Cost$ 0 | SVar$ CheckCombatDamageDone | Type$ Number | Expression$ 1
T:Mode$ Always | Execute$ TrigReturn | CheckSVar$ CheckCombatDamageDone | SVarCompare$ GE1 | TriggerZones$ Graveyard | TriggerDescription$ Whenever one or more creatures you control deal combat damage to a player, if CARDNAME is in your graveyard, you may pay 3. If you do, return CARDNAME to your hand.
SVar:TrigReturn:AB$ ChangeZone | Cost$ 3 | Origin$ Graveyard | Destination$ Hand | Defined$ Self | SubAbility$ DBReset
T:Mode$ Phase | Phase$ First Strike Damage | ValidPlayer$ You | Execute$ DBReset | Static$ True
T:Mode$ Phase | Phase$ Combat Damage | ValidPlayer$ You | Execute$ DBReset | Static$ True
SVar:DBReset:DB$ StoreSVar | SVar$ CheckCombatDamageDone | Type$ Number | Expression$ 0
SVar:CheckCombatDamageDone:Number$0
SVar:PlayMain1:TRUE
SVar:Picture:http://www.wizards.com.sixxs.org/global/images/magic/general/pyrewild_shaman.jpg
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Dragon's Maze Spoiler Season
by friarsol » 18 Apr 2013, 16:49
Yea he's storing the svar so it only triggers once.moomarc wrote:Is there any particular reason why you're storing the svar instead of just executing the change zone directly off the combat damage trigger? Is it to prevent multiple triggers hitting the stack potentially allowing you to cast it between each stack entry resolve?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Dragon's Maze Spoiler Season
by moomarc » 18 Apr 2013, 17:52
In that case the script looks goodfriarsol wrote:Yea he's storing the svar so it only triggers once.moomarc wrote:Is there any particular reason why you're storing the svar instead of just executing the change zone directly off the combat damage trigger? Is it to prevent multiple triggers hitting the stack potentially allowing you to cast it between each stack entry resolve?
Wouldn't it be better to have a TriggerLimit param or something similar that limits the number of times a trigger will fire per trigger source. So for Pyrewild Shaman for instance, have TriggerLimit$1 in the trigger line. Then in the DamageDone trigger tests, check for the param. If present
Edit: triggerCount would have to be stored as a Map<Card,int> so that various sources would have their own counters. If the map isn't present the trigger would add (triggerSource,1) or if it is present increment the int.
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Dragon's Maze Spoiler Season
by friarsol » 18 Apr 2013, 20:05
I'd imagine the best way to do it has similar to the difference between AttackerBlocked and Blocks triggers. One only happens once, one happens multiple times.moomarc wrote:Wouldn't it be better to have a TriggerLimit param or something similar that limits the number of times a trigger will fire per trigger source. So for Pyrewild Shaman for instance, have TriggerLimit$1 in the trigger line. Then in the DamageDone trigger tests, check for the param. If presentincrease an int triggerCount(not sure where the best place would be to store it though - somewhere in trigger), unless triggerCount already matches the TriggerLimit specified in which case it returns false. End of Combat phase would probably have to reset triggeredCount back to 0.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Dragon's Maze Spoiler Season
by swordshine » 19 Apr 2013, 00:30
I love the TriggerLimit idea, if it's done, cards like Kira, Great Glass-Spinner and Chancellor of the Annex are scriptable. Unfortunately, I don't know how to do it cuz it's totally different from ActivationLimit.moomarc wrote:Wouldn't it be better to have a TriggerLimit param or something similar that limits the number of times a trigger will fire per trigger source. So for Pyrewild Shaman for instance, have TriggerLimit$1 in the trigger line. Then in the DamageDone trigger tests, check for the param. If presentincrease an int triggerCount(not sure where the best place would be to store it though - somewhere in trigger), unless triggerCount already matches the TriggerLimit specified in which case it returns false. End of Combat phase would probably have to reset triggeredCount back to 0.
Edit: triggerCount would have to be stored as a Map<Card,int> so that various sources would have their own counters. If the map isn't present the trigger would add (triggerSource,1) or if it is present increment the int.
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Dragon's Maze Spoiler Season
by Max mtg » 19 Apr 2013, 07:04
don't forget to distinguish limits, because Kira uses per-turn limits, and Chancellor uses per-game ones.
So name it "TriggersPerTurn" probably
I can't even understand why Chancellor of the Annex would need TriggerLimit. Let's say, when you've revealed it from opening hand an effect is created for each opponent. As that effect triggers, it resolves as counterspell and removes itself... or is that unsupported now?
So name it "TriggersPerTurn" probably
I can't even understand why Chancellor of the Annex would need TriggerLimit. Let's say, when you've revealed it from opening hand an effect is created for each opponent. As that effect triggers, it resolves as counterspell and removes itself... or is that unsupported now?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Dragon's Maze Spoiler Season
by swordshine » 19 Apr 2013, 08:08
An opponent cast Shock, Chancellor of the Annex triggers, and if that opponent cast another Shock before the trigger resolves, Chancellor of the Annex would trigger again without a triggerlimit.Max mtg wrote:don't forget to distinguish limits, because Kira uses per-turn limits, and Chancellor uses per-game ones.
So name it "TriggersPerTurn" probably
I can't even understand why Chancellor of the Annex would need TriggerLimit. Let's say, when you've revealed it from opening hand an effect is created for each opponent. As that effect triggers, it resolves as counterspell and removes itself... or is that unsupported now?
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Dragon's Maze Spoiler Season
by Max mtg » 19 Apr 2013, 08:16
Then what about removing the effect from command zone right as it has triggered?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Dragon's Maze Spoiler Season
by swordshine » 19 Apr 2013, 08:28
If you use a static trigger to remove the effect, the effect would be immediately removed and the counterspell trigger in this effect doesn't exist.Max mtg wrote:Then what about removing the effect from command zone right as it has triggered?
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Dragon's Maze Spoiler Season
by Max mtg » 19 Apr 2013, 09:07
static effect:
1. remove the effect from command zone (but keep executing it)
2. add to stack "counter [spell we've triggered on] unless its controller pays
"
I don't know for sure how it works, maybe something is missing in the current codebase to implement this.
1. remove the effect from command zone (but keep executing it)
2. add to stack "counter [spell we've triggered on] unless its controller pays
" I don't know for sure how it works, maybe something is missing in the current codebase to implement this.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Dragon's Maze Spoiler Season
by swordshine » 22 Apr 2013, 13:38
I tried to script Plasm Capture:
- Plasm Capture | Open
- Code: Select all
Name:Plasm Capture
ManaCost:U U G G
Types:Instant
A:SP$ Counter | Cost$ U U G G | TargetType$ Spell | RememberCountered$ True | ForgetOtherTargets$ True | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost.
SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Main1 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ CARDNAME - At the beginning of your next precombat main phase, aadd X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost.
SVar:AddMana:DB$ Mana | Cost$ 0 | Produced$ Combo Any | Amount$ X | References$ X
SVar:X:Remembered$CardManaCost
SVar:Picture:http://www.wizards.com/global/images/magic/general/plasm_capture.jpg
- RuntimeException | Open
- Code: Select all
Forge Version: SVN
Operating System: Windows XP 5.1 x86
Java Version: 1.7.0_17 Oracle Corporation
java.lang.RuntimeException: AbilityFactoryMana::manaResolve() - combo mana color choice is empty for Plasm Capture
at forge.card.ability.effects.ManaEffect.resolve(ManaEffect.java:106)
at forge.card.spellability.AbilitySub.resolve(AbilitySub.java:130)
at forge.card.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1082)
at forge.card.ability.AbilityUtils.resolve(AbilityUtils.java:1061)
at forge.game.ai.ComputerUtil.playNoStack(ComputerUtil.java:317)
at forge.card.trigger.WrappedAbility.resolve(WrappedAbility.java:418)
at forge.card.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1082)
at forge.card.ability.AbilityUtils.resolve(AbilityUtils.java:1061)
at forge.game.zone.MagicStack.resolveStack(MagicStack.java:615)
at forge.game.phase.PhaseHandler$1.run(PhaseHandler.java:743)
at forge.game.phase.PhaseHandler.passPriority(PhaseHandler.java:751)
at forge.game.player.PlayerController.passPriority(PlayerController.java:77)
at forge.control.input.InputBase$1.run(InputBase.java:78)
at forge.FThreads$1.run(FThreads.java:113)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Dragon's Maze Spoiler Season
by Sloth » 22 Apr 2013, 15:42
Commit and i fix the AI.swordshine wrote:I tried to script Plasm Capture:It works fine for human, but would get a crash for AI:
- Plasm Capture | Open
- Code: Select all
Name:Plasm Capture
ManaCost:U U G G
Types:Instant
A:SP$ Counter | Cost$ U U G G | TargetType$ Spell | RememberCountered$ True | ForgetOtherTargets$ True | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost.
SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Main1 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ CARDNAME - At the beginning of your next precombat main phase, aadd X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost.
SVar:AddMana:DB$ Mana | Cost$ 0 | Produced$ Combo Any | Amount$ X | References$ X
SVar:X:Remembered$CardManaCost
SVar:Picture:http://www.wizards.com/global/images/magic/general/plasm_capture.jpg
- RuntimeException | Open
- Code: Select all
Forge Version: SVN
Operating System: Windows XP 5.1 x86
Java Version: 1.7.0_17 Oracle Corporation
java.lang.RuntimeException: AbilityFactoryMana::manaResolve() - combo mana color choice is empty for Plasm Capture
at forge.card.ability.effects.ManaEffect.resolve(ManaEffect.java:106)
at forge.card.spellability.AbilitySub.resolve(AbilitySub.java:130)
at forge.card.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1082)
at forge.card.ability.AbilityUtils.resolve(AbilityUtils.java:1061)
at forge.game.ai.ComputerUtil.playNoStack(ComputerUtil.java:317)
at forge.card.trigger.WrappedAbility.resolve(WrappedAbility.java:418)
at forge.card.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1082)
at forge.card.ability.AbilityUtils.resolve(AbilityUtils.java:1061)
at forge.game.zone.MagicStack.resolveStack(MagicStack.java:615)
at forge.game.phase.PhaseHandler$1.run(PhaseHandler.java:743)
at forge.game.phase.PhaseHandler.passPriority(PhaseHandler.java:751)
at forge.game.player.PlayerController.passPriority(PlayerController.java:77)
at forge.control.input.InputBase$1.run(InputBase.java:78)
at forge.FThreads$1.run(FThreads.java:113)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
69 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 8 guests