forked from External/mage
remove unnecessary args from RollDiceEffect
This commit is contained in:
parent
6a19ec48df
commit
119c432344
7 changed files with 10 additions and 29 deletions
|
|
@ -35,8 +35,7 @@ public final class AtomwheelAcrobats extends CardImpl {
|
|||
this.addAbility(new AtomwheelAcrobatsTriggeredAbility());
|
||||
|
||||
// {2}{G}: Roll a six-sided die.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(null, 6), new ManaCostsImpl<>("{2}{G}"));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SimpleActivatedAbility(new RollDiceEffect(6), new ManaCostsImpl<>("{2}{G}")));
|
||||
}
|
||||
|
||||
private AtomwheelAcrobats(final AtomwheelAcrobats card) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
|
|
@ -47,7 +46,7 @@ public final class ChickenALaKing extends CardImpl {
|
|||
this.addAbility(new ChickenALaKingTriggeredAbility());
|
||||
|
||||
// Tap an untapped Bird you control: Roll a six-sided die.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(null, Outcome.Benefit, 6), new TapTargetCost(new TargetControlledPermanent(1, 1, filter, false))));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(6), new TapTargetCost(new TargetControlledPermanent(1, 1, filter, false))));
|
||||
}
|
||||
|
||||
private ChickenALaKing(final ChickenALaKing card) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public final class MonoxaMidwayManager extends CardImpl {
|
|||
this.addAbility(new MonoxaMidwayManagerTriggeredAbility());
|
||||
|
||||
// {6}: Roll a six-sided die.
|
||||
this.addAbility(new SimpleActivatedAbility(new RollDiceEffect(null, 6), new GenericManaCost(6)));
|
||||
this.addAbility(new SimpleActivatedAbility(new RollDiceEffect(6), new GenericManaCost(6)));
|
||||
}
|
||||
|
||||
private MonoxaMidwayManager(final MonoxaMidwayManager card) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class SteelSquirrel extends CardImpl {
|
|||
this.addAbility(new SteelSquirrelTriggeredAbility());
|
||||
|
||||
// 6: Roll a six-sided die.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(null, 6), new GenericManaCost(6));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(6), new GenericManaCost(6));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class VexingPuzzlebox extends CardImpl {
|
|||
|
||||
// {T}: Add one mana of any color. Roll a d20.
|
||||
AnyColorManaAbility manaAbility = new AnyColorManaAbility();
|
||||
manaAbility.addEffect(new RollDiceEffect(null, 20).setText("Roll a d20"));
|
||||
manaAbility.addEffect(new RollDiceEffect(20).setText("Roll a d20"));
|
||||
manaAbility.setUndoPossible(false);
|
||||
this.addAbility(manaAbility);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public final class WillingTestSubject extends CardImpl {
|
|||
this.addAbility(new WillingTestSubjectTriggeredAbility());
|
||||
|
||||
// 6: Roll a six-sided die.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(null, 6), new GenericManaCost(6));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(6), new GenericManaCost(6));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
|
|
@ -16,36 +13,22 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class RollDiceEffect extends OneShotEffect {
|
||||
|
||||
protected Effects executingEffects = new Effects();
|
||||
protected int numSides;
|
||||
|
||||
public RollDiceEffect(Effect effect, int numSides) {
|
||||
this(effect, Outcome.Neutral, numSides);
|
||||
}
|
||||
|
||||
public RollDiceEffect(Effect effect, Outcome outcome, int numSides) {
|
||||
super(outcome);
|
||||
addEffect(effect);
|
||||
public RollDiceEffect(int numSides) {
|
||||
super(Outcome.Benefit);
|
||||
this.numSides = numSides;
|
||||
}
|
||||
|
||||
protected RollDiceEffect(final RollDiceEffect effect) {
|
||||
super(effect);
|
||||
this.executingEffects = effect.executingEffects.copy();
|
||||
this.numSides = effect.numSides;
|
||||
}
|
||||
|
||||
public void addEffect(Effect effect) {
|
||||
if (effect != null) {
|
||||
executingEffects.add(effect);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject mageObject = game.getObject(source);
|
||||
if (controller != null && mageObject != null) {
|
||||
if (controller != null) {
|
||||
controller.rollDice(outcome, source, game, numSides);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -57,7 +40,7 @@ public class RollDiceEffect extends OneShotEffect {
|
|||
if (!staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "Roll a " + CardUtil.numberToText(numSides) + "-sided die";
|
||||
return "roll a " + CardUtil.numberToText(numSides) + "-sided die";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue