Innistrad Scripts
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: Innistrad Scripts
by ArsenalNut » 10 Sep 2011, 06:51 
I think one difference is flip cards don't change color but I believe at least two of the spoilers, Civilized Scholar // Homicidal Brute and Garruk, change color when they transform. Not a big deal, just something to keep track of in the alternative card data.slapshot5 wrote:So, for programming, I'm not sure there's any difference between flip cards and two-faced cards. Except maybe we want to rotate the pic 180 degrees if a card is flipped. We should probably have some kind of overlay icon for this.
I think I convinced myself transform cards would be easier...
If anyone has thoughts on this, please let me know.
-slapshot5
Have you come up with a scheme to manage the alternative data? From a scripting point of view I'd like to see all in one file. It could be basically the same format just encapsulated in between block markers like
- Code: Select all
 Name:
ManaCost:
Types:
Text:
PT:
<normal keywords and abilities>
ALTERNATIVE_CHARACTERISTICS_START
Name:
Types:
Text:
PT:
AltColor:
SVar:AltPicture:
<alternative keywords and abilities>
ALTERNATIVE_CHARACTERISTICS_END
SVar:Rarity:
SVar:Picture:
SetInfo:
Oracle:
End
- Code: Select all
 Name:
ManaCost:
Types:
Text:
PT:
A:AB$
Alt:Name:
Alt:Types:
Alt:Text:
Alt:PT:
Alt:Color:
Alt:SVar:Picture:
Alt:A:AB$ .......
Alt:SVar:Picture:
SVar:Rarity:
SVar:Picture:
SetInfo:
Oracle:
End
So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by Sloth » 10 Sep 2011, 09:18 
Where's the flashback?ArsenalNut wrote:Edit 1: Cackling Counterpart
- Cackling Counterpart | Open
 - Name:Cackling Counterpart
 
ManaCost:1 U U
Types:Instant
Text:no text
A:SP$CopyPermanent | Cost$ 1 U U | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | SpellDescription$ Put a token onto the battlefield that's a copy of target creature you control.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/cackling_counterpart.jpg
End
I think flip cards may be possible with AF Animate.ArsenalNut wrote:I think one difference is flip cards don't change color but I believe at least two of the spoilers, Civilized Scholar // Homicidal Brute and Garruk, change color when they transform. Not a big deal, just something to keep track of in the alternative card data.
Have you come up with a scheme to manage the alternative data? From a scripting point of view I'd like to see all in one file. It could be basically the same format just encapsulated in between block markers like
- 
				

Sloth - Programmer
 - Posts: 3498
 - Joined: 23 Jun 2009, 19:40
 - Has thanked: 125 times
 - Been thanked: 507 times
 
Re: Innistrad Scripts
by ArsenalNut » 10 Sep 2011, 13:50 
Just plain forgot it. I fixed the original post.Sloth wrote:Where's the flashback?ArsenalNut wrote:Edit 1: Cackling Counterpart
I agree that AF Animate can almost do the transformation right now. It's only missing changing the name and image. But if you bury the alternative characteristics in an Animate ability how would you display them in the deck editor? I would like to be able to see both sides of the cards with all card text in the editor. I don't need the fancy transform button but some nice display of all the information would be desirable.Sloth wrote:I think flip cards may be possible with AF Animate.ArsenalNut wrote:I think one difference is flip cards don't change color but I believe at least two of the spoilers, Civilized Scholar // Homicidal Brute and Garruk, change color when they transform. Not a big deal, just something to keep track of in the alternative card data.
Have you come up with a scheme to manage the alternative data? From a scripting point of view I'd like to see all in one file. It could be basically the same format just encapsulated in between block markers like
So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by Sloth » 11 Sep 2011, 14:45 
Three cards I've claimed but haven't posted yet:
			
		- Elite Inquisitor | Open
 - Name:Elite Inquisitor
ManaCost:W W
Types:Creature Human Soldier
Text:no text
PT:2/2
K:First Strike
K:Vigilance
K:Protection:Vampire,Werewolf,Zombie:Protection from Vampires, from Werewolves, and from Zombies.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/elite_inquisitor.jpg
End 
- Skeletal Grimace | Open
 - Name:Skeletal Grimace
ManaCost:1 B
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ 1 B | ValidTgts$ Creature | AILogic$ Pump
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 1 | AddToughness$ 1 | AddAbility$ ABRegen | Description$ Enchanted creature gets +1/+1 and has "B: Regenerate this creature."
SVar:ABRegen:AB$Regenerate | Cost$ B | SpellDescription$ Regenerate this creature.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/skeletal_grimace.jpg
End 
- Travel Preparations | Open
 - Name:Travel Preparations
ManaCost:1 G
Types:Sorcery
Text:no text
A:SP$ PutCounter | Cost$ 1 G | CounterNum$ 1 | CounterType$ P1P1 | TargetMin$ 0 | TargetMax$ 2 | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Put a +1/+1 counter on each of up to two target creatures.
A:SP$ PutCounter | Cost$ 1 W | CounterNum$ 1 | CounterType$ P1P1 | TargetMin$ 0 | TargetMax$ 2 | ValidTgts$ Creature | TgtPrompt$ Select target creature | Flashback$ True | CostDesc$ Flashback 1 W | SpellDescription$ (You may cast this card from your graveyard for its flashback cost. Then exile it.)
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/travel_preparations.jpg
End 
- 
				

Sloth - Programmer
 - Posts: 3498
 - Joined: 23 Jun 2009, 19:40
 - Has thanked: 125 times
 - Been thanked: 507 times
 
Re: Innistrad Scripts
by ArsenalNut » 12 Sep 2011, 05:57 
- Brimstone Volley | Open
 - Name:Brimstone Volley
ManaCost:2 R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 2 R | Tgt$ TgtCP | NumDmg$ X | SpellDescription$ CARDNAME deals 3 damage to target creature or player. Morbid - CARDNAME deals 5 damage to that creature or player instead if a creature died this turn.
SVar:X:Count$Morbid.5.3
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/brimstone_volley.jpg
End 
Edited to use new "Morbid" script parameter.
Last edited by ArsenalNut on 13 Sep 2011, 02:20, edited 1 time in total.
					
				
			So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by Max mtg » 12 Sep 2011, 11:15 
ArsenalNut, there is not much space in the lower-right part of deckeditor window to show both sides at once in a propper size. CardDetailPanel will also need some tuning then.ArsenalNut wrote:But if you bury the alternative characteristics in an Animate ability how would you display them in the deck editor? I would like to be able to see both sides of the cards with all card text in the editor. I don't need the fancy transform button but some nice display of all the information would be desirable.
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: Innistrad Scripts
by friarsol » 12 Sep 2011, 11:57 
Brimstone Volley is wrong. It shouldn't be two different abilities, it should be more similar to Thermal Blast.
			
		- friarsol
 - Global Moderator
 - Posts: 7593
 - Joined: 15 May 2010, 04:20
 - Has thanked: 243 times
 - Been thanked: 965 times
 
Re: Innistrad Scripts
by ArsenalNut » 12 Sep 2011, 12:54 
Why is it wrong? The casting restrictions from the CheckSVar in the two abilities are mutually exclusive so only one ability can be used at any time. The damage comes from only one source.friarsol wrote:Brimstone Volley is wrong. It shouldn't be two different abilities, it should be more similar to Thermal Blast.
I tried to do it like Thermal Blast but you can't do the X calculation without a code mod. "ThisTurnEntered" doesn't support the same implicit true/false syntax like Threshold and some of the others e.g. "Count$Threshold .<TRUE>.<FALSE>". In my first attempt at this card, I added a "Morbid" script parameter that worked like Threshold .
The way I did the CheckSVar is basically doing the true/false at the ability choice instead of at the X calculation. I'll be happy to check in the code with the "Morbid" script parameter implemented. I was just trying to avoid adding code that useful for only one card (so far).
So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by ZzzzSleep » 12 Sep 2011, 13:31 
Thanks to Sol's work in adding milling as a cost, I can now do a proper Deranged Assistant!
			
		- "Deranged Assistant" | Open
 - Name:Deranged Assistant
ManaCost:1 U
Types:Creature Human Wizard
Text:no text
PT:1/1
A:AB$ Mana | Cost$ T Mill<1> | Produced$ 1 | SpellDescription$ Add 1 to your mana pool.
SVar:RemAIDeck:True
SVar:Rarity:Common
End 
Re: Innistrad Scripts
by friarsol » 12 Sep 2011, 14:07 
It's wrong for this reason: If you cast Brimstone Volley before a creature has died and while it's on the stack a creature dies, it still only deals 3 damage, which is incorrect. While adding Count$Morbid might only be for one card now, it seems like it'll show up in more cards since there's still a bunch left to be spoiled, and Wizards likes that type of ability structure. I can easily see a card like this:ArsenalNut wrote:The way I did the CheckSVar is basically doing the true/false at the ability choice instead of at the X calculation. I'll be happy to check in the code with the "Morbid" script parameter implemented. I was just trying to avoid adding code that useful for only one card (so far).
2B Target opponent discards a card at random. Morbid - If a creature died this turn, instead that opponent discards two cards at random.
- friarsol
 - Global Moderator
 - Posts: 7593
 - Joined: 15 May 2010, 04:20
 - Has thanked: 243 times
 - Been thanked: 965 times
 
Re: Innistrad Scripts
by ArsenalNut » 12 Sep 2011, 14:28 
I'll check the Morbid change into the repository. I see what you're saying about the stack. I don't think the stack description will change if something dies while Brimstone Volley is on the stack but the resolved damage will probably be right. I'll test that case.friarsol wrote:It's wrong for this reason: If you cast Brimstone Volley before a creature has died and while it's on the stack a creature dies, it still only deals 3 damage, which is incorrect. While adding Count$Morbid might only be for one card now, it seems like it'll show up in more cards since there's still a bunch left to be spoiled, and Wizards likes that type of ability structure. I can easily see a card like this:ArsenalNut wrote:The way I did the CheckSVar is basically doing the true/false at the ability choice instead of at the X calculation. I'll be happy to check in the code with the "Morbid" script parameter implemented. I was just trying to avoid adding code that useful for only one card (so far).
2B Target opponent discards a card at random. Morbid - If a creature died this turn, instead that opponent discards two cards at random.
So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by ArsenalNut » 13 Sep 2011, 02:18 
I checked in the "Morbid" script parameter addition in rev 10409. The syntax is "Count$Morbid.<True>.<False>" where <true> is the value returned if a creature died this turn and <false> is returned otherwise. I edited my original post for Brimstone Volley to use the new parameter.ArsenalNut wrote:I'll check the Morbid change into the repository. I see what you're saying about the stack. I don't think the stack description will change if something dies while Brimstone Volley is on the stack but the resolved damage will probably be right. I'll test that case.friarsol wrote:It's wrong for this reason: If you cast Brimstone Volley before a creature has died and while it's on the stack a creature dies, it still only deals 3 damage, which is incorrect. While adding Count$Morbid might only be for one card now, it seems like it'll show up in more cards since there's still a bunch left to be spoiled, and Wizards likes that type of ability structure. I can easily see a card like this:ArsenalNut wrote:The way I did the CheckSVar is basically doing the true/false at the ability choice instead of at the X calculation. I'll be happy to check in the code with the "Morbid" script parameter implemented. I was just trying to avoid adding code that useful for only one card (so far).
2B Target opponent discards a card at random. Morbid - If a creature died this turn, instead that opponent discards two cards at random.
I checked the case where a creature died while Brimstone Volley was on the stack. The stack description didn't get updated to say 5 damage but the spell resolved properly for 5 damage.
So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by ArsenalNut » 13 Sep 2011, 03:26 
Maybe we do need the fancy transform/flip buttonMax mtg wrote:ArsenalNut, there is not much space in the lower-right part of deckeditor window to show both sides at once in a propper size. CardDetailPanel will also need some tuning then.
Mostly my point is there needs to be a way to show the proper card text and image for these cards in the gui. If all the alternative information is buried in the script parameters of an ability line, then we have to parse the abilities to get the information. If you can come up with a scheme to encapsulate the data to make it easy to display the transformed state in the gui, then you could likely use this same scheme to pass the data to an Ability Factory to make the transformation.
I am looking to solve two problems at once. Besides Transform/Flip cards, there is a need for an ability factory to do shapeshifting for cards like Shapesharer. Transform/Flip card are basically shapeshifting with a predefined target. If you generalized the ability factory to accept a target to copy and setup the alternative information for Transform/Flip cards to be in the form of a target, you could use the resulting ability factory for both purposes.
I picture the scripting looking something like this for transform/flip
- Code: Select all
 AnimateSelf | Cost$ 0 | Define$ Alternative ...
Then for shapeshifting it would look like
- Code: Select all
 AnimateSelf | Cost$ 0 | ValidTgts$ <Vaild Types> | TgtPropmpt$ ...
Last edited by ArsenalNut on 13 Sep 2011, 12:45, edited 1 time in total.
					
				
			So many cards, so little time
		- 
				

ArsenalNut - Posts: 512
 - Joined: 08 Jul 2011, 03:49
 - Has thanked: 27 times
 - Been thanked: 121 times
 
Re: Innistrad Scripts
by inb63 » 13 Sep 2011, 03:55 
Two new cards to be committed by someone who can do so:
EDIT:
EDIT 2: This dude is crazy with Hero of Bladehold:
EDIT 3: Changed Rakish Heir's ValidTarget$ to Player.
			
				- Bump in the Night | Open
 - Name:Bump in the Night
ManaCost:B
Types:Sorcery
Text:no text
A:SP$ LoseLife | Cost$ B | ValidTgts$ Opponent | LifeAmount$ 3 | SpellDescription$ Target opponent loses 3 life.
A:SP$ LoseLife | Cost$ 5 R | ValidTgts$ Opponent | LifeAmount$ 3 | Flashback$ True | CostDesc$ Flashback - 5 R | SpellDescription$ (You may cast this card from your graveyard for its flashback cost. Then exile it.)
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/bump_in_the_night.jpg
End 
- Rakish Heir | Open
 - Name:Rakish Heir
ManaCost:2 R
Types:Creature Vampire
Text:no text
PT:2/2
T:Mode$ DamageDone | ValidSource$ Vampire.YouCtrl | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever a Vampire you control deals combat damage to a player, put a +1/+1 counter on it.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ TriggeredSource | CounterType$ P1P1 | CounterNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/rakish_heir.jpg
End 
EDIT:
- Nephalia Drownyard | Open
 - Name:Nephalia Drownyard
ManaCost:no cost
Types:Land
Text:no text
A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool.
A:AB$ Mill | Cost$ 1 U B T | NumCards$ 3 | ValidTgts$ Player | TgtPrompt$ Choose a player | SpellDescription$ Target player puts the top three cards of his or her library into his or her graveyard.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/nephalia_drownyard.jpg
End 
EDIT 2: This dude is crazy with Hero of Bladehold:
- Kessig Cagebreakers | Open
 - Name:Kessig Cagebreakers
ManaCost:4 G
Types:Creature Human Rogue
Text:no text
PT:3/4
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME attacks, put a 2/2 green Wolf creature token onto the battlefield tapped and attacking for each creature card in your graveyard.
SVar:TrigToken:AB$Token | Cost$ 0 | TokenImage$ G 2 2 Wolf | TokenAmount$ X | TokenName$ Wolf | TokenTypes$ Creature,Wolf | TokenOwner$ You | TokenColors$ Green | TokenPower$ 2 | TokenToughness$ 2 | TokenTapped$ True | TokenAttacking$ True
SVar:X:Count$TypeInYourYard.Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/kessig_cagebreakers.jpg
End 
EDIT 3: Changed Rakish Heir's ValidTarget$ to Player.
Last edited by inb63 on 14 Sep 2011, 02:42, edited 4 times in total.
					
				
			
		Re: Innistrad Scripts
by Max mtg » 13 Sep 2011, 07:51 
I am looking from the deckeditor's perspective first.ArsenalNut wrote:Maybe we do need the fancy transform/flip buttonMax mtg wrote:ArsenalNut, there is not much space in the lower-right part of deckeditor window to show both sides at once in a propper size. CardDetailPanel will also need some tuning then.![]()
Mostly my point is there needs to be a way to show the proper card text and image for these cards in the gui. If all the alternative information is buried in the script parameters of an ability line, then we have to parse the abilities to get the information. If you can come up with a scheme to encapsulate the data to make it easy to display the transformed state in the gui, then you could likely use this same scheme to pass the data to an Ability Factory to make the transformation.
I am looking to solve two problems at once. Besides Transform/Flip cards, there is a need for an ability factory to do shapeshifting for cards like Shapesharer. Transform/Flip card are basically shapeshifting with a predefined target. If you generalized the ability factory to accept a target to copy and setup the alternative information for Transform/Flip cards to be in the form of a target, you could use the resulting ability factory for both purposes.
I picture the scripting looking something like this for transform/flipwhere "Define$ Alternative" would fetch the alternative characteristics
- Code: Select all
 AnimateCopy | Cost$ 0 | Define$ Alternative ...
Then for shapeshifting it would look like
- Code: Select all
 AnimateCopy | Cost$ 0 | ValidTgts$ <Vaild Types> | TgtPropmpt$ ...
We can show card pictures without transform button: when there two sides of a card, both images may overlap, being the "day" side above by default so that a right-bottom part of "night" face is visible. When you move your mouse over the night part it goes on top.
I am not sure which data from the second face is to be shown in GUI, the table in deckeditor... and how. That second face may have a different color, card type, P/T and so on - so does it mean that deckeditor has to show them? If so, then how? Moreover, this data should becode a part of CardRules class, since it's the heaviest card deckeditor may use - that means this data should not be hidden somewhere deep into an ability of cardname.txt
Cards displayed in deckeditor are not used to build abilities, so I have nothing to say about shapeshifting to a predefined target.
Single class for single responsibility.
		- Max mtg
 - Programmer
 - Posts: 1997
 - Joined: 02 Jul 2011, 14:26
 - Has thanked: 173 times
 - Been thanked: 334 times
 
Who is online
Users browsing this forum: No registered users and 130 guests