Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 2 additions & 36 deletions Mage.Sets/src/mage/cards/b/Blustersquall.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -29,11 +21,10 @@ public Blustersquall(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand All @@ -45,28 +36,3 @@ public Blustersquall copy() {
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);
}
}
7 changes: 2 additions & 5 deletions Mage.Sets/src/mage/cards/b/BreakTheIce.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -34,11 +33,9 @@ public BreakTheIce(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand Down
47 changes: 3 additions & 44 deletions Mage.Sets/src/mage/cards/c/ChemistersTrick.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -33,14 +24,10 @@ public ChemistersTrick(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand All @@ -52,31 +39,3 @@ public ChemistersTrick copy() {
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);
}
}
15 changes: 2 additions & 13 deletions Mage.Sets/src/mage/cards/c/CorporealProjection.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,17 +20,9 @@ public CorporealProjection(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand Down
50 changes: 4 additions & 46 deletions Mage.Sets/src/mage/cards/c/Counterflux.java
Original file line number Diff line number Diff line change
@@ -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;


/**
*
Expand All @@ -49,11 +43,9 @@ public Counterflux(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand All @@ -65,37 +57,3 @@ public Counterflux copy() {
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);
}

}
10 changes: 2 additions & 8 deletions Mage.Sets/src/mage/cards/c/CyclonicRift.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -29,13 +27,9 @@ public CyclonicRift(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand Down
14 changes: 3 additions & 11 deletions Mage.Sets/src/mage/cards/d/Damn.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,16 +20,10 @@ public Damn(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand Down
10 changes: 2 additions & 8 deletions Mage.Sets/src/mage/cards/d/Downsize.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -25,12 +22,9 @@ public Downsize(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand Down
Loading