TgtP
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
24 posts
• Page 1 of 2 • 1, 2
TgtP
by slapshot5 » 16 Nov 2010, 06:48
Please forgive me if this is a dumb question, but when I use Target, and specify TgtP, why am I prompted for a "planeswalker or player"? I would expect this to only target a player.
Target.java:
Target.java:
- Code: Select all
else if (parse.equals("P")){
valid = "Planeswalker,Player";
prompt = "Select target planeswalker or player";
}
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: TgtP
by Hellfish » 16 Nov 2010, 12:26
Isn't this to effectively implement the rule of "306.7. If noncombat damage would be dealt to a player by a source controlled by an opponent, that opponent may have that source deal that damage to a planeswalker the first player controls instead.". Ergo, if you can target a player, you can target a planeswalker.
Where's a lawyer when you need one?
Where's a lawyer when you need one?

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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: TgtP
by Rob Cashwalker » 16 Nov 2010, 14:34
What if I want to Shock my own walker? Rules-wise, can I do that?
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: TgtP
by Hellfish » 16 Nov 2010, 14:46
I'm really the wrong person to ask, I just happened to have MagicCompRules.rtf handy
As far as I can tell, there is only provisions for when the opponent controls the damage source. So I guess you can't actually shock your own planeswalker?
Full rule:

As far as I can tell, there is only provisions for when the opponent controls the damage source. So I guess you can't actually shock your own planeswalker?

Full rule:
- Code: Select all
306.7. If noncombat damage would be dealt to a player by a source controlled by an opponent, that opponent may have that source deal that damage to a planeswalker the first player controls instead. This is a redirection effect (see rule 614.9) and is subject to the normal rules for ordering replacement effects (see rule 616). The opponent chooses whether to redirect the damage as the redirection effect is applied.
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: TgtP
by friarsol » 16 Nov 2010, 14:54
TgtP was written at a time when it was only used for Damage. At this point, we really shouldn't be using it at all since ValidTgt is much more robust.
However, this is more shortcutting done by the program. You don't target a Planeswalker with direct damage spells. You target the player, and then redirect to the Planeswalker. And you aren't allowed to redirect damage you are dealing to yourself, only opponents. I'll put this in as an issue, and change TgtP to send in Planeswalker.YouDontCtrl for the Shock issue.
If you want to target a player do it like this:
However, this is more shortcutting done by the program. You don't target a Planeswalker with direct damage spells. You target the player, and then redirect to the Planeswalker. And you aren't allowed to redirect damage you are dealing to yourself, only opponents. I'll put this in as an issue, and change TgtP to send in Planeswalker.YouDontCtrl for the Shock issue.
If you want to target a player do it like this:
- Code: Select all
ValidTgts$Player|TgtPrompt$Choose a player to XXXX
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: TgtP
by Snacko » 16 Nov 2010, 17:15
However if you have Empyrial Archangel and you apply Empyrial Archangel's effect, the damage is redirected to it. The planeswalker replacement effect is no longer applicable.
I think Forge wouldn't be able to reproduce it in the current state.
I think Forge wouldn't be able to reproduce it in the current state.
Re: TgtP
by friarsol » 16 Nov 2010, 21:41
Sure Empyrial Archangel creates a replacement effect, just like Planeswalkers do. But if the work was put in for Replacement effects on damage, it could easily be put on for things like Archangel, Pariah, Pariah's Shield. And then give the effected player a choice which replacement effect to take.
Probably the best way to break ground on this is to get the similar Prevention Effects working, and then branch off for Replacement Effects.
Probably the best way to break ground on this is to get the similar Prevention Effects working, and then branch off for Replacement Effects.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: TgtP
by Sloth » 17 Nov 2010, 11:40
The problem is that some cards really only want to target a player. At the moment you can Ancestral Recall a planeswalkerslapshot5 wrote:Please forgive me if this is a dumb question, but when I use Target, and specify TgtP, why am I prompted for a "planeswalker or player"? I would expect this to only target a player.
-slapshot5

I would suggest changing the current "TgtP" to "TgtPP" for damage spells to target a player or a planeswalker and using "TgtP" for only players.
Do you agree?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: TgtP
by friarsol » 17 Nov 2010, 15:40
Well, no. I think we shouldn't use them at all anymore. The only reason they were part of the Target object was for backwards compatibility. P and PP are not descriptive enough terms, neither is C for that matter. And I think it would be better if we stopped using them completely.Sloth wrote:The problem is that some cards really only want to target a player. At the moment you can Ancestral Recall a planeswalker.
I would suggest changing the current "TgtP" to "TgtPP" for damage spells to target a player or a planeswalker and using "TgtP" for only players.
Do you agree?
Sure we may not need the Robustness of ValidTgt for just targeting a player. But ValidTgt does work here without any additional coding. Especially if the coding is to just patch older code, that could be removed entirely once we stop using abilities dependent on them.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: TgtP
by slapshot5 » 17 Nov 2010, 17:14
I like the shorthand notation that TgtP gives.
I'd much rather type
I would, in fact expand it to:
Tgt$TgtP - target player
Tgt$TgtOpp - target opponent
Tgt$TgtC - target creature
Tgt$TgtPW - target planeswalker
Tgt$TgtA - target artifact
Tgt$TgtE - target enchantment
Tgt$TgtPerm - target Permanent
those are all so common, that it seems silly to require typing all the Valid stuff. My $0.02
-slapshot5
I'd much rather type
- Code: Select all
Tgt$TgtP
- Code: Select all
ValidTgts$Player|TgtPrompt$Select target player
I would, in fact expand it to:
Tgt$TgtP - target player
Tgt$TgtOpp - target opponent
Tgt$TgtC - target creature
Tgt$TgtPW - target planeswalker
Tgt$TgtA - target artifact
Tgt$TgtE - target enchantment
Tgt$TgtPerm - target Permanent
those are all so common, that it seems silly to require typing all the Valid stuff. My $0.02
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: TgtP
by friarsol » 17 Nov 2010, 18:51
I didn't think the shorthand was so popular. If you really want to expand it, we should make sure it gets done clearly.
Firstly, drop Tgt from the Value. It's not needed anymore, just leftover from older code bases. If it's there it will just be stripped away, but if the goal is shorthand, typing less is the idea right?
Next we should make sure to put commas in between the different targets. If you want to have all those different types, then they shouldn't be just smashed together.
Disenchant would be: Tgt$A,E
Fissure would be: Tgt$C,L (i'm assuming you plan to do this for Lands as well?)
I still have one major issue. No card specifically targets Planeswalkers right now. However the way we have Damage setup is that if you can target a Player you also can target a Planeswalker (recently fixed to only target a Planeswalker you don't control). How do we resolve that? If someone uses the PW shorthand do we tack on the .YouDontCtrl automatically? What if a card comes up that can target any Planeswalker? I want to those slippery slopes to have giant warning signs before they become issues down the road.
If we have an elegant solution for that, the process isn't too hard:
The changes would need to go in
public Target(String parse, int min, int max)
Split the parse String, and then build Valid and Prompt strings simultaneously for each parse value.
Minor note, Opponent will need some additional changes into Target_Selection. There are enough spells that Target Opponents, so it's fine to have. Just informing you so you'll know there's extra work for that.
Firstly, drop Tgt from the Value. It's not needed anymore, just leftover from older code bases. If it's there it will just be stripped away, but if the goal is shorthand, typing less is the idea right?
Next we should make sure to put commas in between the different targets. If you want to have all those different types, then they shouldn't be just smashed together.
Disenchant would be: Tgt$A,E
Fissure would be: Tgt$C,L (i'm assuming you plan to do this for Lands as well?)
I still have one major issue. No card specifically targets Planeswalkers right now. However the way we have Damage setup is that if you can target a Player you also can target a Planeswalker (recently fixed to only target a Planeswalker you don't control). How do we resolve that? If someone uses the PW shorthand do we tack on the .YouDontCtrl automatically? What if a card comes up that can target any Planeswalker? I want to those slippery slopes to have giant warning signs before they become issues down the road.
If we have an elegant solution for that, the process isn't too hard:
The changes would need to go in
public Target(String parse, int min, int max)
Split the parse String, and then build Valid and Prompt strings simultaneously for each parse value.
Minor note, Opponent will need some additional changes into Target_Selection. There are enough spells that Target Opponents, so it's fine to have. Just informing you so you'll know there's extra work for that.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: TgtP
by slapshot5 » 17 Nov 2010, 20:47
agreedfriarsol wrote:Firstly, drop Tgt from the Value.
agreedfriarsol wrote:Next we should make sure to put commas in between the different targets.
Yeah, I knew I was missing something easy. But it was late...friarsol wrote:(i'm assuming you plan to do this for Lands as well?)
Is that how Damage is supposed to work? Planeswalkers didn't exist when I played a lot of Magic, and I don't use them now either. So, I really am not up to date on these rules.friarsol wrote:I still have one major issue. No card specifically targets Planeswalkers right now. However the way we have Damage setup is that if you can target a Player you also can target a Planeswalker (recently fixed to only target a Planeswalker you don't control). How do we resolve that? If someone uses the PW shorthand do we tack on the .YouDontCtrl automatically? What if a card comes up that can target any Planeswalker? I want to those slippery slopes to have giant warning signs before they become issues down the road.
I think we need to make these distinct, and leave it up to the programmer to use Tgt$P,PW.
I'd like to get others' thoughts on this.
slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: TgtP
by friarsol » 17 Nov 2010, 21:06
Heh, I haven't collected in 10 years. But I keep up with the rules. Forge cheats when it handles damage and Planeswalkers. Forge lets you target Planeswalkers with direct damage.
Here's how it should work:
We definitely should keep Player and Planeswalker distinct. These changes would be pointless otherwise.
The real question is: how do you differentiate between targeting a Planeswalker with a direct damage SA and a non-direct damage SA. Since direct damage can't target your own Planeswalker, but non-direct damage can?
Here's how it should work:
- Code: Select all
212.9g If noncombat damage would be dealt to a player by a source controlled by an opponent, that opponent may have that source deal that damage to a planeswalker the first player controls instead. This is a redirection effect (see rule 419.6c) and is subject to the normal rules for ordering replacement effects (see rule 419.9). The opponent chooses whether to redirect the damage as the redirection effect is applied.
We definitely should keep Player and Planeswalker distinct. These changes would be pointless otherwise.
The real question is: how do you differentiate between targeting a Planeswalker with a direct damage SA and a non-direct damage SA. Since direct damage can't target your own Planeswalker, but non-direct damage can?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: TgtP
by Chris H. » 17 Nov 2010, 22:59
Shoot, I sold all of my cards a good 13+ years ago or so.
I do not have much to contribute except to say that I like names that are easy to see and remember. I find the new AF sa's with their key + value arrangement to be a move in the right direction. That combined with the spaces should help new people to check out the project and maybe get involved.
I do not have much to contribute except to say that I like names that are easy to see and remember. I find the new AF sa's with their key + value arrangement to be a move in the right direction. That combined with the spaces should help new people to check out the project and maybe get involved.
-
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: TgtP
by slapshot5 » 17 Nov 2010, 23:38
I was thinking about this after I posted, and now Chris just made the point. Since Valid uses the full names, perhaps Tgt should exactly match it.
So, Tgt$Artifact,Creature,Land instead of Tgt$A,C,L
-slapshot5
So, Tgt$Artifact,Creature,Land instead of Tgt$A,C,L
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
24 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: Google [Bot], Google Adsense [Bot] and 288 guests