[J25] Implement Slinza, the Spiked Stampede

This commit is contained in:
theelk801 2024-11-14 11:27:55 -05:00
parent 405a6d7c2a
commit a609d044ec
15 changed files with 308 additions and 604 deletions

View file

@ -2,20 +2,20 @@ package mage.cards.a;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashAllEffect; import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashAllEffect;
import mage.abilities.keyword.DayboundAbility; import mage.abilities.keyword.DayboundAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken; import mage.game.permanent.token.WolfToken;
import java.util.UUID; import java.util.UUID;
@ -42,7 +42,9 @@ public final class ArlinnThePacksHope extends CardImpl {
Ability ability = new LoyaltyAbility(new CastAsThoughItHadFlashAllEffect( Ability ability = new LoyaltyAbility(new CastAsThoughItHadFlashAllEffect(
Duration.UntilYourNextTurn, filter Duration.UntilYourNextTurn, filter
).setText("until your next turn, you may cast creature spells as though they had flash"), 1); ).setText("until your next turn, you may cast creature spells as though they had flash"), 1);
ability.addEffect(new ArlinnThePacksHopeEffect()); ability.addEffect(new EntersWithCountersControlledEffect(
StaticFilters.FILTER_PERMANENT_CREATURE, CounterType.P1P1.createInstance(), false
));
this.addAbility(ability); this.addAbility(ability);
// 3: Create two 2/2 green Wolf creature tokens. // 3: Create two 2/2 green Wolf creature tokens.
@ -58,40 +60,3 @@ public final class ArlinnThePacksHope extends CardImpl {
return new ArlinnThePacksHope(this); return new ArlinnThePacksHope(this);
} }
} }
class ArlinnThePacksHopeEffect extends ReplacementEffectImpl {
ArlinnThePacksHopeEffect() {
super(Duration.UntilYourNextTurn, Outcome.BoostCreature);
this.staticText = ", and each creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private ArlinnThePacksHopeEffect(ArlinnThePacksHopeEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(game);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent target = ((EntersTheBattlefieldEvent) event).getTarget();
if (target != null) {
target.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public ArlinnThePacksHopeEffect copy() {
return new ArlinnThePacksHopeEffect(this);
}
}

View file

@ -1,29 +1,29 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.filter.common.FilterCreaturePermanent;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent; import java.util.UUID;
import mage.game.permanent.Permanent;
/** /**
*
* @author emerald000 * @author emerald000
*/ */
public final class BramblewoodParagon extends CardImpl { public final class BramblewoodParagon extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.WARRIOR, "Warrior creature");
public BramblewoodParagon(UUID ownerId, CardSetInfo setInfo) { public BramblewoodParagon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add(SubType.ELF, SubType.WARRIOR); this.subtype.add(SubType.ELF, SubType.WARRIOR);
@ -31,17 +31,15 @@ public final class BramblewoodParagon extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Each other Warrior creature you control enters the battlefield with an additional +1/+1 counter on it. // Each other Warrior creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BramblewoodParagonReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
filter, CounterType.P1P1.createInstance(), true
)));
// Each creature you control with a +1/+1 counter on it has trample. // Each creature you control with a +1/+1 counter on it has trample.
this.addAbility(new SimpleStaticAbility( this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(
Zone.BATTLEFIELD, TrampleAbility.getInstance(), Duration.WhileOnBattlefield,
new GainAbilityAllEffect( StaticFilters.FILTER_EACH_CONTROLLED_CREATURE_P1P1
TrampleAbility.getInstance(), )));
Duration.WhileOnBattlefield,
StaticFilters.FILTER_EACH_CONTROLLED_CREATURE_P1P1)
)
);
} }
@ -54,43 +52,3 @@ public final class BramblewoodParagon extends CardImpl {
return new BramblewoodParagon(this); return new BramblewoodParagon(this);
} }
} }
class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl {
BramblewoodParagonReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "Each other Warrior creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private BramblewoodParagonReplacementEffect(final BramblewoodParagonReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
return creature != null && creature.isControlledBy(source.getControllerId())
&& creature.isCreature(game)
&& creature.hasSubtype(SubType.WARRIOR, game)
&& !event.getTargetId().equals(source.getSourceId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public BramblewoodParagonReplacementEffect copy() {
return new BramblewoodParagonReplacementEffect(this);
}
}

View file

@ -6,7 +6,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -15,10 +15,9 @@ import mage.constants.Outcome;
import mage.constants.SubType; import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -43,9 +42,10 @@ public final class CombineGuildmage extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// {1}{G}, {T}: This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it. // {1}{G}, {T}: This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it.
Ability ability = new SimpleActivatedAbility( Ability ability = new SimpleActivatedAbility(new EntersWithCountersControlledEffect(
new CombineGuildmageReplacementEffect(), new ManaCostsImpl<>("{1}{G}") Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE,
); CounterType.P1P1.createInstance(), false
), new ManaCostsImpl<>("{1}{G}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
this.addAbility(ability); this.addAbility(ability);
@ -69,43 +69,6 @@ public final class CombineGuildmage extends CardImpl {
} }
} }
class CombineGuildmageReplacementEffect extends ReplacementEffectImpl {
CombineGuildmageReplacementEffect() {
super(Duration.EndOfTurn, Outcome.BoostCreature);
this.staticText = "This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private CombineGuildmageReplacementEffect(CombineGuildmageReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(game);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent target = ((EntersTheBattlefieldEvent) event).getTarget();
if (target != null) {
target.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public CombineGuildmageReplacementEffect copy() {
return new CombineGuildmageReplacementEffect(this);
}
}
class CombineGuildmageCounterEffect extends OneShotEffect { class CombineGuildmageCounterEffect extends OneShotEffect {
CombineGuildmageCounterEffect() { CombineGuildmageCounterEffect() {

View file

@ -1,26 +1,27 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.filter.FilterPermanent;
import mage.game.events.EntersTheBattlefieldEvent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import java.util.UUID;
/** /**
* @author nantuko * @author nantuko
*/ */
public final class DearlyDeparted extends CardImpl { public final class DearlyDeparted extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.HUMAN, "Human creature");
public DearlyDeparted(UUID ownerId, CardSetInfo setInfo) { public DearlyDeparted(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}");
this.subtype.add(SubType.SPIRIT); this.subtype.add(SubType.SPIRIT);
@ -31,7 +32,9 @@ public final class DearlyDeparted extends CardImpl {
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it. // As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new DearlyDepartedEntersBattlefieldEffect())); this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new EntersWithCountersControlledEffect(
filter, CounterType.P1P1.createInstance(), false
).setText("as long as {this} is in your graveyard, each Human creature you control enters with an additional +1/+1 counter on it")));
} }
private DearlyDeparted(final DearlyDeparted card) { private DearlyDeparted(final DearlyDeparted card) {
@ -43,44 +46,3 @@ public final class DearlyDeparted extends CardImpl {
return new DearlyDeparted(this); return new DearlyDeparted(this);
} }
} }
class DearlyDepartedEntersBattlefieldEffect extends ReplacementEffectImpl {
DearlyDepartedEntersBattlefieldEffect() {
super(Duration.WhileInGraveyard, Outcome.BoostCreature);
staticText = "As long as {this} is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private DearlyDepartedEntersBattlefieldEffect(final DearlyDepartedEntersBattlefieldEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
if (permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.hasSubtype(SubType.HUMAN, game)) {
return true;
}
return false;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent target = ((EntersTheBattlefieldEvent) event).getTarget();
if (target != null) {
target.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public DearlyDepartedEntersBattlefieldEffect copy() {
return new DearlyDepartedEntersBattlefieldEffect(this);
}
}

View file

@ -1,17 +1,17 @@
package mage.cards.g; package mage.cards.g;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.filter.FilterPermanent;
import mage.game.events.EntersTheBattlefieldEvent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.events.GameEvent; import mage.filter.predicate.Predicates;
import mage.game.permanent.Permanent;
import java.util.UUID; import java.util.UUID;
@ -20,6 +20,12 @@ import java.util.UUID;
*/ */
public final class GrumgullyTheGenerous extends CardImpl { public final class GrumgullyTheGenerous extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("non-Human creature");
static {
filter.add(Predicates.not(SubType.HUMAN.getPredicate()));
}
public GrumgullyTheGenerous(UUID ownerId, CardSetInfo setInfo) { public GrumgullyTheGenerous(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}");
@ -30,7 +36,9 @@ public final class GrumgullyTheGenerous extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Each other non-Human creature you control enters the battlefield with an additional +1/+1 counter on it. // Each other non-Human creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(new GrumgullyTheGenerousReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
filter, CounterType.P1P1.createInstance(), true
)));
} }
private GrumgullyTheGenerous(final GrumgullyTheGenerous card) { private GrumgullyTheGenerous(final GrumgullyTheGenerous card) {
@ -42,45 +50,3 @@ public final class GrumgullyTheGenerous extends CardImpl {
return new GrumgullyTheGenerous(this); return new GrumgullyTheGenerous(this);
} }
} }
class GrumgullyTheGenerousReplacementEffect extends ReplacementEffectImpl {
GrumgullyTheGenerousReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "Each other non-Human creature you control " +
"enters the battlefield with an additional +1/+1 counter on it.";
}
private GrumgullyTheGenerousReplacementEffect(final GrumgullyTheGenerousReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
return creature != null
&& creature.isCreature(game)
&& !source.getSourceId().equals(creature.getId())
&& creature.isControlledBy(source.getControllerId())
&& !creature.hasSubtype(SubType.HUMAN, game);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public GrumgullyTheGenerousReplacementEffect copy() {
return new GrumgullyTheGenerousReplacementEffect(this);
}
}

