forked from External/mage
* Added getProducableManaTypes method for mana effects to handle Squandered Resources or Reflecting Pool like abilities.
* Fixes to Soldevi Adnate, Skirge Familiar, Mana Web.
This commit is contained in:
parent
121e1043ab
commit
67dd45c1c7
25 changed files with 420 additions and 404 deletions
|
|
@ -170,39 +170,22 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
// its frame colors.
|
||||
if (this.isLand()) {
|
||||
ObjectColor cl = frameColor.copy();
|
||||
Set<ManaType> manaTypes = EnumSet.noneOf(ManaType.class);
|
||||
for (Ability ab : getAbilities()) {
|
||||
if (ab instanceof ActivatedManaAbilityImpl) {
|
||||
ActivatedManaAbilityImpl mana = (ActivatedManaAbilityImpl) ab;
|
||||
try {
|
||||
List<Mana> manaAdded = mana.getNetMana(game);
|
||||
for (Mana m : manaAdded) {
|
||||
if (m.getAny() > 0) {
|
||||
return new ObjectColor("WUBRG");
|
||||
}
|
||||
if (m.getWhite() > 0) {
|
||||
cl.setWhite(true);
|
||||
}
|
||||
if (m.getBlue() > 0) {
|
||||
cl.setBlue(true);
|
||||
}
|
||||
if (m.getBlack() > 0) {
|
||||
cl.setBlack(true);
|
||||
}
|
||||
if (m.getRed() > 0) {
|
||||
cl.setRed(true);
|
||||
}
|
||||
if (m.getGreen() > 0) {
|
||||
cl.setGreen(true);
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
// Ability depends on game
|
||||
// but no game passed
|
||||
// All such abilities are 5-color ones
|
||||
return new ObjectColor("WUBRG");
|
||||
}
|
||||
manaTypes.addAll(((ActivatedManaAbilityImpl) ab).getProducableManaTypes(game));
|
||||
}
|
||||
}
|
||||
cl.setWhite(manaTypes.contains(ManaType.WHITE));
|
||||
cl.setBlue(manaTypes.contains(ManaType.BLUE));
|
||||
cl.setBlack(manaTypes.contains(ManaType.BLACK));
|
||||
cl.setRed(manaTypes.contains(ManaType.RED));
|
||||
cl.setGreen(manaTypes.contains(ManaType.GREEN));
|
||||
|
||||
// // Ability depends on game
|
||||
// // but no game passed
|
||||
// // All such abilities are 5-color ones
|
||||
// return new ObjectColor("WUBRG");
|
||||
return cl;
|
||||
} else {
|
||||
// For everything else, just return the frame colors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue