foul-magics/Mage/src/main/java/mage/abilities/keyword/CleaveAbility.java
Susucre f75b1c9f0a
Code cleanup: protect all copy constructors (#10750)
* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
2023-08-04 19:34:58 -04:00

41 lines
1.2 KiB
Java

package mage.abilities.keyword;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.cards.Card;
import mage.constants.SpellAbilityType;
import mage.constants.TimingRule;
/**
* @author TheElk801
*/
public class CleaveAbility extends SpellAbility {
public CleaveAbility(Card card, Effect effect, String manaString) {
super(new ManaCostsImpl<>(manaString), card.getName() + " with cleave");
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
this.addEffect(effect);
this.setRuleAtTheTop(true);
this.timing = (card.isSorcery(null) ? TimingRule.SORCERY : TimingRule.INSTANT);
}
protected CleaveAbility(final CleaveAbility ability) {
super(ability);
}
@Override
public CleaveAbility copy() {
return new CleaveAbility(this);
}
@Override
public String getRule(boolean all) {
return getRule();
}
@Override
public String getRule() {
return "Cleave " + getManaCostsToPay().getText() + " <i>(You may cast this spell for its cleave cost. If you do, remove the words in square brackets.)</i>";
}
}