View file

@ -1,37 +1,36 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SuperType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.filter.StaticFilters;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.KorAllyToken; import mage.game.permanent.token.KorAllyToken;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class OathOfGideon extends CardImpl { public final class OathOfGideon extends CardImpl {
public OathOfGideon(UUID ownerId, CardSetInfo setInfo) { public OathOfGideon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.supertype.add(SuperType.LEGENDARY); this.supertype.add(SuperType.LEGENDARY);
// When Oath of Gideon enters the battlefield, create two 1/1 Kor Ally creature tokens. // When Oath of Gideon enters the battlefield, create two 1/1 Kor Ally creature tokens.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KorAllyToken(), 2), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KorAllyToken(), 2), false));
// Each planeswalker you control enters the battlefield with an additional loyalty counter on it. // Each planeswalker you control enters the battlefield with an additional loyalty counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OathOfGideonReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
StaticFilters.FILTER_PERMANENT_PLANESWALKER,
CounterType.LOYALTY.createInstance(), false
)));
} }
private OathOfGideon(final OathOfGideon card) { private OathOfGideon(final OathOfGideon card) {
@ -43,42 +42,3 @@ public final class OathOfGideon extends CardImpl {
return new OathOfGideon(this); return new OathOfGideon(this);
} }
} }
class OathOfGideonReplacementEffect extends ReplacementEffectImpl {
OathOfGideonReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "Each planeswalker you control enters the battlefield with an additional loyalty counter on it";
}
private OathOfGideonReplacementEffect(final OathOfGideonReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
return creature != null && creature.isControlledBy(source.getControllerId())
&& creature.isPlaneswalker(game)
&& !event.getTargetId().equals(source.getSourceId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.LOYALTY.createInstance(), source.getControllerId(), source, game);
}
return false;
}
@Override
public OathOfGideonReplacementEffect copy() {
return new OathOfGideonReplacementEffect(this);
}
}

View file

@ -1,32 +1,36 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamagedPlayerEvent; import mage.game.events.DamagedPlayerEvent;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class OonasBlackguard extends CardImpl { public final class OonasBlackguard extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.ROGUE, "Rogue creature");
public OonasBlackguard(UUID ownerId, CardSetInfo setInfo) { public OonasBlackguard(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.FAERIE); this.subtype.add(SubType.FAERIE);
@ -36,12 +40,14 @@ public final class OonasBlackguard extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it. // Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OonasBlackguardReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
filter, CounterType.P1P1.createInstance(), true
)));
// Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card. // Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card.
this.addAbility(new OonasBlackguardTriggeredAbility()); this.addAbility(new OonasBlackguardTriggeredAbility());
} }
private OonasBlackguard(final OonasBlackguard card) { private OonasBlackguard(final OonasBlackguard card) {
@ -54,49 +60,6 @@ public final class OonasBlackguard extends CardImpl {
} }
} }
class OonasBlackguardReplacementEffect extends ReplacementEffectImpl {
OonasBlackguardReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private OonasBlackguardReplacementEffect(final OonasBlackguardReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null && creature.isControlledBy(source.getControllerId())
&& creature.isCreature(game)
&& creature.hasSubtype(SubType.ROGUE, game)
&& !event.getTargetId().equals(source.getSourceId())) {
return true;
}
return false;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public OonasBlackguardReplacementEffect copy() {
return new OonasBlackguardReplacementEffect(this);
}
}
class OonasBlackguardTriggeredAbility extends TriggeredAbilityImpl { class OonasBlackguardTriggeredAbility extends TriggeredAbilityImpl {
public OonasBlackguardTriggeredAbility() { public OonasBlackguardTriggeredAbility() {
@ -135,5 +98,4 @@ class OonasBlackguardTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() { public String getRule() {
return "Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card."; return "Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card.";
} }
} }

View file

@ -1,19 +1,18 @@
package mage.cards.r; package mage.cards.r;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect; import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.filter.StaticFilters;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID; import java.util.UUID;
@ -38,7 +37,9 @@ public final class RenataCalledToTheHunt extends CardImpl {
).addHint(DevotionCount.G.getHint())); ).addHint(DevotionCount.G.getHint()));
// Each other creature you control enters the battlefield with an additional +1/+1 counter on it. // Each other creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(new RenataCalledToTheHuntReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
StaticFilters.FILTER_PERMANENT_CREATURE, CounterType.P1P1.createInstance(), true
)));
} }
private RenataCalledToTheHunt(final RenataCalledToTheHunt card) { private RenataCalledToTheHunt(final RenataCalledToTheHunt card) {
@ -50,43 +51,3 @@ public final class RenataCalledToTheHunt extends CardImpl {
return new RenataCalledToTheHunt(this); return new RenataCalledToTheHunt(this);
} }
} }
class RenataCalledToTheHuntReplacementEffect extends ReplacementEffectImpl {
RenataCalledToTheHuntReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "Each other creature you control enters the battlefield with an additional +1/+1 counter on it.";
}
private RenataCalledToTheHuntReplacementEffect(final RenataCalledToTheHuntReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
return creature != null
&& creature.isCreature(game)
&& !source.getSourceId().equals(creature.getId())
&& creature.isControlledBy(source.getControllerId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public RenataCalledToTheHuntReplacementEffect copy() {
return new RenataCalledToTheHuntReplacementEffect(this);
}
}

View file

@ -1,31 +1,31 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.RemoveCounterCost; import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.filter.FilterPermanent;
import mage.game.events.EntersTheBattlefieldEvent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class SageOfFables extends CardImpl { public final class SageOfFables extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.WIZARD, "Wizard creature");
public SageOfFables(UUID ownerId, CardSetInfo setInfo) { public SageOfFables(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.subtype.add(SubType.MERFOLK); this.subtype.add(SubType.MERFOLK);
@ -34,10 +34,12 @@ public final class SageOfFables extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Each other Wizard creature you control enters the battlefield with an additional +1/+1 counter on it. // Each other Wizard creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SageOfFablesReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
filter, CounterType.P1P1.createInstance(), true
)));
// {2}, Remove a +1/+1 counter from a creature you control: Draw a card. // {2}, Remove a +1/+1 counter from a creature you control: Draw a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2)); Ability ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new GenericManaCost(2));
ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.P1P1)); ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.P1P1));
this.addAbility(ability); this.addAbility(ability);
} }
@ -51,43 +53,3 @@ public final class SageOfFables extends CardImpl {
return new SageOfFables(this); return new SageOfFables(this);
} }
} }
class SageOfFablesReplacementEffect extends ReplacementEffectImpl {
SageOfFablesReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "Each other Wizard creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private SageOfFablesReplacementEffect(final SageOfFablesReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
return creature != null && creature.isControlledBy(source.getControllerId())
&& creature.isCreature(game)
&& creature.hasSubtype(SubType.WIZARD, game)
&& !event.getTargetId().equals(source.getSourceId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public SageOfFablesReplacementEffect copy() {
return new SageOfFablesReplacementEffect(this);
}
}

View file

@ -0,0 +1,73 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DoWhenCostPaid;
import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SlinzaTheSpikedStampede extends CardImpl {
private static final FilterCard filter = new FilterCard("Beast spells");
private static final FilterPermanent filter2 = new FilterCreaturePermanent(SubType.BEAST, "Beast creature");
private static final FilterPermanent filter3 = new FilterCreaturePermanent("creature with power 4 or greater");
static {
filter3.add(new PowerPredicate(ComparisonType.MORE_THAN, 3));
}
public SlinzaTheSpikedStampede(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.BEAST);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Beast spells you cast cost {2} less to cast.
this.addAbility(new SimpleStaticAbility(new SpellsCostReductionControllerEffect(filter, 2)));
// Each other Beast creature you control enters with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
filter2, CounterType.P1P1.createInstance(), true
)));
// Whenever Slinza or another creature with power 4 or greater enters, you may pay {1}{R/G}. When you do, Slinza fights target creature you don't control.
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new FightTargetSourceEffect(), false);
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(new EntersBattlefieldThisOrAnotherTriggeredAbility(new DoWhenCostPaid(
ability, new ManaCostsImpl<>("{1}{R/G}"), "Pay {1}{R/G}?"
), filter3, false, false));
}
private SlinzaTheSpikedStampede(final SlinzaTheSpikedStampede card) {
super(card);
}
@Override
public SlinzaTheSpikedStampede copy() {
return new SlinzaTheSpikedStampede(this);
}
}

View file

@ -8,7 +8,7 @@ import mage.abilities.costs.Cost;
import mage.abilities.costs.common.RemoveCounterCost; import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.MillCardsControllerEffect; import mage.abilities.effects.common.MillCardsControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -18,20 +18,18 @@ import mage.constants.*;
import mage.counters.Counter; import mage.counters.Counter;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterPermanentCard; import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.ManaValuePredicate; import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.filter.predicate.permanent.CounterAnyPredicate; import mage.filter.predicate.permanent.CounterAnyPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import java.util.HashSet;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
@ -51,15 +49,17 @@ public final class TayamLuminousEnigma extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Each other creature you control enters the battlefield with an additional vigilance counter on it. // Each other creature you control enters the battlefield with an additional vigilance counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TayamLuminousEnigmaReplacementEffect())); this.addAbility(new SimpleStaticAbility(new EntersWithCountersControlledEffect(
StaticFilters.FILTER_PERMANENT_CREATURE,
CounterType.VIGILANCE.createInstance(), true
)));
// {3}, Remove three counters from among creatures you control: Put the top three cards of your library into your graveyard, then return a permanent card with converted mana cost 3 or less from your graveyard to the battlefield. // {3}, Remove three counters from among creatures you control: Put the top three cards of your library into your graveyard, then return a permanent card with converted mana cost 3 or less from your graveyard to the battlefield.
MillCardsControllerEffect millEffect = new MillCardsControllerEffect(3); Ability ability = new SimpleActivatedAbility(
millEffect.concatBy("."); new MillCardsControllerEffect(3).concatBy("."), new GenericManaCost(3)
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, millEffect, new GenericManaCost(3)); );
ability.addCost(new TayamLuminousEnigmaCost()); ability.addCost(new TayamLuminousEnigmaCost());
TayamLuminousEnigmaEffect effect = new TayamLuminousEnigmaEffect(); ability.addEffect(new TayamLuminousEnigmaEffect());
ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);
} }
@ -192,43 +192,3 @@ class TayamLuminousEnigmaEffect extends OneShotEffect {
return player.moveCards(game.getCard(target.getFirstTarget()), Zone.BATTLEFIELD, source, game); return player.moveCards(game.getCard(target.getFirstTarget()), Zone.BATTLEFIELD, source, game);
} }
} }
class TayamLuminousEnigmaReplacementEffect extends ReplacementEffectImpl {
TayamLuminousEnigmaReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "Each other creature you control enters the battlefield with an additional vigilance counter on it.";
}
private TayamLuminousEnigmaReplacementEffect(final TayamLuminousEnigmaReplacementEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
return creature != null
&& creature.isCreature(game)
&& !source.getSourceId().equals(creature.getId())
&& creature.isControlledBy(source.getControllerId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(CounterType.VIGILANCE.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public TayamLuminousEnigmaReplacementEffect copy() {
return new TayamLuminousEnigmaReplacementEffect(this);
}
}

View file

@ -1,32 +1,25 @@
package mage.cards.v; package mage.cards.v;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.OpponentsLostLifeCondition; import mage.abilities.condition.common.OpponentsLostLifeCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.decorator.ConditionalReplacementEffect;
import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.abilities.keyword.MenaceAbility; import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate; import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent; import java.util.UUID;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/** /**
*
* @author weirddan455 * @author weirddan455
*/ */
public final class VampireSocialite extends CardImpl { public final class VampireSocialite extends CardImpl {
@ -57,7 +50,12 @@ public final class VampireSocialite extends CardImpl {
)); ));
// As long as an opponent lost life this turn, each other Vampire you control enters the battlefield with an additional +1/+1 counter on it. // As long as an opponent lost life this turn, each other Vampire you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(new VampireSocialiteReplacementEffect(filter))); this.addAbility(new SimpleStaticAbility(new ConditionalReplacementEffect(
new EntersWithCountersControlledEffect(
filter, CounterType.P1P1.createInstance(), true
), OpponentsLostLifeCondition.instance
).setText("as long as an opponent lost life this turn, " +
"each other Vampire you control enters the battlefield with an additional +1/+1 counter on it")));
} }
private VampireSocialite(final VampireSocialite card) { private VampireSocialite(final VampireSocialite card) {
@ -69,47 +67,3 @@ public final class VampireSocialite extends CardImpl {
return new VampireSocialite(this); return new VampireSocialite(this);
} }
} }
class VampireSocialiteReplacementEffect extends ReplacementEffectImpl {
private final FilterPermanent filter;
public VampireSocialiteReplacementEffect(FilterPermanent filter) {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
this.filter = filter;
staticText = "As long as an opponent lost life this turn, each other Vampire you control enters the battlefield with an additional +1/+1 counter on it";
}
private VampireSocialiteReplacementEffect(final VampireSocialiteReplacementEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public VampireSocialiteReplacementEffect copy() {
return new VampireSocialiteReplacementEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (OpponentsLostLifeCondition.instance.apply(game, source)) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
return permanent != null && filter.match(permanent, source.getControllerId(), source, game);
}
return false;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
}

View file

@ -1,26 +1,24 @@
package mage.cards.z; package mage.cards.z;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCounterCost; import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.EntersWithCountersControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.filter.StaticFilters;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class ZameckGuildmage extends CardImpl { public final class ZameckGuildmage extends CardImpl {
@ -32,10 +30,13 @@ public final class ZameckGuildmage extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// {G}{U}: This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it. // {G}{U}: This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ZameckGuildmageEntersBattlefieldEffect(), new ManaCostsImpl<>("{G}{U}"))); this.addAbility(new SimpleActivatedAbility(new EntersWithCountersControlledEffect(
Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE,
CounterType.P1P1.createInstance(), false
), new ManaCostsImpl<>("{G}{U}")));
// {G}{U}, Remove a +1/+1 counter from a creature you control: Draw a card. // {G}{U}, Remove a +1/+1 counter from a creature you control: Draw a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{G}{U}")); Ability ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{G}{U}"));
ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.P1P1)); ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.P1P1));
this.addAbility(ability); this.addAbility(ability);
} }
@ -49,40 +50,3 @@ public final class ZameckGuildmage extends CardImpl {
return new ZameckGuildmage(this); return new ZameckGuildmage(this);
} }
} }
class ZameckGuildmageEntersBattlefieldEffect extends ReplacementEffectImpl {
ZameckGuildmageEntersBattlefieldEffect() {
super(Duration.EndOfTurn, Outcome.BoostCreature);
this.staticText = "This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it";
}
private ZameckGuildmageEntersBattlefieldEffect(final ZameckGuildmageEntersBattlefieldEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
return permanent != null && permanent.isControlledBy(source.getControllerId()) && permanent.isCreature(game);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent target = ((EntersTheBattlefieldEvent) event).getTarget();
if (target != null) {
target.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
@Override
public ZameckGuildmageEntersBattlefieldEffect copy() {
return new ZameckGuildmageEntersBattlefieldEffect(this);
}
}

View file

@ -613,6 +613,7 @@ public final class FoundationsJumpstart extends ExpansionSet {
cards.add(new SetCardInfo("Skymarch Bloodletter", 125, Rarity.COMMON, mage.cards.s.SkymarchBloodletter.class)); cards.add(new SetCardInfo("Skymarch Bloodletter", 125, Rarity.COMMON, mage.cards.s.SkymarchBloodletter.class));
cards.add(new SetCardInfo("Slimebind", 360, Rarity.COMMON, mage.cards.s.Slimebind.class)); cards.add(new SetCardInfo("Slimebind", 360, Rarity.COMMON, mage.cards.s.Slimebind.class));
cards.add(new SetCardInfo("Slimy Piper", 25, Rarity.COMMON, mage.cards.s.SlimyPiper.class)); cards.add(new SetCardInfo("Slimy Piper", 25, Rarity.COMMON, mage.cards.s.SlimyPiper.class));
cards.add(new SetCardInfo("Slinza, the Spiked Stampede", 55, Rarity.RARE, mage.cards.s.SlinzaTheSpikedStampede.class));
cards.add(new SetCardInfo("Smoke Shroud", 361, Rarity.COMMON, mage.cards.s.SmokeShroud.class)); cards.add(new SetCardInfo("Smoke Shroud", 361, Rarity.COMMON, mage.cards.s.SmokeShroud.class));
cards.add(new SetCardInfo("Snakeskin Veil", 713, Rarity.COMMON, mage.cards.s.SnakeskinVeil.class)); cards.add(new SetCardInfo("Snakeskin Veil", 713, Rarity.COMMON, mage.cards.s.SnakeskinVeil.class));
cards.add(new SetCardInfo("Snapping Gnarlid", 714, Rarity.COMMON, mage.cards.s.SnappingGnarlid.class)); cards.add(new SetCardInfo("Snapping Gnarlid", 714, Rarity.COMMON, mage.cards.s.SnappingGnarlid.class));

View file

@ -0,0 +1,93 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.counters.Counter;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/**
* @author TheElk801
*/
public class EntersWithCountersControlledEffect extends ReplacementEffectImpl {
private final FilterPermanent filter;
private final Counter counter;
private final boolean excludeSource;
public EntersWithCountersControlledEffect(FilterPermanent filter, Counter counter, boolean excludeSource) {
this(Duration.WhileOnBattlefield, filter, counter, excludeSource);
}
public EntersWithCountersControlledEffect(Duration duration, FilterPermanent filter, Counter counter, boolean excludeSource) {
super(duration, Outcome.BoostCreature);
this.filter = filter;
this.counter = counter;
this.excludeSource = excludeSource;
staticText = makeText();
}
private EntersWithCountersControlledEffect(final EntersWithCountersControlledEffect effect) {
super(effect);
this.filter = effect.filter.copy();
this.counter = effect.counter.copy();
this.excludeSource = effect.excludeSource;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (excludeSource && event.getTargetId().equals(source.getSourceId())) {
return false;
}
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
return permanent != null
&& permanent.isControlledBy(source.getControllerId())
&& filter.match(permanent, source.getControllerId(), source, game);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
if (creature != null) {
creature.addCounters(counter, source.getControllerId(), source, game, event.getAppliedEffects());
}
return false;
}
private String makeText() {
StringBuilder sb = new StringBuilder();
if (duration == Duration.EndOfTurn) {
sb.append("this turn, ");
}
sb.append("each ");
if (excludeSource) {
sb.append("other ");
}
sb.append(filter.getMessage());
sb.append(" you control enters with ");
sb.append(CardUtil.numberToText(counter.getCount(), "an"));
sb.append(" additional ");
sb.append(counter.getName());
if (counter.getCount() > 1) {
sb.append('s');
}
sb.append(" on it");
return sb.toString();
}
@Override
public EntersWithCountersControlledEffect copy() {
return new EntersWithCountersControlledEffect(this);
}
}