Card Contributions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Contributions
by Marek14 » 15 Dec 2014, 12:25
Technically, you only have two targets -- source of damage is chosen on resolution of spell.friarsol wrote:Yea, the damage source should still be the same. Maybe try it with: DamageSource$ ReplacedSourcekrimsen wrote:First attempt at scripting for Forge. Seems to be working okay, although I don't know if the damage's source is supposed to change. Redirected deathtouch damage does not kill atm.
Although I'm not sure this script is quite right. When you cast Kor Chant (and it's cousin Kor Dirge), you have to target the creature you are protecting, the source of the damage, and the creature to redirect the damage to. If I'm reading the script correctly, you are only targeting the protected creature on casting, and targeting the redirected creature during the replacement effect. And I Don't see anything that selects the damage source (like what you see on Circles of Protection)
Re: Card Contributions
by friarsol » 15 Dec 2014, 13:18
It wasn't a list of things that were targeted, just a list of things that needed to happen. I wasn't suggesting the source of damage was targeted. Since later I just said "select" and not "target" And since I did say it's the same as COPs and those definitely don't target, I figured it'd get the point across. The point still stands, you need 3 things, and that script only had 1.5 things.Marek14 wrote:Technically, you only have two targets -- source of damage is chosen on resolution of spell.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by krimsen » 16 Dec 2014, 23:02
Using Remember, Imprint, and ChosenCard seems to work fine. I can't get the Effect to work, though. Maybe someone with more experience knows how to fix this.
If I replace KorChantEffect with a chain of DealDamages, I can address both of my targets and the chosen damage source just fine.
If I replace KorChantEffect with a chain of DealDamages, I can address both of my targets and the chosen damage source just fine.
- Code: Select all
Name:Kor Chant
ManaCost:2 W
Types:Instant
# Creature to save: Remembered
A:SP$ Pump | Cost$ 2 W | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | RememberObjects$ Targeted | SubAbility$ DBEffect | SpellDescription$ All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead.
# Creature to damage: Imprinted
SVar:DBEffect:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Choose target creature to redirect damage to | ImprintCards$ Targeted | SubAbility$ ChooseDmgSource
# Damage Source: ChosenCard
SVar:ChooseDmgSource:DB$ ChooseSource | Choices$ Card | AILogic$ NeedsPrevention | SubAbility$ KorChantEffect | SpellDescription$ ChooseDmgSource
# Replacement Effect until EOT
SVar:KorChantEffect:DB$ Effect | Name$ Kor Chant Effect | ReplacementEffects$ RPreventFromSource | SVars$ RPreventFromSource,RedirectDamage,X
SVar:RPreventFromSource:Event$ DamageDone | ValidSource$ ChosenCard | ValidTarget$ Remembered | ReplaceWith$ RedirectDamage | PreventionEffect$ True | Description$ All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead.
SVar:RedirectDamage:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ChosenCard | NumDmg$ X | References$ X
SVar:X:ReplaceCount$DamageAmount
- krimsen
- Posts: 5
- Joined: 11 Dec 2014, 20:43
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Contributions
by Hexadecimal » 04 Feb 2015, 02:44
Æther Vial was displaying technical info in the stack after activation. I've added stack description and removed confirmation prompt.
- | Open
- Code: Select all
Name:AEther Vial
ManaCost:1
Types:Artifact
A:AB$ ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ChangeType$ Creature.cmcEQX+YouCtrl | ChangeNum$ 1 | References$ X | SpellDescription$ You may put a creature card with converted mana cost equal to the number of charge counters on CARDNAME from your hand onto the battlefield. | StackDescription$ Player puts a creature card with converted mana cost equal to the number of charge counters on AEther Vial from his or her hand onto the battlefield.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your upkeep, you may put a charge counter on CARDNAME.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ CHARGE | CounterNum$ 1
SVar:X:Count$CardCounters.CHARGE
SVar:Picture:http://www.wizards.com/global/images/magic/general/aether_vial.jpg
Oracle:At the beginning of your upkeep, you may put a charge counter on AEther Vial.\n{T}: You may put a creature card with converted mana cost equal to the number of charge counters on AEther Vial from your hand onto the battlefield.
- Hexadecimal
- Posts: 69
- Joined: 08 Oct 2013, 20:36
- Has thanked: 6 times
- Been thanked: 2 times
Re: Card Contributions
by elcnesh » 04 Feb 2015, 12:45
The confirmation prompt should be there, right? It explicitly says "you MAY put a creature card...", won't this force you into doing it if you don't want to?
- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Card Contributions
by Hexadecimal » 04 Feb 2015, 17:38
There are two prompts, I've only removed the unnecessary one. You still get to choose whether to use vial or not, so 'may' part is still here. You don't have to put a creature if you don't want to. Ruling doesn't say "You may tap Æther Vial. If you do...", which is what this prompt effectively does, asks the player whether he wants or not to tap vial.elcnesh wrote:The confirmation prompt should be there, right? It explicitly says "you MAY put a creature card...", won't this force you into doing it if you don't want to?
- Hexadecimal
- Posts: 69
- Joined: 08 Oct 2013, 20:36
- Has thanked: 6 times
- Been thanked: 2 times
Re: Card Contributions
by friarsol » 04 Feb 2015, 18:05
I think what Hexadecimal is trying to say is that since Aether Vial is grabbing a creature from a hidden zone, it's already optional, so no additional optional parameter is needed. You can just fail to "find" a creature, if you don't want one. It has nothing to do with tapping, since tapping is a cost and will always happen. However the Stack Description should more closely follow the Oracle text if it's not going to directly reference objects:Hexadecimal wrote:There are two prompts, I've only removed the unnecessary one. You still get to choose whether to use vial or not, so 'may' part is still here. You don't have to put a creature if you don't want to. Ruling doesn't say "You may tap Æther Vial. If you do...", which is what this prompt effectively does, asks the player whether he wants or not to tap vial.elcnesh wrote:The confirmation prompt should be there, right? It explicitly says "you MAY put a creature card...", won't this force you into doing it if you don't want to?
"StackDescription$ You may put a creature card with converted mana cost equal to the number of charge counters on AEther Vial from your hand onto the battlefield."
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Hexadecimal » 04 Feb 2015, 18:45
Just checked, and you are right. For some reason I thought this prompt served as a protection from accident tap, so vial will become untapped if player says 'no'. Since it's not the case, there is even less justification for this prompt to exist.friarsol wrote:It has nothing to do with tapping, since tapping is a cost and will always happen.
- Hexadecimal
- Posts: 69
- Joined: 08 Oct 2013, 20:36
- Has thanked: 6 times
- Been thanked: 2 times
- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Card Contributions
by Hexadecimal » 27 Feb 2015, 00:28
I think I've fixed Stormfront Riders. But someone more experienced may want to doublecheck if it's optimal or if I haven't accidently broke something. Though I've tested it and it seem to work fine.
- | Open
- Code: Select all
Name:Stormfront Riders
ManaCost:4 W
Types:Creature Human Soldier
PT:4/3
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChangeZone | TriggerDescription$ When CARDNAME enters the battlefield, return two creatures you control to their owner's hand.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Hand | ValidCard$ Creature.YouCtrl | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME or another creature is returned to your hand from the battlefield, put a 1/1 white Soldier creature token onto the battlefield.
SVar:TrigToken:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Soldier | TokenTypes$ Creature,Soldier | TokenOwner$ You | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1 | TokenImage$ w 1 1 soldier PLC
SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Hidden$ True | ChangeType$ Creature.YouCtrl | ChangeNum$ 2 | Mandatory$ True
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/stormfront_riders.jpg
Oracle:Flying\nWhen Stormfront Riders enters the battlefield, return two creatures you control to their owner's hand.\nWhenever Stormfront Riders or another creature is returned to your hand from the battlefield, put a 1/1 white Soldier creature token onto the battlefield.
- Hexadecimal
- Posts: 69
- Joined: 08 Oct 2013, 20:36
- Has thanked: 6 times
- Been thanked: 2 times
Re: Card Contributions
by jlands » 06 Mar 2015, 07:37
Claimed Narset Transcendent on the Forge Upcoming page.
Here is the code (No picture link because forum won't allow me to post it):
Here is the code (No picture link because forum won't allow me to post it):
- Code: Select all
Name:Narset Transcendent
ManaCost:2 W U
Types:Planeswalker Narset
Loyalty:6
A:AB$ PeekAndReveal | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | AILogic$ Main2 | PeekAmount$ 1 | RevealValid$ Card.nonCreature+nonLand | RevealOptional$ True | RememberRevealed$ True | SubAbility$ DBChangeZone | SpellDescription$ Look at the top card of your library. If it's a noncreature, nonland card, you may reveal it and put it into your hand.
SVar:DBChangeZone:DB$ ChangeZone | Defined$ TopOfLibrary | Origin$ Library | Destination$ Hand | ConditionDefined$ Remembered | ConditionPresent$ Card.nonCreature+nonLand | ConditionCompare$ EQ1 | SubAbility$ DBCleanupOne
SVar:DBCleanupOne:DB$ Cleanup | ClearRemembered$ True
A:AB$Effect | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Name$ Narset Transcendent effect. | Triggers$ AddRebound | SVars$ AddReboundMain,DBCleanupTwo | SpellDescription$ When you cast your next instant or sorcery spell from your hand this turn, it gains rebound.
SVar:AddRebound:Mode$ SpellCast | ValidCard$ Instant,Sorcery,Card.wasCastFromHand,Self | ValidActivatingPlayer$ You | OneOff$ True | Execute$ AddReboundMain | TriggerZones$ Command | SubAbility$ DBCleanupTwo | TriggerDescription$ When you cast your next instant or sorcery spell from your hand this turn, it gains rebound.
SVar:AddReboundMain:AB$ Pump | Cost$ 0 | Defined$ TriggeredCard| KW$ Rebound | PumpZone$ Stack | SubAbility$ DBCleanupTwo
SVar:DBCleanupTwo:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
A:AB$ Effect | Cost$ SubCounter<9/LOYALTY> | Name$ Narset Transcendent emblem | StaticAbilities$ STNarset | Planeswalker$ True | Ultimate$ True | Stackable$ False | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "Your opponents can't cast noncreature spells."
SVar:STNarset:Mode$ CantBeCast | ValidCard$ Card.nonCreature | Caster$ Opponent | EffectZone$ Command
SVar:Picture: INSERT MYTHIC SPOILER IMAGE HERE
Oracle:[+1] Look at the top card of your library. If it's a creature card, you may reveal it and put it into your hand.\n[-2] Target creature you control fights another target creature.\n[-7] You get an emblem with "Creatures you control have double strike, trample, hexproof, and haste."
Re: Card Contributions
by Marek14 » 06 Mar 2015, 07:42
Is it really necessary to check that the card is noncreature and nonland in DBChangeZone? If the card is remembered, it had to be revealed, which means it satisfies the conditions automatically.
Re: Card Contributions
by jlands » 06 Mar 2015, 08:56
I was thinking the same thing. I am going off of the code for Domri Rade (Note the Oracle text that I forgot to change...), since it is nearly identical. It probably would work without the check.
Re: Card Contributions
by Sloth » 06 Mar 2015, 13:31
That script doesn't work because the trigger will work in any zone. Even the hand or library.Hexadecimal wrote:I think I've fixed Stormfront Riders. But someone more experienced may want to doublecheck if it's optimal or if I haven't accidently broke something. Though I've tested it and it seem to work fine.
- | Open
- Code: Select all
Name:Stormfront Riders
ManaCost:4 W
Types:Creature Human Soldier
PT:4/3
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChangeZone | TriggerDescription$ When CARDNAME enters the battlefield, return two creatures you control to their owner's hand.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Hand | ValidCard$ Creature.YouCtrl | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME or another creature is returned to your hand from the battlefield, put a 1/1 white Soldier creature token onto the battlefield.
SVar:TrigToken:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Soldier | TokenTypes$ Creature,Soldier | TokenOwner$ You | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1 | TokenImage$ w 1 1 soldier PLC
SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Hidden$ True | ChangeType$ Creature.YouCtrl | ChangeNum$ 2 | Mandatory$ True
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/stormfront_riders.jpg
Oracle:Flying\nWhen Stormfront Riders enters the battlefield, return two creatures you control to their owner's hand.\nWhenever Stormfront Riders or another creature is returned to your hand from the battlefield, put a 1/1 white Soldier creature token onto the battlefield.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Contributions
by friarsol » 06 Mar 2015, 13:33
jlands, please post all scripts for cards from the new set in the "Spoiler Season" thread.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Who is online
Users browsing this forum: No registered users and 30 guests