abDamageTgt
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
9 posts
• Page 1 of 1
abDamageTgt
by Rob Cashwalker » 12 Feb 2010, 03:17
Usual revision process to support Count and Drawback.
Like spDamageTgt, it supports targeting creatures only (C), players only (P) and creatures or players. (CP)
New Drawback actions:
DamageSelf - deals damage to the source card
LoseLifeTgtCtrlr - Controller of target card loses life
Modified the addDamage method in GameAction to take LifeLink and other card interactions into account. Added a different addDamage method for targeting a player.
I discovered that I only need to define two different abilities for the three combinations of cost. Mana and Tap uses the same ability as Tap-Only. Before assigning it to the card object, the Ability_Tap object is assigned a mana cost (setManaCost).
This "discovery" means I can chop out an unnecessary chunk of code in abPump.
To update cards.txt, just do search and replace for abDamageCP -> abDamageTgtCP (no prior keyword for creature only or player only)
A few new cards:
Like spDamageTgt, it supports targeting creatures only (C), players only (P) and creatures or players. (CP)
New Drawback actions:
DamageSelf - deals damage to the source card
LoseLifeTgtCtrlr - Controller of target card loses life
Modified the addDamage method in GameAction to take LifeLink and other card interactions into account. Added a different addDamage method for targeting a player.
I discovered that I only need to define two different abilities for the three combinations of cost. Mana and Tap uses the same ability as Tap-Only. Before assigning it to the card object, the Ability_Tap object is assigned a mana cost (setManaCost).
This "discovery" means I can chop out an unnecessary chunk of code in abPump.
To update cards.txt, just do search and replace for abDamageCP -> abDamageTgtCP (no prior keyword for creature only or player only)
A few new cards:
- Code: Select all
Abyssal Hunter
3 B
Creature Human Assassin
no text
1/1
abDamageTgtC B T:X:Drawback$TapTgt:Tap target creature. Abyssal Hunter deals damage equal to Abyssal Hunter's power to that creature.:Abyssal Hunter - tap creature and deal damage to it.
SVar:X:Count$CardPower
Brothers of Fire
1 R R
Creature Human Shaman
no text
2/2
abDamageTgtCP 1 R R:1:Drawback$DamageYou/1:Brothers of Fire deals 1 damage to target creature or player and 1 damage to you.:Brothers of Fire - deal damage to creature or player and you.
Fireslinger
1 R
Creature Human Wizard
no text
1/1
abDamageTgtCP T:1:Drawback$DamageYou/1:Fireslinger deals 1 damage to target creature or player and 1 damage to you.:Fireslinger - deal damage to creature or player and you.
Flamewave Invoker
2 R
Creature Goblin Mutant
no text
2/2
abDamageTgtP 7 R:5
Granger Guildmage
G
Creature Human Wizard
no text
1/1
abPumpTgt W T:First Strike
abDamageTgtCP R T:1:Drawback$DamageYou/1:Granger Guildmage deals 1 damage to target creature or player and 1 damage to you.:Granger Guildmage - damage creature or player and you.
Granite Shard
3
Artifact
no text
abDamageTgtCP 3 T:1
abDamageTgtCP R T:1
Psionic Entity
4 U
Creature Illusion
no text
2/2
abDamageTgtCP T:2:Drawback$DamageSelf/3:Psionic Entity deals 2 damage to target creature or player and 3 damage to itself.:Psionic Entity - deal damage to creature or player and itself.
Rakdos Ickspitter
1 B R
Creature Thrull
no text
1/1
abDamageTgtC T:1:Drawback$LoseLifeTgtCtrlr/1:Rakdos Ickspitter deals 1 damage to target creature and that creature's controller loses 1 life.:Rakdos Ickspitter - deal damage to creature and its controller loses life.
Reckless Embermage
3 R
Creature Human Wizard
no text
2/2
abDamageTgtCP 1 R:1:Drawback$DamageSelf/1:Reckless Embermage deals 1 damage to target creature or player and 1 damage to itself.:Reckless Embermage - deal damage to creature or player and itself.
Spikeshot Goblin
2 R
Creature Goblin Shaman
no text
1/2
abDamageTgtCP R T:X:Spikeshot Goblin deals damage equal to its power to target creature or player.:Spikeshot Goblin - deal X damage to creature or player.
Storm Spirit
3 W U G
Creature Elemental Spirit
no text
3/3
abDamageTgtC T:2
Stun Sniper
W R
Creature Human Archer
no text
1/1
abDamageTgtC 1 T:1:Drawback$TapTgt
Sunflare Shaman
1 R
Creature Elemental Shaman
no text
2/1
abDamageTgtCP 1 R T:X:Drawback$DamageSelf/X:Sunflare Shaman deals X damage to target creature or player and X damage to itself, where X is the number of Elemental cards in your graveyard.:Sunflare Shaman - deals X damage to creature or player and X damage to itself.
SVar:X:Count$TypeInYourYard.Elemental
Telim 'Tor's Darts
2
Artifact
no text
abDamageTgtP 2 T:1
Thornscape Master
2 G G
Creature Human Wizard
no text
2/2
abDamageTgtC R R T:2
abPumpTgt W W T:Protection from white
abPumpTgt W W T:Protection from blue
abPumpTgt W W T:Protection from black
abPumpTgt W W T:Protection from red
abPumpTgt W W T:Protection from green
- Code: Select all
Goblin Artillery
1 R R
Creature Goblin Warrior
no text
1/3
abDamageTgtCP T:2:Drawback$DamageYou/3:Goblin Artillery deals 2 damage to target creature or player and 3 damage to you.:Goblin Artillery - deal damage to creature or player and you.
Orcish Artillery
1 R R
Creature Orc Warrior
no text
1/3
abDamageTgtCP T:2:Drawback$DamageYou/3:Orcish Artillery deals 2 damage to target creature or player and 3 damage to you.:Orcish Artillery - deal damage to creature or player and you.
Orcish Cannoneers
1 R R
Creature Orc Warrior
no text
1/3
abDamageTgtCP T:2:Drawback$DamageYou/3:Orcish Cannoneers deals 2 damage to target creature or player and 3 damage to you.:Orcish Cannoneers - deal damage to creature or player and you.
Sparksmith
1 R
Creature Goblin
no text
1/1
abDamageTgtC T:X:Drawback$DamageYou/X:Sparksmith deals X damage to target creature and X damage to you, where X is the number of Goblins on the battlefield.:Sparksmith - deal X damage to creature and X damage to you.
SVar:X:Count$TypeOnBattlefield.Goblin
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abDamageTgt
by DennisBergkamp » 12 Feb 2010, 06:23
This is looking good, and the extra cards is a sweet bonus.
Commit it to SVN anytime
Commit it to SVN anytime

-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: abDamageTgt
by Chris H. » 12 Feb 2010, 12:09
Thank you, Rob. That is an impressive list of new cards. 

-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abDamageTgt
by Rob Cashwalker » 12 Feb 2010, 12:36
Actually, I committed it yesterday afternoon. I had a 6 hour interruption while writing the post....
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abDamageTgt
by mtgrares » 12 Feb 2010, 19:08
That is a pretty complicated keyword. Great work. I need to write an article about how to make your own custom cards using scripting.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: abDamageTgt
by Rob Cashwalker » 13 Feb 2010, 02:31
It's not complicated, it's sophisticated.
Someone over on the Magic Set Editor forum posted a question about exporting from MSE to Forge. No one over there knew about the scripting, the assumption was that all cards need java. I responded with a post detailing the two different methods of adding cards, by keywords, and by code.
To be honest, I don't think custom cards would be too good in Forge. While it looks like we support a ton of things by keyword scripts, it's SO limited, that it would limit the creative process of the custom card developer. Also, most custom cards I see also involve custom mechanics, that we're not likely to have keywords for. On top of that, what little the AI knows of real card mechanics may not interact correctly with any custom mechanics someone may try to implement.
Which really brings me to the point that if someone were really itching to play an entire custom set, they'd be better off making a branch from the Forge source, with support for their custom cards.
Someone over on the Magic Set Editor forum posted a question about exporting from MSE to Forge. No one over there knew about the scripting, the assumption was that all cards need java. I responded with a post detailing the two different methods of adding cards, by keywords, and by code.
To be honest, I don't think custom cards would be too good in Forge. While it looks like we support a ton of things by keyword scripts, it's SO limited, that it would limit the creative process of the custom card developer. Also, most custom cards I see also involve custom mechanics, that we're not likely to have keywords for. On top of that, what little the AI knows of real card mechanics may not interact correctly with any custom mechanics someone may try to implement.
Which really brings me to the point that if someone were really itching to play an entire custom set, they'd be better off making a branch from the Forge source, with support for their custom cards.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abDamageTgt
by Chris H. » 15 Feb 2010, 02:43
Several of the new abDamageTgt cards are not displaying the mana/tap cost with it's ability description. And yet other new abDamageTgt cards display the mana/tap cost. Puzzling. This is with r381.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: abDamageTgt
by Rob Cashwalker » 15 Feb 2010, 03:53
which ones specifically?
edit - nevermind, I see what's going on. The cost wasn't added to the description when using the description parameters. Only with basic abilities which build the string by code.
As with the missing braces in the keyword pump, I'd fix it, but it will have to wait until I finish the abDrawCards...
I wish you could mark sections of code to be committed or not.
edit - nevermind, I see what's going on. The cost wasn't added to the description when using the description parameters. Only with basic abilities which build the string by code.
As with the missing braces in the keyword pump, I'd fix it, but it will have to wait until I finish the abDrawCards...
I wish you could mark sections of code to be committed or not.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: abDamageTgt
by Rob Cashwalker » 20 Feb 2010, 04:17
Fixed this in today's commit of CardFactory.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 42 guests