From 5b132c9c97f0f7af69020095b20c886d3fc4911b Mon Sep 17 00:00:00 2001 From: Alvin Date: Thu, 29 Sep 2011 01:06:43 +0900 Subject: [PATCH 1/3] Add cards [ALA] Angel's Herald, Cradle of Vitality, Knight of tthe Skyward Eye change one comment cause invalid charactor on 2-characters os --- .../betrayersofkamigawa/UmezawasJitte.java | 2 +- .../mage/sets/shardsofalara/AngelsHerald.java | 100 +++++++++++++ .../sets/shardsofalara/CradleOfVitality.java | 139 ++++++++++++++++++ .../shardsofalara/KnightOfTheSkywardEye.java | 71 +++++++++ 4 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/UmezawasJitte.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/UmezawasJitte.java index 3fb91e7a6d0..a528fe48dbc 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/UmezawasJitte.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/UmezawasJitte.java @@ -65,7 +65,7 @@ public class UmezawasJitte extends CardImpl { // Whenever equipped creature deals combat damage, put two charge counters on Umezawa's Jitte. this.addAbility(new UmezawasJitteAbility()); - // Remove a charge counter from Umezawa's Jitte: Choose one � Equipped creature gets +2/+2 until end of turn; or target creature gets -1/-1 until end of turn; or you gain 2 life. + // Remove a charge counter from Umezawa's Jitte: Choose one Equipped creature gets +2/+2 until end of turn; or target creature gets -1/-1 until end of turn; or you gain 2 life. Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2, Constants.Duration.EndOfTurn), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); Mode mode = new Mode(); mode.getEffects().add(new BoostTargetEffect(-1, -1, Constants.Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java b/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java new file mode 100644 index 00000000000..383d7f22c41 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.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.shardsofalara; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * @author nantuko + */ +public class AngelsHerald extends CardImpl { + + private static final FilterCard filter = new FilterCard("Empyrial Archangel"); + + private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent("a green creature"); + private static final FilterControlledCreaturePermanent filterWhite = new FilterControlledCreaturePermanent("a white creature"); + private static final FilterControlledCreaturePermanent filterBlue = new FilterControlledCreaturePermanent("a blue creature"); + + static { + filterGreen.getColor().setGreen(true); + filterGreen.setUseColor(true); + filterWhite.getColor().setWhite(true); + filterWhite.setUseColor(true); + filterBlue.getColor().setBlue(true); + filterBlue.setUseColor(true); + } + + static { + filter.getName().add("Empyrial Archangel"); + } + + public AngelsHerald(UUID ownerId) { + super(ownerId, 2, "Angel's Herald", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{W}, {tap}, Sacrifice a green creature, a white creature, and a blue creature: Search your library for a card named Empyrial Archangel and put it onto the battlefield. Then shuffle your library. + TargetCardInLibrary target = new TargetCardInLibrary(1, 1, new FilterCard(filter)); + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target), new ManaCostsImpl("{2}{W}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterWhite, false))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterGreen, false))); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterBlue, false))); + this.addAbility(ability); + } + + public AngelsHerald(final AngelsHerald card) { + super(card); + } + + @Override + public AngelsHerald copy() { + return new AngelsHerald(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java new file mode 100644 index 00000000000..9b7d646768b --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java @@ -0,0 +1,139 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; + +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author Alvin + */ +public class CradleOfVitality extends CardImpl { + + public CradleOfVitality(UUID ownerId) { + super(ownerId, 7, "Cradle of Vitality", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "ALA"; + + this.color.setWhite(true); + + // Whenever you gain life, you may pay {1}{W}. If you do, put a +1/+1 counter on target creature for each 1 life you gained. + Ability ability = new CradleOfVitalityGainLifeTriggeredAbility(); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CradleOfVitality(final CradleOfVitality card) { + super(card); + } + + @Override + public CradleOfVitality copy() { + return new CradleOfVitality(this); + } +} + + +class CradleOfVitalityGainLifeTriggeredAbility extends TriggeredAbilityImpl { + + public CradleOfVitalityGainLifeTriggeredAbility() { + super(Zone.BATTLEFIELD, new CradleOfVitalityEffect(), false); + addManaCost(new ManaCostsImpl("{1}{W}")); + } + + public CradleOfVitalityGainLifeTriggeredAbility(final CradleOfVitalityGainLifeTriggeredAbility ability) { + super(ability); + } + + @Override + public CradleOfVitalityGainLifeTriggeredAbility copy() { + return new CradleOfVitalityGainLifeTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) { + this.getEffects().get(0).setValue("amount", event.getAmount()); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you gain life, you may pay {1}{W}. If you do, put a +1/+1 counter on target creature for each 1 life you gained"; + } +} + +class CradleOfVitalityEffect extends OneShotEffect { + + public CradleOfVitalityEffect() { + super(Outcome.Benefit); + staticText = "Put a +1/+1 counter on target creature for each 1 life you gained"; + } + + public CradleOfVitalityEffect(final CradleOfVitalityEffect effect) { + super(effect); + } + + @Override + public CradleOfVitalityEffect copy() { + return new CradleOfVitalityEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int affectedTargets = 0; + Integer amount = (Integer) getValue("amount"); + for (UUID uuid : targetPointer.getTargets(source)) { + Permanent permanent = game.getPermanent(uuid); + permanent.addCounters(CounterType.P1P1.createInstance(amount), game); + affectedTargets ++; + } + return affectedTargets > 0; + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java new file mode 100644 index 00000000000..e9e765372c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheSkywardEye.java @@ -0,0 +1,71 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; + +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.ActivateOncePerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; + +/** + * + * @author Alvin + */ +public class KnightOfTheSkywardEye extends CardImpl { + + public KnightOfTheSkywardEye(UUID ownerId) { + super(ownerId, 15, "Knight of the Skyward Eye", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {3}{G}: Knight of the Skyward Eye gets +3/+3 until end of turn. Activate this ability only once each turn. + this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new ManaCostsImpl("{3}{G}"))); + + } + + public KnightOfTheSkywardEye(final KnightOfTheSkywardEye card) { + super(card); + } + + @Override + public KnightOfTheSkywardEye copy() { + return new KnightOfTheSkywardEye(this); + } +} From ecf3c5857ce791054795c735d1811fda7bd92728 Mon Sep 17 00:00:00 2001 From: Alvin Date: Thu, 29 Sep 2011 19:35:28 +0900 Subject: [PATCH 2/3] effect class name changed --- Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java b/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java index dfe6429a684..c59a486b264 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ClockworkVorrac.java @@ -63,7 +63,7 @@ public class ClockworkVorrac extends CardImpl { this.toughness = new MageInt(0); this.addAbility(TrampleAbility.getInstance()); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)), "{this} enters the battlefield with four +1/+1 counters on it")); - this.addAbility(new AttacksOrBlocksTriggeredAbility(new ClockworkCondorEffect(), false)); + this.addAbility(new AttacksOrBlocksTriggeredAbility(new ClockworkVorracEffect(), false)); this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new TapSourceCost())); } From 1806b40a6f60e2ebfbc4ac6446c3f1677a3b0861 Mon Sep 17 00:00:00 2001 From: Alvin Date: Sat, 1 Oct 2011 22:51:01 +0900 Subject: [PATCH 3/3] ISD new cards --- .../src/mage/sets/innistrad/Curiosity.java | 112 +++++++++++++++++ .../sets/innistrad/CurseOfTheBloodyTome.java | 114 ++++++++++++++++++ .../src/mage/sets/innistrad/DeadWeight.java | 75 ++++++++++++ .../mage/sets/innistrad/DelverOfSecrets.java | 68 +++++++++++ .../sets/innistrad/GruesomeDeformity.java | 76 ++++++++++++ .../sets/innistrad/InsectileAberration.java | 47 ++++++++ 6 files changed, 492 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/innistrad/Curiosity.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/DeadWeight.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java diff --git a/Mage.Sets/src/mage/sets/innistrad/Curiosity.java b/Mage.Sets/src/mage/sets/innistrad/Curiosity.java new file mode 100644 index 00000000000..0c68c31b16b --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/Curiosity.java @@ -0,0 +1,112 @@ +/* + * 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.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DealsCombatDamageToAPlayerAttachedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class Curiosity extends CardImpl { + + public Curiosity(UUID ownerId) { + super(ownerId, 49, "Curiosity", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Aura"); + + this.color.setBlue(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Neutral)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Whenever enchanted creature deals damage to an opponent, you may draw a card. + this.addAbility(new DealsCombatDamageToAPlayerAttachedTriggeredAbility(new DrawCardControllerEffect(1), "equipped", true)); + } + + public Curiosity(final Curiosity card) { + super(card); + } + + @Override + public Curiosity copy() { + return new Curiosity(this); + } +} + + +class CuriosityAbility extends TriggeredAbilityImpl { + + public CuriosityAbility() { + super(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1)); + } + + public CuriosityAbility(final CuriosityAbility ability) { + super(ability); + } + + @Override + public CuriosityAbility copy() { + return new CuriosityAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event instanceof DamagedPlayerEvent) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && this.sourceId.equals(event.getSourceId())) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever enchanted creature deals damage to an opponent, you may draw a card."; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java new file mode 100644 index 00000000000..4e77fe9354e --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java @@ -0,0 +1,114 @@ +/* + * 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.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class CurseOfTheBloodyTome extends CardImpl { + + public CurseOfTheBloodyTome(UUID ownerId) { + super(ownerId, 50, "Curse of the Bloody Tome", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Aura"); + this.subtype.add("Curse"); + + this.color.setBlue(true); + + // Enchant player + TargetPermanent target = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(target.getTargetName()); + this.addAbility(ability); + // At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard. + this.addAbility(new CurseOfTheBloodyTomeAbility()); + + } + + public CurseOfTheBloodyTome(final CurseOfTheBloodyTome card) { + super(card); + } + + @Override + public CurseOfTheBloodyTome copy() { + return new CurseOfTheBloodyTome(this); + } +} + +class CurseOfTheBloodyTomeAbility extends TriggeredAbilityImpl { + + public CurseOfTheBloodyTomeAbility() { + super(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2)); + } + + public CurseOfTheBloodyTomeAbility(final CurseOfTheBloodyTomeAbility ability) { + super(ability); + } + + @Override + public CurseOfTheBloodyTomeAbility copy() { + return new CurseOfTheBloodyTomeAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DRAW_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + this.addTarget(new TargetPlayer()); + getTargets().get(0).add(event.getPlayerId(), game); + return true; + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of each player's upkeep, that player reveals a card at random from his or her hand. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able."; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/innistrad/DeadWeight.java b/Mage.Sets/src/mage/sets/innistrad/DeadWeight.java new file mode 100644 index 00000000000..78fec0d03b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/DeadWeight.java @@ -0,0 +1,75 @@ +/* + * 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.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class DeadWeight extends CardImpl { + + public DeadWeight(UUID ownerId) { + super(ownerId, 96, "Dead Weight", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Aura"); + + this.color.setBlack(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Neutral)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets -2/-2. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(-2, -2, Constants.Duration.WhileOnBattlefield))); + } + + public DeadWeight(final DeadWeight card) { + super(card); + } + + @Override + public DeadWeight copy() { + return new DeadWeight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java b/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java new file mode 100644 index 00000000000..d0cc824e3cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/DelverOfSecrets.java @@ -0,0 +1,68 @@ +/* + * 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.innistrad; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; + +/** + * + * @author anonymous + */ +public class DelverOfSecrets extends CardImpl { + + public DelverOfSecrets(UUID ownerId) { + super(ownerId, 51, "Delver of Secrets", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery card is revealed this way, transform Delver of Secrets. + this.addWatcher(new InsectileAberration.InsectileAberrationWatcher()); + } + + public DelverOfSecrets(final DelverOfSecrets card) { + super(card); + } + + @Override + public DelverOfSecrets copy() { + return new DelverOfSecrets(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java b/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java new file mode 100644 index 00000000000..055feb72a85 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/GruesomeDeformity.java @@ -0,0 +1,76 @@ +/* + * 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.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.IntimidateAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class GruesomeDeformity extends CardImpl { + + public GruesomeDeformity(UUID ownerId) { + super(ownerId, 103, "Gruesome Deformity", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Aura"); + + this.color.setBlack(true); + + // Enchant creature + TargetPermanent target = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility)); + Ability ability = new EnchantAbility(target.getTargetName()); + this.addAbility(ability); + // Enchanted creature has intimidate. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IntimidateAbility.getInstance(), Constants.AttachmentType.AURA))); + } + + public GruesomeDeformity(final GruesomeDeformity card) { + super(card); + } + + @Override + public GruesomeDeformity copy() { + return new GruesomeDeformity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/InsectileAberration.java b/Mage.Sets/src/mage/sets/innistrad/InsectileAberration.java index 849fd242087..9b7fdd32cc1 100644 --- a/Mage.Sets/src/mage/sets/innistrad/InsectileAberration.java +++ b/Mage.Sets/src/mage/sets/innistrad/InsectileAberration.java @@ -27,12 +27,23 @@ */ package mage.sets.innistrad; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; import java.util.UUID; + import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.watchers.WatcherImpl; /** * @@ -64,4 +75,40 @@ public class InsectileAberration extends CardImpl { public InsectileAberration copy() { return new InsectileAberration(this); } + + public static class InsectileAberrationWatcher extends WatcherImpl { + + public Map> blockedCreatures = new HashMap>(); + + public InsectileAberrationWatcher() { + super("InsectileAberrationWatcher"); + } + + public InsectileAberrationWatcher(final InsectileAberrationWatcher watcher) { + super(watcher); + } + + @Override + public InsectileAberrationWatcher copy() { + return new InsectileAberrationWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE && event.getSourceId().equals(sourceId)) { + Player player = game.getPlayer(event.getPlayerId()); + if (player != null && player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.lookAtCards("Insectile Aberration", cards, game); + + if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) { + player.revealCards("This card", cards, game); + condition = true; + } + } + } + } + } }