diff --git a/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java b/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java index f14cc4bfb5..2804a94319 100644 --- a/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java +++ b/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java @@ -15,8 +15,10 @@ import mage.constants.Zone; import mage.game.ExileZone; import mage.game.Game; +import java.util.Arrays; import java.util.List; import java.util.UUID; +import java.util.stream.Collectors; /** * @author phulin @@ -29,10 +31,7 @@ public class AdventureCardSpellImpl extends CardImpl implements AdventureCardSpe super(ownerId, setInfo, cardTypes, costs, SpellAbilityType.ADVENTURE_SPELL); this.subtype.add(SubType.ADVENTURE); - AdventureCardSpellAbility newSpellAbility = new AdventureCardSpellAbility(getSpellAbility()); - newSpellAbility.setName(adventureName, costs); - newSpellAbility.addEffect(ExileAdventureSpellEffect.getInstance()); - newSpellAbility.setCardName(adventureName); + AdventureCardSpellAbility newSpellAbility = new AdventureCardSpellAbility(getSpellAbility(), adventureName, cardTypes, costs); this.replaceSpellAbility(newSpellAbility); spellAbility = newSpellAbility; @@ -103,8 +102,19 @@ public class AdventureCardSpellImpl extends CardImpl implements AdventureCardSpe } class AdventureCardSpellAbility extends SpellAbility { - public AdventureCardSpellAbility(final SpellAbility ability) { + + String nameFull; + + public AdventureCardSpellAbility(final SpellAbility baseSpellAbility, String adventureName, CardType[] cardTypes, String costs) { + super(baseSpellAbility); + this.setName(cardTypes, adventureName, costs); + this.addEffect(ExileAdventureSpellEffect.getInstance()); + this.setCardName(adventureName); + } + + public AdventureCardSpellAbility(final AdventureCardSpellAbility ability) { super(ability); + this.nameFull = ability.nameFull; } @Override @@ -120,8 +130,9 @@ class AdventureCardSpellAbility extends SpellAbility { return super.canActivate(playerId, game); } - public void setName(String name, String costs) { - this.name = "Adventure — " + name + " " + costs; + public void setName(CardType[] cardTypes, String name, String costs) { + this.nameFull = "Adventure " + Arrays.stream(cardTypes).map(CardType::toString).collect(Collectors.joining(" ")) + " — " + name; + this.name = this.nameFull + " " + costs; } @Override @@ -132,8 +143,7 @@ class AdventureCardSpellAbility extends SpellAbility { @Override public String getRule() { StringBuilder sbRule = new StringBuilder(); - sbRule.append("Adventure — "); - sbRule.append(this.getCardName()); + sbRule.append(this.nameFull); sbRule.append(" "); sbRule.append(manaCosts.getText()); sbRule.append(" — ");