From ba7eefe7bc8fc0bafd76970438b1c545f20d2322 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Tue, 22 Mar 2016 17:16:04 -0500 Subject: [PATCH] [SOI] Implemented Goldknight Castigator, Angelic Purge, Hanweir Militia Captain, Fevered Visions, and Triskaidekaphobia. --- .../shadowsoverinnistrad/AngelicPurge.java | 77 +++++++++ .../shadowsoverinnistrad/FeveredVisions.java | 100 ++++++++++++ .../GoldknightCastigator.java | 136 ++++++++++++++++ .../HanweirMilitiaCaptain.java | 78 +++++++++ .../Triskaidekaphobia.java | 149 ++++++++++++++++++ .../WestvaleCultLeader.java | 80 ++++++++++ Utils/mtg-cards-data.txt | 4 +- 7 files changed, 623 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/AngelicPurge.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/FeveredVisions.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoldknightCastigator.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/HanweirMilitiaCaptain.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/Triskaidekaphobia.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/WestvaleCultLeader.java diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/AngelicPurge.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/AngelicPurge.java new file mode 100644 index 00000000000..a8aaee753e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/AngelicPurge.java @@ -0,0 +1,77 @@ +/* + * 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.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class AngelicPurge extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public AngelicPurge(UUID ownerId) { + super(ownerId, 3, "Angelic Purge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "SOI"; + + // As an additional cost to cast Angelic Purge, sacrifice a permanent. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledPermanent("a permanent")))); + + // Exile target artifact, creature, or enchantment. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public AngelicPurge(final AngelicPurge card) { + super(card); + } + + @Override + public AngelicPurge copy() { + return new AngelicPurge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FeveredVisions.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FeveredVisions.java new file mode 100644 index 00000000000..39bf2aa55a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FeveredVisions.java @@ -0,0 +1,100 @@ +/* + * 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.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class FeveredVisions extends CardImpl { + + public FeveredVisions(UUID ownerId) { + super(ownerId, 244, "Fevered Visions", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{R}"); + this.expansionSetCode = "SOI"; + + // At the beginning of each player's end step, that player draws a card. If the player is your opponent and has four or more cards in hand, + // Fevered Visions deals 2 damage to him or her. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new FeveredVisionsEffect(), TargetController.ANY, false)); + } + + public FeveredVisions(final FeveredVisions card) { + super(card); + } + + @Override + public FeveredVisions copy() { + return new FeveredVisions(this); + } +} + +class FeveredVisionsEffect extends OneShotEffect { + + public FeveredVisionsEffect() { + super(Outcome.LoseLife); + staticText = "that player draws a card. If the player is your opponent and has four or more cards in hand, {this} deals 2 damage to him or her"; + } + + public FeveredVisionsEffect(final FeveredVisionsEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + UUID activePlayerId = game.getActivePlayerId(); + Player player = game.getPlayer(activePlayerId); + if (controller != null && player != null) { + player.drawCards(1, game); + Set opponents = game.getOpponents(source.getControllerId()); + if (opponents.contains(player.getId()) && player.getHand().size() > 3) { + player.damage(2, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } + + @Override + public FeveredVisionsEffect copy() { + return new FeveredVisionsEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoldknightCastigator.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoldknightCastigator.java new file mode 100644 index 00000000000..d184018c27c --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoldknightCastigator.java @@ -0,0 +1,136 @@ +/* + * 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.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import static mage.game.events.GameEvent.EventType.DAMAGE_CREATURE; +import static mage.game.events.GameEvent.EventType.DAMAGE_PLAYER; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class GoldknightCastigator extends CardImpl { + + public GoldknightCastigator(UUID ownerId) { + super(ownerId, 162, "Goldknight Castigator", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "SOI"; + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(9); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // If a source would deal damage to you, it deals double that damage to you instead. + // If a source would deal damage to Goldknight Castigator, it deals double that damage to Goldknight Castigator instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoldknightCastigatorDoubleDamageEffect())); + } + + public GoldknightCastigator(final GoldknightCastigator card) { + super(card); + } + + @Override + public GoldknightCastigator copy() { + return new GoldknightCastigator(this); + } +} + +class GoldknightCastigatorDoubleDamageEffect extends ReplacementEffectImpl { + + public GoldknightCastigatorDoubleDamageEffect() { + super(Duration.WhileOnBattlefield, Outcome.Damage); + staticText = "If a source would deal damage to you, it deals double that damage to you instead." + + "
If a source would deal damage to Goldknight Castigator, it deals double that damage to {this} instead."; + } + + public GoldknightCastigatorDoubleDamageEffect(final GoldknightCastigatorDoubleDamageEffect effect) { + super(effect); + } + + @Override + public GoldknightCastigatorDoubleDamageEffect copy() { + return new GoldknightCastigatorDoubleDamageEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType().equals(EventType.DAMAGE_CREATURE) || + event.getType().equals(EventType.DAMAGE_PLAYER); + } + + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + switch (event.getType()) { + case DAMAGE_PLAYER: + if (event.getTargetId().equals(source.getControllerId())) { + event.setAmount(event.getAmount() * 2); + } + break; + case DAMAGE_CREATURE: + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + if (permanent.getId().equals(source.getSourceId())) { + event.setAmount(event.getAmount() * 2); + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HanweirMilitiaCaptain.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HanweirMilitiaCaptain.java new file mode 100644 index 00000000000..5dd1430ddb8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HanweirMilitiaCaptain.java @@ -0,0 +1,78 @@ +/* + * 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.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class HanweirMilitiaCaptain extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("if you control four or more creatures"); + + public HanweirMilitiaCaptain(UUID ownerId) { + super(ownerId, 21, "Hanweir Militia Captain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "SOI"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + this.canTransform = true; + this.secondSideCard = new WestvaleCultLeader(ownerId); + + // At the beginning of your upkeep, if you control four or more creatures, transform Hanweir Militia Captain. + this.addAbility(new TransformAbility()); + this.addAbility(new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.YOU, false), + new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 3), + "At the beginning of your upkeep, if you control four or more creatures, transform {this}")); + } + + public HanweirMilitiaCaptain(final HanweirMilitiaCaptain card) { + super(card); + } + + @Override + public HanweirMilitiaCaptain copy() { + return new HanweirMilitiaCaptain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/Triskaidekaphobia.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/Triskaidekaphobia.java new file mode 100644 index 00000000000..3dd86a61a0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/Triskaidekaphobia.java @@ -0,0 +1,149 @@ +/* + * 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.Ability; +import mage.abilities.Mode; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; +import mage.players.PlayerList; + +/** + * + * @author fireshoes + */ +public class Triskaidekaphobia extends CardImpl { + + public Triskaidekaphobia(UUID ownerId) { + super(ownerId, 141, "Triskaidekaphobia", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); + this.expansionSetCode = "SOI"; + + // At the beginning of your upkeep, choose one &mdash Each player with exactly 13 life loses the game, then each player gains 1 life. + // Each player with exactly 13 life loses the game, then each player loses 1 life. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new TriskaidekaphobiaGainLifeEffect(), TargetController.YOU, false); + Mode mode = new Mode(); + mode.getEffects().add(new TriskaidekaphobiaLoseLifeEffect()); + ability.addMode(mode); + this.addAbility(ability); + } + + public Triskaidekaphobia(final Triskaidekaphobia card) { + super(card); + } + + @Override + public Triskaidekaphobia copy() { + return new Triskaidekaphobia(this); + } +} + +class TriskaidekaphobiaGainLifeEffect extends OneShotEffect { + + public TriskaidekaphobiaGainLifeEffect() { + super(Outcome.Neutral); + this.staticText = "Each player with exactly 13 life loses the game, then each player gains 1 life"; + } + + public TriskaidekaphobiaGainLifeEffect(final TriskaidekaphobiaGainLifeEffect effect) { + super(effect); + } + + @Override + public TriskaidekaphobiaGainLifeEffect copy() { + return new TriskaidekaphobiaGainLifeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int life; + PlayerList playerList = game.getState().getPlayersInRange(source.getControllerId(), game); + for (UUID pid : playerList) { + Player player = game.getPlayer(pid); + if (player != null) { + life = player.getLife(); + if (life == 13) { + player.lost(game); + } + } + } + for (UUID pid : playerList) { + Player player = game.getPlayer(pid); + if (player != null) { + player.gainLife(1, game); + } + } + return true; + } +} + +class TriskaidekaphobiaLoseLifeEffect extends OneShotEffect { + + public TriskaidekaphobiaLoseLifeEffect() { + super(Outcome.Neutral); + this.staticText = "Each player with exactly 13 life loses the game, then each player loses 1 life"; + } + + public TriskaidekaphobiaLoseLifeEffect(final TriskaidekaphobiaLoseLifeEffect effect) { + super(effect); + } + + @Override + public TriskaidekaphobiaLoseLifeEffect copy() { + return new TriskaidekaphobiaLoseLifeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int life; + PlayerList playerList = game.getState().getPlayersInRange(source.getControllerId(), game); + for (UUID pid : playerList) { + Player player = game.getPlayer(pid); + if (player != null) { + life = player.getLife(); + if (life == 13) { + player.lost(game); + } + } + } + for (UUID pid : playerList) { + Player player = game.getPlayer(pid); + if (player != null) { + player.loseLife(1, game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/WestvaleCultLeader.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/WestvaleCultLeader.java new file mode 100644 index 00000000000..a33e01e63fd --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/WestvaleCultLeader.java @@ -0,0 +1,80 @@ +/* + * 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.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WestvaleCultLeader extends CardImpl { + + final private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creatures you control"); + + public WestvaleCultLeader(UUID ownerId) { + super(ownerId, 21, "Westvale Cult Leader", Rarity.RARE, new CardType[]{CardType.CREATURE}, ""); + this.expansionSetCode = "SOI"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + this.color.setWhite(true); + + // this card is the second face of double-faced card + this.nightCard = true; + + // Westvale Cult Leader's power and toughness are each equal to the number of creatures you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + + // At the beginning of your end step, put a 1/1 white and black Human Cleric creature token onto the battlefield. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new CreateTokenEffect(new HumanClericToken()), TargetController.YOU, false)); + } + + public WestvaleCultLeader(final WestvaleCultLeader card) { + super(card); + } + + @Override + public WestvaleCultLeader copy() { + return new WestvaleCultLeader(this); + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index acd5df21547..4d8bcc64493 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -56939,6 +56939,7 @@ Wastes|Oath of the Gatewatch|183|C||Basic Land|||{T}: Add {C} to your mana pool. Wastes|Oath of the Gatewatch|184|C||Basic Land|||{T}: Add {C} to your mana pool.| Always Watching|Shadows over Innistrad|1|R|{1}{W}{W}|Enchantment|||Nontoken creatures you control get +1/+1 and have vigilance.| Angel of Deliverance|Shadows over Innistrad|2|R|{6}{W}{W}|Creature - Angel|6|6|Flying$Delirium — Whenever Angel of Deliverance deals damage, if there are four or more card types among cards in your graveyard, exile target creature an opponent controls.| +Angelic Purge|Shadows over Innistrad|3|C|{2}{W}|Sorcery|||As an additional cost to cast Angelic Purge, sacrifice a permanent.$Exile target artifact, creature, or enchantment.| Archangel Avacyn|Shadows over Innistrad|5a|M|{3}{W}{W}|Legendary Creature - Angel|4|4|Flash$Flying, vigilance$When Archangel Avacyn enters the battlefield, creatures you control gain indestructible until end of turn.$When a non-Angel creature you control dies, transform Archangel Avacyn at the beginning of the next upkeep.| Avacyn, the Purifier|Shadows over Innistrad|5b|M||Legendary Creature - Angel|6|5|Flying$When this creature transforms into Avacyn, the Purifier, it deals 3 damage to each other creature and each opponent.| Avacynian Missionaries|Shadows over Innistrad|6a|U|{3}{W}|Creature - Human Cleric|3|3|At the beginning of your end step, if Avacynian Missionaries is equipped, transform it.| @@ -57049,6 +57050,7 @@ Krallenhorde Howler|Shadows over Innistrad|203b|U||Creature - Werewolf|3|3|Creat Groundskeeper|Shadows over Innistrad|208|U|{G}|Creature - Human Druid|1|1|{1}{G}: Return target basic land card from your graveyard to your hand.| Hinterland Logger|Shadows over Innistrad|210a|C|{1}{G}|Creature - Human Werewolf|2|1|At the beginning of each upkeep, if no spells were cast last turn, transform Hinterland Logger.| Timber Shredder|Shadows over Innistrad|210b|C||Creature - Werewolf|4|2|Trample$At the beginning of each upkeep, if a player cast two or more spells last turn, transform Timber Shredder.| +Howlpack Resurgence|Shadows over Innistrad|211|U|{2}{G}|Enchantment|||Flash (You may cast this spell any time you could cast an instant.)$Each creature you control that's a Wolf or a Werewolf gets +1/+1 and has trample.| Obsessive Skinner|Shadows over Innistrad|220|U|{1}{G}|Creature - Human Rogue|1|1|When Obsessive Skinner enters the battlefield, put a +1/+1 counter on target creature.$Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, put a +1/+1 counter on target creature.| Pack Guardian|Shadows over Innistrad|221|U|{2}{G}{G}|Creature - Wolf Spirit|4|3|Flash$When Pack Guardian enters the battlefield, you may discard a land card. If you do, put a 2/2 green Wolf creature token onto the battlefield.| Quilled Wolf|Shadows over Innistrad|222|C|{1}{G}|Creature - Wolf|2|2|{5}{G}: Quilled Wolf gets +4/+4 until end of turn.| @@ -57072,7 +57074,7 @@ Olivia, Mobilized for War|Shadows over Innistrad|248|M|{1}{B}{R}|Legendary Creat Sigarda, Heron's Grace|Shadows over Innistrad|250|M|{3}{G}{W}|Legendary Creature - Angel|4|5|Flying$You and Humans you control have hexproof.${2}, Exile a card from your graveyard: Put a 1/1 white Human Soldier creature token onto the battlefield.| Sorin, Grim Nemesis|Shadows over Innistrad|251|M|{4}{W}{B}|Planeswalker - Sorin|||+1: Reveal the top card of your library and put that card into your hand. Each opponent loses life equal to its converted mana cost.$-X: Sorin, Grim Nemesis deals X damage to target creature or planeswalker and you gain X life.$-9: Put a number of 1/1 black Vampire Knight creature tokens with lifelink onto the battlefield equal to the highest life total among all players.| Brain in a Jar|Shadows over Innistrad|252|R|{2}|Artifact|||{1}, {T}: Put a charge counter on Brain in a Jar, then you may cast an instant or sorcery card with converted mana costs equal to the number of charge counters on Brain in a Jar from your hand without paying its mana cost.${3}< {T}, Remove X charge counters from Brain in a Jar: Scry X.| -Corrupted Grafstone|Shadows over Innistrad|153|R|{2}|Artifact|||Corrupted Grafstone enters the battlefield tapped.${T}: Choose a card in your graveyard. Add mana of that card's color to your mana pool.| +Corrupted Grafstone|Shadows over Innistrad|153|R|{2}|Artifact|||Corrupted Grafstone enters the battlefield tapped.${T}: Choose a color of a card in your graveyard. Add mana of that color to your mana pool.| Explosive Apparatus|Shadows over Innistrad|255|C|{1}|Artifact|||{3}, {T}, Sacrifice Explosive Apparatus: Explosive Apparatus deals 2 damage to target creature or player.| Magnifying Glass|Shadows over Innistrad|258|U|{3}|Artifact|||{T}: Add {C} to your mana pool.${4}, {T}: Investigate. (Put a colorless Clue artifact token onto the battlefield with "{2}, Sacrifice this artifact: Draw a card.")| Neglected Heirloom|Shadows over Innistrad|260a|U|{1}|Artifact - Equipment|||Equipped creature gets +1/+1.$When equipped creature transforms, transform Neglected Heirloom.$Equip {1}|