It is currently 03 Jun 2025, 10:33
   
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 Hellfish » 05 Oct 2011, 06:55

I've been able to get Johtull to work without the NumBlockersMinus1 parameter with some tinkering to calculateAmount. I think it has to do with how calculateAmount delegates to xCount and some info that isn't retained (and shouldn't be).Will report back with more info and hopefully a fix.

EDIT: Okay, yeah, I see it now. When AF_Pump gets to sees "Number$" in X it delegates the calculation to xCount (omitting the spellability, because xCount must sometimes function without one), then xCount processes the XMath (Times.Z) and recurses to calculate Z. Unfortunately it recurses to xCount again, which doesn't have access to the spellability required to calculate the TriggerCount in Z. To solve this, I added a block to calculateAmount which handles "SVar$" calculations.If it catches one, it recurses to itself to calculate that SVar first, letting you use TriggerCount and whatnot properly.

tl;dr check out r10928. :)
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

Re: Card Development Questions

Postby Sloth » 05 Oct 2011, 08:29

jeffwadsworth wrote:I did not notice a "comment" section on the SVN. Doesn't the recently added Teferi's Moat need "Affected$ Creature.withoutFlying+ChosenColor+YouDontCtrl"?
Fixed! Thanks Jeff.
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 jeffwadsworth » 05 Oct 2011, 16:52

Looking at Blood Lust.

| Open
Name:Blood Lust
ManaCost:1 R
Types:Instant
Text:no text
A:SP$ Pump | Cost$ 1 R | NumAtt$ +4 | NumDef$ -4 | ValidTgts$ Creature | TgtPrompt$ Select target creature | ConditionDefined$ Targeted | ConditionPresent$ toughnessGE5 | ConditionCompare$ EQ1 | SubAbility$ DBPump | SpellDescription$ If target creature has toughness 5 or greater, it gets +4/-4 until end of turn. Otherwise, it gets +4/-X until end of turn, where X is its toughness minus 1.
SVar:DBPump:DB$Pump | NumAtt$ 4 | NumDef$ -X | Defined$ Targeted | ConditionDefined$ Targeted | ConditionPresent$ toughnessLT5 | ConditionCompare$ EQ1
SVar:X:Targeted$CardToughness/Minus.1
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/blood_lust.jpg
End


This fires, but the targeted creature does not get the pump at all, even though the generated stack description looks fine. Ideas?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby slapshot5 » 05 Oct 2011, 23:18

jeffwadsworth wrote:Looking at Blood Lust.

| Open
Name:Blood Lust
ManaCost:1 R
Types:Instant
Text:no text
A:SP$ Pump | Cost$ 1 R | NumAtt$ +4 | NumDef$ -4 | ValidTgts$ Creature | TgtPrompt$ Select target creature | ConditionDefined$ Targeted | ConditionPresent$ toughnessGE5 | ConditionCompare$ EQ1 | SubAbility$ DBPump | SpellDescription$ If target creature has toughness 5 or greater, it gets +4/-4 until end of turn. Otherwise, it gets +4/-X until end of turn, where X is its toughness minus 1.
SVar:DBPump:DB$Pump | NumAtt$ 4 | NumDef$ -X | Defined$ Targeted | ConditionDefined$ Targeted | ConditionPresent$ toughnessLT5 | ConditionCompare$ EQ1
SVar:X:Targeted$CardToughness/Minus.1
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/blood_lust.jpg
End


This fires, but the targeted creature does not get the pump at all, even though the generated stack description looks fine. Ideas?
Creature.toughnessGE5 ?
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby jeffwadsworth » 06 Oct 2011, 00:37

Yes, thanks. That and a little logic switcharoo saved the day.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 06 Oct 2011, 16:49

Testing Lesser Werewolf

| Open
Name:Lesser Werewolf
ManaCost:3 B
Types:Creature Werewolf
Text:no text
PT:2/4
A:AB$ Pump | Cost$ B | NumAtt$ -1 | Defined$ Self | ConditionDefined$ Self | ConditionPresent$ Creature.powerGE1 | ConditionCompare$ EQ1 | SubAbility$ DBPutCounter | ActivationPhases$ Declare Blockers - Play Instants and Abilities | SpellDescription$ If CARDNAME's power is 1 or more, it gets -1/-0 until end of turn and put a -0/-1 counter on target creature blocking or blocked by CARDNAME. Activate this ability only during the declare blockers step.
SVar:DBPutCounter:DB$ PutCounter | ConditionDefined$ Self | ConditionPresent$ Creature.powerGE0 | ConditionCompare$ EQ1 | ValidTgts$ Creature.blockedBySource,Creature.blockingSource | TgtPrompt$ Select target creature blocking or blocked by Lesser Werewolf | CounterType$ M0M1 | CounterNum$ 1
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/lesser_werewolf.jpg
End


