Alternative spell abilities: added support of modes and other extra things in commander, awaken, jump-start, spectacle, retrace and surge abilities;

This commit is contained in:
Oleg Agafonov 2019-06-21 17:11:44 +04:00
parent a8c047a2be
commit d25ae47104
10 changed files with 138 additions and 89 deletions

View file

@ -11,20 +11,10 @@ import mage.constants.Zone;
public class CastCommanderAbility extends SpellAbility {
public CastCommanderAbility(Card card) {
super(card.getManaCost(), card.getName(), Zone.COMMAND, SpellAbilityType.BASE);
if (card.getSpellAbility() != null) {
this.getCosts().addAll(card.getSpellAbility().getCosts().copy());
this.getEffects().addAll(card.getSpellAbility().getEffects().copy());
this.getTargets().addAll(card.getSpellAbility().getTargets().copy());
this.setTargetAdjuster(card.getSpellAbility().getTargetAdjuster());
this.setCostAdjuster(card.getSpellAbility().getCostAdjuster());
this.timing = card.getSpellAbility().getTiming();
} else {
throw new IllegalStateException("Cast commander ability must be used with spell ability only: " + card.getName());
}
this.usesStack = true;
this.controllerId = card.getOwnerId();
this.sourceId = card.getId();
super(card.getSpellAbility());
this.setCardName(cardName = card.getName());
zone = Zone.COMMAND;
spellAbilityType = SpellAbilityType.BASE;
}
public CastCommanderAbility(final CastCommanderAbility ability) {