Skip to content

Commit

Permalink
some more text improvements (#11258)
Browse files Browse the repository at this point in the history
* text on Eldrazi Spawn token

* refactor: return Ability instead of void

* cleanup assigning null to staticText

* cleanup Mimic cycle and GainAbilitySourceEffect

adjust Groundling Pouncer

* remove hardcoded rule param from SpellCastControllerTriggeredAbility

* fix #11257
  • Loading branch information
xenohedron authored Oct 6, 2023
1 parent cd6c5aa commit c8e2282
Show file tree
Hide file tree
Showing 25 changed files with 97 additions and 160 deletions.
11 changes: 5 additions & 6 deletions Mage.Sets/src/mage/cards/a/AriaOfFlame.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ public AriaOfFlame(UUID ownerId, CardSetInfo setInfo) {
this.addAbility(new EntersBattlefieldTriggeredAbility(new AriaOfFlameEffect()));

// Whenever you cast an instant or sorcery spell, put a verse counter on Aria of Flame, then it deals damage equal to the number of verse counters on it to target player or planeswalker.
Ability ability = SpellCastControllerTriggeredAbility.createWithRule(
Ability ability = new SpellCastControllerTriggeredAbility(
new AddCountersSourceEffect(CounterType.VERSE.createInstance()),
StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY,
false, "Whenever you cast an instant or sorcery spell, "
+ "put a verse counter on {this}, then it deals damage equal to "
+ "the number of verse counters on it to target player or planeswalker."
false
);
ability.addEffect(new DamageTargetEffect(xValue));
ability.addEffect(new DamageTargetEffect(xValue)
.setText(", then it deals damage equal to the number of verse counters on it to target player or planeswalker"));
ability.addTarget(new TargetPlayerOrPlaneswalker());
this.addAbility(ability);
}
Expand Down Expand Up @@ -82,4 +81,4 @@ public boolean apply(Game game, Ability source) {
public AriaOfFlameEffect copy() {
return new AriaOfFlameEffect(this);
}
}
}
11 changes: 5 additions & 6 deletions Mage.Sets/src/mage/cards/b/BattlegateMimic.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

package mage.cards.b;

import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
Expand All @@ -30,8 +30,6 @@ public final class BattlegateMimic extends CardImpl {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}

private static final String rule = "Whenever you cast a spell that's both red and white, {this} has base power and toughness 4/2 until end of turn and gains first strike until end of turn.";

public BattlegateMimic(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R/W}");
this.subtype.add(SubType.SHAPESHIFTER);
Expand All @@ -40,9 +38,10 @@ public BattlegateMimic(UUID ownerId, CardSetInfo setInfo) {
this.toughness = new MageInt(1);

// Whenever you cast a spell that's both red and white, Battlegate Mimic has base power and toughness 4/2 and gains first strike until end of turn.
SetBasePowerToughnessSourceEffect baseToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(4, 2, Duration.EndOfTurn);
Ability ability = SpellCastControllerTriggeredAbility.createWithRule(baseToughnessSourceEffect, filter, false, rule);
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, false, true));
Effect effect = new SetBasePowerToughnessSourceEffect(4, 2, Duration.EndOfTurn);
Ability ability = new SpellCastControllerTriggeredAbility(effect, filter, false);
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)
.setText("and gains first strike until end of turn"));
this.addAbility(ability);

}
Expand Down
7 changes: 3 additions & 4 deletions Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public BoseijuWhoSheltersAll(UUID ownerId, CardSetInfo setInfo) {
ability.getEffects().get(0).setText("Add {C}. If that mana is spent on an instant or sorcery spell, that spell can't be countered");
this.addAbility(ability, new BoseijuWhoSheltersAllWatcher(ability.getOriginalId()));

this.addAbility(new SimpleStaticAbility(Zone.ALL, new BoseijuWhoSheltersAllCantCounterEffect()));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BoseijuWhoSheltersAllCantCounterEffect()).setRuleVisible(false));
}

private BoseijuWhoSheltersAll(final BoseijuWhoSheltersAll card) {
Expand Down Expand Up @@ -91,9 +91,8 @@ public void reset() {

class BoseijuWhoSheltersAllCantCounterEffect extends ContinuousRuleModifyingEffectImpl {

public BoseijuWhoSheltersAllCantCounterEffect() {
BoseijuWhoSheltersAllCantCounterEffect() {
super(Duration.EndOfGame, Outcome.Benefit);
staticText = null;
}

private BoseijuWhoSheltersAllCantCounterEffect(final BoseijuWhoSheltersAllCantCounterEffect effect) {
Expand Down Expand Up @@ -125,4 +124,4 @@ public boolean applies(GameEvent event, Ability source, Game game) {
Spell spell = game.getStack().getSpell(event.getTargetId());
return spell != null && watcher != null && watcher.spellCantBeCountered(new MageObjectReference(spell, game));
}
}
}
5 changes: 2 additions & 3 deletions Mage.Sets/src/mage/cards/c/CavernOfSouls.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CavernOfSouls(UUID ownerId, CardSetInfo setInfo) {
// {T}: Add one mana of any color. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered.
Ability ability = new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new CavernOfSoulsManaBuilder(), true);
this.addAbility(ability, new CavernOfSoulsWatcher(ability.getOriginalId()));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect()));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect()).setRuleVisible(false));
}

private CavernOfSouls(final CavernOfSouls card) {
Expand Down Expand Up @@ -163,9 +163,8 @@ public void reset() {

class CavernOfSoulsCantCounterEffect extends ContinuousRuleModifyingEffectImpl {

public CavernOfSoulsCantCounterEffect() {
CavernOfSoulsCantCounterEffect() {
super(Duration.EndOfGame, Outcome.Benefit);
staticText = null;
}

private CavernOfSoulsCantCounterEffect(final CavernOfSoulsCantCounterEffect effect) {
Expand Down
6 changes: 2 additions & 4 deletions Mage.Sets/src/mage/cards/d/DelightedHalfling.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mage.cards.d;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;

Expand Down Expand Up @@ -43,7 +42,7 @@ public DelightedHalfling(UUID ownerId, CardSetInfo setInfo) {
// {T}: Add one mana of any color. Spend this mana only to cast a legendary spell, and that spell can't be countered.
Ability ability = new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new DelightedHalflingManaBuilder(), true);
this.addAbility(ability, new DelightedHalflingWatcher(ability.getOriginalId()));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new DelightedHalflingCantCounterEffect()));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new DelightedHalflingCantCounterEffect()).setRuleVisible(false));
}

private DelightedHalfling(final DelightedHalfling card) {
Expand Down Expand Up @@ -134,9 +133,8 @@ public void reset() {

class DelightedHalflingCantCounterEffect extends ContinuousRuleModifyingEffectImpl {

public DelightedHalflingCantCounterEffect() {
DelightedHalflingCantCounterEffect() {
super(Duration.EndOfGame, Outcome.Benefit);
staticText = null;
}

private DelightedHalflingCantCounterEffect(final DelightedHalflingCantCounterEffect effect) {
Expand Down
8 changes: 4 additions & 4 deletions Mage.Sets/src/mage/cards/d/DragonTurtle.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public DragonTurtle(UUID ownerId, CardSetInfo setInfo) {
this.addAbility(FlashAbility.getInstance());

// Drag Below — When Dragon Turtle enters the battlefield, tap it and up to one target creature an opponent controls. They don't untap during their controllers' next untap steps.
Ability ability = new EntersBattlefieldTriggeredAbility(new TapSourceEffect().setText(null));
ability.addEffect(new TapTargetEffect("tap it and up to one target creature an opponent controls"));
ability.addEffect(new DontUntapInControllersNextUntapStepSourceEffect().setText(null));
ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect().setText("They don't untap during their controllers' next untap steps"));
Ability ability = new EntersBattlefieldTriggeredAbility(new TapSourceEffect().setText("tap it"));
ability.addEffect(new TapTargetEffect("and up to one target creature an opponent controls"));
ability.addEffect(new DontUntapInControllersNextUntapStepSourceEffect().setText("They"));
ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect().setText(" don't untap during their controllers' next untap steps"));
ability.addTarget(new TargetOpponentsCreaturePermanent(0, 1));
this.addAbility(ability.withFlavorWord("Drag Below"));
}
Expand Down
16 changes: 5 additions & 11 deletions Mage.Sets/src/mage/cards/d/Dreamcatcher.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

package mage.cards.d;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
Expand All @@ -27,14 +26,9 @@ public Dreamcatcher(UUID ownerId, CardSetInfo setInfo) {
this.toughness = new MageInt(1);

// Whenever you cast a Spirit or Arcane spell, you may sacrifice Dreamcatcher. If you do, draw a card.
Ability ability = SpellCastControllerTriggeredAbility.createWithRule(
new SacrificeSourceEffect(),
StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD,
true,
"Whenever you cast a Spirit or Arcane spell, you may sacrifice {this}. If you do, draw a card."
);
ability.addEffect(new DrawCardSourceControllerEffect(1));
this.addAbility(ability);
this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(
new DrawCardSourceControllerEffect(1), new SacrificeSourceCost()
), StaticFilters.FILTER_SPIRIT_OR_ARCANE_CARD, false));
}

private Dreamcatcher(final Dreamcatcher card) {
Expand Down
10 changes: 5 additions & 5 deletions Mage.Sets/src/mage/cards/g/GiantSlug.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,27 @@ public boolean apply(Game game, Ability source) {
switch (choices.getChoice()) {
case "Plains":
game.addEffect(new GainAbilitySourceEffect(
new PlainswalkAbility(), Duration.EndOfTurn, false
new PlainswalkAbility(), Duration.EndOfTurn
), source);
return true;
case "Island":
game.addEffect(new GainAbilitySourceEffect(
new IslandwalkAbility(), Duration.EndOfTurn, false
new IslandwalkAbility(), Duration.EndOfTurn
), source);
return true;
case "Swamp":
game.addEffect(new GainAbilitySourceEffect(
new SwampwalkAbility(), Duration.EndOfTurn, false
new SwampwalkAbility(), Duration.EndOfTurn
), source);
return true;
case "Mountain":
game.addEffect(new GainAbilitySourceEffect(
new MountainwalkAbility(), Duration.EndOfTurn, false
new MountainwalkAbility(), Duration.EndOfTurn
), source);
return true;
case "Forest":
game.addEffect(new GainAbilitySourceEffect(
new ForestwalkAbility(), Duration.EndOfTurn, false
new ForestwalkAbility(), Duration.EndOfTurn
), source);
return true;
default:
Expand Down
48 changes: 16 additions & 32 deletions Mage.Sets/src/mage/cards/g/GroundlingPouncer.java
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@

package mage.cards.g;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.OpponentControlsPermanentCondition;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.EffectType;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;

import java.util.UUID;

/**
*
* @author jeffwadsworth
*
*/
public final class GroundlingPouncer extends CardImpl {

private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();

static {
filter.add(new AbilityPredicate(FlyingAbility.class));
}

public GroundlingPouncer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G/U}");
this.subtype.add(SubType.FAERIE);

this.power = new MageInt(2);
this.toughness = new MageInt(1);

// {GU}: Groundling Pouncer gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying.
Ability ability = new GroundlingPouncerAbility(
Zone.BATTLEFIELD,
new BoostSourceEffect(1, 3, Duration.EndOfTurn),
new ManaCostsImpl<>("{G/U}"),
new OpponentControlsPermanentCondition(filter),
"{G/U}: {this} gets +1/+3 and gains flying until end of turn. Activate only once each turn and only if an opponent controls a creature with flying.");
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true));
this.addAbility(ability);
// {G/U}: Groundling Pouncer gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying.
this.addAbility(new GroundlingPouncerAbility());

}

Expand All @@ -69,19 +48,24 @@ public GroundlingPouncer copy() {

class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {

private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();

static {
filter.add(new AbilityPredicate(FlyingAbility.class));
}

private static final Effects emptyEffects = new Effects();

private final String ruleText;
private static final String ruleText = "{G/U}: {this} gets +1/+3 and gains flying until end of turn. Activate only once each turn and only if an opponent controls a creature with flying.";

public GroundlingPouncerAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) {
super(zone, effect, cost);
this.condition = condition;
this.ruleText = rule;
GroundlingPouncerAbility() {
super(Zone.BATTLEFIELD, new BoostSourceEffect(1, 3, Duration.EndOfTurn), new ManaCostsImpl<>("{G/U}"));
this.condition = new OpponentControlsPermanentCondition(filter);
this.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn));
}

private GroundlingPouncerAbility(final GroundlingPouncerAbility ability) {
super(ability);
this.ruleText = ability.ruleText;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/l/LilianaDeathsMajesty.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public LilianaDeathsMajesty(UUID ownerId, CardSetInfo setInfo) {

// -3: Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types.
ability = new LoyaltyAbility(new AddCreatureTypeAdditionEffect(SubType.ZOMBIE, true) // because the effect has to be active for triggered effects that e.g. check if the creature entering is a Zombie, the continuous effect needs to be added before the card moving effect is applied
.setText(""), -3);
.setText("Return target creature card"), -3);
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
ability.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()
.setText("Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types"));
.setText(" from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types"));
this.addAbility(ability);

