mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
* Double lands - fixed duplicated choices in choose dialog (#7197);
This commit is contained in:
parent
c2c1e157e9
commit
24e2728fca
2 changed files with 33 additions and 8 deletions
|
|
@ -3,10 +3,7 @@ package mage.cards;
|
|||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.*;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.constants.*;
|
||||
|
|
@ -171,12 +168,24 @@ public abstract class ModalDoubleFacesCard extends CardImpl {
|
|||
return getInnerAbilities(game, false);
|
||||
}
|
||||
|
||||
private boolean isIgnoreDefaultAbility(Ability ability) {
|
||||
// ignore default play/spell ability from main card (only halfes are actual)
|
||||
// default abilities added on card creation from card type and can't be skipped
|
||||
|
||||
// skip cast spell
|
||||
if (ability instanceof SpellAbility && ((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.MODAL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// skip play land
|
||||
return ability instanceof PlayLandAbility;
|
||||
}
|
||||
|
||||
private Abilities<Ability> getInnerAbilities(Game game, boolean showOnlyMainSide) {
|
||||
Abilities<Ability> allAbilites = new AbilitiesImpl<>();
|
||||
|
||||
// ignore default spell ability from main card (only halfes are actual)
|
||||
for (Ability ability : super.getAbilities(game)) {
|
||||
if (ability instanceof SpellAbility && ((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.MODAL) {
|
||||
if (isIgnoreDefaultAbility(ability)) {
|
||||
continue;
|
||||
}
|
||||
allAbilites.add(ability);
|
||||
|
|
@ -193,9 +202,8 @@ public abstract class ModalDoubleFacesCard extends CardImpl {
|
|||
private Abilities<Ability> getInnerAbilities(boolean showOnlyMainSide) {
|
||||
Abilities<Ability> allAbilites = new AbilitiesImpl<>();
|
||||
|
||||
// ignore default spell ability from main card (only halfes are actual)
|
||||
for (Ability ability : super.getAbilities()) {
|
||||
if (ability instanceof SpellAbility && ((SpellAbility) ability).getSpellAbilityType() == SpellAbilityType.MODAL) {
|
||||
if (isIgnoreDefaultAbility(ability)) {
|
||||
continue;
|
||||
}
|
||||
allAbilites.add(ability);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue