Merge pull request #2020 from Styxo/master

Added Heal the Scars and Hunter Of Eyeblights
This commit is contained in:
LevelX2 2016-06-20 09:10:31 +02:00 committed by GitHub
commit ea53692b57
3 changed files with 193 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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);
}
}

View file

@ -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));