Merge origin/master

This commit is contained in:
Styxo 2016-03-30 22:23:11 +02:00
commit 7ec91d55bb
26 changed files with 716 additions and 22 deletions

View file

@ -28,11 +28,16 @@
package mage.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
@ -52,8 +57,14 @@ public class AshmouthBlade extends CardImpl {
// this card is the second face of double-faced card
this.nightCard = true;
// Equipped creature gets +3/+3.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3)));
// Equipped creature gets +3/+3
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3));
this.addAbility(ability);
// and has first strike.
Effect effect = new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT);
effect.setText("and has first strike");
ability.addEffect(effect);
// Equip {3}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));

View file

@ -91,7 +91,7 @@ class BriarbridgePatrolCondition implements Condition {
PermanentsSacrificedWatcher watcher = (PermanentsSacrificedWatcher) game.getState().getWatchers().get(PermanentsSacrificedWatcher.class.getName());
if (watcher != null) {
List<Permanent> sacrificedPermanents = watcher.getThisTurnSacrificedPermanents(source.getControllerId());
if (!sacrificedPermanents.isEmpty()) {
if (sacrificedPermanents != null && !sacrificedPermanents.isEmpty()) {
int amountOfClues = 0;
for (Permanent permanent : sacrificedPermanents) {
if (permanent.getSubtype().contains("Clue")) {

View file

@ -60,7 +60,7 @@ public class ConfrontTheUnknown extends CardImpl {
Effect effect = new InvestigateEffect();
effect.setText("Investigate");
getSpellAbility().addEffect(effect);
effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Duration.EndOfTurn);
effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Duration.EndOfTurn, true);
effect.setText(", then target creature gets +1/+1 until end of turn for each Clue you control. <i>(To investigate, "
+ "put a colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\")</i>");
getSpellAbility().addEffect(effect);

View file

@ -54,6 +54,7 @@ public class FlameheartWerewolf extends CardImpl {
this.subtype.add("Werewolf");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
this.color.setRed(true);
// this card is the second face of double-faced card
this.nightCard = true;

View file

@ -29,16 +29,19 @@ package mage.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SacrificeAllTriggeredAbility;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect;
import mage.abilities.effects.keyword.InvestigateEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.TargetPlayer;
/**
@ -61,7 +64,7 @@ public class FleetingMemories extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new InvestigateEffect(), false));
// Whenever you sacrifice a Clue, target player puts the top three cards of his or her graveyard into his or her graveyard.
Ability ability = new SacrificeAllTriggeredAbility(new PutTopCardOfLibraryIntoGraveTargetEffect(3), filter, TargetController.YOU, false);
Ability ability = new FleetingMemoriesTriggeredAbility();
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
@ -75,3 +78,36 @@ public class FleetingMemories extends CardImpl {
return new FleetingMemories(this);
}
}
class FleetingMemoriesTriggeredAbility extends TriggeredAbilityImpl {
public FleetingMemoriesTriggeredAbility() {
super(Zone.BATTLEFIELD, new PutTopCardOfLibraryIntoGraveTargetEffect(3));
setLeavesTheBattlefieldTrigger(true);
}
public FleetingMemoriesTriggeredAbility(final FleetingMemoriesTriggeredAbility ability) {
super(ability);
}
@Override
public FleetingMemoriesTriggeredAbility copy() {
return new FleetingMemoriesTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SACRIFICED_PERMANENT;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype().contains("Clue");
}
@Override
public String getRule() {
return "Whenever you sacrifice a Clue, " + super.getRule();
}
}

View file

@ -53,6 +53,8 @@ public class GatstafRavagers extends CardImpl {
this.subtype.add("Werewolf");
this.power = new MageInt(6);
this.toughness = new MageInt(5);
this.color.setRed(true);
this.canTransform = true;
this.nightCard = true;

View file

@ -0,0 +1,108 @@
/*
* 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.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author halljared
*/
public class HarvestHand extends CardImpl {
public HarvestHand(UUID ownerId) {
super(ownerId, 256, "Harvest Hand", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.expansionSetCode = "SOI";
this.subtype.add("Scarecrow");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.canTransform = true;
this.secondSideCard = new ScroungedScythe(ownerId);
// When Harvest Hand dies, return it to the battlefield transformed under your control.
this.addAbility(new TransformAbility());
this.addAbility(new DiesTriggeredAbility(new HarvestHandReturnTransformedEffect()));
}
public HarvestHand(final HarvestHand card) {
super(card);
}
@Override
public HarvestHand copy() {
return new HarvestHand(this);
}
}
class HarvestHandReturnTransformedEffect extends OneShotEffect {
public HarvestHandReturnTransformedEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "Return {this} to the battlefield transformed under your control";
}
public HarvestHandReturnTransformedEffect(final HarvestHandReturnTransformedEffect effect) {
super(effect);
}
@Override
public HarvestHandReturnTransformedEffect copy() {
return new HarvestHandReturnTransformedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
Card card = game.getCard(source.getSourceId());
if (card != null) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
}
}
return true;
}
return false;
}
}

View file

@ -51,6 +51,7 @@ public class IncitedRabble extends CardImpl {
this.subtype.add("Human");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
this.color.setRed(true);
// this card is the second face of double-faced card
this.nightCard = true;

View file

@ -56,6 +56,7 @@ public class LoneWolfOfTheNatterknolls extends CardImpl {
this.subtype.add("Werewolf");
this.power = new MageInt(3);
this.toughness = new MageInt(5);
this.color.setGreen(true);
this.nightCard = true;
this.canTransform = true;

View file

@ -36,7 +36,6 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
@ -49,9 +48,11 @@ public class MorkrutNecropod extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("another creature or land");
static {
filter.add(Predicates.or(Predicates.and(new AnotherPredicate(), new CardTypePredicate(CardType.CREATURE)),
new CardTypePredicate(CardType.LAND)));
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.LAND)));
filter.add(new AnotherPredicate());
}
public MorkrutNecropod(UUID ownerId) {
@ -66,7 +67,7 @@ public class MorkrutNecropod extends CardImpl {
this.addAbility(new MenaceAbility());
// Whenever Morkrut Necropod attacks or blocks, sacrifice another creature or land.
this.addAbility(new AttacksOrBlocksTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false));
this.addAbility(new AttacksOrBlocksTriggeredAbility(new SacrificeControllerEffect(filter, 1, ""), false));
}
public MorkrutNecropod(final MorkrutNecropod card) {

View file

@ -0,0 +1,116 @@
/*
* 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.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author halljared
*/
public class NeglectedHeirloom extends CardImpl {
public NeglectedHeirloom(UUID ownerId) {
super(ownerId, 260, "Neglected Heirloom", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "SOI";
this.subtype.add("Equipment");
this.canTransform = true;
this.secondSideCard = new AshmouthBlade(ownerId);
// Equipped creature gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
// When equipped creature transforms, transform Neglected Heirloom.
this.addAbility(new TransformAbility());
this.addAbility(new NeglectedHeirloomTriggeredAbility());
}
public NeglectedHeirloom(final NeglectedHeirloom card) {
super(card);
}
@Override
public NeglectedHeirloom copy() {
return new NeglectedHeirloom(this);
}
}
class NeglectedHeirloomTriggeredAbility extends TriggeredAbilityImpl {
public NeglectedHeirloomTriggeredAbility() {
super(Zone.BATTLEFIELD, new TransformSourceEffect(true), false);
}
public NeglectedHeirloomTriggeredAbility(final NeglectedHeirloomTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.TRANSFORMED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.TRANSFORMED) {
if (game.getPermanent(event.getTargetId()).getAttachments().contains(this.getSourceId())) {
return true;
}
}
return false;
}
@Override
public NeglectedHeirloomTriggeredAbility copy() {
return new NeglectedHeirloomTriggeredAbility(this);
}
@Override
public String getRule() {
return "When equipped creature transforms, transform Neglected Heirloom.";
}
}

View file

@ -52,6 +52,7 @@ public class OneOfThePack extends CardImpl {
this.subtype.add("Werewolf");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
this.color.setGreen(true);
this.nightCard = true;
this.canTransform = true;

View file

@ -48,6 +48,7 @@ public class PersistentNightmare extends CardImpl {
this.subtype.add("Nightmare");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.color.setBlue(true);
// this card is the second face of double-faced card
this.nightCard = true;

View file

@ -37,9 +37,11 @@ import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffec
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
@ -49,6 +51,11 @@ import mage.game.events.GameEvent;
* @author LevelX2
*/
public class PrizedAmalgam extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
public PrizedAmalgam(UUID ownerId) {
super(ownerId, 249, "Prized Amalgam", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{B}");
@ -59,7 +66,7 @@ public class PrizedAmalgam extends CardImpl {
// Whenever a creature enters the battlefield, if it entered from your graveyard or you cast it from your graveyard, return Prized Amalgam from your graveyard to the battlefield tapped at the beginning of the next end step.
this.addAbility(new PrizedAmalgamTriggerdAbility(new CreateDelayedTriggeredAbilityEffect(
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceFromGraveyardToBattlefieldEffect(true))), new FilterCreaturePermanent()));
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceFromGraveyardToBattlefieldEffect(true))), filter));
}
public PrizedAmalgam(final PrizedAmalgam card) {

View file

@ -46,6 +46,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.AnotherCardPredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
@ -105,13 +106,14 @@ class RelentlessDeadEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", source, game)) {
if (controller.chooseUse(Outcome.BoostCreature, "Do you want to pay {X}?", source, game)) {
int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
Cost cost = new GenericManaCost(costX);
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
FilterCard filter = new FilterCard("Zombie card with converted mana cost " + costX);
FilterCard filter = new FilterCard("Another target Zombie card with converted mana cost " + costX);
filter.add(new SubtypePredicate("Zombie"));
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, costX));
filter.add(new AnotherCardPredicate());
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
if (controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());

View file

@ -1,3 +1,4 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
@ -56,6 +57,8 @@ public class ScroungedScythe extends CardImpl {
this.expansionSetCode = "SOI";
this.subtype.add("Equipment");
this.nightCard = true;
// Equipped creature gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
@ -76,4 +79,4 @@ public class ScroungedScythe extends CardImpl {
public ScroungedScythe copy() {
return new ScroungedScythe(this);
}
}
}

View file

@ -29,19 +29,21 @@ package mage.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.common.SacrificeAllTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.keyword.InvestigateEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
/**
*
@ -67,7 +69,7 @@ public class TirelessTracker extends CardImpl {
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new InvestigateEffect(), new FilterControlledLandPermanent("a land"), false, null, true));
// Whenever you sacrifice a Clue, put a +1/+1 counter on Tireless Tracker.
this.addAbility(new SacrificeAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, TargetController.YOU, false));
this.addAbility(new TirelessTrackerTriggeredAbility());
}
public TirelessTracker(final TirelessTracker card) {
@ -79,3 +81,36 @@ public class TirelessTracker extends CardImpl {
return new TirelessTracker(this);
}
}
class TirelessTrackerTriggeredAbility extends TriggeredAbilityImpl {
public TirelessTrackerTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
setLeavesTheBattlefieldTrigger(true);
}
public TirelessTrackerTriggeredAbility(final TirelessTrackerTriggeredAbility ability) {
super(ability);
}
@Override
public TirelessTrackerTriggeredAbility copy() {
return new TirelessTrackerTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SACRIFICED_PERMANENT;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype().contains("Clue");
}
@Override
public String getRule() {
return "Whenever you sacrifice a Clue, " + super.getRule();
}
}

View file

@ -28,20 +28,24 @@
package mage.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SacrificeAllTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.keyword.InvestigateEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
/**
*
@ -66,7 +70,7 @@ public class UlvenwaldMysteries extends CardImpl {
this.addAbility(new DiesCreatureTriggeredAbility(new InvestigateEffect(), false, filter));
// Whenever you sacrifice a Clue, put a 1/1 white Human Soldier creature token onto the battlefield.
this.addAbility(new SacrificeAllTriggeredAbility(new CreateTokenEffect(new HumanSoldierToken()), filterClue, TargetController.YOU, false));
this.addAbility(new UlvenwaldMysteriesTriggeredAbility());
}
public UlvenwaldMysteries(final UlvenwaldMysteries card) {
@ -78,3 +82,36 @@ public class UlvenwaldMysteries extends CardImpl {
return new UlvenwaldMysteries(this);
}
}
class UlvenwaldMysteriesTriggeredAbility extends TriggeredAbilityImpl {
public UlvenwaldMysteriesTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new HumanSoldierToken()));
setLeavesTheBattlefieldTrigger(true);
}
public UlvenwaldMysteriesTriggeredAbility(final UlvenwaldMysteriesTriggeredAbility ability) {
super(ability);
}
@Override
public UlvenwaldMysteriesTriggeredAbility copy() {
return new UlvenwaldMysteriesTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SACRIFICED_PERMANENT;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype().contains("Clue");
}
@Override
public String getRule() {
return "Whenever you sacrifice a Clue, " + super.getRule();
}
}

View file

@ -62,6 +62,7 @@ public class VildinPackAlpha extends CardImpl {
this.subtype.add("Werewolf");
this.power = new MageInt(4);
this.toughness = new MageInt(3);
this.color.setRed(true);
this.canTransform = true;
this.nightCard = true;

View file

@ -96,7 +96,7 @@ class WelcomeToTheFoldEffect extends GainControlTargetEffect {
maxToughness = source.getManaCostsToPay().getX();
}
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null && permanent.getToughness().getValue() <= maxToughness) {
if (permanent != null && permanent.getToughness().getValue() > maxToughness) {
this.discard();
return;
}