mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Rework Manaforge Cinder to have a Mana Ability (#10929)
This commit is contained in:
parent
ffc1ffd071
commit
44fcf3553d
9 changed files with 159 additions and 105 deletions
|
|
@ -1,51 +0,0 @@
|
|||
|
||||
package mage.abilities.mana;
|
||||
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ActivateOncePerTurnManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
||||
public ActivateOncePerTurnManaAbility(Zone zone, BasicManaEffect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
this.netMana.add(effect.getManaTemplate());
|
||||
this.maxActivationsPerTurn = 1;
|
||||
}
|
||||
|
||||
public ActivateOncePerTurnManaAbility(Zone zone, AddManaOfAnyColorEffect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
this.netMana.add(new Mana(0, 0, 0, 0, 0, 0, effect.getAmount(), 0));
|
||||
this.maxActivationsPerTurn = 1;
|
||||
}
|
||||
|
||||
public ActivateOncePerTurnManaAbility(ActivateOncePerTurnManaAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, boolean noMana) {
|
||||
if (canActivate(this.controllerId, game).canActivate()) {
|
||||
return super.activate(game, noMana);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return super.getRule() + " Activate only once each turn.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivateOncePerTurnManaAbility copy() {
|
||||
return new ActivateOncePerTurnManaAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
|
||||
package mage.abilities.mana;
|
||||
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.ManaEffect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author LevelX2, Susucr
|
||||
*/
|
||||
public class LimitedTimesPerTurnActivatedManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
||||
public LimitedTimesPerTurnActivatedManaAbility(Zone zone, BasicManaEffect effect, Cost cost) {
|
||||
this(zone, effect, cost, 1);
|
||||
}
|
||||
|
||||
public LimitedTimesPerTurnActivatedManaAbility(Zone zone, BasicManaEffect effect, Cost cost, int maxActivationPerTurn) {
|
||||
this(zone, effect, cost, maxActivationPerTurn, effect.getManaTemplate());
|
||||
}
|
||||
|
||||
public LimitedTimesPerTurnActivatedManaAbility(Zone zone, AddManaOfAnyColorEffect effect, Cost cost) {
|
||||
this(zone, effect, cost, 1);
|
||||
}
|
||||
|
||||
public LimitedTimesPerTurnActivatedManaAbility(Zone zone, AddManaOfAnyColorEffect effect, Cost cost, int maxActivationPerTurn) {
|
||||
this(zone, effect, cost, maxActivationPerTurn,
|
||||
new Mana(0, 0, 0, 0, 0, 0, effect.getAmount(), 0));
|
||||
}
|
||||
|
||||
public LimitedTimesPerTurnActivatedManaAbility(Zone zone, ManaEffect effect, Cost cost, int maxActivationPerTurn, Mana mana) {
|
||||
this(zone, effect, cost, maxActivationPerTurn, Arrays.asList(mana));
|
||||
}
|
||||
|
||||
public LimitedTimesPerTurnActivatedManaAbility(Zone zone, ManaEffect effect, Cost cost, int maxActivationPerTurn, List<Mana> mana) {
|
||||
super(zone, effect, cost);
|
||||
this.netMana.addAll(mana);
|
||||
this.maxActivationsPerTurn = maxActivationPerTurn;
|
||||
}
|
||||
|
||||
private LimitedTimesPerTurnActivatedManaAbility(final LimitedTimesPerTurnActivatedManaAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, boolean noMana) {
|
||||
if (canActivate(this.controllerId, game).canActivate()) {
|
||||
return super.activate(game, noMana);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
String text = super.getRule() + " Activate ";
|
||||
text += maxActivationsPerTurn == 1
|
||||
? "only once"
|
||||
: "no more than " + CardUtil.numberToText(maxActivationsPerTurn) + " times";
|
||||
text += " each turn.";
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LimitedTimesPerTurnActivatedManaAbility copy() {
|
||||
return new LimitedTimesPerTurnActivatedManaAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue