* Commander - fixed that instant/sourcery/enchantment don't work from command zone (#5795);

This commit is contained in:
Oleg Agafonov 2019-05-13 16:07:29 +04:00
parent bf20e7d656
commit 28924c1cb7

View file

@ -15,8 +15,15 @@ public class CastCommanderAbility extends SpellAbility {
public CastCommanderAbility(Card card) {
super(card.getManaCost(), card.getName(), Zone.COMMAND, SpellAbilityType.BASE);
this.costs = card.getSpellAbility() != null ? card.getSpellAbility().getCosts().copy() : new CostsImpl<>();
this.timing = TimingRule.SORCERY;
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.timing = card.getSpellAbility().getTiming();
} else {
this.costs = new CostsImpl<>();
this.timing = TimingRule.SORCERY;
}
this.usesStack = true;
this.controllerId = card.getOwnerId();
this.sourceId = card.getId();