// -7: Destroy all non-Zombie creatures.
Expand Down
12 changes: 5 additions & 7 deletions Mage.Sets/src/mage/cards/n/NightskyMimic.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package mage.cards.n;

import mage.MageInt;
Expand All @@ -23,15 +22,13 @@
*/
public final class NightskyMimic extends CardImpl {

private static final FilterSpell filter = new FilterSpell("a spell that's both black and green");
private static final FilterSpell filter = new FilterSpell("a spell that's both white and black");

static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
filter.add(new ColorPredicate(ObjectColor.BLACK));
}

private static final String rule = "Whenever you cast a spell that's both white and black, {this} has base power and toughness 4/4 until end of turn and gains flying until end of turn.";

public NightskyMimic(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W/B}");
this.subtype.add(SubType.SHAPESHIFTER);
Expand All @@ -42,11 +39,12 @@ public NightskyMimic(UUID ownerId, CardSetInfo setInfo) {
this.toughness = new MageInt(1);

// Whenever you cast a spell that's both white and black, Nightsky Mimic has base power and toughness 4/4 until end of turn and gains flying until end of turn.
Ability ability = SpellCastControllerTriggeredAbility.createWithRule(
Ability ability = new SpellCastControllerTriggeredAbility(
new SetBasePowerToughnessSourceEffect(4, 4, Duration.EndOfTurn),
filter, false, rule
filter, false
);
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true));
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)
.setText("and gains flying until end of turn"));
this.addAbility(ability);
}

Expand Down
10 changes: 4 additions & 6 deletions Mage.Sets/src/mage/cards/p/PollywogSymbiote.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import mage.filter.FilterSpell;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.mageobject.AbilityPredicate;

import java.util.UUID;
Expand All @@ -25,8 +24,8 @@
public final class PollywogSymbiote extends CardImpl {

private static final FilterCard filter = new FilterCreatureCard();
private static final FilterSpell filter2 = new FilterCreatureSpell();
private static final Predicate predicate = new AbilityPredicate(MutateAbility.class);
private static final FilterSpell filter2 = new FilterCreatureSpell("a creature spell, if it has mutate");
private static final AbilityPredicate predicate = new AbilityPredicate(MutateAbility.class);

static {
filter.add(predicate);
Expand All @@ -45,9 +44,8 @@ public PollywogSymbiote(UUID ownerId, CardSetInfo setInfo) {
.setText("each creature spell you cast costs {1} less to cast if it has mutate")));

// Whenever you cast a creature spell, if it has mutate, draw a card, then discard a card.
this.addAbility(SpellCastControllerTriggeredAbility.createWithRule(
new DrawDiscardControllerEffect(1, 1), filter2, false,
"Whenever you cast a creature spell, if it has mutate, draw a card, then discard a card."
this.addAbility(new SpellCastControllerTriggeredAbility(
new DrawDiscardControllerEffect(1, 1), filter2, false
));
}

Expand Down
Loading

0 comments on commit c8e2282

Please sign in to comment.