mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
* Fixed a lot of sacrifice handling that was targeted and some sacrifice where the player that could sacrifice was not checked correctly (e.g. Kiki-Jiki, Mirror Breaker Token).
This commit is contained in:
parent
d7e64287ef
commit
8d1da5c35f
28 changed files with 326 additions and 373 deletions
|
@ -43,6 +43,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -56,10 +57,6 @@ public class SlaveOfBolas extends CardImpl {
|
|||
super(ownerId, 136, "Slave of Bolas", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U/R}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Gain control of target creature. Untap that creature. It gains haste until end of turn. Sacrifice it at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new UntapTargetEffect());
|
||||
|
@ -96,13 +93,17 @@ class SlaveOfBolasEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,16 +37,13 @@ import mage.abilities.effects.Effect;
|
|||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -65,15 +62,13 @@ public class LordOfTresserhorn extends CardImpl {
|
|||
|
||||
// When Lord of Tresserhorn enters the battlefield, you lose 2 life, you sacrifice two creatures, and target opponent draws two cards.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(2), false);
|
||||
ability.addEffect(new SacrificeTargetEffect(", you sacrifice two creatures"));
|
||||
Target target = new TargetControlledCreaturePermanent(2,2, new FilterControlledCreaturePermanent(), true);
|
||||
ability.addTarget(target);
|
||||
ability.addEffect(new SacrificeControllerEffect(new FilterControlledCreaturePermanent("creatures"), 2, "you"));
|
||||
Effect effect = new DrawCardTargetEffect(2);
|
||||
effect.setText(", and target opponent draws two cards");
|
||||
effect.setTargetPointer(new SecondTargetPointer());
|
||||
ability.addEffect(effect);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {B}: Regenerate Lord of Tresserhorn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")));
|
||||
}
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
package mage.sets.avacynrestored;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -40,7 +37,11 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -54,7 +55,6 @@ public class ThatcherRevolt extends CardImpl {
|
|||
super(ownerId, 158, "Thatcher Revolt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
||||
|
||||
// Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new ThatcherRevoltEffect());
|
||||
}
|
||||
|
@ -90,14 +90,16 @@ class ThatcherRevoltEffect extends OneShotEffect {
|
|||
for (int i = 0; i < 3; i++) {
|
||||
RedHumanToken token = new RedHumanToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
Permanent permanent = game.getPermanent(token.getLastAddedToken());
|
||||
if (permanent != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,13 +25,9 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
|
@ -41,8 +37,10 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
@ -58,8 +56,8 @@ public class JunkyoBell extends CardImpl {
|
|||
public JunkyoBell(UUID ownerId) {
|
||||
super(ownerId, 258, "Junkyo Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
this.expansionSetCode = "CHK";
|
||||
|
||||
// At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn,
|
||||
|
||||
// At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn,
|
||||
// where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step.
|
||||
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent());
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn), TargetController.YOU, true);
|
||||
|
@ -77,37 +75,36 @@ public class JunkyoBell extends CardImpl {
|
|||
return new JunkyoBell(this);
|
||||
}
|
||||
|
||||
|
||||
private class JunkyoBellSacrificeEffect extends OneShotEffect {
|
||||
private class JunkyoBellSacrificeEffect extends OneShotEffect {
|
||||
|
||||
public JunkyoBellSacrificeEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "If you do, sacrifice that creature at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JunkyoBellSacrificeEffect copy() {
|
||||
return new JunkyoBellSacrificeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(source.getFirstTarget());
|
||||
if (creature != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
public JunkyoBellSacrificeEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "If you do, sacrifice that creature at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JunkyoBellSacrificeEffect copy() {
|
||||
return new JunkyoBellSacrificeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(source.getFirstTarget());
|
||||
if (creature != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName(), source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
|
@ -42,7 +38,10 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
@ -124,8 +123,7 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect {
|
|||
token.addAbility(HasteAbility.getInstance());
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect();
|
||||
sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step");
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
|
|
|
@ -30,22 +30,26 @@ package mage.sets.championsofkamigawa;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.effects.common.continuous.SetCardSubtypeAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
@ -54,7 +58,8 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class OniPossession extends CardImpl {
|
||||
|
||||
private static final List<String> setSubtypes = new ArrayList<String>();
|
||||
private static final List<String> setSubtypes = new ArrayList<>();
|
||||
|
||||
static {
|
||||
setSubtypes.add("Demon");
|
||||
setSubtypes.add("Spirit");
|
||||
|
@ -67,13 +72,14 @@ public class OniPossession extends CardImpl {
|
|||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// At the beginning of your upkeep, sacrifice a creature.
|
||||
Ability ability2 = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect("sacrifice a creature"), TargetController.YOU, false);
|
||||
ability2.addTarget(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent(),false));
|
||||
Ability ability2 = new BeginningOfUpkeepTriggeredAbility(
|
||||
new SacrificeControllerEffect(new FilterControlledCreaturePermanent(), 1, ""), TargetController.YOU, false);
|
||||
this.addAbility(ability2);
|
||||
// Enchanted creature gets +3/+3 and has trample.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));
|
||||
|
|
|
@ -63,7 +63,6 @@ public class ThroughTheBreach extends CardImpl {
|
|||
this.expansionSetCode = "CHK";
|
||||
this.subtype.add("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 ThroughTheBreachEffect());
|
||||
// Splice onto Arcane {2}{R}{R}
|
||||
|
@ -81,7 +80,7 @@ public class ThroughTheBreach extends CardImpl {
|
|||
}
|
||||
|
||||
class ThroughTheBreachEffect extends OneShotEffect {
|
||||
|
||||
|
||||
private static final String choiceText = "Put a creature card from your hand onto the battlefield?";
|
||||
|
||||
public ThroughTheBreachEffect() {
|
||||
|
@ -111,10 +110,10 @@ class ThroughTheBreachEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
|
|
|
@ -46,6 +46,7 @@ import mage.constants.Rarity;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.EmptyToken;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
@ -113,15 +114,16 @@ class FeldonOfTheThirdPathEffect extends OneShotEffect {
|
|||
}
|
||||
token.addAbility(HasteAbility.getInstance());
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect();
|
||||
sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
Permanent permanent = game.getPermanent(token.getLastAddedToken());
|
||||
if (permanent != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ import mage.abilities.DelayedTriggeredAbility;
|
|||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.GetXValue;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -64,7 +63,6 @@ public class WakeTheDead extends CardImpl {
|
|||
super(ownerId, 31, "Wake the Dead", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{B}{B}");
|
||||
this.expansionSetCode = "C14";
|
||||
|
||||
|
||||
// Cast Wake the Dead only during combat on an opponent's turn.
|
||||
Ability ability = new SimpleStaticAbility(Zone.ALL, new WakeTheDeadEffect());
|
||||
ability.setRuleAtTheTop(true);
|
||||
|
@ -72,7 +70,7 @@ public class WakeTheDead extends CardImpl {
|
|||
|
||||
// Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0,Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,7 +78,7 @@ public class WakeTheDead extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
||||
ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,8 +157,8 @@ class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEff
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.changeControllerId(source.getControllerId(), game);
|
||||
Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step");
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step", source.getControllerId());
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -51,19 +50,20 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class AshlingTheExtinguisher extends CardImpl {
|
||||
|
||||
public AshlingTheExtinguisher (UUID ownerId) {
|
||||
public AshlingTheExtinguisher(UUID ownerId) {
|
||||
super(ownerId, 33, "Ashling, the Extinguisher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Elemental");
|
||||
this.subtype.add("Shaman");
|
||||
|
||||
// Whenever Ashling, the Extinguisher deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature.
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.addAbility(new AshlingTheExtinguisherTriggeredAbility());
|
||||
}
|
||||
|
||||
public AshlingTheExtinguisher (final AshlingTheExtinguisher card) {
|
||||
public AshlingTheExtinguisher(final AshlingTheExtinguisher card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,7 @@ public class AshlingTheExtinguisher extends CardImpl {
|
|||
}
|
||||
|
||||
class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public AshlingTheExtinguisherTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new SacrificeTargetEffect());
|
||||
this.addTarget(new TargetCreaturePermanent());
|
||||
|
@ -115,4 +116,4 @@ class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public String getRule() {
|
||||
return "Whenever {this} deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,12 @@ package mage.sets.invasion;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -46,18 +44,18 @@ import mage.target.TargetPermanent;
|
|||
public class Dredge extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("a creature or land");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
||||
}
|
||||
|
||||
|
||||
public Dredge(UUID ownerId) {
|
||||
super(ownerId, 103, "Dredge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}");
|
||||
this.expansionSetCode = "INV";
|
||||
|
||||
// Sacrifice a creature or land.
|
||||
this.getSpellAbility().addEffect(new SacrificeControllerEffect(filter, 1, ""));
|
||||
|
||||
|
||||
// Draw a card.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
|
||||
}
|
||||
|
|
|
@ -29,15 +29,12 @@ package mage.sets.legions;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -53,11 +50,7 @@ public class GoblinFirebug extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Goblin Firebug leaves the battlefield, sacrifice a land.
|
||||
Effect effect = new SacrificeTargetEffect();
|
||||
effect.setText("sacrifice a land");
|
||||
Ability ability = new LeavesBattlefieldTriggeredAbility(effect, false);
|
||||
ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false));
|
||||
}
|
||||
|
||||
public GoblinFirebug(final GoblinFirebug card) {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class IncandescentSoulstoke extends CardImpl {
|
|||
static {
|
||||
filter.add(new SubtypePredicate("Elemental"));
|
||||
}
|
||||
|
||||
|
||||
public IncandescentSoulstoke(UUID ownerId) {
|
||||
super(ownerId, 178, "Incandescent Soulstoke", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.expansionSetCode = "LRW";
|
||||
|
@ -81,13 +81,12 @@ public class IncandescentSoulstoke extends CardImpl {
|
|||
|
||||
// Other Elemental creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
|
||||
|
||||
|
||||
|
||||
// {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(Zone.BATTLEFIELD, new IncandescentSoulstokeEffect(), new ManaCostsImpl<>("{1}{R}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public IncandescentSoulstoke(final IncandescentSoulstoke card) {
|
||||
|
@ -101,7 +100,7 @@ public class IncandescentSoulstoke extends CardImpl {
|
|||
}
|
||||
|
||||
class IncandescentSoulstokeEffect extends OneShotEffect {
|
||||
|
||||
|
||||
private static final String choiceText = "Put an Elemental creature card from your hand onto the battlefield?";
|
||||
|
||||
public IncandescentSoulstokeEffect() {
|
||||
|
@ -133,10 +132,10 @@ class IncandescentSoulstokeEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
|
|
|
@ -30,14 +30,13 @@ package mage.sets.magic2014;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -50,7 +49,6 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
@ -60,6 +58,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class ShadowbornDemon extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Demon creature");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new SubtypePredicate("Demon")));
|
||||
}
|
||||
|
@ -75,17 +74,14 @@ public class ShadowbornDemon extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Shadowborn Demon enters the battlefield, destroy target non-Demon creature.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(),false);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
|
||||
// At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature.
|
||||
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect(), TargetController.YOU, false);
|
||||
target = new TargetControlledCreaturePermanent();
|
||||
target.setNotTarget(false);
|
||||
triggeredAbility.addTarget(target);
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
triggeredAbility,
|
||||
new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), TargetController.YOU, false),
|
||||
new InvertCondition(new CreatureCardsInControllerGraveCondition(6)),
|
||||
"At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature"));
|
||||
|
||||
|
@ -102,6 +98,7 @@ public class ShadowbornDemon extends CardImpl {
|
|||
}
|
||||
|
||||
class CreatureCardsInControllerGraveCondition implements Condition {
|
||||
|
||||
private int value;
|
||||
|
||||
public CreatureCardsInControllerGraveCondition(int value) {
|
||||
|
@ -111,10 +108,9 @@ class CreatureCardsInControllerGraveCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player p = game.getPlayer(source.getControllerId());
|
||||
if (p != null && p.getGraveyard().count(new FilterCreatureCard(), game) >= value)
|
||||
{
|
||||
return true;
|
||||
if (p != null && p.getGraveyard().count(new FilterCreatureCard(), game) >= value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,16 +29,13 @@ package mage.sets.masterseditioniv;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -55,13 +52,9 @@ public class FoulSpirit extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// When Foul Spirit enters the battlefield, sacrifice a land.
|
||||
Effect effect = new SacrificeTargetEffect();
|
||||
effect.setText("sacrifice a land");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false));
|
||||
}
|
||||
|
||||
public FoulSpirit(final FoulSpirit card) {
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
package mage.sets.planarchaos;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
|
@ -43,7 +39,12 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
|||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -57,7 +58,6 @@ public class FatalFrenzy extends CardImpl {
|
|||
super(ownerId, 98, "Fatal Frenzy", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||
this.expansionSetCode = "PLC";
|
||||
|
||||
|
||||
// Until end of turn, target creature you control gains trample and gets +X/+0, where X is its power. Sacrifice it at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true));
|
||||
|
@ -94,13 +94,16 @@ class FatalFrenzyEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,8 +76,7 @@ public class RealityAcid extends CardImpl {
|
|||
this.addAbility(new VanishingSacrificeAbility());
|
||||
|
||||
// When Reality Acid leaves the battlefield, enchanted permanent's controller sacrifices it.
|
||||
Effect effect = new SacrificeTargetEffect();
|
||||
effect.setText("enchanted permanent's controller sacrifices it");
|
||||
Effect effect = new SacrificeTargetEffect("enchanted permanent's controller sacrifices it");
|
||||
this.addAbility(new RealityAcidTriggeredAbility(effect, false));
|
||||
}
|
||||
|
||||
|
|
|
@ -25,20 +25,25 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.riseoftheeldrazi;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
|
@ -48,29 +53,27 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
|||
*/
|
||||
public class DemonicAppetite extends CardImpl {
|
||||
|
||||
public DemonicAppetite (UUID ownerId) {
|
||||
public DemonicAppetite(UUID ownerId) {
|
||||
super(ownerId, 106, "Demonic Appetite", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||
this.expansionSetCode = "ROE";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
|
||||
// Enchant creature you control
|
||||
TargetPermanent auraTarget = new TargetControlledCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature gets +3/+3.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));
|
||||
|
||||
ability = new BeginningOfUpkeepTriggeredAbility(
|
||||
new DemonicAppetiteEffect(),
|
||||
TargetController.YOU,
|
||||
false);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
// At the beginning of your upkeep, sacrifice a creature.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent("a creature"), 1, ""),
|
||||
TargetController.YOU, false));
|
||||
}
|
||||
|
||||
public DemonicAppetite (final DemonicAppetite card) {
|
||||
public DemonicAppetite(final DemonicAppetite card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -80,16 +83,16 @@ public class DemonicAppetite extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class DemonicAppetiteEffect extends SacrificeTargetEffect {
|
||||
class DemonicAppetiteEffect extends SacrificeTargetEffect {
|
||||
|
||||
DemonicAppetiteEffect() {
|
||||
super();
|
||||
staticText = "sacrifice a creature";
|
||||
}
|
||||
DemonicAppetiteEffect() {
|
||||
super();
|
||||
staticText = "sacrifice a creature";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DemonicAppetiteEffect copy() {
|
||||
return new DemonicAppetiteEffect();
|
||||
}
|
||||
@Override
|
||||
public DemonicAppetiteEffect copy() {
|
||||
return new DemonicAppetiteEffect();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,15 +32,9 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
|
@ -62,7 +56,6 @@ public class FootstepsOfTheGoryo extends CardImpl {
|
|||
this.expansionSetCode = "SOK";
|
||||
this.subtype.add("Arcane");
|
||||
|
||||
|
||||
// Return target creature card from your graveyard to the battlefield. Sacrifice that creature at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new FootstepsOfTheGoryoEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard()));
|
||||
|
@ -104,8 +97,8 @@ class FootstepsOfTheGoryoEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
// Sacrifice it at end of turn
|
||||
Effect sacrificeEffect = new SacrificeTargetEffect("Sacrifice that creature at the beginning of next end step");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
Effect sacrificeEffect = new SacrificeTargetEffect("Sacrifice that creature at the beginning of next end step", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
|
|
|
@ -30,23 +30,19 @@ package mage.sets.saviorsofkamigawa;
|
|||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -62,7 +58,10 @@ public class WineOfBloodAndIron extends CardImpl {
|
|||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true),
|
||||
new GenericManaCost(4));
|
||||
ability.addEffect(new WineOfBloodAndIronEffect());
|
||||
Effect effect = new CreateDelayedTriggeredAbilityEffect(
|
||||
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()), false);
|
||||
effect.setText("Sacrifice {this} at the beginning of the next end step");
|
||||
ability.addEffect(effect);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -76,32 +75,3 @@ public class WineOfBloodAndIron extends CardImpl {
|
|||
return new WineOfBloodAndIron(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WineOfBloodAndIronEffect extends OneShotEffect {
|
||||
|
||||
public WineOfBloodAndIronEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "Sacrifice {this} at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public WineOfBloodAndIronEffect(final WineOfBloodAndIronEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WineOfBloodAndIronEffect copy() {
|
||||
return new WineOfBloodAndIronEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(source.getSourceId()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,13 +25,9 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.scarsofmirrodin;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
|
@ -39,7 +35,9 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
@ -60,16 +58,19 @@ public class ShapeAnew extends CardImpl {
|
|||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
}
|
||||
|
||||
public ShapeAnew (UUID ownerId) {
|
||||
public ShapeAnew(UUID ownerId) {
|
||||
super(ownerId, 43, "Shape Anew", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
|
||||
this.expansionSetCode = "SOM";
|
||||
|
||||
this.getSpellAbility().addEffect(new SacrificeTargetEffect());
|
||||
// The controller of target artifact sacrifices it, then reveals cards from the top
|
||||
// of his or her library until he or she reveals an artifact card. That player puts
|
||||
// that card onto the battlefield, then shuffles all other cards revealed this way into his or her library.
|
||||
this.getSpellAbility().addEffect(new SacrificeTargetEffect("The controller of target artifact sacrifices it"));
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addEffect(new ShapeAnewEffect());
|
||||
}
|
||||
|
||||
public ShapeAnew (final ShapeAnew card) {
|
||||
public ShapeAnew(final ShapeAnew card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -82,7 +83,7 @@ public class ShapeAnew extends CardImpl {
|
|||
|
||||
public ShapeAnewEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
staticText = "Then reveals cards from the top of his or her library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library";
|
||||
staticText = ", then reveals cards from the top of his or her library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library";
|
||||
}
|
||||
|
||||
public ShapeAnewEffect(ShapeAnewEffect effect) {
|
||||
|
@ -102,9 +103,9 @@ public class ShapeAnew extends CardImpl {
|
|||
Cards revealed = new CardsImpl();
|
||||
Card artifactCard = null;
|
||||
Cards nonArtifactCards = new CardsImpl();
|
||||
Player player = game.getPlayer(sourcePermanent.getControllerId());
|
||||
while (artifactCard == null && player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
Player targetController = game.getPlayer(sourcePermanent.getControllerId());
|
||||
while (artifactCard == null && targetController.getLibrary().size() > 0) {
|
||||
Card card = targetController.getLibrary().removeFromTop(game);
|
||||
revealed.add(card);
|
||||
if (card.getCardType().contains(CardType.ARTIFACT)) {
|
||||
artifactCard = card;
|
||||
|
@ -112,14 +113,12 @@ public class ShapeAnew extends CardImpl {
|
|||
nonArtifactCards.add(card);
|
||||
}
|
||||
}
|
||||
player.revealCards("Shape Anew", revealed, game);
|
||||
targetController.revealCards(sourcePermanent.getIdName(), revealed, game);
|
||||
if (artifactCard != null) {
|
||||
artifactCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
artifactCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), targetController.getId());
|
||||
}
|
||||
for (Card cardToMove: nonArtifactCards.getCards(game)) {
|
||||
cardToMove.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
targetController.moveCards(nonArtifactCards, null, Zone.LIBRARY, source, game);
|
||||
targetController.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ import mage.filter.FilterCard;
|
|||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -117,16 +118,19 @@ class ImpromptuRaidEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
if (controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId())) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect();
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("", source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ package mage.sets.tempest;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,11 +50,9 @@ public class ServantOfVolrath extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Servant of Volrath leaves the battlefield, sacrifice a creature.
|
||||
Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeTargetEffect(), false);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false));
|
||||
}
|
||||
|
||||
|
||||
public ServantOfVolrath(final ServantOfVolrath card) {
|
||||
super(card);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ public class SneakAttack extends CardImpl {
|
|||
super(ownerId, 218, "Sneak Attack", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||
this.expansionSetCode = "USG";
|
||||
|
||||
|
||||
// {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(Zone.BATTLEFIELD, new SneakAttackEffect(), new ManaCostsImpl("{R}")));
|
||||
}
|
||||
|
@ -78,23 +77,23 @@ public class SneakAttack extends CardImpl {
|
|||
}
|
||||
|
||||
class SneakAttackEffect extends OneShotEffect {
|
||||
|
||||
|
||||
private static final String choiceText = "Put a creature card from your hand onto the battlefield?";
|
||||
|
||||
|
||||
public SneakAttackEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "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";
|
||||
}
|
||||
|
||||
|
||||
public SneakAttackEffect(final SneakAttackEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SneakAttackEffect copy() {
|
||||
return new SneakAttackEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
@ -106,20 +105,21 @@ class SneakAttackEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
if (player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) {
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
game.addEffect(effect, source);
|
||||
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
|
||||
if (permanent != null) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,16 +30,11 @@ package mage.sets.zendikar;
|
|||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -57,7 +52,8 @@ public class RuinousMinotaur extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Ruinous Minotaur deals damage to an opponent, sacrifice a land.
|
||||
this.addAbility(new RuinousMinotaurTriggeredAbility());
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false, false));
|
||||
|
||||
}
|
||||
|
||||
public RuinousMinotaur(final RuinousMinotaur card) {
|
||||
|
@ -69,38 +65,3 @@ public class RuinousMinotaur extends CardImpl {
|
|||
return new RuinousMinotaur(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RuinousMinotaurTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
|
||||
|
||||
public RuinousMinotaurTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new SacrificeTargetEffect(), false);
|
||||
this.addTarget(new TargetControlledPermanent(filter));
|
||||
}
|
||||
|
||||
public RuinousMinotaurTriggeredAbility(final RuinousMinotaurTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuinousMinotaurTriggeredAbility copy() {
|
||||
return new RuinousMinotaurTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return event.getSourceId().equals(this.sourceId)
|
||||
&& game.getOpponents(this.getControllerId()).contains(event.getTargetId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever {this} deals damage to an opponent, sacrifice a land.";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package org.mage.test.cards.copy;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
|
@ -79,6 +78,7 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Voice of Resurgence", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3);
|
||||
// Flamebreak deals 3 damage to each creature without flying and each player. Creatures dealt damage this way can't be regenerated this turn.
|
||||
addCard(Zone.HAND, playerB, "Flamebreak");
|
||||
|
||||
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Put a token that's a copy of target nonlegendary creature you control onto the battlefield. That token has haste. Sacrifice it at the beginning of the next end step.");
|
||||
|
@ -97,7 +97,41 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, "Elemental", 2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Kiki-Jiki, Mirror Breaker creates a copy of Humble Defector, activate
|
||||
* Humble defector, token gets sacrificed while under opponents control.
|
||||
*/
|
||||
@Test
|
||||
public void testTokenNotSacrificedIfNotControlled() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
|
||||
// Tap target creature you don't control.
|
||||
// Overload {3}{U}
|
||||
addCard(Zone.HAND, playerA, "Blustersquall", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Kiki-Jiki, Mirror Breaker", 1);
|
||||
// {T}: Draw two cards. Target opponent gains control of Humble Defector. Activate this ability only during your turn.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Humble Defector", 1);
|
||||
|
||||
castSpell(2, PhaseStep.UPKEEP, playerA, "Blustersquall", "Humble Defector"); // Tap nontoken Defector so only the Token can be used later
|
||||
|
||||
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Put a token that's a copy of target nonlegendary creature you control onto the battlefield. That token has haste. Sacrifice it at the beginning of the next end step.");
|
||||
|
||||
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Draw two cards. Target opponent gains control");
|
||||
|
||||
setStopAt(3, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
assertHandCount(playerB, 3); // normal 1 draw of turn two + 2 from Defector
|
||||
|
||||
assertGraveyardCount(playerA, "Blustersquall", 1);
|
||||
assertPermanentCount(playerB, "Humble Defector", 1);
|
||||
assertPermanentCount(playerA, "Humble Defector", 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ import mage.abilities.TriggeredAbilityImpl;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagePlayerEvent;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
@ -45,7 +44,7 @@ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl
|
|||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect) {
|
||||
this(effect, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, false);
|
||||
|
|
|
@ -1,38 +1,37 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -42,17 +41,31 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class SacrificeTargetEffect extends OneShotEffect {
|
||||
|
||||
protected UUID playerIdThatHasToSacrifice;
|
||||
|
||||
public SacrificeTargetEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this("");
|
||||
}
|
||||
|
||||
public SacrificeTargetEffect(String text) {
|
||||
this();
|
||||
this(text, null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param text use this text as rule text for the effect
|
||||
* @param playerIdThatHasToSacrifice only this playerId has to sacrifice
|
||||
* (others can't)
|
||||
*/
|
||||
public SacrificeTargetEffect(String text, UUID playerIdThatHasToSacrifice) {
|
||||
super(Outcome.Sacrifice);
|
||||
this.playerIdThatHasToSacrifice = playerIdThatHasToSacrifice;
|
||||
staticText = text;
|
||||
}
|
||||
|
||||
public SacrificeTargetEffect(final SacrificeTargetEffect effect) {
|
||||
super(effect);
|
||||
this.playerIdThatHasToSacrifice = effect.playerIdThatHasToSacrifice;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -65,7 +78,7 @@ public class SacrificeTargetEffect extends OneShotEffect {
|
|||
int affectedTargets = 0;
|
||||
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(permanentId);
|
||||
if (permanent != null) {
|
||||
if (permanent != null && (playerIdThatHasToSacrifice == null || playerIdThatHasToSacrifice.equals(permanent.getControllerId()))) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
affectedTargets++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue