mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Clean up visual details.
This commit is contained in:
parent
1bbfc32886
commit
d2cb10d7b7
2 changed files with 41 additions and 14 deletions
|
@ -21,10 +21,7 @@ public abstract class AdventureCard extends CardImpl {
|
|||
|
||||
public AdventureCard(UUID ownerId, CardSetInfo setInfo, CardType[] types, CardType[] typesSpell, String costs, String adventureName, String costsSpell) {
|
||||
super(ownerId, setInfo, types, costs);
|
||||
spellCard = new AdventureCardSpellImpl(ownerId, setInfo, typesSpell, costsSpell, this);
|
||||
spellCard.getSpellAbility().addEffect(ExileAdventureSpellEffect.getInstance());
|
||||
spellCard.setName(adventureName);
|
||||
spellCard.getSpellAbility().setCardName(adventureName);
|
||||
spellCard = new AdventureCardSpellImpl(ownerId, setInfo, adventureName, typesSpell, costsSpell, this);
|
||||
this.addAbility(spellCard.getSpellAbility());
|
||||
}
|
||||
|
||||
|
@ -83,13 +80,7 @@ public abstract class AdventureCard extends CardImpl {
|
|||
@Override
|
||||
public Abilities<Ability> getAbilities(Game game) {
|
||||
Abilities<Ability> allAbilities = new AbilitiesImpl<>();
|
||||
for (Ability ability : super.getAbilities(game)) {
|
||||
if (ability instanceof SpellAbility
|
||||
&& ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT
|
||||
&& ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT_AFTERMATH) {
|
||||
allAbilities.add(ability);
|
||||
}
|
||||
}
|
||||
allAbilities.addAll(super.getAbilities(game));
|
||||
allAbilities.addAll(spellCard.getAbilities(game));
|
||||
return allAbilities;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
package mage.cards;
|
||||
|
||||
import mage.abilities.Modes;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.effects.common.ExileAdventureSpellEffect;
|
||||
import mage.constants.CardType;
|
||||
|
@ -25,10 +26,17 @@ public class AdventureCardSpellImpl extends CardImpl implements AdventureCardSpe
|
|||
|
||||
private AdventureCard adventureCardParent;
|
||||
|
||||
public AdventureCardSpellImpl(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costs, AdventureCard adventureCardParent) {
|
||||
public AdventureCardSpellImpl(UUID ownerId, CardSetInfo setInfo, String adventureName, CardType[] cardTypes, String costs, AdventureCard adventureCardParent) {
|
||||
super(ownerId, setInfo, cardTypes, costs, SpellAbilityType.ADVENTURE_SPELL);
|
||||
this.subtype.add(SubType.ADVENTURE);
|
||||
this.replaceSpellAbility(new AdventureCardSpellAbility(getSpellAbility()));
|
||||
|
||||
AdventureCardSpellAbility newSpellAbility = new AdventureCardSpellAbility(getSpellAbility());
|
||||
newSpellAbility.setName(adventureName, costs);
|
||||
newSpellAbility.addEffect(ExileAdventureSpellEffect.getInstance());
|
||||
newSpellAbility.setCardName(adventureName);
|
||||
this.replaceSpellAbility(newSpellAbility);
|
||||
|
||||
this.setName(adventureName);
|
||||
this.adventureCardParent = adventureCardParent;
|
||||
}
|
||||
|
||||
|
@ -95,7 +103,7 @@ public class AdventureCardSpellImpl extends CardImpl implements AdventureCardSpe
|
|||
}
|
||||
|
||||
class AdventureCardSpellAbility extends SpellAbility {
|
||||
public AdventureCardSpellAbility(SpellAbility ability) {
|
||||
public AdventureCardSpellAbility(final SpellAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
@ -108,4 +116,32 @@ class AdventureCardSpellAbility extends SpellAbility {
|
|||
return super.canActivate(playerId, game);
|
||||
}
|
||||
}
|
||||
|
||||
public void setName(String name, String costs) {
|
||||
this.name = "Adventure — " + name + " " + costs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule(boolean all) {
|
||||
return this.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sbRule = new StringBuilder();
|
||||
sbRule.append("Adventure — ");
|
||||
sbRule.append(this.getCardName());
|
||||
sbRule.append(" ");
|
||||
sbRule.append(manaCosts.getText());
|
||||
sbRule.append(" — ");
|
||||
Modes modes = this.getModes();
|
||||
if (modes.size() <= 1) {
|
||||
sbRule.append(modes.getMode().getEffects().getTextStartingUpperCase(modes.getMode()));
|
||||
} else {
|
||||
sbRule.append(getModes().getText());
|
||||
}
|
||||
sbRule.append(super.getRule(false));
|
||||
sbRule.append(" <i>(Then exile this card. You may cast the creature later from exile.)</i>");
|
||||
return sbRule.toString();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue