It is currently 25 May 2025, 20:50
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Card Development Questions

Postby moomarc » 03 Jan 2012, 16:03

SoulStorm wrote:
moomarc wrote:
SoulStorm wrote:Is Consuming Vapors scriptable? I've tried a few way of scripting it using Tribute to Hunger as a template, but nothing seems to work right. Are rebound cards just not scriptable at his point?
As a keyword, rebound isn't available for scripting yet. I was going to try some with the method I used above if the other devs were happy with the method, but I don't know if we can do the "as it resolves" part.
Thanks for the data. I'm looking forward to seeing what you come up with.
Just tried and it can't quite be done AFAICT. The method I used for the other cards needs the stack->battlefield trigger. The rebound cards, however, exile the card as part of the spell resolution and you can't set a trigger for that because stack->any trigger would fire even if the spell is countered (or even cancelled I think). The exile instead has to happen as a conditional subability. So no luck yet, but on the bright side, if someone does check in code to check for cast from hand, then we can add Phage the Untouchable and Epochrasite.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby SoulStorm » 03 Jan 2012, 20:16

Thanks for taking a look Moomarc.
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby moomarc » 04 Jan 2012, 10:22

I've scripted Myojin of Cleansing Fire using the same cast from hand method I used before. The difference is that it affects whether it enters the battlefield with a counter. So what I've done is made the Stack->battlefield trigger static and it seems to work as expected. Is there any functional difference between this and how K:ETBCounter... works? Any potential problems?

If not I'll go ahead and script the other four Myojins.

Code: Select all
Name:Myojin of Cleansing Fire
ManaCost:5 W W W
Types:Legendary Creature Spirit
Text:no text
PT:4/6
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Hand | Destination$ Stack | Static$ True | DelayedTrigger$ CastFromHand | TriggerDescription$ CARDNAME enters the battlefield with a divinity counter on it if you cast it from your hand.
SVar:CastFromHand:Mode$ ChangesZone | Origin$ Stack | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ETBCounter | Static$ True
SVar:ETBCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ DIVINITY | CounterNum$ 1
S:Mode$ Continuous | Affected$ Card.Self+counters_GE1_DIVINITY | AddKeyword$ Indestructible | Description$ CARDNAME is indestructible as long as it has a divinity counter on it.
A:AB$DestroyAll | Cost$ SubCounter<1/DIVINITY> | ValidCards$ Creature.Other | SpellDescription$ Destroy all other creatures.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/myojin_of_cleansing_fire.jpg
SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/35.jpg
Oracle:Myojin of Cleansing Fire enters the battlefield with a divinity counter on it if you cast it from your hand.\nMyojin of Cleansing Fire is indestructible as long as it has a divinity counter on it.\nRemove a divinity counter from Myojin of Cleansing Fire: Destroy all other creatures.
End
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby Sloth » 04 Jan 2012, 10:59

moomarc wrote:I've scripted Myojin of Cleansing Fire using the same cast from hand method I used before. The difference is that it affects whether it enters the battlefield with a counter. So what I've done is made the Stack->battlefield trigger static and it seems to work as expected. Is there any functional difference between this and how K:ETBCounter... works? Any potential problems?
It should be ok in this case. Hellfish made sure that static ETB triggers will resolve before regular triggers. The only problem that can arise is that static abilities are not checked in between. So if a card gets printed with a trigger that reads "Whenever an indestructible creature enters the battlefield, ..." it will not trigger on the Myojins, but should.

This is a coding problem, the script is as it should be, so please add the Myojins.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby lazylockie » 05 Jan 2012, 21:31

Is there a way to give flashback to an Instant or Sorcery (like Snapcaster Mage) except the flashback cost is different from the original cost?
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Card Development Questions

Postby moomarc » 06 Jan 2012, 06:18

lazylockie wrote:Is there a way to give flashback to an Instant or Sorcery (like Snapcaster Mage) except the flashback cost is different from the original cost?
Which card do you need this for?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby lazylockie » 06 Jan 2012, 14:55

moomarc wrote:
lazylockie wrote:Is there a way to give flashback to an Instant or Sorcery (like Snapcaster Mage) except the flashback cost is different from the original cost?
Which card do you need this for?
I wanted it for Chandra, the Firebrand and other copy spells as a temporary solution for the targeting problem. So if there's no implementation for it, please do not implement this! I'll just find another way heh
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Card Development Questions

Postby moomarc » 07 Jan 2012, 16:53

I'm trying to do the Licids from Tempest block but it needs two things:
- a cost to end an animate effect
- handle AB$Attach as a subability.

Are these easy enough to do slot in to someone's planned work? If not it's no problem, I'll wait like everyone else.

They could then be scripted easily like this (I'm just not sure on the rules whether it should include 'OverwriteTypes$ True' or not):
Quickening Licid | Open
Name:Quickening Licid
ManaCost:1 W
Types:Creature Licid
Text:none
PT:1/1
A:AB$ Animate | Cost$ 1 W T | Defined$ Card.Self | Types$ Enchantment,Aura | Keywords$ Enchant creature | Permanent$ True | EndEffect$ W | IsPresent$ Card.Self+nonAura | SpellDescription$ CARDNAME loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay W to end this effect.
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ First Strike | Description$ Enchanted creature has first strike.
SVar:LicidAttach:AB$Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/quickening_licid.jpg
SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/248.jpg
Oracle:{1}{W}, {T}: Quickening Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.\nEnchanted creature has first strike.
End

One consideration if anyone attempts these additions: the script template incorporates the "loses this ability..." part by using 'IsPresent$ Card.Self+nonAura' so I'm not sure if it would affect the code at all considering the ability line is no longer valid once the Licid has been animated. I'm not knowledgeable enough to know if that causes issues.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby moomarc » 08 Jan 2012, 10:58

Testing Ib Halfheart, Goblin Tactician:
Ib Halfheart, Goblin Tactician | Open
Code: Select all
Name:Ib Halfheart, Goblin Tactician
ManaCost:3 R
Types:Legendary Creature Goblin Advisor
Text:no text
PT:3/2
T:Mode$ AttackerBlocked | ValidCard$ Goblin.YouCtrl+Other | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ Whenever another Goblin you control becomes blocked, sacrifice it. If you do, it deals 4 damage to each creature blocking it.
A:AB$ Token | Cost$ Sac<2/Mountain> | TokenAmount$ 2 | TokenName$ Goblin | TokenTypes$ Creature,Goblin | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put two 1/1 red Goblin creature tokens onto the battlefield.
SVar:TrigSac:AB$SacrificeAll | Cost$ 0 | Defined$ TriggeredAttacker | RememberSacrificed$ True | SubAbility$ DBDamage
SVar:DBDamage:DB$DealDamage | Defined$ TriggeredBlocker | NumDmg$ 4 | ValidDescription$ each creature blocking it. | CheckSVar$ TriggeredSac | SVarCompare$ GE1
SVar:TriggeredSac:Remembered$Amount
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/ib_halfheart_goblin_tactician.jpg
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/163.jpg
Oracle:Whenever another Goblin you control becomes blocked, sacrifice it. If you do, it deals 4 damage to each creature blocking it.\nSacrifice two Mountains: Put two 1/1 red Goblin creature tokens onto the battlefield.
End
I'm testing using Lure and currently it will only deal damage to one of the blockers instead of each triggered blocker. Is there a way around this? I've tried using Blocked trigger, but that goes on the stack separately for each blocker and therefore still only damages the first blocker because each other stack instance requires the sacrifice too.

I also tried DB$DamageAll for the last SubAbility, but it doesn't do anything using TriggeredBlocker with either Defined or ValidCards. Further testing showed that it also did nothing for ValidCards$Creature.blocking although it worked correctly with ValidCards$Creature so does anyone know what the issue with DB$DamageAll is?

Edit: Just noticed that its a bit of a moot point because it's not the goblin sacrificed that's doing the damage anyway (so if a goblin with lifelink is sacrificed this way, no life would be gained). But I'd still like to know what the problem with the last subability is anyway, if anyone knows.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby moomarc » 09 Jan 2012, 14:24

Scripted Clash of Realities:
Clash of Realities | Open
Code: Select all
Name:Clash of Realities
ManaCost:3 R
Types:Enchantment
Text:no text
S:Mode$ Continuous | Affected$ Creature.Spirit | EffectZone$ Battlefield | AffectedZone$ Battlefield,Stack | AddTrigger$ CoRSpiritETB | AddSVar$ CoRSpiritDmg | Description$ All Spirits have "When this permanent enters the battlefield, you may have it deal 3 damage to target non-Spirit creature."
S:Mode$ Continuous | Affected$ Creature.nonSpirit | EffectZone$ Battlefield | AffectedZone$ Battlefield,Stack | AddTrigger$ CoRNonETB | AddSVar$ CoRNonDmg | Description$ Non-Spirit creatures have "When this permanent enters the battlefield, you may have it deal 3 damage to target Spirit creature."
SVar:CoRSpiritETB:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | OptionalDecider$ TriggeredCardController | TriggerZones$ Battlefield | Execute$ CoRSpiritDmg | TriggerDescription$ When this permanent enters the battlefield, you may have it deal 3 damage to target non-Spirit creature.
SVar:CoRSpiritDmg:DB$DealDamage | ValidTgts$ Creature.nonSpirit | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target non-Spirit creature | NumDmg$ 3
SVar:CoRNonETB:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | OptionalDecider$ TriggeredCardController | TriggerZones$ Battlefield | Execute$ CoRNonDmg | TriggerDescription$ When this permanent enters the battlefield, you may have it deal 3 damage to target Spirit creature.
SVar:CoRNonDmg:DB$DealDamage | ValidTgts$ Creature.Spirit | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target Spirit creature | NumDmg$ 3
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/clash_of_realities.jpg
SetInfo:BOK|Rare|http://magiccards.info/scans/en/bok/97.jpg
Oracle:All Spirits have "When this permanent enters the battlefield, you may have it deal 3 damage to target non-Spirit creature."\nNon-Spirit creatures have "When this creature enters the battlefield, you may have it deal 3 damage to target Spirit creature."
End
The card works perfectly for the human player, but when the AI puts a creature into play there's always at least 5 copies of the trigger on the stack. I was testing with 2 clashes in play, but this still shouldn't happen. I even added the TargetsMin/Max params but that didn't help. Any ideas?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby SoulStorm » 11 Jan 2012, 19:19

Sloth, would you please tell me what's wrong with Sudden Spoiling? I've been using it and haven't noticed any problems.

Code: Select all
Name:Sudden Spoiling
ManaCost:1 B B
Types:Instant
Text:no text
K:Split second
A:SP$ AnimateAll | Cost$ 1 B B | ValidTgts$ Player | TgtPrompt$ Select target player | ValidCards$ Creature | Power$ 0 | Toughness$ 2 | RemoveAllAbilities$ True | SpellDescription$ Creatures target player controls become 0/2 and lose all abilities until end of turn.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sudden_spoiling.jpg
End
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby Sloth » 11 Jan 2012, 20:58

SoulStorm wrote:Sloth, would you please tell me what's wrong with Sudden Spoiling? I've been using it and haven't noticed any problems.

Code: Select all
Name:Sudden Spoiling
ManaCost:1 B B
Types:Instant
Text:no text
K:Split second
A:SP$ AnimateAll | Cost$ 1 B B | ValidTgts$ Player | TgtPrompt$ Select target player | ValidCards$ Creature | Power$ 0 | Toughness$ 2 | RemoveAllAbilities$ True | SpellDescription$ Creatures target player controls become 0/2 and lose all abilities until end of turn.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sudden_spoiling.jpg
End
I posted here: viewtopic.php?f=52&t=5757#p78942
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby ArsenalNut » 12 Jan 2012, 07:39

moomarc wrote:I'm trying to do the Licids from Tempest block but it needs two things:
- a cost to end an animate effect
- handle AB$Attach as a subability.

Are these easy enough to do slot in to someone's planned work? If not it's no problem, I'll wait like everyone else.

They could then be scripted easily like this (I'm just not sure on the rules whether it should include 'OverwriteTypes$ True' or not):
Quickening Licid | Open
Name:Quickening Licid
ManaCost:1 W
Types:Creature Licid
Text:none
PT:1/1
A:AB$ Animate | Cost$ 1 W T | Defined$ Card.Self | Types$ Enchantment,Aura | Keywords$ Enchant creature | Permanent$ True | EndEffect$ W | IsPresent$ Card.Self+nonAura | SpellDescription$ CARDNAME loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay W to end this effect.
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ First Strike | Description$ Enchanted creature has first strike.
SVar:LicidAttach:AB$Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/quickening_licid.jpg
SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/248.jpg
Oracle:{1}{W}, {T}: Quickening Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.\nEnchanted creature has first strike.
End

One consideration if anyone attempts these additions: the script template incorporates the "loses this ability..." part by using 'IsPresent$ Card.Self+nonAura' so I'm not sure if it would affect the code at all considering the ability line is no longer valid once the Licid has been animated. I'm not knowledgeable enough to know if that causes issues.
This is really similar to the new Soul Seizer//Ghastly Haunting DKA card. I would look at using the setState ability to script these. Then the "end this effect" could be another setState that "transforms" it back. I just checked in code that allow cards transformed to Auras by setState to attach to game entities.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Card Development Questions

Postby moomarc » 12 Jan 2012, 08:26

ArsenalNut wrote:
moomarc wrote:I'm trying to do the Licids from Tempest block but it needs two things:
- a cost to end an animate effect
- handle AB$Attach as a subability.

Are these easy enough to do slot in to someone's planned work? If not it's no problem, I'll wait like everyone else.

They could then be scripted easily like this (I'm just not sure on the rules whether it should include 'OverwriteTypes$ True' or not):
Quickening Licid | Open
Name:Quickening Licid
ManaCost:1 W
Types:Creature Licid
Text:none
PT:1/1
A:AB$ Animate | Cost$ 1 W T | Defined$ Card.Self | Types$ Enchantment,Aura | Keywords$ Enchant creature | Permanent$ True | EndEffect$ W | IsPresent$ Card.Self+nonAura | SpellDescription$ CARDNAME loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay W to end this effect.
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ First Strike | Description$ Enchanted creature has first strike.
SVar:LicidAttach:AB$Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/quickening_licid.jpg
SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/248.jpg
Oracle:{1}{W}, {T}: Quickening Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.\nEnchanted creature has first strike.
End

One consideration if anyone attempts these additions: the script template incorporates the "loses this ability..." part by using 'IsPresent$ Card.Self+nonAura' so I'm not sure if it would affect the code at all considering the ability line is no longer valid once the Licid has been animated. I'm not knowledgeable enough to know if that causes issues.
This is really similar to the new Soul Seizer//Ghastly Haunting DKA card. I would look at using the setState ability to script these. Then the "end this effect" could be another setState that "transforms" it back. I just checked in code that allow cards transformed to Auras by setState to attach to game entities.
That was the method I initially hoped would become available when Hellfish started the transform functions. So thanks for that. I'll add some ASAP. Dominating licid should be almost a direct copy of Soul Seizer.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby Hellfish » 12 Jan 2012, 08:29

ArsenalNut wrote:This is really similar to the new Soul Seizer//Ghastly Haunting DKA card. I would look at using the setState ability to script these. Then the "end this effect" could be another setState that "transforms" it back. I just checked in code that allow cards transformed to Auras by setState to attach to game entities.
Cool stuff, it just needs a little refinement so that Licids won't be mistaken for doublefaced cards. It's a quick fix, I've already committed it in fact :mrgreen:
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 52 guests


Who is online

In total there are 52 users online :: 0 registered, 0 hidden and 52 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 52 guests

Login Form