equipMagnetList?
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
equipMagnetList?
by Rob Cashwalker » 08 Oct 2010, 14:23
I was browsing through the recent changes, and I came across this from Chris:
Shouldn't this be handled via an SVar? Kinda like the AI hints for "buffed by"?
What about Auriok Steelshaper?- Minor edit to CardFactoryUtil.eqPump_Equip. The equipMagnetList will now add Goblin Gaveleer and Loxodon Punisher to this list
Shouldn't this be handled via an SVar? Kinda like the AI hints for "buffed by"?
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: equipMagnetList?
by Sloth » 08 Oct 2010, 15:51
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.Rob Cashwalker wrote:Shouldn't this be handled via an SVar? Kinda like the AI hints for "buffed by"?
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).
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: equipMagnetList?
by 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())));
}
});
}
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 47 guests