It is currently 19 Apr 2024, 21:45
   
Text Size

Card Contributions

Post MTG Forge Related Programming Questions Here

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

Re: Card Contributions

Postby jeffwadsworth » 31 Jan 2011, 16:36

@phoenix, I believe Parallax Nexus has a problem due to it not specifically targeting the remembered card. It bombs on me.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Contributions

Postby friarsol » 31 Jan 2011, 16:59

jeffwadsworth wrote:@phoenix, I believe Parallax Nexus has a problem due to it not specifically targeting the remembered card. It bombs on me.
That's a good point. Since Remember currently only works with what is Targeted the Nexus will need some additional code to work properly. It would be good if Remember was more flexible to handle things like this. It would also be a good way to reference cards within SubAbilities that aren't targeted.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby lazylockie » 31 Jan 2011, 21:38

Name:Contagion Engine
ManaCost:6
Types:Artifact
Text:no text
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPutCounterAll | TriggerDescription$ When CARDNAME enters the battlefield, put a -1/-1 counter on each creature target player controls.
A:AB$ Proliferate | Cost$ 4 T | SubAbility$ SVar=DBProliferate | SpellDescription$ Proliferate, then proliferate again.
SVar:DBProliferate:DB$Proliferate | Cost$ 0
SVar:TrigPutCounterAll:AB$PutCounterAll | Cost$ 0 | ValidCards$ Creature.YouDontCtrl | CounterType$ M1M1 | CounterNum$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/contagion_engine.jpg
SVar:Rarity:Rare
SetInfo:SOM|Rare|http://magiccards.info/scans/en/som/145.jpg
End
Thanks Chris H. for PutCounterAll ability! Now, just gotta be careful to not miss a proliferate when using this activating the ability, because they happen sequentially and the text for both are the same.


also,

Name:Pyrokinesis
ManaCost:4 R R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 4 R R | ValidTgts$ Creature | TgtPrompt$ Select target creature (1) | NumDmg$ 1 | SubAbility$ SVar=DBDamage2 | SpellDescription$ 4 R R - CARDNAME deals 4 damage divided as you choose among any number of target creatures.
SVar:DBDamage2:DB$DealDamage | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature (2) | NumDmg$ 1 | SubAbility$ SVar=DBDamage3
SVar:DBDamage3:DB$DealDamage | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature (3) | NumDmg$ 1 | SubAbility$ SVar=DBDamage4
SVar:DBDamage4:DB$DealDamage | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature (4) | NumDmg$ 1
SVar:AltCost:ExileFromHand<1/Card.Red>$You may exile a red card from your hand rather than pay CARDNAME 's mana cost.
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/pyrokinesis.jpg
SVar:Rarity:Uncommon
SetInfo:ALL|Uncommon|http://magiccards.info/scans/en/ai/115.jpg
End
and Contagion with triggers. I can't test this one because the current solution is hardcoded and is overlapping the txt code

Name:Contagion
ManaCost:3 B B
Types:Instant
Text:no text
A:SP$PutCounter | Cost$ 3 B B | ValidTgts$ Creature | TgtPrompt$ Select target creature (1) | CounterType$ M2M1 | CounterNum$ 1 | SubAbility$ SVar=DBPutCounter | SpellDescription$ Distribute two -2/-1 counters among one or two target creatures.
SVar:DBPutCounter:DB$PutCounter | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature (2) | CounterType$ M2M1 | CounterNum$ 1
SVar:AltCost:PayLife<1> ExileFromHand<1/Card.Black>$You may pay 1 life and exile a black card from your hand rather than pay Contagion's mana cost.
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/contagion.jpg
SVar:Rarity:Uncommon
SetInfo:ALL|Uncommon|http://magiccards.info/scans/en/ai/4.jpg
End
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Card Contributions

Postby Zirbert » 31 Jan 2011, 23:14

Here's Death Pit Offering. It's a pain to do the one-by-one sacrificing, but it's functionally correct. If SacrificeAll or somesuch is a valid parameter, then by all means anyone who knows what they're doing should feel free to tune this one up:

Code: Select all
Name:Death Pit Offering
ManaCost:2 B B
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSacAll | TriggerDescription$ When CARDNAME enters the battlefield, sacrifice all creatures you control.
SVar:TrigSacAll:DB$Sacrifice | Amount$ X | SacValid$ Creature
SVar:X:Count$NumTypeYouCtrl.Creature
K:stPumpAll:Creature.YouCtrl:2/2:No Condition:Creatures you control get +2/+2.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/death_pit_offering.jpg
SetInfo:NMS|Rare|http://magiccards.info/scans/en/ne/56.jpg
SetInfo:8ED|Uncommon|http://magiccards.info/scans/en/8e/124.jpg
End
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Contributions

Postby jeffwadsworth » 01 Feb 2011, 02:13

@lazylockie: The issue I have with your Contagion Engine script is that it ignores the targeting of a player. It automatically puts the counters on creatures you don't control. Perhaps others can shed light on whether or not this is acceptable. Your Contagion card works perfectly.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Contributions

Postby lazylockie » 01 Feb 2011, 03:04

jeffwadsworth wrote:@lazylockie: The issue I have with your Contagion Engine script is that it ignores the targeting of a player. It automatically puts the counters on creatures you don't control. Perhaps others can shed light on whether or not this is acceptable. Your Contagion card works perfectly.
I've noticed that. At first I was going to make the card for myself, but since this script 99% functional, then I thought I'd share with you guys. I don't think this part is codeable though - see Dawnglare Invoker, it's hardcoded.
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Card Contributions

Postby friarsol » 01 Feb 2011, 03:32

lazylockie wrote:I've noticed that. At first I was going to make the card for myself, but since this script 99% functional, then I thought I'd share with you guys. I don't think this part is codeable though - see Dawnglare Invoker, it's hardcoded.
Many cards were hardcoded in the past. There has been a strong push in only the last 3-4 months or so to get everything moved over to Consistent Scripting, because it makes debugging easier and then people without coding experience can help write up cards (as you guys are doing a great job doing)

A common aspect of the AFs is to handle simpler cases first. These are the cases where everything is predefined what is happend. Destroy all creatures you don't control. Tap all lands. Etc.

Targeting still needs to be implemented in many of these areas. The AFs continue to grow organically and will only grow when the developers are putting forth the time to get them working. Right now there's a big push to get Triggers functional and useful, because properly working Triggers add more cards than adding targeting to a single AF does. I am doing some work right now in the AFs but it's related to A) Triggers and B) Getting the AI to use abilities outside it's main phase.

Feel free to add Issues in the code.google space to mention things like UntapAll needs to be able to Target players. At the very least they won't get lost in the forums when the devs who are familiar with that stuff get some free time.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby jeffwadsworth » 01 Feb 2011, 05:32

Speaking of cards that are not quite right, but "semi-functional"...here is a Phyrexian Rebirth.
Code: Select all
Name:Phyrexian Rebirth
ManaCost:4 W W
Types:Sorcery
Text:no text
A:SP$Token | Cost$ 4 W W | TokenAmount$ 1 | TokenName$ Horror | TokenTypes$ Creature,Horror,Artifact | TokenOwner$ Controller | TokenColors$ Colorless | TokenPower$ X | TokenToughness$ X | SubAbility$ SVar=DBDestroyAll | SpellDescription$ Put an X/X colorless Horror artifact creature token onto the battlefield, where X is the number of creatures destroyed this way.
SVar:DBDestroyAll:DB$DestroyAll | Cost$ 0 | ValidCards$ Creature.nonToken+nonHorror | SpellDescription$ Destroy all creatures in play.
SVar:X:Count$Valid Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_rebirth.jpg
End
Just for fun, of course.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Contributions

Postby Sloth » 01 Feb 2011, 06:24

jeffwadsworth wrote:Speaking of cards that are not quite right, but "semi-functional"...here is a Phyrexian Rebirth.
Code: Select all
Name:Phyrexian Rebirth
ManaCost:4 W W
Types:Sorcery
Text:no text
A:SP$Token | Cost$ 4 W W | TokenAmount$ 1 | TokenName$ Horror | TokenTypes$ Creature,Horror,Artifact | TokenOwner$ Controller | TokenColors$ Colorless | TokenPower$ X | TokenToughness$ X | SubAbility$ SVar=DBDestroyAll | SpellDescription$ Put an X/X colorless Horror artifact creature token onto the battlefield, where X is the number of creatures destroyed this way.
SVar:DBDestroyAll:DB$DestroyAll | Cost$ 0 | ValidCards$ Creature.nonToken+nonHorror | SpellDescription$ Destroy all creatures in play.
SVar:X:Count$Valid Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_rebirth.jpg
End
Just for fun, of course.
This card won't interact correctly with indestructible, Horror, Token and regenerating creatures. It can be hardcoded though (sililar to March of Souls).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Contributions

