mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
remove unnecessary args from RollDiceEffect
This commit is contained in:
parent
6a19ec48df
commit
119c432344
7 changed files with 10 additions and 29 deletions
|
|
@ -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