From 0a4acc2be69c7bedb872defd62831344b0dce649 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 24 Sep 2012 21:47:49 +0200 Subject: [PATCH] [BOK] 4 cards --- .../BlessingOfLeeches.java | 88 +++++++++++++ .../betrayersofkamigawa/ClashOfRealities.java | 101 +++++++++++++++ .../betrayersofkamigawa/MarkOfTheOni.java | 120 ++++++++++++++++++ .../ThreadsOfDisloyalty.java | 87 +++++++++++++ 4 files changed, 396 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/betrayersofkamigawa/BlessingOfLeeches.java create mode 100644 Mage.Sets/src/mage/sets/betrayersofkamigawa/ClashOfRealities.java create mode 100644 Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfTheOni.java create mode 100644 Mage.Sets/src/mage/sets/betrayersofkamigawa/ThreadsOfDisloyalty.java diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlessingOfLeeches.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlessingOfLeeches.java new file mode 100644 index 00000000000..660af7bf5dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlessingOfLeeches.java @@ -0,0 +1,88 @@ +/* + * 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.betrayersofkamigawa; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.LoseLifeSourceEffect; +import mage.abilities.effects.common.RegenerateAttachedEffect; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class BlessingOfLeeches extends CardImpl { + + public BlessingOfLeeches(UUID ownerId) { + super(ownerId, 62, "Blessing of Leeches", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "BOK"; + this.color.setBlack(true); + this.subtype.add("Aura"); + this.addAbility(FlashAbility.getInstance()); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Regenerate)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // At the beginning of your upkeep, you lose 1 life. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceEffect(1), Constants.TargetController.YOU, false)); + + // {0}: Regenerate enchanted creature. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateAttachedEffect(Constants.AttachmentType.AURA),new GenericManaCost(0))); + } + + public BlessingOfLeeches(final BlessingOfLeeches card) { + super(card); + } + + @Override + public BlessingOfLeeches copy() { + return new BlessingOfLeeches(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ClashOfRealities.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ClashOfRealities.java new file mode 100644 index 00000000000..496610c2a71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ClashOfRealities.java @@ -0,0 +1,101 @@ +/* + * 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.betrayersofkamigawa; + +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.common.ZoneChangeTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ClashOfRealities extends CardImpl { + + private final static FilterCreaturePermanent filterSpirit = new FilterCreaturePermanent("Spirit creature"); + private final static FilterCreaturePermanent filterNotSpirit = new FilterCreaturePermanent("non-Spirit creature"); + + static { + filterSpirit.add(new SubtypePredicate("Spirit")); + filterNotSpirit.add(Predicates.not(new SubtypePredicate("Spirit"))); + } + + public ClashOfRealities(UUID ownerId) { + super(ownerId, 97, "Clash of Realities", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); + this.expansionSetCode = "BOK"; + this.color.setRed(true); + + // All Spirits have "When this permanent enters the battlefield, you may have it deal 3 damage to target non-Spirit creature." + Ability ability1 = new ClashOfRealitiesTriggeredAbility(new DamageTargetEffect(3), "When this permanent enters the battlefield, "); + ability1.addTarget(new TargetCreaturePermanent(filterNotSpirit)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAllEffect(ability1, Constants.Duration.WhileOnBattlefield, filterSpirit, "All Spirits have \"When this permanent enters the battlefield, you may have it deal 3 damage to target non-Spirit creature.\""))); + + // Non-Spirit creatures have "When this creature enters the battlefield, you may have it deal 3 damage to target Spirit creature." + Ability ability2 = new ClashOfRealitiesTriggeredAbility(new DamageTargetEffect(3), "When this creature enters the battlefield, "); + ability2.addTarget(new TargetCreaturePermanent(filterSpirit)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAllEffect(ability2, Constants.Duration.WhileOnBattlefield, filterNotSpirit, "Non-Spirit creatures have \"When this creature enters the battlefield, you may have it deal 3 damage to target Spirit creature.\""))); + } + + public ClashOfRealities(final ClashOfRealities card) { + super(card); + } + + @Override + public ClashOfRealities copy() { + return new ClashOfRealities(this); + } + + private class ClashOfRealitiesTriggeredAbility extends ZoneChangeTriggeredAbility { + + public ClashOfRealitiesTriggeredAbility(Effect effect, String rule) { + super(Constants.Zone.BATTLEFIELD, effect, rule, true); + } + + public ClashOfRealitiesTriggeredAbility(ClashOfRealitiesTriggeredAbility ability) { + super(ability); + } + + + @Override + public ClashOfRealitiesTriggeredAbility copy() { + return new ClashOfRealitiesTriggeredAbility(this); + } + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfTheOni.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfTheOni.java new file mode 100644 index 00000000000..1b19df093a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfTheOni.java @@ -0,0 +1,120 @@ +/* + * 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.betrayersofkamigawa; + +import java.util.UUID; +import mage.Constants; +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.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.continious.ControlEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class MarkOfTheOni extends CardImpl { + + public MarkOfTheOni(UUID ownerId) { + super(ownerId, 73, "Mark of the Oni", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "BOK"; + this.color.setBlack(true); + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // You control enchanted creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + + // At the beginning of the end step, if you control no Demons, sacrifice Mark of the Oni. + this.addAbility(new MarkOfTheOniTriggeredAbility()); + + } + + public MarkOfTheOni(final MarkOfTheOni card) { + super(card); + } + + @Override + public MarkOfTheOni copy() { + return new MarkOfTheOni(this); + } + + private class MarkOfTheOniTriggeredAbility extends TriggeredAbilityImpl { + MarkOfTheOniTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new SacrificeSourceEffect()); + } + + MarkOfTheOniTriggeredAbility(final MarkOfTheOniTriggeredAbility ability) { + super(ability); + } + + @Override + public MarkOfTheOniTriggeredAbility copy() { + return new MarkOfTheOniTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new SubtypePredicate("Demon")); + if (!game.getBattlefield().contains(filter, controllerId, 1, game)) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of the end step, if you control no Demons, sacrifice {this}."; + } + } +} + diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThreadsOfDisloyalty.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThreadsOfDisloyalty.java new file mode 100644 index 00000000000..68d2c7953e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThreadsOfDisloyalty.java @@ -0,0 +1,87 @@ +/* + * 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.betrayersofkamigawa; + +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.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.ControlEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ThreadsOfDisloyalty extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost 2 or less"); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 3)); + } + + public ThreadsOfDisloyalty(UUID ownerId) { + super(ownerId, 56, "Threads of Disloyalty", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "BOK"; + this.color.setBlue(true); + this.subtype.add("Aura"); + + // Enchant creature with converted mana cost 2 or less + TargetPermanent auraTarget = new TargetCreaturePermanent(filter); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // You control enchanted creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + + } + + public ThreadsOfDisloyalty(final ThreadsOfDisloyalty card) { + super(card); + } + + @Override + public ThreadsOfDisloyalty copy() { + return new ThreadsOfDisloyalty(this); + } +} +