mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
This commit is contained in:
parent
e22648a385
commit
80c9c33b78
7 changed files with 100 additions and 109 deletions
|
|
@ -6,6 +6,7 @@ import mage.abilities.effects.common.combat.GoadAllEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -17,7 +18,7 @@ public final class DisruptDecorum extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
|
||||
|
||||
// Goad all creatures you don't control.
|
||||
this.getSpellAbility().addEffect(new GoadAllEffect());
|
||||
this.getSpellAbility().addEffect(new GoadAllEffect(StaticFilters.FILTER_CREATURES_YOU_DONT_CONTROL));
|
||||
}
|
||||
|
||||
private DisruptDecorum(final DisruptDecorum card) {
|
||||
|
|
|
|||
|
|
@ -3,19 +3,16 @@ package mage.cards.g;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.combat.GoadTargetEffect;
|
||||
import mage.abilities.effects.common.combat.GoadAllEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -24,6 +21,12 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class GeodeRager extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(TargetController.SOURCE_TARGETS.getControllerPredicate());
|
||||
}
|
||||
|
||||
public GeodeRager(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
|
||||
|
||||
|
|
@ -35,7 +38,7 @@ public final class GeodeRager extends CardImpl {
|
|||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// Landfall — Whenever a land enters the battlefield under your control, goad each creature target player controls.
|
||||
Ability ability = new LandfallAbility(new GeodeRagerEffect());
|
||||
Ability ability = new LandfallAbility(new GoadAllEffect(filter).setText("goad each creature target player controls"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -49,33 +52,3 @@ public final class GeodeRager extends CardImpl {
|
|||
return new GeodeRager(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GeodeRagerEffect extends OneShotEffect {
|
||||
|
||||
GeodeRagerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "goad each creature target player controls";
|
||||
}
|
||||
|
||||
private GeodeRagerEffect(final GeodeRagerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeodeRagerEffect copy() {
|
||||
return new GeodeRagerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, source.getFirstTarget(), source, game
|
||||
)) {
|
||||
if (permanent == null) {
|
||||
continue;
|
||||
}
|
||||
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import mage.game.events.DamagedEvent;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -126,12 +127,11 @@ class KomainuBattleArmorEffect extends OneShotEffect {
|
|||
if (playerId == null) {
|
||||
return false;
|
||||
}
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
playerId, source, game
|
||||
)) {
|
||||
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source);
|
||||
}
|
||||
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTargets(
|
||||
game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, playerId, source, game
|
||||
), game
|
||||
)), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,21 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||
import mage.abilities.effects.common.combat.GoadTargetEffect;
|
||||
import mage.abilities.effects.common.combat.GoadAllEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterInstantOrSorceryCard;
|
||||
import mage.filter.predicate.mageobject.MonocoloredPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -30,9 +26,11 @@ public final class MaestrosConfluence extends CardImpl {
|
|||
|
||||
private static final FilterCard filter
|
||||
= new FilterInstantOrSorceryCard("monocolored instant or sorcery card from your graveyard");
|
||||
private static final FilterPermanent filter2 = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(MonocoloredPredicate.instance);
|
||||
filter2.add(TargetController.SOURCE_TARGETS.getControllerPredicate());
|
||||
}
|
||||
|
||||
public MaestrosConfluence(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
@ -53,7 +51,7 @@ public final class MaestrosConfluence extends CardImpl {
|
|||
).addTarget(new TargetCreaturePermanent()));
|
||||
|
||||
// • Goad each creature target player controls.
|
||||
this.getSpellAbility().addMode(new Mode(new MaestrosConfluenceEffect()).addTarget(new TargetPlayer()));
|
||||
this.getSpellAbility().addMode(new Mode(new GoadAllEffect(filter2).setText("goad each creature target player controls")).addTarget(new TargetPlayer()));
|
||||
}
|
||||
|
||||
private MaestrosConfluence(final MaestrosConfluence card) {
|
||||
|
|
@ -65,30 +63,3 @@ public final class MaestrosConfluence extends CardImpl {
|
|||
return new MaestrosConfluence(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MaestrosConfluenceEffect extends OneShotEffect {
|
||||
|
||||
MaestrosConfluenceEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "goad each creature target player controls";
|
||||
}
|
||||
|
||||
private MaestrosConfluenceEffect(final MaestrosConfluenceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaestrosConfluenceEffect copy() {
|
||||
return new MaestrosConfluenceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, source.getFirstTarget(), source, game
|
||||
)) {
|
||||
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ import mage.constants.*;
|
|||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -104,12 +103,15 @@ class MarisiBreakerOfTheCoilEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE,
|
||||
targetPointer.getFirst(game, source), game
|
||||
)) {
|
||||
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source);
|
||||
UUID playerId = getTargetPointer().getFirst(game, source);
|
||||
if (playerId == null) {
|
||||
return false;
|
||||
}
|
||||
game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTargets(
|
||||
game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, playerId, source, game
|
||||
), game
|
||||
)), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,36 @@
|
|||
package mage.abilities.effects.common.combat;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class GoadAllEffect extends OneShotEffect {
|
||||
public class GoadAllEffect extends ContinuousEffectImpl {
|
||||
|
||||
public GoadAllEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Goad all creatures you don't control. <i>(Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)</i>";
|
||||
private final FilterPermanent filter;
|
||||
|
||||
public GoadAllEffect(FilterPermanent filter) {
|
||||
this(Duration.UntilYourNextTurn, filter);
|
||||
}
|
||||
|
||||
public GoadAllEffect(final GoadAllEffect effect) {
|
||||
public GoadAllEffect(Duration duration, FilterPermanent filter) {
|
||||
super(duration, Layer.RulesEffects, SubLayer.NA, Outcome.Detriment);
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
private GoadAllEffect(final GoadAllEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -28,15 +38,43 @@ public class GoadAllEffect extends OneShotEffect {
|
|||
return new GoadAllEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
game.getBattlefield()
|
||||
.getActivePermanents(
|
||||
filter, source.getControllerId(), source, game
|
||||
).stream()
|
||||
.map(permanent -> new MageObjectReference(permanent, game))
|
||||
.forEach(this.affectedObjectList::add);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
|
||||
if (!creature.isControlledBy(source.getControllerId())) {
|
||||
Effect effect = new GoadTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||
effect.apply(game, source);
|
||||
if (this.affectedObjectsSet) {
|
||||
this.affectedObjectList.removeIf(mor -> !mor.zoneCounterIsCurrent(game));
|
||||
if (affectedObjectList.isEmpty()) {
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
for (MageObjectReference mor : this.affectedObjectList) {
|
||||
mor.getPermanent(game).addGoadingPlayer(source.getControllerId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||
creature.addGoadingPlayer(source.getControllerId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "Goad all " + filter.getMessage() + ". <i>(Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)</i>";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
|
@ -39,20 +41,24 @@ public class GoadTargetEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (targetCreature != null && controller != null) {
|
||||
game.informPlayers(controller.getLogName() + " is goading " + targetCreature.getLogName());
|
||||
if (controller == null) {
|
||||
return;
|
||||
}
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent targetCreature = game.getPermanent(targetId);
|
||||
if (targetCreature != null) {
|
||||
game.informPlayers(controller.getLogName() + " is goading " + targetCreature.getLogName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature == null) {
|
||||
return false;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent targetCreature = game.getPermanent(targetId);
|
||||
targetCreature.addGoadingPlayer(source.getControllerId());
|
||||
}
|
||||
targetCreature.addGoadingPlayer(source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue