mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
refactor text gen for PutCardIntoPlayWithHasteAndSacrificeEffect
This commit is contained in:
parent
cac779cbec
commit
7be16bdaac
5 changed files with 19 additions and 20 deletions
|
|
@ -6,6 +6,7 @@ import mage.abilities.effects.common.PutCardIntoPlayWithHasteAndSacrificeEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -18,10 +19,10 @@ public final class ArmsRace extends CardImpl {
|
|||
public ArmsRace(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||
|
||||
// {3}{R}: You may put an artifact card from your hand onto the battlefield. It gains haste. Sacrifice it at the beginning of the next end step.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new PutCardIntoPlayWithHasteAndSacrificeEffect(StaticFilters.FILTER_CARD_ARTIFACT), new ManaCostsImpl<>("{3}{R}")
|
||||
));
|
||||
// {3}{R}: You may put an artifact card from your hand onto the battlefield. That artifact gains haste. Sacrifice it at the beginning of the next end step.
|
||||
this.addAbility(new SimpleActivatedAbility(new PutCardIntoPlayWithHasteAndSacrificeEffect(
|
||||
StaticFilters.FILTER_CARD_ARTIFACT, Duration.Custom, "That artifact", "it"
|
||||
), new ManaCostsImpl<>("{3}{R}")));
|
||||
}
|
||||
|
||||
private ArmsRace(final ArmsRace card) {
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ public final class IncandescentSoulstoke extends CardImpl {
|
|||
|
||||
// {1}{R}, {T}: You may put an Elemental creature card from your hand onto the battlefield. That creature gains haste until end of turn. Sacrifice it at the beginning of the next end step.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new PutCardIntoPlayWithHasteAndSacrificeEffect(filter2, Duration.EndOfTurn)
|
||||
.setText("You may put an Elemental creature card from your hand onto the battlefield. " +
|
||||
"That creature gains haste until end of turn. Sacrifice it at the beginning of the next end step."),
|
||||
new PutCardIntoPlayWithHasteAndSacrificeEffect(filter2, Duration.EndOfTurn, "That creature", "it"),
|
||||
new ManaCostsImpl<>("{1}{R}")
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import mage.abilities.effects.common.PutCardIntoPlayWithHasteAndSacrificeEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -19,9 +20,9 @@ public final class SneakAttack extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||
|
||||
// {R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new PutCardIntoPlayWithHasteAndSacrificeEffect(StaticFilters.FILTER_CARD_CREATURE), new ManaCostsImpl<>("{R}")
|
||||
));
|
||||
this.addAbility(new SimpleActivatedAbility(new PutCardIntoPlayWithHasteAndSacrificeEffect(
|
||||
StaticFilters.FILTER_CARD_CREATURE, Duration.Custom, "That creature", "the creature"
|
||||
), new ManaCostsImpl<>("{R}")));
|
||||
}
|
||||
|
||||
private SneakAttack(final SneakAttack card) {
|
||||
|
|
@ -33,4 +34,3 @@ public final class SneakAttack extends CardImpl {
|
|||
return new SneakAttack(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import mage.abilities.keyword.SpliceAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
|
|
@ -21,7 +22,9 @@ public final class ThroughTheBreach extends CardImpl {
|
|||
this.subtype.add(SubType.ARCANE);
|
||||
|
||||
// You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new PutCardIntoPlayWithHasteAndSacrificeEffect(StaticFilters.FILTER_CARD_CREATURE));
|
||||
this.getSpellAbility().addEffect(new PutCardIntoPlayWithHasteAndSacrificeEffect(
|
||||
StaticFilters.FILTER_CARD_CREATURE, Duration.Custom, "That creature", "that creature"
|
||||
));
|
||||
|
||||
// Splice onto Arcane {2}{R}{R}
|
||||
this.addAbility(new SpliceAbility(SpliceAbility.ARCANE, new ManaCostsImpl<>("{2}{R}{R}")));
|
||||
|
|
|
|||
|
|
@ -26,17 +26,14 @@ public class PutCardIntoPlayWithHasteAndSacrificeEffect extends OneShotEffect {
|
|||
private final FilterCard filter;
|
||||
private final Duration duration;
|
||||
|
||||
public PutCardIntoPlayWithHasteAndSacrificeEffect(FilterCard filter) {
|
||||
this(filter, Duration.Custom);
|
||||
}
|
||||
|
||||
public PutCardIntoPlayWithHasteAndSacrificeEffect(FilterCard filter, Duration duration) {
|
||||
super(Outcome.Benefit);
|
||||
public PutCardIntoPlayWithHasteAndSacrificeEffect(FilterCard filter, Duration duration, String objectName, String objectName2) {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.filter = filter;
|
||||
this.duration = duration;
|
||||
this.staticText = "you may put " + CardUtil.addArticle(filter.getMessage()) +
|
||||
(" from your hand onto the battlefield. It gains haste " + duration).trim() +
|
||||
". Sacrifice that " + filter.getMessage() + " at the beginning of the next end step";
|
||||
" from your hand onto the battlefield. " + objectName +
|
||||
" gains haste" + (duration.toString().isEmpty() ? "" : ' ' + duration.toString()) +
|
||||
". Sacrifice " + objectName2 + " at the beginning of the next end step";
|
||||
}
|
||||
|
||||
private PutCardIntoPlayWithHasteAndSacrificeEffect(final PutCardIntoPlayWithHasteAndSacrificeEffect effect) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue