Return to Ravnica Spoiler Season
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: Return to Ravnica Spoiler Season
 by ZzzzSleep » 13 Sep 2012, 11:54
by ZzzzSleep » 13 Sep 2012, 11:54 
Two green cards!
Slime Molding (it's like Gelatinous Genesis, but only one of them at half the price!)
			
		Slime Molding (it's like Gelatinous Genesis, but only one of them at half the price!)
- "Slime Molding" | Open
- Code: Select all
- Name:Slime Molding
 ManaCost:X G
 Types:Sorcery
 Text:no text
 A:SP$ Token | Cost$ X G | TokenImage$ G X X Ooze | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | References$ X | SpellDescription$ Put an X/X green Ooze creature token onto the battlefield.
 SVar:X:Count$xPaid
 SVar:Rarity:Uncommon
 SVar:Picture:http://www.wizards.com/global/images/magic/general/slime_molding.jpg
 End
 
- "Axebane Guardian" | Open
- Code: Select all
- Name:Axebane Guardian
 ManaCost:2 G
 Types:Creature Human Druid
 Text:no text
 PT:0/3
 K:Defender
 A:AB$ Mana | Cost$ T | Produced$ Any | Amount$ X | References$ X | SpellDescription$ Add X mana in any combination of colors to your mana pool, where X is the number of creatures with defender you control.
 SVar:X:Count$Valid Creature.withDefender+YouCtrl
 SVar:Rarity:Common
 SVar:Picture:http://www.wizards.com/global/images/magic/general/axebane_guardian.jpg
 End
 
Re: Return to Ravnica Spoiler Season
 by torridus » 14 Sep 2012, 06:03
by torridus » 14 Sep 2012, 06:03 
Once again I can't edit the wiki, but here's more.
 I couldn't for the life of me manage to get that ult working, haha.
 I couldn't for the life of me manage to get that ult working, haha.
			
				- Isperia, Supreme Judge | Open
- Code: Select all
- Name:Isperia, Supreme Judge
 ManaCost:2 W W U U
 Types:Legendary Creature Sphinx
 Text:no text
 PT:6/4
 K:Flying
 T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigDraw | OptionalDecider$ You | TriggerDescription$ Whenever a creature attacks you or a planeswalker you control, you may draw a card.
 SVar:TrigDraw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1
 SVar:Rarity:Mythic
 SVar:Picture:http://www.wizards.com/global/images/magic/general/isperia_supreme_judge.jpg
 End
 
- Rakdos's Return | Open
- Code: Select all
- Name:Rakdos's Return
 ManaCost:X B R
 Types:Sorcery
 Text:no text
 A:SP$ DealDamage | Cost$ X B R | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | NumDmg$ X | References$ X | SubAbility$ DBDiscardOpp | SpellDescription$ CARDNAME deals X damage to target opponent. That player discards X cards.
 SVar:DBDiscardOpp:DB$Discard | Defined$ Targeted | NumCards$ X | References$ X | Mode$ TgtChoose
 SVar:X:Count$xPaid
 SVar:Rarity:Mythic
 End
 
- Sphinx's Revelation | Open
- Code: Select all
- Name:Sphinx's Revelation
 ManaCost:X W U U
 Types:Instant
 Text:no text
 A:SP$ GainLife | Cost$ X W U U | LifeAmount$ X | References$ X | SubAbility$ DBDraw | SpellDescription$ You gain X life and draw X cards.
 SVar:DBDraw:DB$Draw | NumCards$ X | References$ X
 SVar:X:Count$xPaid
 SVar:Rarity:Mythic
 End
 
 I couldn't for the life of me manage to get that ult working, haha.
 I couldn't for the life of me manage to get that ult working, haha.Last edited by torridus on 14 Sep 2012, 13:33, edited 2 times in total.
					
				
			
		Re: Return to Ravnica Spoiler Season
 by moomarc » 14 Sep 2012, 11:14
by moomarc » 14 Sep 2012, 11:14 
Thanks torridus and ZzzzSleep! Added your cards. Isperia just needed an optional decider on her trigger and the image link was for Drogskul Reaver. For Axebane Guardian, we don't support selecting a different color mana for each one produced yet so I've just moved it on the claimed page to the Not Quite Working section.
			-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: Return to Ravnica Spoiler Season
 by torridus » 14 Sep 2012, 13:34
by torridus » 14 Sep 2012, 13:34 
Whoops! Edited my post to fix up the mistakes, just so no one gets confused. 
Coded another one too.
			
				Coded another one too.
- Necropolis Regent | Open
- Code: Select all
- Name:Necropolis Regent
 ManaCost:3 B B B
 Types:Creature Vampire
 Text:no text
 PT:6/5
 K:Flying
 T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Player | TriggerZones$ Battlefield | CombatDamage$ True | Execute$ TrigPutCounter | TriggerDescription$ Whenever a creature you control deals combat damage to a player, put that many +1/+1 counters on it.
 SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | Defined$ TriggeredSource | CounterType$ P1P1 | CounterNum$ X | References$ X
 SVar:X:TriggerCount$DamageAmount
 SVar:Rarity:Mythic
 End
 
Last edited by torridus on 15 Sep 2012, 08:26, edited 1 time in total.
					
				
			
		Re: Return to Ravnica Spoiler Season
 by Sloth » 14 Sep 2012, 19:30
by Sloth » 14 Sep 2012, 19:30 
The Overload ability needs the little addition "NonBasicSpell$ True", so that the player can't use it when the spell is cast "without paying its mana cost".moomarc wrote:
And here's some Overload love: (I decided to replace the reminder text with the actual replacement text - just makes life easier for users)
- Cyclonic Rift | Open
- Code: Select all
Name:Cyclonic Rift
ManaCost:1 U
Types:Instant
Text:no text
A:SP$ ChangeZone | Cost$ 1 U | ValidTgts$ Permanent.nonLand+YouDontCtrl | TgtPrompt$ Select target nonland permanent you don't control | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target nonland permanent you don't control to its owner's hand.
A:SP$ ChangeZoneAll | Cost$ 6 U | ChangeType$ Permanent.nonLand+YouDontCtrl | Origin$ Battlefield | Destination$ Hand | PrecostDesc$ Overload | CostDesc$ 6 U | SpellDescription$ (Return each nonland permanent you don't control to its owner's hand.)
SVar:PlayMain1:TRUE
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/cyclonic_rift.jpg
End
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Return to Ravnica Spoiler Season
 by moomarc » 14 Sep 2012, 20:04
by moomarc » 14 Sep 2012, 20:04 
Hey Sloth, quick question... When I was scripting Isperia I obviously just checked out other 'Whenever X attacks you or a planeswalker you control' and all except the first search result had the same trigger (can't remember which card it was offhand but it started with Blood). Anyway, it was the newest card so thought I'd add the extra Attack$Player param. When I tested it though it causes a crash when my planeswalker was attacked (again, can't remember the details but I think it was trying cast Card to Player). I tried to track it down and it seems like it was just trying to add details to the combat map. So is it a param that needs to be fixed and added to the other similar triggers?
			-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: Return to Ravnica Spoiler Season
 by moomarc » 15 Sep 2012, 08:52
by moomarc » 15 Sep 2012, 08:52 
I've got Axebane Guardian scripted using a tweaked Repeat AF. Basically the repeat happens X times (where X is the number of creatures with Defender) and each time adds 1 mana of any color. That part is working properly, but at the moment it doesn't act like a proper mana ability. I could get it to skip the stack with a Static$True parameter, but it still couldn't be used to pay for abilities and wouldn't interact properly with cards like Pithing Needle.
So do we have a way to flag an ability as a mana ability?
Out of interest, here's the tweaked Repeat resolve code (I had to make the fixed number of repeats part of the resolve instead of as a repeat condition so that it can repeat 0 times):
Edit 2: So the IsManaAbility param works fine for Pithing Needle, but the Static$True param doesn't (obviously, seeing as its not a trigger). So trying to track down all the places that might need the param check now and try work out how to make it act as a mana ability should. Search for 'instanceof AbilityMana' seems like a good place to start...
			So do we have a way to flag an ability as a mana ability?
Out of interest, here's the tweaked Repeat resolve code (I had to make the fixed number of repeats part of the resolve instead of as a repeat condition so that it can repeat 0 times):
- Code: Select all
- if (params.containsKey("RepeatNumber")) { //fixed number of repeats - usually an svar
 final int repeats = AbilityFactory.calculateAmount(sa.getSourceCard(), params.get("RepeatNumber"), sa);
 for (int repeatCount = 0; repeatCount < repeats; repeatCount++) {
 AbilityFactory.resolve(repeat, false);
 }
 } else { //repeat until condition met
 //execute repeat ability at least once
 do {
 AbilityFactory.resolve(repeat, false);
 } while (checkRepeatConditions(af, sa));
 }
Edit 2: So the IsManaAbility param works fine for Pithing Needle, but the Static$True param doesn't (obviously, seeing as its not a trigger). So trying to track down all the places that might need the param check now and try work out how to make it act as a mana ability should. Search for 'instanceof AbilityMana' seems like a good place to start...
-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: Return to Ravnica Spoiler Season
 by friarsol » 15 Sep 2012, 12:01
by friarsol » 15 Sep 2012, 12:01 
Re: Axebane
I'd vote for trying to convince someone to write up ManaCombination instead of some huge script that is extremely complex.
			
		I'd vote for trying to convince someone to write up ManaCombination instead of some huge script that is extremely complex.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Return to Ravnica Spoiler Season
 by ArsenalNut » 15 Sep 2012, 12:51
by ArsenalNut » 15 Sep 2012, 12:51 
I'll take a look at adding a mana combination feature to the existing mana ability AF. This should be similar to the "Any" mana feature.friarsol wrote:Re: Axebane
I'd vote for trying to convince someone to write up ManaCombination instead of some huge script that is extremely complex.
So many cards, so little time
		- 
				 
 ArsenalNut
- Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Return to Ravnica Spoiler Season
 by friarsol » 15 Sep 2012, 13:37
by friarsol » 15 Sep 2012, 13:37 
Thanks Arsenal.
I was picturing it as it's own AF, since some combinations (Like Orcish Lumberjack) don't choose from All colors. But you could probably roll it into Mana with some specific choices.
Combination$ R,G | Amount$ 3
Combination$ Any | Amount$ X
			
		I was picturing it as it's own AF, since some combinations (Like Orcish Lumberjack) don't choose from All colors. But you could probably roll it into Mana with some specific choices.
Combination$ R,G | Amount$ 3
Combination$ Any | Amount$ X
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Return to Ravnica Spoiler Season
 by Sloth » 15 Sep 2012, 15:40
by Sloth » 15 Sep 2012, 15:40 
Fixed! Thanks marc. (but Isperia doesn't need this parameter)moomarc wrote:Hey Sloth, quick question... When I was scripting Isperia I obviously just checked out other 'Whenever X attacks you or a planeswalker you control' and all except the first search result had the same trigger (can't remember which card it was offhand but it started with Blood). Anyway, it was the newest card so thought I'd add the extra Attack$Player param. When I tested it though it causes a crash when my planeswalker was attacked (again, can't remember the details but I think it was trying cast Card to Player). I tried to track it down and it seems like it was just trying to add details to the combat map. So is it a param that needs to be fixed and added to the other similar triggers?
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Return to Ravnica Spoiler Season
 by ArsenalNut » 15 Sep 2012, 19:54
by ArsenalNut » 15 Sep 2012, 19:54 
I am going to work on a new Combo[WUBRG] keyword in the existing mana AF. In the mean time, I think you could script Axebane Guardian as a mana ability with a repeat AF subability. You'd have to work out the logic to handle the X = 0 case but I think that would resolve the other issues you're having.moomarc wrote:I've got Axebane Guardian scripted using a tweaked Repeat AF. Basically the repeat happens X times (where X is the number of creatures with Defender) and each time adds 1 mana of any color. That part is working properly, but at the moment it doesn't act like a proper mana ability. I could get it to skip the stack with a Static$True parameter, but it still couldn't be used to pay for abilities and wouldn't interact properly with cards like Pithing Needle.
So do we have a way to flag an ability as a mana ability?
Out of interest, here's the tweaked Repeat resolve code (I had to make the fixed number of repeats part of the resolve instead of as a repeat condition so that it can repeat 0 times):Edit: Okay, for Pithing Needle and friends I could just set a parameter that applyCantBeActivated can check for. But I'd still like to be able to use the mana to pay for costs directly without having to add to the mana pool first. Would that be possible or would it cause a problem if the card is trying to add more mana than is needed for a cost?
- Code: Select all
if (params.containsKey("RepeatNumber")) { //fixed number of repeats - usually an svar
final int repeats = AbilityFactory.calculateAmount(sa.getSourceCard(), params.get("RepeatNumber"), sa);
for (int repeatCount = 0; repeatCount < repeats; repeatCount++) {
AbilityFactory.resolve(repeat, false);
}
} else { //repeat until condition met
//execute repeat ability at least once
do {
AbilityFactory.resolve(repeat, false);
} while (checkRepeatConditions(af, sa));
}
Edit 2: So the IsManaAbility param works fine for Pithing Needle, but the Static$True param doesn't (obviously, seeing as its not a trigger). So trying to track down all the places that might need the param check now and try work out how to make it act as a mana ability should. Search for 'instanceof AbilityMana' seems like a good place to start...
So many cards, so little time
		- 
				 
 ArsenalNut
- Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Return to Ravnica Spoiler Season
 by moomarc » 18 Sep 2012, 15:06
by moomarc » 18 Sep 2012, 15:06 
Do we have any way to find the triggering card of a triggered ability from Card.java? I'm trying to script Search the city but I need to create a restriction something along the lines of "Card.sharesNameWith TriggeredCard".
Would I have to create a separate param similar to TargetsWithoutSameCreatureType etc, then filter the target choices in TargetSelection?
			Would I have to create a separate param similar to TargetsWithoutSameCreatureType etc, then filter the target choices in TargetSelection?
-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: Return to Ravnica Spoiler Season
 by Sloth » 18 Sep 2012, 18:01
by Sloth » 18 Sep 2012, 18:01 
I think Martyr's Bond uses what you are looking for: "SacValid$ TriggeredCard.sharesCardTypeWith". The source will be replaced by the triggered card. So it will look like this: "TriggeredCard.sharesNameWith".moomarc wrote:Do we have any way to find the triggering card of a triggered ability from Card.java? I'm trying to script Search the city but I need to create a restriction something along the lines of "Card.sharesNameWith TriggeredCard".
Would I have to create a separate param similar to TargetsWithoutSameCreatureType etc, then filter the target choices in TargetSelection?
- 
				 
 Sloth
- Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Return to Ravnica Spoiler Season
 by moomarc » 18 Sep 2012, 20:59
by moomarc » 18 Sep 2012, 20:59 
Thanks Sloth, I'll try that out in the morning (and if that doesn't work I got the filtering the choices in TargetSelection working). So either way I just have to get the second half of the card working tomorrow (work permitting).Sloth wrote:I think Martyr's Bond uses what you are looking for: "SacValid$ TriggeredCard.sharesCardTypeWith". The source will be replaced by the triggered card. So it will look like this: "TriggeredCard.sharesNameWith".moomarc wrote:Do we have any way to find the triggering card of a triggered ability from Card.java? I'm trying to script Search the city but I need to create a restriction something along the lines of "Card.sharesNameWith TriggeredCard".
Would I have to create a separate param similar to TargetsWithoutSameCreatureType etc, then filter the target choices in TargetSelection?
-Marc
		- 
				 
 moomarc
- Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Who is online
Users browsing this forum: No registered users and 26 guests
