It is currently 29 Oct 2025, 07:05
   
Text Size

Goblin Sharpshooter

Post MTG Forge Related Programming Questions Here

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

Goblin Sharpshooter

Postby Chris H. » 24 Feb 2011, 14:57

Currently, Goblin Sharpshooter looks like this, notice the card specific keyword:

Goblin Sharpshooter card | Open
Name:Goblin Sharpshooter
ManaCost:2 R
Types:Creature Goblin
Text:no text
PT:1/1
A:AB$DealDamage | Cost$ T | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
K:CARDNAME doesn't untap during your untap step.
K:Whenever a creature is put into a graveyard from the battlefield, untap Goblin Sharpshooter.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_sharpshooter.jpg
SetInfo:ONS|Rare|http://magiccards.info/scans/en/on/207.jpg
End


We have a section of code in GameActionUtil that untaps the Goblin Sharpshooter without using the stack:

Code: Select all
    private static void destroyCreature_Goblin_Sharpshooter(Card c, Card destroyed) {
        //not using stack for this one
        if(AllZone.GameAction.isCardInPlay(c) && c.isTapped()) c.untap();
    }
`
If this card is converted to triggers, the untap will use the stack. So, should this card be converted to triggers which would use the stack or should this card be given a note stating do not convert.

I thought that I would ask before moving forward on this card. :)
User avatar
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: Goblin Sharpshooter

Postby Hellfish » 24 Feb 2011, 15:32

I think it can be converted fine since, AFAICT, it's just a straight-forward triggered ability.
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: Goblin Sharpshooter

Postby friarsol » 24 Feb 2011, 15:39

There are lots of cards that incorrectly don't use the stack that are hardcoded, I'm not sure when those decisions were made, but in general they are incorrect.

Hellfish is right. There's nothing tricky about this one.

The best part is clearing out these one-time use keywords.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Goblin Sharpshooter

Postby Chris H. » 24 Feb 2011, 16:10

Thank you for the confirmation, Hellfish and Sol. :)

I suspect that cards that are implemented this way were done so since it requires less time to code the cards and it tends not to grow the source code by large amounts of new code for a single card.

I spent a lot of time trying to actually find this keyword and was unsuccessful. It's only purpose may be to play that text string into the card text area. The actual test in GameActionUtil tests for the card name and not for the keyword as far as I can tell. But I decided it was not worth too much time to try and track this down. :)

And yes, I do not mind deprecating another keyword. 8)
User avatar
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: Goblin Sharpshooter

Postby slapshot5 » 24 Feb 2011, 17:23

Chris H. wrote:I spent a lot of time trying to actually find this keyword and was unsuccessful. It's only purpose may be to play that text string into the card text area. The actual test in GameActionUtil tests for the card name and not for the keyword as far as I can tell. But I decided it was not worth too much time to try and track this down. :)
I've run into this a couple time. I wouldn't be surprised if there are a few others out there.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Goblin Sharpshooter

Postby Chris H. » 24 Feb 2011, 17:51

slapshot5 wrote:
Chris H. wrote:I spent a lot of time trying to actually find this keyword and was unsuccessful. It's only purpose may be to play that text string into the card text area. The actual test in GameActionUtil tests for the card name and not for the keyword as far as I can tell. But I decided it was not worth too much time to try and track this down. :)
I've run into this a couple time. I wouldn't be surprised if there are a few others out there.
`
There are a few dealing with auras that I put in myself a long time ago. The aura code may need to be redone at some point to bring it up to date with recent advancements.
User avatar
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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 9 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 9 guests

Login Form