Postby Zirbert » 01 Feb 2011, 21:26

Bet you didn't see this one coming - no one ever expects the Giant Shark!

Code: Select all
Name:Giant Shark
ManaCost:5 U
Types:Creature Fish
Text:no text
PT:4/4
T:Mode$ Blocks | ValidCard$ Creature.wasDealtDamageThisTurn | ValidAttacker$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigBlockedPump | TriggerDescription$ Whenever CARDNAME becomes blocked by a creature that has been dealt damage this turn, CARDNAME gets +2/+0 and gains trample until end of turn.
SVar:TrigBlockedPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 0 | KW$ Trample
T:Mode$ Blocks | ValidCard$ Card.Self | ValidBlocked$ Creature.wasDealtDamageThisTurn | TriggerZones$ Battlefield | Execute$ TrigBlockingPump | TriggerDescription$ Whenever CARDNAME blocks a creature that has been dealt damage this turn, CARDNAME gets +2/+0 and gains trample until end of turn.
SVar:TrigBlockingPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 0 | KW$ Trample
K:CARDNAME can't attack unless defending player controls an Island.
K:When you control no Islands, sacrifice CARDNAME.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/giant_shark.jpg
SetInfo:DRK|Common|http://magiccards.info/scans/en/dk/28.jpg
End
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Contributions

Postby jeffwadsworth » 01 Feb 2011, 22:15

@Zirbert: I am having a difficult time mustering the will to even test this horribly over-priced and practically useless card. I will give it a go for the sake of set completion. <-- j/k
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Contributions

Postby Zirbert » 01 Feb 2011, 22:19

jeffwadsworth wrote:@Zirbert: I am having a difficult time mustering the will to even test this horribly over-priced and practically useless card. I will give it a go for the sake of set completion. <-- j/k
If you want to spare yourself the pain, I've tested it pretty thoroughly. I even built a testing deck with 15 copies of it. No one should have to go through that again.

-Zirbert
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Contributions

Postby jeffwadsworth » 01 Feb 2011, 22:28

@Zilbert, okay I see an issue right of the bat. There is no current way to know if the Giant Shark was blocked by a specific card that took damage. There could have been 10 cards attacking and blocking and each would trigger the bonus.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Contributions

Postby Zirbert » 01 Feb 2011, 23:03

jeffwadsworth wrote:@Zilbert, okay I see an issue right of the bat. There is no current way to know if the Giant Shark was blocked by a specific card that took damage. There could have been 10 cards attacking and blocking and each would trigger the bonus.
I thought the syntax of the Blocks trigger, using "ValidCard$ Card.Self" / "ValidAttacker$ Card.Self" would restrict the trigger to the correct situations. I could have missed the scenario you outlined, though, because I was using Pyrohemia to make sure there was blood in the water. All the AI's creatures took damage, not just the specific attacker / blocker. I'll kick the tires on this one some more and see what happens.

Be back shortly...

-Zirbert
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Contributions

Postby lazylockie » 01 Feb 2011, 23:15

Name:Necrotic Sliver
ManaCost:1 W B
Types:Creature Sliver
Text:no text
PT:2/2
K:stPumpAll:Sliver:0/0/SVar=Destroy:no Condition:All Slivers have "3, Sacrifice this permanent: Destroy target permanent."
SVar:Destroy:AB$Destroy | Cost$ 3 Sac<1/CARDNAME> | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | SpellDescription$ Destroy target permanent.
SVar:PlayMain1:TRUE
SVar:BuffedBy:Sliver
SVar:Picture:http://www.wizards.com/global/images/magic/general/necrotic_sliver.jpg
SVar:Rarity:Uncommon
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/159.jpg
End
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 120 guests


Who is online

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

Login Form