mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
* Adventure cards - added missing adventure card type info into rules (instant or sorcery);
This commit is contained in:
parent
383ab959d3
commit
d860c026bd
1 changed files with 19 additions and 9 deletions
|
@ -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(" — ");
|
||||
|
|
Loading…
Reference in a new issue