refactor: simplify DrawCardSourceControllerEffect text generation (#12621)

This commit is contained in:
jimga150 2024-07-31 22:46:22 -04:00 committed by GitHub
parent ee3cab84ef
commit f2d3850250
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 88 additions and 86 deletions

View file

@ -38,7 +38,7 @@ public final class AbzanCharm extends CardImpl {
this.getSpellAbility().addEffect(new ExileTargetEffect());
// *You draw two cards and you lose 2 life
Mode mode = new Mode(new DrawCardSourceControllerEffect(2).setText("you draw two cards"));
Mode mode = new Mode(new DrawCardSourceControllerEffect(2, true));
mode.addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
this.getSpellAbility().addMode(mode);

View file

@ -43,7 +43,7 @@ public final class AlquistProftMasterSleuth extends CardImpl {
// {X}{W}{U}{U}, {T}, Sacrifice a Clue: You draw X cards and gain X life.
Ability ability = new SimpleActivatedAbility(
new DrawCardSourceControllerEffect(GetXValue.instance, "you"), new ManaCostsImpl<>("{X}{W}{U}{U}")
new DrawCardSourceControllerEffect(GetXValue.instance, true), new ManaCostsImpl<>("{X}{W}{U}{U}")
);
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_CLUE));

View file

@ -19,7 +19,7 @@ public final class AmbitionsCost extends CardImpl {
// You draw three cards and you lose 3 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3).setText("you draw three cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(3).concatBy("and"));
}

View file

@ -18,7 +18,7 @@ public final class AncientCraving extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}");
// You draw three cards and you lose 3 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3).setText("you draw three cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(3).concatBy("and"));
}

View file

@ -40,7 +40,7 @@ public final class ArchonOfCruelty extends CardImpl {
ability.addTarget(new TargetOpponent());
ability.addEffect(new DiscardTargetEffect(1, false).setText(", discards a card"));
ability.addEffect(new LoseLifeTargetEffect(3).setText(", and loses 3 life."));
ability.addEffect(new DrawCardSourceControllerEffect(1).concatBy("You"));
ability.addEffect(new DrawCardSourceControllerEffect(1, true));
ability.addEffect(new GainLifeEffect(3).setText("and gain 3 life"));
this.addAbility(ability);
}

View file

@ -33,7 +33,7 @@ public final class AsylumVisitor extends CardImpl {
// At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), TargetController.ANY, false),
new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1, true), TargetController.ANY, false),
new CardsInHandCondition(ComparisonType.EQUAL_TO, 0, TargetController.ACTIVE),
"At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.");
Effect effect = new LoseLifeSourceControllerEffect(1);

View file

@ -27,7 +27,7 @@ public final class AudaciousThief extends CardImpl {
// Whenever Audacious Thief attacks, you draw a card and you lose 1 life.
Ability ability = new AttacksTriggeredAbility(
new DrawCardSourceControllerEffect(1).setText("you draw a card"), false
new DrawCardSourceControllerEffect(1, true), false
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -43,7 +43,7 @@ public final class AureliaTheLawAbove extends CardImpl {
// Whenever a player attacks with three or more creatures, you draw a card.
this.addAbility(new AureliaTheLawAboveTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"), 3
new DrawCardSourceControllerEffect(1, true), 3
));
// Whenever a player attacks with five or more creatures, Aurelia, the Law Above deals 3 damage to each of your opponents and you gain 3 life.

View file

@ -20,7 +20,7 @@ public final class BadDeal extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
// You draw two cards and each opponent discards two cards. Each player loses 2 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("You draw two cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addEffect(new DiscardEachPlayerEffect(
StaticValue.get(2), false, TargetController.OPPONENT
).concatBy("and"));

View file

@ -27,7 +27,7 @@ public final class BalefulForce extends CardImpl {
this.toughness = new MageInt(7);
// At the beginning of each upkeep, you draw a card and you lose 1 life.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), TargetController.ANY, false);
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1, true), TargetController.ANY, false);
Effect effect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(effect.concatBy("and"));
this.addAbility(ability);

View file