The pump works correctly and will not push the power of the Lesser Werewolf below 0. The 0/-1 counter on the defender will keep going even though the Lesser Werewolf is at 0 power. Does anyone see what can be done here?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby friarsol » 06 Oct 2011, 16:57

jeffwadsworth wrote:Testing Lesser Werewolf

The pump works correctly and will not push the power of the Lesser Werewolf below 0. The 0/-1 counter on the defender will keep going even though the Lesser Werewolf is at 0 power. Does anyone see what can be done here?
Did you try flipping the Abilities?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 06 Oct 2011, 17:13

friarsol wrote:
jeffwadsworth wrote:Testing Lesser Werewolf

The pump works correctly and will not push the power of the Lesser Werewolf below 0. The 0/-1 counter on the defender will keep going even though the Lesser Werewolf is at 0 power. Does anyone see what can be done here?
Did you try flipping the Abilities?
Switcharoo's FTW. Thanks.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby friarsol » 06 Oct 2011, 23:19

Jeff,
Sword of the Ages is wrong. Exiling Creatures is part of the cost, and might even be supported with my recent Cost changes.

Check out Devastating Dreams for a similar Card.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 07 Oct 2011, 00:00

friarsol wrote:Jeff,
Sword of the Ages is wrong. Exiling Creatures is part of the cost, and might even be supported with my recent Cost changes.

Check out Devastating Dreams for a similar Card.
So, something like this? Won't work but just making sure there isn't a better way.

| Open
Name:Sword of the Ages
ManaCost:6
Types:Artifact
Text:no text
K:CARDNAME enters the battlefield tapped.
A:AB$ DealDamage | Cost$ T Exile<1/CARDNAME> Exile<X/Creature.YouCtrl | NumDmg$ Y | CostDesc$ Exile Sword of the Ages and any number of creatures you control: | SpellDescription$ CARDNAME deals X damage to target creature or player, where X is the total power of the creatures exiled this way.
SVar:Y:Exiled$TotalPower
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sword_of_the_ages.jpg
End
Last edited by jeffwadsworth on 07 Oct 2011, 00:13, edited 1 time in total.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby friarsol » 07 Oct 2011, 00:10

Yea that looks right. Not sure if you need the .YouCtrl or not.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 07 Oct 2011, 00:16

Here is a sample script for The Wretched.

| Open
Name:The Wretched
ManaCost:3 B B
Types:Creature Demon
Text:no text
PT:2/5
T:Mode$ AttackerBlocked | ValidCard$ Card.Self | ValidBlocker$ Creature | DelayedTrigger$ DelayedTrig | TriggerDescription$ At end of combat, gain control of all creatures blocking CARDNAME for as long as you control CARDNAME.
SVar:DelayedTrig:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ You | Execute$ TrigGainControl | TriggerDescription$ Gain control of creature that blocked CARDNAME
SVar:TrigGainControl:AB$GainControl | Cost$ 0 | Defined$ TriggeredBlocker | LoseControl$ LeavesPlay
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/the_wretched.jpg
End


Now, this works for 1 creature blocking The Wretched, but not 2 or more. What am I missing?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby slapshot5 » 07 Oct 2011, 02:05

jeffwadsworth wrote:Now, this works for 1 creature blocking The Wretched, but not 2 or more. What am I missing?
I think TriggeredBlocker will only ever return 1 card. More than 1 is not supported at this time.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby jeffwadsworth » 07 Oct 2011, 03:00

friarsol wrote:Yea that looks right. Not sure if you need the .YouCtrl or not.
It will have to wait until SVar:Y:Exiled$SumPower is done.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby slapshot5 » 07 Oct 2011, 03:25

jeffwadsworth wrote:
friarsol wrote:Yea that looks right. Not sure if you need the .YouCtrl or not.
It will have to wait until SVar:Y:Exiled$SumPower is done.
Did you try just Exiled$CardPower? I think it might sum the list for you.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 33 guests


Who is online

In total there are 33 users online :: 0 registered, 0 hidden and 33 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 33 guests

Login Form