Commander abilities - fixed rules text for alternative spells;

This commit is contained in:
Oleg Agafonov 2019-07-14 01:21:55 +04:00
parent 9db80a0cf3
commit 528ba66e16

View file

@ -9,16 +9,20 @@ import mage.constants.Zone;
*/
public class CastCommanderAbility extends SpellAbility {
private String ruleText;
public CastCommanderAbility(Card card, SpellAbility spellTemplate) {
super(spellTemplate);
this.newId();
this.setCardName(spellTemplate.getCardName());
zone = Zone.COMMAND;
spellAbilityType = spellTemplate.getSpellAbilityType();
this.zone = Zone.COMMAND;
this.spellAbilityType = spellTemplate.getSpellAbilityType();
this.ruleText = spellTemplate.getRule(); // need to support custom rule texts like OverloadAbility
}
public CastCommanderAbility(final CastCommanderAbility ability) {
super(ability);
this.ruleText = ability.ruleText;
}
@Override
@ -26,4 +30,9 @@ public class CastCommanderAbility extends SpellAbility {
return new CastCommanderAbility(this);
}
@Override
public String getRule() {
return ruleText;
}
}