@ -39,7 +39,7 @@ public final class BarbedServitor extends CardImpl {
// Whenever Barbed Servitor deals combat damage to a player, you draw a card and you lose 1 life.
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"), false
new DrawCardSourceControllerEffect(1, true), false
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -33,7 +33,7 @@ public final class Bequeathal extends CardImpl {
this.addAbility(ability);
// When enchanted creature dies, you draw two cards.
this.addAbility(new DiesAttachedTriggeredAbility(new DrawCardSourceControllerEffect(2).setText("you draw two cards"), "enchanted creature"));
this.addAbility(new DiesAttachedTriggeredAbility(new DrawCardSourceControllerEffect(2, true), "enchanted creature"));
}
private Bequeathal(final Bequeathal card) {

View file

@ -33,7 +33,7 @@ public final class Betrayal extends CardImpl {
this.addAbility(ability);
// Whenever enchanted creature becomes tapped, you draw a card.
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), "enchanted creature"));
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1, true), "enchanted creature"));
}
private Betrayal(final Betrayal card) {

View file

@ -49,7 +49,7 @@ public final class BilbosRing extends CardImpl {
// Whenever equipped creature attacks alone, you draw a card and you lose 1 life.
ability = new AttacksAloneAttachedTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you")
new DrawCardSourceControllerEffect(1, true)
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -54,7 +54,7 @@ public final class CaesarLegionsEmperor extends CardImpl {
triggeredAbility.getModes().setMaxModes(2);
// * You draw a card and you lose 1 life.
Mode drawMode = new Mode(new DrawCardSourceControllerEffect(1, "you"));
Mode drawMode = new Mode(new DrawCardSourceControllerEffect(1, true));
drawMode.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
triggeredAbility.addMode(drawMode);

View file

@ -35,7 +35,7 @@ public final class CallousBloodmage extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new Pest11GainLifeToken()));
// You draw a card and you lose 1 life.
Mode mode = new Mode(new DrawCardSourceControllerEffect(1).setText("you draw a card"));
Mode mode = new Mode(new DrawCardSourceControllerEffect(1, true));
mode.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
ability.addMode(mode);

View file

@ -36,7 +36,7 @@ public final class ClatteringAugur extends CardImpl {
this.addAbility(new CantBlockAbility());
// When Clattering Augur enters the battlefield, you draw a card and you lose 1 life.
Effect drawEffect = new DrawCardSourceControllerEffect(1, "you");
Effect drawEffect = new DrawCardSourceControllerEffect(1, true);
Ability ability = new EntersBattlefieldTriggeredAbility(drawEffect);
Effect lifeEffect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(lifeEffect.concatBy("and"));

View file

@ -27,7 +27,7 @@ public final class ClockworkFox extends CardImpl {
// When leaves Clockwork Fox the battlefield, you draw two cards and each opponent draws a card.
Ability ability = new LeavesBattlefieldTriggeredAbility(
new DrawCardSourceControllerEffect(2).setText("you draw two cards"), false
new DrawCardSourceControllerEffect(2, true), false
);
ability.addEffect(new DrawCardAllEffect(1, TargetController.OPPONENT).concatBy("and"));
this.addAbility(ability);

View file

@ -18,7 +18,7 @@ public final class CrushingDisappointment extends CardImpl {
// Each player loses 2 life. You draw two cards.
this.getSpellAbility().addEffect(new LoseLifeAllPlayersEffect(2));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).concatBy("You"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
}
private CrushingDisappointment(final CrushingDisappointment card) {

View file

@ -48,7 +48,7 @@ public final class Cryptbreaker extends CardImpl {
this.addAbility(ability);
// Tap three untapped Zombies you control: You draw a card and you lose 1 life.
Effect effect = new DrawCardSourceControllerEffect(1, "you");
Effect effect = new DrawCardSourceControllerEffect(1, true);
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapTargetCost(new TargetControlledPermanent(3, 3, filter, true)));
effect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(effect.concatBy("and"));

View file

@ -22,7 +22,7 @@ public final class CutOfTheProfits extends CardImpl {
this.addAbility(new CasualtyAbility(3));
// You draw X cards and you lose X life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(GetXValue.instance, "you"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(GetXValue.instance, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(GetXValue.instance).concatBy("and"));
}

View file

@ -23,7 +23,7 @@ public final class DarkProphecy extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}");
// Whenever a creature you control dies, you draw a card and you lose 1 life.
Effect effect = new DrawCardSourceControllerEffect(1, "you");
Effect effect = new DrawCardSourceControllerEffect(1, true);
Ability ability = new DiesCreatureTriggeredAbility(effect, false, StaticFilters.FILTER_CONTROLLED_A_CREATURE);
effect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(effect.concatBy("and"));

View file

@ -69,7 +69,7 @@ public final class DiscerningFinancier extends CardImpl {
new ManaCostsImpl<>("{2}{W}")
);
ability.addTarget(new TargetControlledPermanent(filter));
ability.addEffect(new DrawCardSourceControllerEffect(1, "you"));
ability.addEffect(new DrawCardSourceControllerEffect(1, true));
this.addAbility(ability);
}

View file

@ -34,7 +34,7 @@ public final class DiscipleOfPerdition extends CardImpl {
// When Disciple of Perdition dies, choose one. If you have exactly 13 life, you may choose both.
// * You draw a card and you lose 1 life.
Ability ability = new DiesSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), false);
Ability ability = new DiesSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, true), false);
ability.getModes().setChooseText("choose one. If you have exactly 13 life, you may choose both.");
ability.getModes().setMoreCondition(new LifeCompareCondition(TargetController.YOU, ComparisonType.EQUAL_TO, 13));
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));

View file

@ -75,7 +75,7 @@ public final class DiscreetRetreat extends CardImpl {
class DiscreetRetreatTriggeredAbility extends TriggeredAbilityImpl {
DiscreetRetreatTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, "you"));
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, true));
addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
setTriggerPhrase("Whenever you cast your first outlaw spell each turn, ");
}

View file

@ -24,7 +24,7 @@ public final class DisinformationCampaign extends CardImpl {
// When Disinformation Campaign enters the battlefield, you draw a card and each opponent discards a card.
Ability ability = new EntersBattlefieldTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"));
new DrawCardSourceControllerEffect(1, true));
ability.addEffect(new DiscardEachPlayerEffect(
StaticValue.get(1), false, TargetController.OPPONENT).concatBy("and"));
this.addAbility(ability);

View file

@ -27,7 +27,7 @@ public final class DuskLegionZealot extends CardImpl {
this.toughness = new MageInt(1);
// When Dusk Legion Zealot enters the battlefield, you draw a card and you lose 1 life.
Effect drawEffect = new DrawCardSourceControllerEffect(1, "you");
Effect drawEffect = new DrawCardSourceControllerEffect(1, true);
Ability ability = new EntersBattlefieldTriggeredAbility(drawEffect);
Effect lifeEffect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(lifeEffect.concatBy("and"));

View file

@ -134,7 +134,7 @@ class ExtraordinaryJourneyEffect extends OneShotEffect {
class ExtraordinaryJourneyTriggeredAbility extends TriggeredAbilityImpl {
ExtraordinaryJourneyTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, "you"), false);
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, true), false);
setTriggerPhrase("Whenever one or more nontoken creatures enter the battlefield, "
+ "if one or more of them entered from exile or was cast from exile, ");
setTriggersLimitEachTurn(1);

View file

@ -40,7 +40,7 @@ public final class FaerieDreamthief extends CardImpl {
// {2}{B}, Exile Faerie Dreamthief from your graveyard: You draw a card and you lose 1 life.
Ability ability = new SimpleActivatedAbility(
Zone.GRAVEYARD,
new DrawCardSourceControllerEffect(1, "you"),
new DrawCardSourceControllerEffect(1, true),
new ManaCostsImpl<>("{2}{B}")
);
ability.addCost(new ExileSourceFromGraveCost());

View file

@ -33,7 +33,7 @@ public final class FatalLore extends CardImpl {
this.getSpellAbility().getModes().setChooseController(TargetController.OPPONENT);
// You draw three cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("you draw three cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3, true));
// You destroy up to two target creatures that player controls. They can't be regenerated. That player draws up to three cards.
this.getSpellAbility().addMode(new Mode(new DestroyTargetEffect(

View file

@ -24,7 +24,7 @@ public final class FeedTheInfection extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
// You draw three cards and lose 3 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3, "you"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(3).concatBy("and"));
// Corrupted -- Each opponent with three or more poison counters loses 3 life.

View file

@ -32,7 +32,7 @@ public final class FreyalisesCharm extends CardImpl {
// Whenever an opponent casts a black spell, you may pay {G}{G}. If you do, you draw a card.
this.addAbility(new SpellCastOpponentTriggeredAbility(
new DoIfCostPaid(
new DrawCardSourceControllerEffect(1, "you"),
new DrawCardSourceControllerEffect(1, true),
new ManaCostsImpl<>("{G}{G}")
), filter, false
));

View file

@ -32,7 +32,7 @@ public final class FugitiveDruid extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Fugitive Druid becomes the target of an Aura spell, you draw a card.
this.addAbility(new BecomesTargetSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), filter));
this.addAbility(new BecomesTargetSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, true), filter));
}
private FugitiveDruid(final FugitiveDruid card) {

View file

@ -24,7 +24,7 @@ public final class GreedsGambit extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
// When Greed's Gambit enters the battlefield, you draw three cards, gain 6 life, and create three 2/1 black Bat creature tokens with flying.
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(3, "you"));
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(3, true));
ability.addEffect(new GainLifeEffect(6).setText(", gain 6 life"));
ability.addEffect(new CreateTokenEffect(new Bat21Token(), 3).concatBy(", and"));
this.addAbility(ability);

View file

@ -52,7 +52,7 @@ public final class GretaSweettoothScourge extends CardImpl {
// {1}{B}, Sacrifice a Food: You draw a card and you lose 1 life.
ability = new SimpleActivatedAbility(
new DrawCardSourceControllerEffect(1, "you"),
new DrawCardSourceControllerEffect(1, true),
new ManaCostsImpl<>("{1}{B}")
);
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_FOOD));

View file

@ -22,7 +22,7 @@ public final class GruesomeRealization extends CardImpl {
// Choose one --
// * You draw two cards and you lose 2 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("you draw two cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
// * Creatures your opponents control get -1/-1 until end of turn.

View file

@ -41,7 +41,7 @@ public final class HemlockVial extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{B}");
// When Hemlock Vial enters the battlefield, you draw a card and you lose 1 life.
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"));
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1, true));
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -21,7 +21,7 @@ public final class HonorTheGodPharaoh extends CardImpl {
this.getSpellAbility().addCost(new DiscardCardCost(false));
// Draw two cards. Amass 1.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("draw two cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
this.getSpellAbility().addEffect(new AmassEffect(1, SubType.ZOMBIE));
}

View file

@ -20,7 +20,7 @@ public final class InfectiousInquiry extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
// You draw two cards and you lose 2 life. Each opponent gets a poison counter.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, "you"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
this.getSpellAbility().addEffect(new AddCountersPlayersEffect(
CounterType.POISON.createInstance(), TargetController.OPPONENT

View file

@ -27,7 +27,7 @@ public final class InfernalIdol extends CardImpl {
// {1}{B}{B}, {T}, Sacrifice Infernal Idol: You draw two cards and you lose 2 life.
Ability ability = new SimpleActivatedAbility(
new DrawCardSourceControllerEffect(2, "you"), new ManaCostsImpl<>("{1}{B}{B}")
new DrawCardSourceControllerEffect(2, true), new ManaCostsImpl<>("{1}{B}{B}")
);
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());

View file

@ -28,7 +28,7 @@ public final class Insight extends CardImpl {
// Whenever an opponent casts a green spell, you draw a card.
this.addAbility(new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), filter, false));
this.addAbility(new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1, true), filter, false));
}
private Insight(final Insight card) {

View file

@ -46,7 +46,7 @@ public final class JaceTheLivingGuildpact extends CardImpl {
// -8: Each player shuffles their hand and graveyard into their library. You draw seven cards.
ability = new LoyaltyAbility(new ShuffleHandGraveyardAllEffect(), -8);
ability.addEffect(new DrawCardSourceControllerEffect(7, "you"));
ability.addEffect(new DrawCardSourceControllerEffect(7, true));
this.addAbility(ability);
}

View file

@ -56,7 +56,7 @@ public final class JonIrenicusShatteredOne extends CardImpl {
this.addAbility(ability);
// Whenever a creature you own but don't control attacks, you draw a card.
this.addAbility(new AttacksAllTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), false, filter, SetTargetPointer.NONE, false));
this.addAbility(new AttacksAllTriggeredAbility(new DrawCardSourceControllerEffect(1, true), false, filter, SetTargetPointer.NONE, false));
}
private JonIrenicusShatteredOne(final JonIrenicusShatteredOne card) {super(card);}

View file

@ -51,7 +51,7 @@ public final class KayaIntangibleSlayer extends CardImpl {
this.addAbility(ability);
// 0: You draw two cards. Then each opponent may scry 1.
ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(2, "you"), 0);
ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(2, true), 0);
ability.addEffect(new KayaIntangibleSlayerScryEffect());
this.addAbility(ability);

View file

@ -25,7 +25,7 @@ public final class LibraryOfLatNam extends CardImpl {
this.getSpellAbility().getModes().setChooseController(TargetController.OPPONENT);
// You draw three cards at the beginning of the next turn's upkeep;
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(3).setText("you draw three cards")), false));
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(3, true)), false));
// or you search your library for a card, put that card into your hand, then shuffle your library.
this.getSpellAbility().addMode(new Mode(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(), false).setText("you search your library for a card, put that card into your hand, then shuffle")));

View file

@ -27,7 +27,7 @@ public final class MalakirSoothsayer extends CardImpl {
this.toughness = new MageInt(4);
// <i>Cohort</i> &mdash; {T}, Tap an untapped Ally you control: You draw a card and you lose a life.
Ability ability = new CohortAbility(new DrawCardSourceControllerEffect(1, "you"));
Ability ability = new CohortAbility(new DrawCardSourceControllerEffect(1, true));
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -20,7 +20,7 @@ public final class MephiticDraught extends CardImpl {
// When Mephitic Draught enters the battlefield or is put into a graveyard from the battlefield, you draw a card and you lose 1 life.
Ability ability = new EntersBattlefieldOrDiesSourceTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"), false, false);
new DrawCardSourceControllerEffect(1, true), false, false);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -30,7 +30,7 @@ public final class MercilessHarlequin extends CardImpl {
this.addAbility(new FreerunningAbility("{1}{B}"));
// When Merciless Harlequin enters the battlefield, you draw a card and you lose 1 life.
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"));
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1, true));
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);
}

View file

@ -24,7 +24,7 @@ public final class MetalspinnersPuzzleknot extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// When Metalspinner's Puzzleknot enters the battlefield, you draw a card and you lose 1 life.
Effect drawEffect = new DrawCardSourceControllerEffect(1, "you");
Effect drawEffect = new DrawCardSourceControllerEffect(1, true);
Ability ability = new EntersBattlefieldTriggeredAbility(drawEffect);
Effect lifeEffect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(lifeEffect.concatBy("and"));

View file

@ -39,7 +39,7 @@ public final class MidnightEntourage extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
// Whenever Midnight Entourage or another Aetherborn you control dies, you draw a card and you lose 1 life.
Ability ability = new DiesThisOrAnotherTriggeredAbility(new DrawCardSourceControllerEffect(1, "you"), false, filter);
Ability ability = new DiesThisOrAnotherTriggeredAbility(new DrawCardSourceControllerEffect(1, true), false, filter);
Effect effect = new LoseLifeSourceControllerEffect(1);
ability.addEffect(effect.concatBy("and"));
this.addAbility(ability);

View file

@ -19,7 +19,7 @@ public final class Mindculling extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{U}");
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, "you"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addEffect(new DiscardTargetEffect(2).concatBy("and"));
}

View file

@ -19,7 +19,7 @@ public final class MordorMuster extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
// You draw a card and you lose 1 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1, "you"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
// Amass Orcs 1.

View file

@ -37,7 +37,7 @@ public final class MosswoodDreadknight extends AdventureCard {
// Dread Whispers
// You draw a card and you lose 1 life.
this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1, "you"));
this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1, true));
this.getSpellCard().getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.finalizeAdventure();

View file

@ -19,7 +19,7 @@ public final class NightsWhisper extends CardImpl {
// You draw two cards and you lose 2 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("you draw two cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
}

View file

@ -30,21 +30,21 @@ public final class Nothic extends CardImpl {
// 1-9 | You draw a card and you lose 1 life.
effect.addTableEntry(
1, 9,
new DrawCardSourceControllerEffect(1, "you"),
new DrawCardSourceControllerEffect(1, true),
new LoseLifeSourceControllerEffect(1).concatBy("and")
);
// 10-19 | You draw two cards and you lose 2 life.
effect.addTableEntry(
10, 19,
new DrawCardSourceControllerEffect(2, "you"),
new DrawCardSourceControllerEffect(2, true),
new LoseLifeSourceControllerEffect(2).concatBy("and")
);
// 20 | You draw seven cards and you lose 7 life.
effect.addTableEntry(
20, 20,
new DrawCardSourceControllerEffect(7, "you"),
new DrawCardSourceControllerEffect(7, true),
new LoseLifeSourceControllerEffect(7).concatBy("and")
);

View file

@ -30,7 +30,7 @@ public final class ObNixilisReignited extends CardImpl {
this.setStartingLoyalty(5);
// +1: You draw a card and you lose 1 life.
Effect effect = new DrawCardSourceControllerEffect(1, "you");
Effect effect = new DrawCardSourceControllerEffect(1, true);
LoyaltyAbility ability1 = new LoyaltyAbility(effect, 1);
effect = new LoseLifeSourceControllerEffect(1);
ability1.addEffect(effect.concatBy("and"));

View file

@ -21,7 +21,7 @@ public final class PhyrexianArena extends CardImpl {
// At the beginning of your upkeep, you draw a card and you lose 1 life.
Ability ability = new BeginningOfUpkeepTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"), TargetController.YOU, false
new DrawCardSourceControllerEffect(1, true), TargetController.YOU, false
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -24,7 +24,7 @@ public final class PhyrexianGargantua extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(4);
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(2, "you"), false);
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(2, true), false);
ability.addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
this.addAbility(ability);
}

View file

@ -19,7 +19,7 @@ public final class PointedDiscussion extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
// You draw two cards, lose 2 life, then create a Blood token.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("you draw two cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2).setText(", lose 2 life"));
this.getSpellAbility().addEffect(new CreateTokenEffect(new BloodToken()).concatBy(", then"));
}

View file

@ -92,7 +92,7 @@ class PreacherOfTheSchismFirstTrigger extends TriggeredAbilityImpl {
class PreacherOfTheSchismSecondTrigger extends TriggeredAbilityImpl {
public PreacherOfTheSchismSecondTrigger() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, "you"), false);
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, true), false);
this.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
setTriggerPhrase("Whenever {this} attacks while you have the most life or are tied for most life, ");
}

View file

@ -33,7 +33,7 @@ public final class RowansGrimSearch extends CardImpl {
));
// You draw two cards and you lose 2 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, "you").concatBy("<br>"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true).concatBy("<br>"));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
}

View file

@ -29,7 +29,7 @@ public final class ScrapworkRager extends CardImpl {
// When Scrapwork Rager enters the battlefield, you draw a card and you lose 1 life.
Ability ability = new EntersBattlefieldTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"), false
new DrawCardSourceControllerEffect(1, true), false
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -32,7 +32,7 @@ public final class ShadowsLair extends CardImpl {
// {B}, {T}, Remove a dread counter from Shadows' Lair: You draw a card and you lose 1 life.
Ability ability = new SimpleActivatedAbility(
new DrawCardSourceControllerEffect(1, "you"), new ManaCostsImpl<>("{B}")
new DrawCardSourceControllerEffect(1, true), new ManaCostsImpl<>("{B}")
);
ability.addCost(new TapSourceCost());
ability.addCost(new RemoveCountersSourceCost(CounterType.DREAD.createInstance()));

View file

@ -47,7 +47,7 @@ public final class SimonWildMagicSorcerer extends CardImpl {
effect.addTableEntry(1, 9, new DrawCardAllEffect(1));
// 10-19 | You draw a card.
effect.addTableEntry(10, 19, new DrawCardSourceControllerEffect(1, "you"));
effect.addTableEntry(10, 19, new DrawCardSourceControllerEffect(1, true));
// 20 | Copy that spell. You may choose new targets for the copy.
effect.addTableEntry(20, 20, new CopyTargetStackObjectEffect());

View file

@ -18,7 +18,7 @@ public final class SuccumbToTemptation extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}{B}");
// You draw two cards and you lose 2 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, "you"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
Effect effect = new LoseLifeSourceControllerEffect(2);
effect.setText("and you lose 2 life");
this.getSpellAbility().addEffect(effect);

View file

@ -42,7 +42,7 @@ public final class SwordOfFireAndIce extends CardImpl {
ability = new DealsDamageToAPlayerAttachedTriggeredAbility(
new DamageTargetEffect(2), "equipped creature", false
);
ability.addEffect(new DrawCardSourceControllerEffect(1, "you").concatBy("and"));
ability.addEffect(new DrawCardSourceControllerEffect(1, true).concatBy("and"));
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);

View file

@ -54,7 +54,7 @@ public final class TalionTheKindlyLord extends CardImpl {
.setText("that player loses 2 life"),
filter, false, SetTargetPointer.PLAYER
);
ability.addEffect(new DrawCardSourceControllerEffect(1, "you").concatBy("and"));
ability.addEffect(new DrawCardSourceControllerEffect(1, true).concatBy("and"));
this.addAbility(ability);
}

View file

@ -55,7 +55,7 @@ public final class TegwyllDukeOfSplendor extends CardImpl {
// Whenever another Faerie you control dies, you draw a card and you lose 1 life.
Ability ability = new DiesCreatureTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"),
new DrawCardSourceControllerEffect(1, true),
false, filter2
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));

