From 9bf92ae9d89f780cfca50bc358d7ad1be65b81c5 Mon Sep 17 00:00:00 2001 From: Styxo Date: Sun, 19 Jun 2016 20:11:05 +0200 Subject: [PATCH] Added Heal the Scars and Hunter Of Eyeblights --- .../src/mage/sets/lorwyn/HealTheScars.java | 98 +++++++++++++++++++ .../mage/sets/lorwyn/HunterOfEyeblights.java | 93 ++++++++++++++++++ .../sets/magicorigins/ThopterEngineer.java | 4 +- 3 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/HealTheScars.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/HunterOfEyeblights.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/HealTheScars.java b/Mage.Sets/src/mage/sets/lorwyn/HealTheScars.java new file mode 100644 index 0000000000..be364232a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/HealTheScars.java @@ -0,0 +1,98 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Styxo + */ +public class HealTheScars extends CardImpl { + + public HealTheScars(UUID ownerId) { + super(ownerId, 217, "Heal the Scars", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); + this.expansionSetCode = "LRW"; + + // Regenerate target creature. You gain life equal to that creature's toughness. + this.getSpellAbility().addEffect(new RegenerateTargetEffect()); + this.getSpellAbility().addEffect(new HealTheScarsEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + } + + public HealTheScars(final HealTheScars card) { + super(card); + } + + @Override + public HealTheScars copy() { + return new HealTheScars(this); + } +} + +class HealTheScarsEffect extends OneShotEffect { + + public HealTheScarsEffect() { + super(Outcome.GainLife); + staticText = "You gain life equal to that creature's toughness"; + } + + public HealTheScarsEffect(final HealTheScarsEffect effect) { + super(effect); + } + + @Override + public HealTheScarsEffect copy() { + return new HealTheScarsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(permanent.getToughness().getValue(), game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/HunterOfEyeblights.java b/Mage.Sets/src/mage/sets/lorwyn/HunterOfEyeblights.java new file mode 100644 index 0000000000..b5d2b0d5a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/HunterOfEyeblights.java @@ -0,0 +1,93 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.CounterAnyPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Styxo + */ +public class HunterOfEyeblights extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature you don't control"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature with a counter on it"); + + static { + filter1.add(new ControllerPredicate(TargetController.NOT_YOU)); + filter2.add(new CounterAnyPredicate()); + + } + + public HunterOfEyeblights(UUID ownerId) { + super(ownerId, 119, "Hunter Of Eyeblights", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + this.subtype.add("Assassin"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Hunter of Eyeblights enters the battlefield, put a +1/+1 counter on target creature you don't control + Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCreaturePermanent(filter1)); + this.addAbility(ability); + + //{B}{2},{T}: Destroy target creature with a counter on it. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + ability2.addCost(new TapSourceCost()); + ability2.addTarget(new TargetCreaturePermanent(filter2)); + this.addAbility(ability2); + } + + public HunterOfEyeblights(final HunterOfEyeblights card) { + super(card); + } + + @Override + public HunterOfEyeblights copy() { + return new HunterOfEyeblights(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java b/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java index a3baa7eef3..cd65ce12e7 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java @@ -49,7 +49,7 @@ import mage.game.permanent.token.ThopterColorlessToken; */ public class ThopterEngineer extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Artifact creatures"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Artifact creatures you control"); static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); @@ -66,7 +66,7 @@ public class ThopterEngineer extends CardImpl { // When Thopter Engineer enters the battlefield, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield. this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), 1))); - // Artifact creatures you control have haste. + // Artifact creatures you control have haste. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false))); }