mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
update text: sacrifice "of their choice"
This commit is contained in:
parent
7292639137
commit
729869ec36
13 changed files with 41 additions and 69 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -26,7 +25,8 @@ public final class ClipWings extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
|
||||
|
||||
// Each opponent sacrifices a creature with flying.
|
||||
this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(filter));
|
||||
this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(filter)
|
||||
.setText("each opponent sacrifices a creature of their choice with flying"));
|
||||
}
|
||||
|
||||
private ClipWings(final ClipWings card) {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetSacrifice;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -30,8 +25,11 @@ public final class GravePact extends CardImpl {
|
|||
public GravePact(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}{B}");
|
||||
|
||||
|
||||
// Whenever a creature you control dies, each other player sacrifices a creature.
|
||||
this.addAbility(new GravePactTriggeredAbility());
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(
|
||||
new GravePactEffect(), false, StaticFilters.FILTER_CONTROLLED_A_CREATURE
|
||||
));
|
||||
}
|
||||
|
||||
private GravePact(final GravePact card) {
|
||||
|
|
@ -44,49 +42,11 @@ public final class GravePact extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class GravePactTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public GravePactTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new GravePactEffect());
|
||||
setTriggerPhrase("Whenever a creature you control dies, ");
|
||||
this.setLeavesTheBattlefieldTrigger(true);
|
||||
}
|
||||
|
||||
private GravePactTriggeredAbility(final GravePactTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GravePactTriggeredAbility copy() {
|
||||
return new GravePactTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zoneChangeEvent = (ZoneChangeEvent) event;
|
||||
if (zoneChangeEvent.isDiesEvent()) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
return permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
|
||||
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
|
||||
}
|
||||
}
|
||||
|
||||
class GravePactEffect extends OneShotEffect {
|
||||
|
||||
GravePactEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "each other player sacrifices a creature";
|
||||
this.staticText = "each other player sacrifices a creature of their choice";
|
||||
}
|
||||
|
||||
private GravePactEffect(final GravePactEffect effect) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class MyrkulsEdictEffect extends OneShotEffect {
|
|||
|
||||
MyrkulsEdictEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "choose an opponent. That player sacrifices a creature";
|
||||
staticText = "choose an opponent. That player sacrifices a creature of their choice";
|
||||
}
|
||||
|
||||
private MyrkulsEdictEffect(final MyrkulsEdictEffect effect) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class RampageOfTheValkyriesEffect extends OneShotEffect {
|
|||
|
||||
RampageOfTheValkyriesEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "each other player sacrifices a creature";
|
||||
staticText = "each other player sacrifices a creature of their choice";
|
||||
}
|
||||
|
||||
private RampageOfTheValkyriesEffect(final RampageOfTheValkyriesEffect effect) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ public final class RunAfoul extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
|
||||
|
||||
// Target opponent sacrifices a creature with flying.
|
||||
this.getSpellAbility().addEffect(new SacrificeEffect(filter, 1, "Target opponent"));
|
||||
this.getSpellAbility().addEffect(new SacrificeEffect(filter, 1, "Target opponent")
|
||||
.setText("target opponent sacrifices a creature of their choice with flying"));
|
||||
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class SavraSacrificeEffect extends OneShotEffect {
|
|||
|
||||
SavraSacrificeEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "each other player sacrifices a creature";
|
||||
this.staticText = "each other player sacrifices a creature of their choice";
|
||||
}
|
||||
|
||||
private SavraSacrificeEffect(final SavraSacrificeEffect effect) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ public final class SporogenicInfection extends CardImpl {
|
|||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// When Sporogenic Infection enters, target player sacrifices a creature other than enchanted creature.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeEffect(filter, 1, "target player"));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeEffect(filter, 1, "target player")
|
||||
.setText("target player sacrifices a creature of their choice other than enchanted creature"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ enum SporogenicInfectionPredicate implements ObjectSourcePlayerPredicate<Permane
|
|||
return !Optional
|
||||
.ofNullable(input.getSource().getSourcePermanentOrLKI(game))
|
||||
.map(Permanent::getAttachedTo)
|
||||
.equals(input.getObject().getId());
|
||||
.map(input.getObject().getId()::equals)
|
||||
.orElse(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,10 @@ public final class StructuralCollapse extends CardImpl {
|
|||
|
||||
|
||||
// Target player sacrifices an artifact and a land. Structural Collapse deals 2 damage to that player.
|
||||
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterArtifactPermanent(), 1, "Target player"));
|
||||
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterArtifactPermanent(), 1, "Target player")
|
||||
.setText("target player sacrifices an artifact"));
|
||||
this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_LANDS, 1, "Target player")
|
||||
.setText("and a land"));
|
||||
.setText("and a land of their choice"));
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(2, true, "that player"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public final class VileMutilator extends CardImpl {
|
|||
|
||||
// When Vile Mutilator enters, each opponent sacrifices a nontoken enchantment, then sacrifices a nontoken creature.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeOpponentsEffect(filter));
|
||||
ability.addEffect(new SacrificeOpponentsEffect(filter2).setText(", then sacrifices a nontoken creature"));
|
||||
ability.addEffect(new SacrificeOpponentsEffect(filter2).setText(", then sacrifices a nontoken creature of their choice"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
|
|
@ -25,16 +26,6 @@ public class DrawDiscardTargetEffect extends OneShotEffect {
|
|||
this.cardsToDraw = cardsToDraw;
|
||||
this.cardsToDiscard = cardsToDiscard;
|
||||
this.random = random;
|
||||
staticText = new StringBuilder("target player draws ")
|
||||
.append(CardUtil.numberToText(cardsToDraw, "a"))
|
||||
.append(" card")
|
||||
.append(cardsToDraw > 1 ? "s" : "")
|
||||
.append(", then discards ")
|
||||
.append(CardUtil.numberToText(cardsToDiscard, "a"))
|
||||
.append(" card")
|
||||
.append(cardsToDiscard > 1 ? "s" : "")
|
||||
.append(random ? " at random" : "")
|
||||
.toString();
|
||||
}
|
||||
|
||||
private DrawDiscardTargetEffect(final DrawDiscardTargetEffect effect) {
|
||||
|
|
@ -59,4 +50,16 @@ public class DrawDiscardTargetEffect extends OneShotEffect {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return getTargetPointer().describeTargets(mode.getTargets(), "that player") + " draws " +
|
||||
CardUtil.numberToText(cardsToDraw, "a") + " card" + (cardsToDraw > 1 ? "s" : "") +
|
||||
", then discards " + CardUtil.numberToText(cardsToDiscard, "a") +
|
||||
" card" + (cardsToDiscard > 1 ? "s" : "") + (random ? " at random" : "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ public class SacrificeAllEffect extends OneShotEffect {
|
|||
sb.append(' ');
|
||||
sb.append(filter.getMessage());
|
||||
}
|
||||
sb.append(" of their choice");
|
||||
staticText = sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ public class SacrificeEffect extends OneShotEffect {
|
|||
if (preText != null) {
|
||||
sb.append(preText);
|
||||
}
|
||||
if (preText != null && (preText.endsWith("player") || preText.endsWith("opponent") || preText.endsWith("controller"))) {
|
||||
boolean playerSacs = preText != null && (preText.endsWith("player") || preText.endsWith("opponent") || preText.endsWith("controller"));
|
||||
if (playerSacs) {
|
||||
sb.append(" sacrifices ");
|
||||
} else {
|
||||
if (preText == null || preText.isEmpty()) {
|
||||
|
|
@ -107,6 +108,9 @@ public class SacrificeEffect extends OneShotEffect {
|
|||
sb.append(" ");
|
||||
sb.append(filter.getMessage());
|
||||
}
|
||||
if (playerSacs && !filter.getMessage().contains("with")) {
|
||||
sb.append(" of their choice");
|
||||
}
|
||||
staticText = sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class SacrificeOpponentsUnlessPayEffect extends OneShotEffect {
|
|||
super(Outcome.Sacrifice);
|
||||
this.cost = cost;
|
||||
this.filter = filter;
|
||||
this.staticText = "each opponent sacrifices " + CardUtil.addArticle(filter.getMessage()) + " unless they " + CardUtil.addCostVerb(cost.getText());
|
||||
this.staticText = "each opponent sacrifices " + CardUtil.addArticle(filter.getMessage()) + " of their choice unless they " + CardUtil.addCostVerb(cost.getText());
|
||||
}
|
||||
|
||||
protected SacrificeOpponentsUnlessPayEffect(final SacrificeOpponentsUnlessPayEffect effect) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue