It is currently 19 Apr 2024, 00:53
   
Text Size

Starting out with a few cards missing from my Krenko EDH

Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins

Starting out with a few cards missing from my Krenko EDH

Postby BursegSardaukar » 13 Sep 2015, 06:29

I just found out about you guys' software this week, and am quickly falling in love. During the construction of my Krenko EDH deck, I found a few cards missing, and figured I'd take a crack at them. I started implementation on a couple cards, specifically Goblin Wizard and Magewright's Stone.

Wizard was pretty straightforward, I duplicated the triggered ability from Goblin Lackey, and made it an activated one. Can't seem to find its card number in The Dark set, though.

Magewright is another beast entirely. As far as I could find in other cards, there was no way to filter for a creature with a specific activated ability cost. I made a hack within the AbilityPredicate class that "works," but certainly isn't the solution.

Code: Select all
 
    @Override
    public boolean apply(MageObject input, Game game) {
        Abilities<Ability> abilities;
        if (input instanceof Card){
            abilities = ((Card)input).getAbilities(game);
        } else {
            abilities = input.getAbilities();
        }
       
        for (Ability ability : abilities) {
            if (abilityClass.equals(ability.getClass())) {
                //Burseg Hack: Magewright's Stone [DIS] specifically looks for activated ability containing {T}
                //As of 9/13/2015, no other AbilityPredicate is filtering for SimpleActivatedAbility
                if (abilityClass.equals(SimpleActivatedAbility.class) && ability.getCosts().size() > 0){
                    for (Cost cost : ability.getCosts()) {
                        if (cost instanceof TapSourceCost) {
                            return true;
                        }
                    }
                    return false;
                } else {
                    return true;
                }
            }
        }
        return false;
    }
I was unable to find any other filter that was searching for SimpleActivatedAbiity, so this hack is literally only for the Magewright stone. Let me know what the proper solution for this would be.
BursegSardaukar
 
Posts: 2
Joined: 13 Sep 2015, 06:12
Has thanked: 0 time
Been thanked: 0 time

Re: Starting out with a few cards missing from my Krenko EDH

Postby LoneFox » 13 Sep 2015, 06:58

BursegSardaukar wrote:Wizard was pretty straightforward, I duplicated the triggered ability from Goblin Lackey, and made it an activated one. Can't seem to find its card number in The Dark set, though.
XMage uses card numbering from magiccards.info for cards that don't have official card number. For Goblin Wizard it is 68. The gen-card.pl script should handle this automatically, but there are some errors in its database.

Magewright is another beast entirely. As far as I could find in other cards, there was no way to filter for a creature with a specific activated ability cost. I made a hack within the AbilityPredicate class that "works," but certainly isn't the solution.

Code: Select all
 
    @Override
    public boolean apply(MageObject input, Game game) {
        Abilities<Ability> abilities;
        if (input instanceof Card){
            abilities = ((Card)input).getAbilities(game);
        } else {
            abilities = input.getAbilities();
        }
       
        for (Ability ability : abilities) {
            if (abilityClass.equals(ability.getClass())) {
                //Burseg Hack: Magewright's Stone [DIS] specifically looks for activated ability containing {T}
                //As of 9/13/2015, no other AbilityPredicate is filtering for SimpleActivatedAbility
                if (abilityClass.equals(SimpleActivatedAbility.class) && ability.getCosts().size() > 0){
                    for (Cost cost : ability.getCosts()) {
                        if (cost instanceof TapSourceCost) {
                            return true;
                        }
                    }
                    return false;
                } else {
                    return true;
                }
            }
        }
        return false;
    }
I was unable to find any other filter that was searching for SimpleActivatedAbiity, so this hack is literally only for the Magewright stone. Let me know what the proper solution for this would be.
Not all activated abilities are SimpleActivatedAbilities. I believe that instead of that AbilityClass thing
Code: Select all
if(ability instanceof ActivatedAbilityImpl)
should work, but I'm not sure...
LoneFox
Programmer
 
Posts: 71
Joined: 08 Mar 2009, 13:43
Has thanked: 0 time
Been thanked: 7 times


Return to Developers Talk

Who is online

Users browsing this forum: No registered users and 7 guests


Who is online

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

Login Form