mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Merge 475768049e into a3e155918b
This commit is contained in:
commit
a1c50f1259
11 changed files with 94 additions and 193 deletions
|
|
@ -1,20 +1,12 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -29,11 +21,10 @@ public final class Blustersquall extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
|
||||
// Tap target creature you don't control.
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL));
|
||||
this.getSpellAbility().addEffect(new TapTargetEffect());
|
||||
|
||||
// Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
this.addAbility(new OverloadAbility(this, new BlustersqallTapAllEffect(), new ManaCostsImpl<>("{3}{U}")));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}"),
|
||||
new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL), new TapTargetEffect());
|
||||
}
|
||||
|
||||
private Blustersquall(final Blustersquall card) {
|
||||
|
|
@ -45,28 +36,3 @@ public final class Blustersquall extends CardImpl {
|
|||
return new Blustersquall(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BlustersqallTapAllEffect extends OneShotEffect {
|
||||
|
||||
BlustersqallTapAllEffect() {
|
||||
super(Outcome.Tap);
|
||||
staticText = "Tap each creature you don't control";
|
||||
}
|
||||
|
||||
private BlustersqallTapAllEffect(final BlustersqallTapAllEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, source.getControllerId(), source, game)) {
|
||||
creature.tap(source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlustersqallTapAllEffect copy() {
|
||||
return new BlustersqallTapAllEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -34,11 +33,9 @@ public final class BreakTheIce extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}");
|
||||
|
||||
// Destroy target land that is snow or could produce {C}.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
|
||||
// Overload {4}{B}{B}
|
||||
this.addAbility(new OverloadAbility(this, new DestroyAllEffect(filter), new ManaCostsImpl<>("{4}{B}{B}")));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{4}{B}{B}"),
|
||||
new TargetPermanent(filter), new DestroyTargetEffect());
|
||||
}
|
||||
|
||||
private BreakTheIce(final BreakTheIce card) {
|
||||
|
|
|
|||
|
|
@ -1,23 +1,14 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.combat.AttacksIfAbleTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -33,14 +24,10 @@ public final class ChemistersTrick extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{R}");
|
||||
|
||||
// Target creature you don't control gets -2/-0 until end of turn and attacks this turn if able.
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL));
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(-2, 0, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn).setText("and attacks this turn if able"));
|
||||
|
||||
// Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
OverloadAbility ability = new OverloadAbility(this, new BoostAllEffect(-2, 0, Duration.EndOfTurn, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false), new ManaCostsImpl<>("{3}{U}{R}"));
|
||||
ability.addEffect(new ChemistersTrickEffect());
|
||||
this.addAbility(ability);
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}{R}"),
|
||||
new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL), new BoostTargetEffect(-2, 0, Duration.EndOfTurn),
|
||||
new AttacksIfAbleTargetEffect(Duration.EndOfTurn).setText("and attacks this turn if able"));
|
||||
}
|
||||
|
||||
private ChemistersTrick(final ChemistersTrick card) {
|
||||
|
|
@ -52,31 +39,3 @@ public final class ChemistersTrick extends CardImpl {
|
|||
return new ChemistersTrick(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ChemistersTrickEffect extends OneShotEffect {
|
||||
|
||||
|
||||
ChemistersTrickEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
staticText = "each creature you don't control attacks this turn if able";
|
||||
}
|
||||
|
||||
private ChemistersTrickEffect(final ChemistersTrickEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, source.getControllerId(), source, game)) {
|
||||
AttacksIfAbleTargetEffect effect = new AttacksIfAbleTargetEffect(Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChemistersTrickEffect copy() {
|
||||
return new ChemistersTrickEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.MyriadAbility;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -23,17 +20,9 @@ public final class CorporealProjection extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{R}");
|
||||
|
||||
// Target creature you control gains myriad until end of turn.
|
||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new MyriadAbility(false)));
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
|
||||
// Overload {3}{U}{U}{R}{R}
|
||||
this.addAbility(new OverloadAbility(
|
||||
this,
|
||||
new GainAbilityAllEffect(
|
||||
new MyriadAbility(false), Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE
|
||||
), new ManaCostsImpl<>("{3}{U}{U}{R}{R}")
|
||||
));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}{U}{R}{R}"),
|
||||
new TargetControlledCreaturePermanent(), new GainAbilityTargetEffect(new MyriadAbility(false)));
|
||||
}
|
||||
|
||||
private CorporealProjection(final CorporealProjection card) {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,23 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CantBeCounteredSourceEffect;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -49,11 +43,9 @@ public final class Counterflux extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Counter target spell you don't control.
|
||||
this.getSpellAbility().addTarget(new TargetSpell(filter));
|
||||
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||
|
||||
// Overload {1}{U}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
this.addAbility(new OverloadAbility(this, new CounterfluxEffect(), new ManaCostsImpl<>("{1}{U}{U}{R}")));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{1}{U}{U}{R}"),
|
||||
new TargetSpell(filter), new CounterTargetEffect());
|
||||
}
|
||||
|
||||
private Counterflux(final Counterflux card) {
|
||||
|
|
@ -65,37 +57,3 @@ public final class Counterflux extends CardImpl {
|
|||
return new Counterflux(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CounterfluxEffect extends OneShotEffect {
|
||||
|
||||
CounterfluxEffect() {
|
||||
super(Outcome.Detriment);
|
||||
staticText = "Counter each spell you don't control.";
|
||||
|
||||
}
|
||||
|
||||
private CounterfluxEffect(final CounterfluxEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
||||
List<Spell> spellsToCounter = new LinkedList<>();
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
if (stackObject instanceof Spell && !stackObject.isControlledBy(source.getControllerId())) {
|
||||
spellsToCounter.add((Spell) stackObject);
|
||||
}
|
||||
}
|
||||
for (Spell spell : spellsToCounter) {
|
||||
game.getStack().counter(spell.getId(), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CounterfluxEffect copy() {
|
||||
return new CounterfluxEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -29,13 +27,9 @@ public final class CyclonicRift extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||
|
||||
// Return target nonland permanent you don't control to its owner's hand.
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
|
||||
// Overload {6}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
Effect effect = new ReturnToHandFromBattlefieldAllEffect(filter);
|
||||
effect.setText("Return each nonland permanent you don't control to its owner's hand");
|
||||
this.addAbility(new OverloadAbility(this, effect, new ManaCostsImpl<>("{6}{U}")));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{6}{U}"),
|
||||
new TargetPermanent(filter), new ReturnToHandTargetEffect());
|
||||
}
|
||||
|
||||
private CyclonicRift(final CyclonicRift card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -22,16 +20,10 @@ public final class Damn extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}");
|
||||
|
||||
// Destroy target creature. A creature destroyed this way can’t be regenerated.
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true)
|
||||
.setText("destroy target creature. A creature destroyed this way can't be regenerated"));
|
||||
|
||||
// Overload {2}{W}{W} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of “target” with “each.”)
|
||||
this.addAbility(new OverloadAbility(
|
||||
this,
|
||||
new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES, true),
|
||||
new ManaCostsImpl<>("{2}{W}{W}")
|
||||
));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{W}{W}"),
|
||||
new TargetCreaturePermanent(), new DestroyTargetEffect(true)
|
||||
.setText("destroy target creature. A creature destroyed this way can't be regenerated"));
|
||||
}
|
||||
|
||||
private Damn(final Damn card) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -25,12 +22,9 @@ public final class Downsize extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
|
||||
// Target creature you don't control gets -4/-0 until end of turn.
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL));
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(-4, 0, Duration.EndOfTurn));
|
||||
|
||||
// Overload {2}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
this.addAbility(new OverloadAbility(this, new BoostAllEffect(-4, 0, Duration.EndOfTurn, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false), new ManaCostsImpl<>("{2}{U}")));
|
||||
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{U}"),
|
||||
new TargetPermanent(FILTER_CREATURE_YOU_DONT_CONTROL), new BoostTargetEffect(-4, 0, Duration.EndOfTurn));
|
||||
}
|
||||
|
||||
private Downsize(final Downsize card) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.LoseAllAbilitiesAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -39,18 +36,9 @@ public final class Dragonshift extends CardImpl {
|
|||
true, false, Duration.EndOfTurn)
|
||||
.withDurationRuleAtStart(true);
|
||||
effect.setText("Until end of turn, target creature you control becomes a blue and red Dragon with base power and toughness 4/4, loses all abilities, and gains flying.");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
|
||||
// Overload {3}{U}{U}{R}{R}
|
||||
Ability ability = new OverloadAbility(this, new LoseAllAbilitiesAllEffect(new FilterControlledCreaturePermanent(""), Duration.EndOfTurn), new ManaCostsImpl<>("{3}{U}{U}{R}{R}"));
|
||||
ability.addEffect(new BecomesCreatureAllEffect(
|
||||
new CreatureToken(4, 4, "blue and red Dragon with base power and toughness 4/4 and with flying")
|
||||
.withColor("UR")
|
||||
.withSubType(SubType.DRAGON)
|
||||
.withAbility(FlyingAbility.getInstance()),
|
||||
null, filter, Duration.EndOfTurn, true, false, true));
|
||||
this.addAbility(ability);
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{3}{U}{U}{R}{R}"),
|
||||
new TargetControlledCreaturePermanent(), effect);
|
||||
}
|
||||
|
||||
private Dragonshift(final Dragonshift card) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.OverloadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -12,6 +10,8 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -23,11 +23,9 @@ public final class Dynacharge extends CardImpl {
|
|||
|
||||
|
||||
// Target creature you control gets +2/+0 until end of turn.
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(2,0, Duration.EndOfTurn));
|
||||
|
||||
// Overload {2}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
this.addAbility(new OverloadAbility(this, new BoostControlledEffect(2,0, Duration.EndOfTurn), new ManaCostsImpl<>("{2}{R}")));
|
||||
OverloadAbility.ImplementOverloadAbility(this, new ManaCostsImpl<>("{2}{R}"),
|
||||
new TargetControlledCreaturePermanent(), new BoostTargetEffect(2,0, Duration.EndOfTurn));
|
||||
}
|
||||
|
||||
private Dynacharge(final Dynacharge card) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.game.Game;
|
||||
import mage.target.Target;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 702.94. Overload
|
||||
|
|
@ -30,6 +40,26 @@ import mage.constants.TimingRule;
|
|||
*/
|
||||
public class OverloadAbility extends SpellAbility {
|
||||
|
||||
public static void ImplementOverloadAbility(Card card, ManaCosts costs, Target target, Effect... effects) {
|
||||
card.getSpellAbility().addTarget(target.copy());
|
||||
Ability overload = new OverloadAbility(card, costs);
|
||||
for (Effect effect : effects) {
|
||||
card.getSpellAbility().addEffect(effect.copy());
|
||||
OverloadedEffect overloadEffect = new OverloadedEffect(effect, target.copy());
|
||||
overloadEffect.setText(effect.getText(card.getSpellAbility().getModes().getMode())
|
||||
.replace("target", "each"));
|
||||
overload.addEffect(overloadEffect);
|
||||
}
|
||||
card.addAbility(overload);
|
||||
}
|
||||
|
||||
public OverloadAbility(Card card, ManaCosts costs) {
|
||||
super(costs, card.getName() + " with overload");
|
||||
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
|
||||
this.timing = (card.isSorcery(null) ? TimingRule.SORCERY : TimingRule.INSTANT);
|
||||
}
|
||||
|
||||
//TODO: Remove once all Overload cards have been converted
|
||||
public OverloadAbility(Card card, Effect effect, ManaCosts costs) {
|
||||
super(costs, card.getName() + " with overload");
|
||||
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
|
||||
|
|
@ -57,3 +87,39 @@ public class OverloadAbility extends SpellAbility {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class OverloadedEffect extends OneShotEffect {
|
||||
Effect innerEffect;
|
||||
Target target;
|
||||
|
||||
public OverloadedEffect(Effect innerEffect, Target target) {
|
||||
super(Outcome.Benefit);
|
||||
this.innerEffect = innerEffect;
|
||||
this.target = target.withNotTarget(true);
|
||||
}
|
||||
|
||||
protected OverloadedEffect(final OverloadedEffect effect) {
|
||||
super(effect);
|
||||
this.innerEffect = effect.innerEffect;
|
||||
this.target = effect.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
innerEffect.setTargetPointer(new FixedTargets(
|
||||
target.possibleTargets(source.getControllerId(), source, game)
|
||||
.stream().map(id -> new MageObjectReference(id, game))
|
||||
.collect(Collectors.toSet())));
|
||||
if (innerEffect instanceof OneShotEffect) {
|
||||
return innerEffect.apply(game, source);
|
||||
} else {
|
||||
game.addEffect((ContinuousEffect) innerEffect, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OverloadedEffect copy() {
|
||||
return new OverloadedEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue