It is currently 22 May 2025, 20:12
   
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 » 09 Jan 2013, 16:00

Puf: I can imagine this being a problem with how the etbCounter keyword was recently changed to being a replacement effect and therefore not being run before the start of the game when pets are put on the battlefield. Not sure ehat exavtly to do about it but there you go.
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 friarsol » 09 Jan 2013, 16:18

puf, you should probably post your script if you are having problems with it. But as Hellfish said, replacement effects probably aren't run at the time when the pet is being put into play.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby pufthemajicdragon » 10 Jan 2013, 21:59

Here's the script, just because. But what I think I'll do is download the source and see if I can fix it myself, probably by adding pets to the battlefield later.
Code: Select all
Name:Elrond of Rivendel
ManaCost:no cost
Types:Planeswalker Elrond
Text:Level 1 Elrond
Loyalty:1
S:Mode$ Continuous | Affected$ Creature.Elf+YouCtrl | AddPower$ X | AddToughness$ X | Description$ Elf creatures you control get +1/+1 for each loyalty counter on CARDNAME.
SVar:X:Count$CardCounters.LOYALTY
A:AB$ GainLife | Cost$ AddCounter<1/LOYALTY> | LifeAmount$ XLife | Planeswalker$ True | References$ XLife | SpellDescription$ You gain 1 life for each Elf you control.
SVar:XLife:Count$TypeYouCtrl.Elf
SVar:Rarity:Mythic
Oracle:Elf creatures you control get +1/+1 for each loyalty counter on CARDNAME.\n[+1] You gain 1 life for each Elf you control.
End
pufthemajicdragon
 
Posts: 23
Joined: 08 Jan 2013, 04:17
Has thanked: 7 times
Been thanked: 2 times

Re: Card Development Questions

Postby moomarc » 05 Feb 2013, 13:29

I was looking at adding Cunning Giant, but before I commit anything, can anyone clarify whether its ability is a triggered or a replacement ability (or a triggered ability that generates a static replacement effect until end of combat). There's nothing on gatherer, and the closest I found was this conversation that doesn't come up with anything conclusive.

EDIT: I've decided to go ahead and add it. If I need to convert it to a trigger I'll do so once someone clarifies the situation. To me it seems as though the intention is an optional replacement effect, so I've scripted it that way. The AI always chooses to use the replacement so I added the RemAIDeck flag to the script. If anyone feels that it should always use the replacement, let me know and I'll remove it.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby Hellfish » 05 Feb 2013, 15:08

Looks like a damage assignment special case, like super-trample, to mw since it has the wording of neither triggers(when,whenever...) nor replacements(would,instead...)
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 moomarc » 05 Feb 2013, 15:15

Hellfish wrote:Looks like a damage assignment special case, like super-trample, to mw since it has the wording of neither triggers(when,whenever...) nor replacements(would,instead...)
The original wording did say 'instead' so my assumption is that the intent is that it replace the damage at least - definitely a either/or case.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 05 Feb 2013, 15:18

moomarc wrote:I was looking at adding Cunning Giant, but before I commit anything, can anyone clarify whether its ability is a triggered or a replacement ability (or a triggered ability that generates a static replacement effect until end of combat). There's nothing on gatherer, and the closest I found was this conversation that doesn't come up with anything conclusive.

EDIT: I've decided to go ahead and add it. If I need to convert it to a trigger I'll do so once someone clarifies the situation. To me it seems as though the intention is an optional replacement effect, so I've scripted it that way. The AI always chooses to use the replacement so I added the RemAIDeck flag to the script. If anyone feels that it should always use the replacement, let me know and I'll remove it.
It's definitely not a trigger. It's an assignment replacement effect with the condition of being unblocked. It's very similar to the replacement effect that's created by Soltari Guerillas, except the replacement can happen if Cunning Giant is unblocked instead of about to damage an Opponent.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 05 Feb 2013, 15:26

friarsol wrote:It's definitely not a trigger. It's an assignment replacement effect with the condition of being unblocked. It's very similar to the replacement effect that's created by Soltari Guerillas, except the replacement can happen if Cunning Giant is unblocked instead of about to damage an Opponent.
So is my current script correct then?
Code: Select all
R:Event$ DamageDone | ValidTarget$ Player.attackedBySourceThisCombat | ValidSource$ Card.Self+unblocked | IsCombat$ True | ReplaceWith$ ChooseVictim | Optional$ True | OptionalDecider$ You | Description$ If CARDNAME is unblocked, you may have it assign its combat damage to a creature defending player controls.
SVar:ChooseVictim:DB$ ChooseCard | ChoiceZone$ Battlefield | Choices$ Creature.DefenderCtrl | Amount$ 1 | ChoiceTitle$ Choose a card to deal the damage to | SubAbility$ CunningDmg
SVar:CunningDmg:DB$ DealDamage | Defined$ ChosenCard | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ CunningX
SVar:CunningX:ReplaceCount$DamageAmount
Or should it be activated just before combat damage (so can be countered) and creates an effect that has the replacement on it?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 05 Feb 2013, 17:45

moomarc wrote:So is my current script correct then?
Code: Select all
R:Event$ DamageDone | ValidTarget$ Player.attackedBySourceThisCombat | ValidSource$ Card.Self+unblocked | IsCombat$ True | ReplaceWith$ ChooseVictim | Optional$ True | OptionalDecider$ You | Description$ If CARDNAME is unblocked, you may have it assign its combat damage to a creature defending player controls.
SVar:ChooseVictim:DB$ ChooseCard | ChoiceZone$ Battlefield | Choices$ Creature.DefenderCtrl | Amount$ 1 | ChoiceTitle$ Choose a card to deal the damage to | SubAbility$ CunningDmg
SVar:CunningDmg:DB$ DealDamage | Defined$ ChosenCard | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ CunningX
SVar:CunningX:ReplaceCount$DamageAmount
Or should it be activated just before combat damage (so can be countered) and creates an effect that has the replacement on it?
It's not something that can be activated/is counterable. During damage resolution, you can assign damage instead to a creature. It's like a reverse Lone Wolf. Without actually testing it, the only way your script is incorrect is if the Giant is attacking a Planeswalker.

"508.5. If an ability of an attacking creature refers to a defending player, or a spell or ability refers to both an attacking creature and a defending player, then unless otherwise specified, the defending player it's referring to is the player that creature was attacking at the time it became an attacking creature that combat, or the controller of the planeswalker that creature was attacking at the time it became an attacking creature that combat."
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 05 Feb 2013, 18:45

In that case I should just need to add a check whether the player returned in attackedBySourceThisCombat is a planeswalker, and if so use its controller for the valid check. I checked the behaviour against multiple opponents in a multiplayer game and all seems to work there. Anything else I should check when I get to test it in the morning?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 05 Feb 2013, 19:17

moomarc wrote:In that case I should just need to add a check whether the player returned in attackedBySourceThisCombat is a planeswalker
Well, there won't be any Players that are Planeswalkers right? It probably just needs a secondary replacement effect that says Planeswalker.attackedBySourceThisCombat.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 05 Feb 2013, 19:43

friarsol wrote:
moomarc wrote:In that case I should just need to add a check whether the player returned in attackedBySourceThisCombat is a planeswalker
Well, there won't be any Players that are Planeswalkers right? It probably just needs a secondary replacement effect that says Planeswalker.attackedBySourceThisCombat.
As far as I remember from when I set up that restriction earlier, attackedBySourceThisCombat uses ...getCombat().getDefenderPlayerByAttacker(source)which checks the attacked game Entity and returns the appropriate type. I'll have a look again in the morning when I don't have to try browse the code on my Blackberry, but remember it checking Planeswalkers in some way.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 05 Feb 2013, 19:46

moomarc wrote:As far as I remember from when I set up that restriction earlier, attackedBySourceThisCombat uses ...getCombat().getDefenderPlayerByAttacker(source)which checks the attacked game Entity and returns the appropriate type. I'll have a look again in the morning when I don't have to try browse the code on my Blackberry, but remember it checking Planeswalkers in some way.
Ahhh, well if that's the case you should be ok. You'll find out soon enough as soon as you try attacking a planeswalker if you can redirect the damage.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 06 Feb 2013, 07:01

friarsol wrote:
moomarc wrote:As far as I remember from when I set up that restriction earlier, attackedBySourceThisCombat uses ...getCombat().getDefenderPlayerByAttacker(source)which checks the attacked game Entity and returns the appropriate type. I'll have a look again in the morning when I don't have to try browse the code on my Blackberry, but remember it checking Planeswalkers in some way.
Ahhh, well if that's the case you should be ok. You'll find out soon enough as soon as you try attacking a planeswalker if you can redirect the damage.
Tested it this morning and ended up having to add a second replacement to handle planeswalkers. Still not entirely sure why, seeing as getDefenderPlayerByAttacker should return the controller of a card if it is the attacked entity. Oh well, was a simple fix anyway.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby moomarc » 06 Feb 2013, 10:48

What needs to happen to make keywords in CardFactoryUtil.parseKeywords pumpable? I'm specifically looking at Unearth (for Sedris, the Traitor King) and Devour (for the Jund plane).
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

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

Login Form