View file

@ -27,7 +27,7 @@ public final class TithebearerGiant extends CardImpl {
// When Tithebearer Giant enters the battlefield, you draw a card and you lose 1 life.
Ability ability = new EntersBattlefieldTriggeredAbility(
new DrawCardSourceControllerEffect(1, "you"), false
new DrawCardSourceControllerEffect(1, true), false
);
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.addAbility(ability);

View file

@ -32,7 +32,7 @@ public final class TriarchPraetorian extends CardImpl {
// Dynastic Codes -- When Triarch Praetorian enters the battlefield from a graveyard, you draw two cards and you lose 2 life.
Ability ability = new EntersBattlefieldFromGraveyardTriggeredAbility(
new DrawCardSourceControllerEffect(2, "you")
new DrawCardSourceControllerEffect(2, true)
);
ability.addEffect(new LoseLifeSourceControllerEffect(2).concatBy("and"));
this.addAbility(ability.withFlavorWord("Dynastic Codes"));

View file

@ -35,7 +35,7 @@ public final class UrzasBauble extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookAtRandomCardEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetPlayer());
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1, "you")), false));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1, true)), false));
this.addAbility(ability);
}

View file

@ -24,7 +24,7 @@ public final class WordsOfWisdom extends CardImpl {
// You draw two cards, then each other player draws a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2).setText("you draw two cards"));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2, true));
this.getSpellAbility().addEffect(new WordsOfWisdomEffect());
}

View file

@ -1,9 +1,7 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
@ -19,21 +17,21 @@ public class DrawCardSourceControllerEffect extends OneShotEffect {
protected DynamicValue amount;
public DrawCardSourceControllerEffect(int amount) {
this(amount, "");
this(amount, false);
}
public DrawCardSourceControllerEffect(int amount, String whoDrawCard) {
this(StaticValue.get(amount), whoDrawCard);
public DrawCardSourceControllerEffect(int amount, boolean youDraw) {
this(StaticValue.get(amount), youDraw);
}
public DrawCardSourceControllerEffect(DynamicValue amount) {
this(amount, "");
this(amount, false);
}
public DrawCardSourceControllerEffect(DynamicValue amount, String whoDrawCard) {
public DrawCardSourceControllerEffect(DynamicValue amount, boolean youDraw) {
super(Outcome.DrawCard);
this.amount = amount.copy();
createStaticText(whoDrawCard);
createStaticText(youDraw);
}
protected DrawCardSourceControllerEffect(final DrawCardSourceControllerEffect effect) {
@ -57,9 +55,13 @@ public class DrawCardSourceControllerEffect extends OneShotEffect {
return false;
}
private void createStaticText(String whoDrawCard) {
StringBuilder sb = new StringBuilder(whoDrawCard);
sb.append(whoDrawCard.isEmpty() ? "draw " : " draw ");
private void createStaticText(boolean youDraw) {
StringBuilder sb = new StringBuilder();
if (youDraw){
sb.append("you draw ");
} else {
sb.append("draw ");
}
String value = amount.toString();
sb.append(CardUtil.numberToText(value, "a"));
sb.append(value.equals("1") ? " card" : " cards");

View file

@ -33,7 +33,7 @@ public final class TyvarKellEmblem extends Emblem {
HasteAbility.getInstance(), Duration.EndOfTurn, null, true
).setText("it gains haste until end of turn"), filter, false, SetTargetPointer.CARD
);
ability.addEffect(new DrawCardSourceControllerEffect(2, "you").concatBy("and"));
ability.addEffect(new DrawCardSourceControllerEffect(2, true).concatBy("and"));
this.getAbilities().add(ability);
}