It is currently 18 May 2024, 05:42
   
Text Size

equipMagnetList?

Post MTG Forge Related Programming Questions Here

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

equipMagnetList?

Postby Rob Cashwalker » 08 Oct 2010, 14:23

I was browsing through the recent changes, and I came across this from Chris:
- Minor edit to CardFactoryUtil.eqPump_Equip. The equipMagnetList will now add Goblin Gaveleer and Loxodon Punisher to this list
What about Auriok Steelshaper?

Shouldn't this be handled via an SVar? Kinda like the AI hints for "buffed by"?
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: equipMagnetList?

Postby Sloth » 08 Oct 2010, 15:51

Rob Cashwalker wrote:Shouldn't this be handled via an SVar? Kinda like the AI hints for "buffed by"?
I was thinking the same thing. There should be SVars like EnchantMe and EquipMe. At the moment the magnet lists have to be maintained in two places of the code.

Maybe we can even differentiate between creatures that benefit from one Aura/Equipment (like Thran Golem) and creatures that benefit from greater numbers (like Rabid Wombat).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: equipMagnetList?

Postby Sloth » 08 Oct 2010, 21:39

I've replaced the old lists with these checks for SVars:

Code: Select all
    public CardList getEquipMagnets() {
       return this.filter(new CardListFilter() {
            public boolean addCard(Card c) {
               return (c.isCreature() && (c.getSVar("EquipMe").equals("Multiple")
                     || (c.getSVar("EquipMe").equals("Once") && !c.isEnchanted())));
            }
        });
    }
   
    public CardList getEnchantMagnets() {
       return this.filter(new CardListFilter() {
            public boolean addCard(Card c) {
               return (c.isCreature() && (c.getSVar("EnchantMe").equals("Multiple")
                     || (c.getSVar("EnchantMe").equals("Once") && !c.isEnchanted())));
            }
        });
    }
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 47 guests


Who is online

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

Login Form