mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Merge pull request #4632 from CountAndromalius/master
Corrected "Any TYPE among permanent types" handling
This commit is contained in:
commit
03ebdc17d8
3 changed files with 14 additions and 9 deletions
|
|
@ -84,7 +84,7 @@ public class AnyColorLandsProduceManaAbility extends ActivatedManaAbilityImpl {
|
|||
class AnyColorLandsProduceManaEffect extends ManaEffect {
|
||||
|
||||
private final FilterPermanent filter;
|
||||
private final boolean onlyColors; // false if mana types can be produced (also Colorless mana), if false only colors can be produced (no Colorless mana).
|
||||
private final boolean onlyColors; // false if mana types can be produced (also Colorless mana), if true only colors can be produced (no Colorless mana).
|
||||
|
||||
private boolean inManaTypeCalculation = false;
|
||||
|
||||
|
|
@ -190,7 +190,6 @@ class AnyColorLandsProduceManaEffect extends ManaEffect {
|
|||
return types;
|
||||
}
|
||||
inManaTypeCalculation = true;
|
||||
// Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "needed to identify endless loop causing cards: {0}", source.getSourceObject(game).getName());
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent land : lands) {
|
||||
Abilities<ActivatedManaAbilityImpl> mana = land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class AnyColorPermanentTypesManaAbility extends ActivatedManaAbilityImpl
|
|||
class AnyColorPermanentTypesManaEffect extends ManaEffect {
|
||||
|
||||
private final FilterPermanent filter;
|
||||
private final boolean onlyColors; // false if mana types can be produced (also Colorless mana), if false only colors can be produced (no Colorless mana).
|
||||
private final boolean onlyColors; // false if mana types can be produced (also Colorless mana), if true only colors can be produced (no Colorless mana).
|
||||
|
||||
private boolean inManaTypeCalculation = false;
|
||||
|
||||
|
|
@ -168,13 +168,19 @@ class AnyColorPermanentTypesManaEffect extends ManaEffect {
|
|||
}
|
||||
inManaTypeCalculation = true;
|
||||
|
||||
List<ObjectColor> permanentColors;
|
||||
// Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "needed to identify endless loop causing cards: {0}", source.getSourceObject(game).getName());
|
||||
ObjectColor permanentColor;
|
||||
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
|
||||
for (Permanent permanent : permanents) {
|
||||
permanentColors = permanent.getColor(game).getColors();
|
||||
for (ObjectColor color : permanentColors){
|
||||
types.add(new Mana(color.getColoredManaSymbol()));
|
||||
permanentColor = permanent.getColor(game);
|
||||
if(permanentColor.isColorless())
|
||||
types.add(Mana.ColorlessMana(1));
|
||||
else{
|
||||
List<ObjectColor> permanentColors = permanent.getColor(game).getColors();
|
||||
for (ObjectColor color : permanentColors){
|
||||
types.add(new Mana(color.getColoredManaSymbol()));
|
||||
}
|
||||
}
|
||||
}
|
||||
inManaTypeCalculation = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue