[C21] Implemented Paradox Zone

This commit is contained in:
Evan Kranzler 2021-04-08 09:03:28 -04:00
parent fd9b055fd3
commit 689efae076
8 changed files with 108 additions and 47 deletions

View file

@ -0,0 +1,43 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author TheElk801
*/
public class DoubleCountersSourceEffect extends OneShotEffect {
private final CounterType counterType;
public DoubleCountersSourceEffect(CounterType counterType) {
super(Outcome.Benefit);
staticText = "double the number of " + counterType.getName() + " counters on {this}";
this.counterType = counterType;
}
private DoubleCountersSourceEffect(final DoubleCountersSourceEffect effect) {
super(effect);
this.counterType = effect.counterType;
}
@Override
public DoubleCountersSourceEffect copy() {
return new DoubleCountersSourceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null) {
return false;
}
return permanent.addCounters(counterType.createInstance(
permanent.getCounters(game).getCount(counterType)
), source.getControllerId(), source, game);
}
}

View file

@ -1,39 +0,0 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author TheElk801
*/
public class DoubleP1P1CountersSourceEffect extends OneShotEffect {
public DoubleP1P1CountersSourceEffect() {
super(Outcome.Benefit);
staticText = "double the number of +1/+1 counters on {this}";
}
private DoubleP1P1CountersSourceEffect(final DoubleP1P1CountersSourceEffect effect) {
super(effect);
}
@Override
public DoubleP1P1CountersSourceEffect copy() {
return new DoubleP1P1CountersSourceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null) {
return false;
}
return permanent.addCounters(CounterType.P1P1.createInstance(
permanent.getCounters(game).getCount(CounterType.P1P1)
), source.getControllerId(), source, game);
}
}