It is currently 27 Apr 2024, 09:58
   
Text Size

addExtrinsicKeyword(String s)

Post MTG Forge Related Programming Questions Here

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

addExtrinsicKeyword(String s)

Postby DennisBergkamp » 17 Feb 2010, 17:39

Is there any reason the code for it looks like this?

Code: Select all
public void addExtrinsicKeyword(String s) {
     if(!getKeyword().contains(s)){
        if (s.startsWith("tap: add")) manaAbility.add(new Ability_Mana(this, s)
        {
           private static final long serialVersionUID = 221124403788942412L;
        });
        else extrinsicKeyword.add(s);
    }
  }
the "if(!getKeyword().contains(s))" block was probably added to prevent duplication of certain keywords, but the problem is that cards like Sidewinder Sliver will not work correctly (since Flanking stacks).

Then again, I might have been the one that added this check in the first place, I can't remember...

For now, I will uncomment the if block, however, it might cause problems for certain cards. Joiner Adept and Gemhide Sliver came to mind but after testing they turned out to be working alright (lands and slivers still only had one set of mana abilities, even with multiple of them in play).
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: addExtrinsicKeyword(String s)

Postby Rob Cashwalker » 17 Feb 2010, 19:22

Yep, you added that.... And made it so that multiple keywords wouldn't stack.

MOST keywords don't stack.

The few that do, are ones that cause triggered abilities, like Exalted or what Lifelink USED to do. To handle this, maybe there needs to be a separate list of keywords that relate to triggered abilities.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: addExtrinsicKeyword(String s)

Postby DennisBergkamp » 18 Feb 2010, 02:12

Maybe we should add an "addStackingExtrinsicKeyword" method then, since only very few cards (Sidewinder Sliver, ... ) would actually use it. Most of the time we wouldn't want to stack them (looks much better aesthetically).
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 105 guests


Who is online

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

Login Form