Merge branch 'magefree/master'

This commit is contained in:
Samuel Sandeen 2016-09-14 18:56:20 -04:00
commit 0214576146
96 changed files with 2538 additions and 295 deletions

View file

@ -95,7 +95,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI
if (object != null && object instanceof Spell) {
Card c = (Spell) object;
if (c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY)) {
if (getTargets().size() == 0) {
if (getTargets().isEmpty()) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}

View file

@ -38,12 +38,7 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -54,6 +49,7 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.Watcher;
/**
*
* @author LevelX2
@ -159,9 +155,8 @@ class DamagedByEnchantedWatcher extends Watcher {
if (enchantment != null && enchantment.getAttachedTo() != null) {
if (enchantment.getAttachedTo().equals(event.getSourceId())) {
MageObjectReference mor = new MageObjectReference(event.getTargetId(), game);
if (!damagedCreatures.contains(mor)) {
damagedCreatures.add(mor);
}
}
}
}

View file

@ -46,6 +46,9 @@ import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.TargetSpell;
import java.util.UUID;
/**
*
* @author LevelX2
@ -103,7 +106,7 @@ class MinamosMeddlingCounterTargetEffect extends OneShotEffect {
for (SpellAbility spellAbility : spell.getSpellAbilities()) {
if (spellAbility.getSpellAbilityType().equals(SpellAbilityType.SPLICE)) {
for (Card card: spellController.getHand().getCards(game)) {
if (card.getName().equals(spellAbility.getCardName()) && !cardsToDiscard.contains(card.getId())) {
if (card.getName().equals(spellAbility.getCardName())) {
cardsToDiscard.add(card);
}
}

View file

@ -34,16 +34,12 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.Watcher;
/**
*
* @author LevelX2
@ -96,9 +92,8 @@ class SpiritOfTheLabyrinthWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DREW_CARD ) {
if (!playersThatDrewCard.contains(event.getPlayerId())) {
playersThatDrewCard.add(event.getPlayerId());
}
}
}

View file

@ -102,7 +102,7 @@ class NezumiGraverobberFlipEffect extends OneShotEffect {
if (card != null) {
Player player = game.getPlayer(card.getOwnerId());
if (player != null) {
if (player.getGraveyard().size() == 0) {
if (player.getGraveyard().isEmpty()) {
return new FlipSourceEffect(new NighteyesTheDesecratorToken()).apply(game, source);
}
}

View file

@ -112,7 +112,7 @@ class DesecratorHagEffect extends OneShotEffect {
}
}
}
if (cards.size() == 0) {
if (cards.isEmpty()) {
return true;
}
if (cards.size() > 1

View file

@ -160,7 +160,6 @@ class JelevaNephaliasCastEffect extends OneShotEffect {
if (controller.choose(Outcome.PlayForFree, exileZone, target, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
game.getExile().removeCard(card, game);
return controller.cast(card.getSpellAbility(), game, true);
}
}

View file

@ -49,7 +49,7 @@ import mage.constants.Zone;
import mage.filter.FilterPlayer;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.other.OwnerIdPredicate;
import mage.filter.predicate.other.PlayerIdPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
@ -86,7 +86,7 @@ public class CrownOfDoom extends CardImpl {
if (sourceCard != null) {
ability.getTargets().clear();
FilterPlayer filter = new FilterPlayer("player other than " + sourceCard.getIdName() + "'s owner");
filter.add(Predicates.not(new OwnerIdPredicate(sourceCard.getOwnerId())));
filter.add(Predicates.not(new PlayerIdPredicate(sourceCard.getOwnerId())));
ability.addTarget(new TargetPlayer(1, 1, false, filter));
}
}

View file

@ -43,6 +43,7 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.watchers.Watcher;
/**
*
* @author maxlebedev
@ -99,9 +100,8 @@ class LeovoldEmissaryOfTrestWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DREW_CARD ) {
if (!playersThatDrewCard.contains(event.getPlayerId())) {
playersThatDrewCard.add(event.getPlayerId());
}
}
}

View file

@ -31,19 +31,23 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.targetpointer.SecondTargetPointer;
/**
*
@ -51,6 +55,12 @@ import mage.target.common.TargetCreatureOrPlayer;
*/
public class RalZarek extends CardImpl {
private static final FilterPermanent secondFilter = new FilterPermanent("another target permanent");
static {
secondFilter.add(new AnotherTargetPredicate(2));
}
public RalZarek(UUID ownerId) {
super(ownerId, 94, "Ral Zarek", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{R}");
this.expansionSetCode = "DGM";
@ -59,8 +69,17 @@ public class RalZarek extends CardImpl {
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
// +1: Tap target permanent, then untap another target permanent.
LoyaltyAbility ability1 = new LoyaltyAbility(new RalZarekTapUntapEffect(), 1);
ability1.addTarget(new TargetPermanent(2, 2, new FilterPermanent(), false));
LoyaltyAbility ability1 = new LoyaltyAbility(new TapTargetEffect(), 1);
TargetPermanent firstTarget = new TargetPermanent();
firstTarget.setTargetTag(1);
ability1.addTarget(firstTarget);
Effect effect = new UntapTargetEffect();
effect.setText(", then untap another target permanent");
effect.setTargetPointer(new SecondTargetPointer());
ability1.addEffect(effect);
TargetPermanent secondTarget = new TargetPermanent(secondFilter);
secondTarget.setTargetTag(2);
ability1.addTarget(secondTarget);
this.addAbility(ability1);
// -2: Ral Zarek deals 3 damage to target creature or player.
@ -83,45 +102,6 @@ public class RalZarek extends CardImpl {
}
}
class RalZarekTapUntapEffect extends OneShotEffect {
public RalZarekTapUntapEffect() {
super(Outcome.Tap);
this.staticText = "Tap target permanent, then untap another target permanent";
}
public RalZarekTapUntapEffect(final RalZarekTapUntapEffect effect) {
super(effect);
}
@Override
public RalZarekTapUntapEffect copy() {
return new RalZarekTapUntapEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
int i = 0;
for (UUID targetId : source.getTargets().get(0).getTargets()) {
i++;
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
if (i == 1) {
permanent.tap(game);
}
if (i == 2) {
permanent.untap(game);
}
}
}
return true;
}
return false;
}
}
class RalZarekExtraTurnsEffect extends OneShotEffect {
public RalZarekExtraTurnsEffect() {

View file

@ -85,7 +85,7 @@ class OpponentHasNoCardsInHandCondition implements Condition {
if (player != null) {
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(playerId);
if (opponent != null && opponent.getHand().size() == 0) {
if (opponent != null && opponent.getHand().isEmpty()) {
return true;
}
}

View file

@ -1,5 +1,6 @@
package mage.sets.innistrad;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -13,14 +14,16 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import java.util.UUID;
public class GavonyTownship extends CardImpl {
public GavonyTownship(UUID ownerId) {
super(ownerId, 239, "Gavony Township", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ISD";
// {T}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {2}{G}{W}, {T}: Put a +1/+1 counter on each creature you control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent("creature you control")), new ManaCostsImpl("{2}{G}{W}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);

View file

@ -0,0 +1,69 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class AcrobaticManeuver extends CardImpl {
public AcrobaticManeuver(UUID ownerId) {
super(ownerId, 1, "Acrobatic Maneuver", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}");
this.expansionSetCode = "KLD";
// Exile target creature you control, then return that card to the battlefield under its owner's control.
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Effect effect = new ExileTargetForSourceEffect();
effect.setApplyEffectsAfter();
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, true));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public AcrobaticManeuver(final AcrobaticManeuver card) {
super(card);
}
@Override
public AcrobaticManeuver copy() {
return new AcrobaticManeuver(this);
}
}

View file

@ -0,0 +1,69 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class AerialResponder extends CardImpl {
public AerialResponder(UUID ownerId) {
super(ownerId, 2, "Aerial Responder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
this.expansionSetCode = "KLD";
this.subtype.add("Dwarf");
this.subtype.add("Soldier");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
}
public AerialResponder(final AerialResponder card) {
super(card);
}
@Override
public AerialResponder copy() {
return new AerialResponder(this);
}
}

View file

@ -0,0 +1,102 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class AetherstormRoc extends CardImpl {
private final UUID originalId;
public AetherstormRoc(UUID ownerId) {
super(ownerId, 3, "Aetherstorm Roc", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.expansionSetCode = "KLD";
this.subtype.add("Bird");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Aetherstorm Roc or another creature enters the battlefield under your control, you get {E}.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new GetEnergyCountersControllerEffect(1), new FilterCreaturePermanent("{this} or another creature")));
// Whenever Aetherstorm Roc attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it and tap up to one target creature defending player controls.
DoIfCostPaid doIfCostPaidEffect = new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2));
doIfCostPaidEffect.addEffect(new TapTargetEffect());
Ability ability = new AttacksTriggeredAbility(doIfCostPaidEffect, false,
"Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it and tap up to one target creature defending player controls.");
ability.addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent("creature defending player controls"), false));
originalId = ability.getOriginalId();
this.addAbility(ability);
}
public AetherstormRoc(final AetherstormRoc card) {
super(card);
this.originalId = card.originalId;
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getOriginalId().equals(originalId)) {
ability.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
ability.addTarget(target);
}
}
@Override
public AetherstormRoc copy() {
return new AetherstormRoc(this);
}
}

View file

@ -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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.keyword.FabricateAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class AngelOfInvention extends CardImpl {
public AngelOfInvention(UUID ownerId) {
super(ownerId, 4, "Angel of Invention", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.expansionSetCode = "KLD";
this.subtype.add("Angel");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// Fabricate 2
this.addAbility(new FabricateAbility(2));
// Other creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, true)));
}
public AngelOfInvention(final AngelOfInvention card) {
super(card);
}
@Override
public AngelOfInvention copy() {
return new AngelOfInvention(this);
}
}

View file

@ -0,0 +1,144 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardHandCost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
* @author emerald000
*/
public class BomatCourier extends CardImpl {
public BomatCourier(UUID ownerId) {
super(ownerId, 199, "Bomat Courier", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
this.expansionSetCode = "KLD";
this.subtype.add("Construct");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Haste
this.addAbility(HasteAbility.getInstance());
// Whenever Bomat Courier attacks, exile the top card of your library face down.
this.addAbility(new AttacksTriggeredAbility(new BomatCourierExileEffect(), false));
// {R}, Discard your hand, Sacrifice Bomat Courier: Put all cards exiled with Bomat Courier into their owners' hands.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BomatCourierReturnEffect(), new ColoredManaCost(ColoredManaSymbol.R));
ability.addCost(new DiscardHandCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public BomatCourier(final BomatCourier card) {
super(card);
}
@Override
public BomatCourier copy() {
return new BomatCourier(this);
}
}
class BomatCourierExileEffect extends OneShotEffect {
BomatCourierExileEffect() {
super(Outcome.Exile);
this.staticText = "exile the top card of your library face down";
}
BomatCourierExileEffect(final BomatCourierExileEffect effect) {
super(effect);
}
@Override
public BomatCourierExileEffect copy() {
return new BomatCourierExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
UUID exileZoneId = CardUtil.getCardExileZoneId(game, source);
card.setFaceDown(true, game);
controller.moveCardsToExile(card, source, game, false, exileZoneId, "Bomat Courier");
card.setFaceDown(true, game);
return true;
}
}
return false;
}
}
class BomatCourierReturnEffect extends OneShotEffect {
BomatCourierReturnEffect() {
super(Outcome.DrawCard);
this.staticText = "Put all cards exiled with {this} into their owners' hands";
}
BomatCourierReturnEffect(final BomatCourierReturnEffect effect) {
super(effect);
}
@Override
public BomatCourierReturnEffect copy() {
return new BomatCourierReturnEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
return controller.moveCards(game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source.getSourceId(), true)), Zone.HAND, source, game);
}
return false;
}
}

View file

@ -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.kaladesh;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.effects.common.PreventAllDamageFromChosenSourceToYouEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterObject;
/**
*
* @author LevelX2
*/
public class ConsulateSurveillance extends CardImpl {
public ConsulateSurveillance(UUID ownerId) {
super(ownerId, 10, "Consulate Surveillance", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
this.expansionSetCode = "KLD";
// When Consulate Surveillance enters the battlefield, you get {E}{E}{E}{E}.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(4)));
// Pay {E}{E}: Prevent all damage that would be dealt to you this turn by a source of your choice.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PreventAllDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, new FilterObject("source"), false),
new PayEnergyCost(2)));
}
public ConsulateSurveillance(final ConsulateSurveillance card) {
super(card);
}
@Override
public ConsulateSurveillance copy() {
return new ConsulateSurveillance(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.kaladesh;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class Demolish extends mage.sets.tenthedition.Demolish {
public Demolish(UUID ownerId) {
super(ownerId);
this.cardNumber = "113";
this.expansionSetCode = "KLD";
}
public Demolish(final Demolish card) {
super(card);
}
@Override
public Demolish copy() {
return new Demolish(this);
}
}

View file

@ -0,0 +1,92 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.target.common.TargetCardInGraveyard;
/**
*
* @author fireshoes
*/
public class DemonOfDarkSchemes extends CardImpl {
public DemonOfDarkSchemes(UUID ownerId) {
super(ownerId, 73, "Demon of Dark Schemes", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}");
this.expansionSetCode = "KLD";
this.subtype.add("Demon");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Demon of Dark Schemes enters the battlefield, all other creatures get -2/-2 until end of turn.
Effect effect = new BoostAllEffect(-2, -2, Duration.EndOfTurn, true);
effect.setText("all other creatures get -2/-2 until end of turn");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false));
// Whenever another creature dies, you get {E}.
this.addAbility(new DiesCreatureTriggeredAbility(new GetEnergyCountersControllerEffect(1), false, true));
// {2}{B}, Pay {E}{E}{E}{E}: Put target creature card from a graveyard onto the battlefield under your control tapped.
effect = new ReturnFromGraveyardToBattlefieldTargetEffect(true);
effect.setText("Put target creature card from a graveyard onto the battlefield under your control tapped");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{B}"));
ability.addCost(new PayEnergyCost(4));
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
this.addAbility(ability);
}
public DemonOfDarkSchemes(final DemonOfDarkSchemes card) {
super(card);
}
@Override
public DemonOfDarkSchemes copy() {
return new DemonOfDarkSchemes(this);
}
}

View file

@ -0,0 +1,159 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RestrictionUntapNotMoreThanEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
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.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author emerald000
*/
public class DovinBaan extends CardImpl {
public DovinBaan(UUID ownerId) {
super(ownerId, 179, "Dovin Baan", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{U}");
this.expansionSetCode = "KLD";
this.subtype.add("Dovin");
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
// +1: Until your next turn, up to one target creature gets -3/-0 and its activated abilities can't be activated.
Effect effect = new BoostTargetEffect(-3, 0, Duration.UntilYourNextTurn);
effect.setText("Until your next turn, up to one target creature gets -3/-0");
Ability ability = new LoyaltyAbility(effect, 1);
ability.addTarget(new TargetCreaturePermanent(0, 1));
ability.addEffect(new DovinBaanCantActivateAbilitiesEffect());
this.addAbility(ability);
// -1: You gain 2 life and draw a card.
ability = new LoyaltyAbility(new GainLifeEffect(2), -1);
effect = new DrawCardSourceControllerEffect(1);
effect.setText("and draw a card");
ability.addEffect(effect);
this.addAbility(ability);
// -7: You get an emblem with "Your opponents can't untap more than two permanents during their untap steps."
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new DovinBaanEmblem()), -7));
}
public DovinBaan(final DovinBaan card) {
super(card);
}
@Override
public DovinBaan copy() {
return new DovinBaan(this);
}
}
class DovinBaanCantActivateAbilitiesEffect extends ContinuousRuleModifyingEffectImpl {
DovinBaanCantActivateAbilitiesEffect() {
super(Duration.UntilYourNextTurn, Outcome.UnboostCreature);
staticText = "and its activated abilities can't be activated";
}
DovinBaanCantActivateAbilitiesEffect(final DovinBaanCantActivateAbilitiesEffect effect) {
super(effect);
}
@Override
public DovinBaanCantActivateAbilitiesEffect copy() {
return new DovinBaanCantActivateAbilitiesEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == EventType.ACTIVATE_ABILITY;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getSourceId().equals(this.getTargetPointer().getFirst(game, source));
}
}
class DovinBaanEmblem extends Emblem {
DovinBaanEmblem() {
this.setName("EMBLEM: Dovin Baan");
Ability ability = new SimpleStaticAbility(Zone.COMMAND, new DovinBaanCantUntapEffect());
this.getAbilities().add(ability);
}
}
class DovinBaanCantUntapEffect extends RestrictionUntapNotMoreThanEffect {
DovinBaanCantUntapEffect() {
super(Duration.WhileOnBattlefield, 2, new FilterControlledPermanent());
staticText = "Your opponents can't untap more than two permanents during their untap steps.";
}
DovinBaanCantUntapEffect(final DovinBaanCantUntapEffect effect) {
super(effect);
}
@Override
public boolean applies(Player player, Ability source, Game game) {
return game.getOpponents(source.getControllerId()).contains(player.getId());
}
@Override
public DovinBaanCantUntapEffect copy() {
return new DovinBaanCantUntapEffect(this);
}
}

View file

@ -0,0 +1,72 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author emerald000
*/
public class ElectrostaticPummeler extends CardImpl {
public ElectrostaticPummeler(UUID ownerId) {
super(ownerId, 210, "Electrostatic Pummeler", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.expansionSetCode = "KLD";
this.subtype.add("Construct");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// When Electrostatic Pummeler enters the battlefield, you get {E}{E}{E}.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(3)));
// Pay {E}{E}{E}: Electrostatic Pummeler gets +X/+X until end of turn, where X is its power.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new SourcePermanentPowerCount(), new SourcePermanentPowerCount(), Duration.EndOfTurn, true), new PayEnergyCost(3)));
}
public ElectrostaticPummeler(final ElectrostaticPummeler card) {
super(card);
}
@Override
public ElectrostaticPummeler copy() {
return new ElectrostaticPummeler(this);
}
}

View file

@ -0,0 +1,67 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class EssenceExtraction extends CardImpl {
public EssenceExtraction(UUID ownerId) {
super(ownerId, 80, "Essence Extraction", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}{B}");
this.expansionSetCode = "KLD";
// Essence Extraction deals 3 damage to target creature and you gain 3 life.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
Effect effect = new DamageTargetEffect(3);
effect.setText("{this} deals 3 damage to target creature");
this.getSpellAbility().addEffect(effect);
effect = new GainLifeEffect(3);
effect.setText("and you gain 3 life");
this.getSpellAbility().addEffect(effect);
}
public EssenceExtraction(final EssenceExtraction card) {
super(card);
}
@Override
public EssenceExtraction copy() {
return new EssenceExtraction(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.kaladesh;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class InspiredCharge extends mage.sets.magic2011.InspiredCharge {
public InspiredCharge(UUID ownerId) {
super(ownerId);
this.cardNumber = "20";
this.expansionSetCode = "KLD";
}
public InspiredCharge(final InspiredCharge card) {
super(card);
}
@Override
public InspiredCharge copy() {
return new InspiredCharge(this);
}
}

View file

@ -0,0 +1,69 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class LiveFast extends CardImpl {
public LiveFast(UUID ownerId) {
super(ownerId, 87, "Live Fast", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}");
this.expansionSetCode = "KLD";
// You draw two cards, lose 2 life, and get {E}{E}.
Effect effect = new DrawCardSourceControllerEffect(2);
effect.setText("You draw two cards");
getSpellAbility().addEffect(effect);
effect = new LoseLifeSourceControllerEffect(2);
effect.setText(", lose 2 life");
getSpellAbility().addEffect(effect);
effect = new GetEnergyCountersControllerEffect(2);
effect.setText(", and get {E}{E} <i>(two energy counters)</i>.");
getSpellAbility().addEffect(effect);
}
public LiveFast(final LiveFast card) {
super(card);
}
@Override
public LiveFast copy() {
return new LiveFast(this);
}
}

View file

@ -0,0 +1,67 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.FabricateAbility;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class MaulfistSquad extends CardImpl {
public MaulfistSquad(UUID ownerId) {
super(ownerId, 91, "Maulfist Squad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "KLD";
this.subtype.add("Human");
this.subtype.add("Artificer");
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// Menace
this.addAbility(new MenaceAbility());
// Fabricate 1
this.addAbility(new FabricateAbility(1));
}
public MaulfistSquad(final MaulfistSquad card) {
super(card);
}
@Override
public MaulfistSquad copy() {
return new MaulfistSquad(this);
}
}

View file

@ -0,0 +1,106 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.MenaceAbility;
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 fireshoes
*/
public class NoxiousGearhulk extends CardImpl {
public NoxiousGearhulk(UUID ownerId) {
super(ownerId, 96, "Noxious Gearhulk", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{B}{B}");
this.expansionSetCode = "KLD";
this.subtype.add("Construct");
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Menace
this.addAbility(new MenaceAbility());
// When Noxious Gearhulk enters the battlefield, you may destroy another target creature. If a creature is destroyed this way, you gain life equal to its toughness.
Ability ability = new EntersBattlefieldTriggeredAbility(new NoxiousGearhulkEffect());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public NoxiousGearhulk(final NoxiousGearhulk card) {
super(card);
}
@Override
public NoxiousGearhulk copy() {
return new NoxiousGearhulk(this);
}
}
class NoxiousGearhulkEffect extends OneShotEffect {
public NoxiousGearhulkEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "you may destroy another target creature. If a creature is destroyed this way, you gain life equal to its toughness";
}
public NoxiousGearhulkEffect(final NoxiousGearhulkEffect effect) {
super(effect);
}
@Override
public NoxiousGearhulkEffect copy() {
return new NoxiousGearhulkEffect(this);
}
@Override
public boolean apply(Game game, final Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent creatureToDestroy = game.getPermanent(getTargetPointer().getFirst(game, source));
if (creatureToDestroy != null && player != null) {
if (player.chooseUse(Outcome.DestroyPermanent, "Destroy creature?", source, game)) {
if (creatureToDestroy.destroy(source.getSourceId(), game, false)) {
player.gainLife(creatureToDestroy.getToughness().getValue(), game);
}
}
}
return true;
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.kaladesh;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class PropheticPrism extends mage.sets.riseoftheeldrazi.PropheticPrism {
public PropheticPrism(UUID ownerId) {
super(ownerId);
this.cardNumber = "229";
this.expansionSetCode = "KLD";
}
public PropheticPrism(final PropheticPrism card) {
super(card);
}
@Override
public PropheticPrism copy() {
return new PropheticPrism(this);
}
}

View file

@ -0,0 +1,82 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CantBlockAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.AnotherCardPredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author emerald000
*/
public class ScrapheapScrounger extends CardImpl {
private static final FilterCard filter = new FilterCreatureCard("another creature card");
static {
filter.add(new AnotherCardPredicate());
}
public ScrapheapScrounger(UUID ownerId) {
super(ownerId, 231, "Scrapheap Scrounger", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}");
this.expansionSetCode = "KLD";
this.subtype.add("Construct");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Scrapheap Scrounger can't block.
this.addAbility(new CantBlockAbility());
// {1}{B}, Exile another creature card from your graveyard: Return Scrapheap Scrounger from your graveyard to the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(false), new ManaCostsImpl<>("{1}{B}"));
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(filter)));
this.addAbility(ability);
}
public ScrapheapScrounger(final ScrapheapScrounger card) {
super(card);
}
@Override
public ScrapheapScrounger copy() {
return new ScrapheapScrounger(this);
}
}

View file

@ -0,0 +1,113 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class SpeedwayFanatic extends CardImpl {
public SpeedwayFanatic(UUID ownerId) {
super(ownerId, 132, "Speedway Fanatic", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetCode = "KLD";
this.subtype.add("Human");
this.subtype.add("Pilot");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Haste
this.addAbility(HasteAbility.getInstance());
// Whenever Speedway Fanatic crews a Vehicle, that Vehicle gains haste until end of turn.
this.addAbility(new CrewsVehicleSourceTriggeredAbility(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn,
"that Vehicle gains haste until end of turn")));
}
public SpeedwayFanatic(final SpeedwayFanatic card) {
super(card);
}
@Override
public SpeedwayFanatic copy() {
return new SpeedwayFanatic(this);
}
}
class CrewsVehicleSourceTriggeredAbility extends TriggeredAbilityImpl {
public CrewsVehicleSourceTriggeredAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect, false);
}
public CrewsVehicleSourceTriggeredAbility(final CrewsVehicleSourceTriggeredAbility ability) {
super(ability);
}
@Override
public CrewsVehicleSourceTriggeredAbility copy() {
return new CrewsVehicleSourceTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.CREWED_VEHICLE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(getSourceId())) {
for (Effect effect : getEffects()) {
// set the vehicle id as target
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
return true;
}
return false;
}
@Override
public String getRule() {
return "When {this} crews a Vehicle, " + super.getRule();
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class StoneQuarry extends mage.sets.shadowsoverinnistrad.StoneQuarry {
public StoneQuarry(UUID ownerId) {
super(ownerId);
this.cardNumber = "269";
this.expansionSetCode = "KLD";
this.rarity = Rarity.COMMON;
}
public StoneQuarry(final StoneQuarry card) {
super(card);
}
@Override
public StoneQuarry copy() {
return new StoneQuarry(this);
}
}

View file

@ -0,0 +1,72 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.CounterType;
/**
*
* @author fireshoes
*/
public class ThrivingRats extends CardImpl {
public ThrivingRats(UUID ownerId) {
super(ownerId, 102, "Thriving Rats", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.expansionSetCode = "KLD";
this.subtype.add("Rat");
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// When Thriving Rats enters the battlefield, you get {E}{E}.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2)));
// Whenever Thriving Rats attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it.
this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2)), false,
"Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it."));
}
public ThrivingRats(final ThrivingRats card) {
super(card);
}
@Override
public ThrivingRats copy() {
return new ThrivingRats(this);
}
}

View file

@ -0,0 +1,86 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class UnderhandedDesigns extends CardImpl {
public UnderhandedDesigns(UUID ownerId) {
super(ownerId, 104, "Underhanded Designs", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.expansionSetCode = "KLD";
// Whenever an artifact enters the battlefield under your control, you may pay {1}. If you do, each opponent loses 1 life and you gain 1 life.
DoIfCostPaid doIfCostPaid = new DoIfCostPaid(new LoseLifeOpponentsEffect(1), new GenericManaCost(1));
Effect effect = new GainLifeEffect(1);
doIfCostPaid.addEffect(effect);
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, doIfCostPaid, new FilterControlledArtifactPermanent("an artifact"), false,
"Whenever an artifact enters the battlefield under your control, you may pay {1}. If you do, each opponent loses 1 life and you gain 1 life."));
// {1}{B}, Sacrifice Underhanded Designs: Destroy target creature. Activate this ability only if you control two or more artifacts.
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD,
new DestroyTargetEffect(),
new ManaCostsImpl("{1}{B}"),
new PermanentsOnTheBattlefieldCondition(new FilterControlledArtifactPermanent("you control two or more artifacts"), CountType.MORE_THAN, 1));
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public UnderhandedDesigns(final UnderhandedDesigns card) {
super(card);
}
@Override
public UnderhandedDesigns copy() {
return new UnderhandedDesigns(this);
}
}

View file

@ -0,0 +1,72 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.ThopterColorlessToken;
/**
*
* @author emerald000
*/
public class WhirlerVirtuoso extends CardImpl {
public WhirlerVirtuoso(UUID ownerId) {
super(ownerId, 190, "Whirler Virtuoso", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{R}");
this.expansionSetCode = "KLD";
this.subtype.add("Vedalken");
this.subtype.add("Artificer");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// When Whirler Virtuoso enters the battlefield, you get {E}{E}{E}.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(3)));
// Pay {E}{E}{E}: Create a 1/1 colorless Thopter artifact creature token with flying.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken()), new PayEnergyCost(3)));
}
public WhirlerVirtuoso(final WhirlerVirtuoso card) {
super(card);
}
@Override
public WhirlerVirtuoso copy() {
return new WhirlerVirtuoso(this);
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.kaladesh;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class WoodlandStream extends mage.sets.shadowsoverinnistrad.WoodlandStream {
public WoodlandStream(UUID ownerId) {
super(ownerId);
this.cardNumber = "274";
this.expansionSetCode = "KLD";
this.rarity = Rarity.COMMON;
}
public WoodlandStream(final WoodlandStream card) {
super(card);
}
@Override
public WoodlandStream copy() {
return new WoodlandStream(this);
}
}

View file

@ -86,7 +86,7 @@ class DingusEggTriggeredAbility extends TriggeredAbilityImpl {
if (zEvent.getFromZone() == Zone.BATTLEFIELD
&& zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTarget().getCardType().contains(CardType.LAND)) {
if (getTargets().size() == 0) {
if (getTargets().isEmpty()) {
UUID targetId = zEvent.getTarget().getControllerId();
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(targetId));

View file

@ -0,0 +1,52 @@
/*
* 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.masterpieceseries;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class NoxiousGearhulk extends mage.sets.kaladesh.NoxiousGearhulk {
public NoxiousGearhulk(UUID ownerId) {
super(ownerId);
this.cardNumber = "3";
this.expansionSetCode = "MPS";
}
public NoxiousGearhulk(final NoxiousGearhulk card) {
super(card);
}
@Override
public NoxiousGearhulk copy() {
return new NoxiousGearhulk(this);
}
}

View file

@ -178,7 +178,6 @@ class KnowledgePoolEffect2 extends OneShotEffect {
while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null && !card.getId().equals(spell.getSourceId())) {
game.getExile().removeCard(card, game);
return player.cast(card.getSpellAbility(), game, true);
}
target.clearChosen();

View file

@ -84,7 +84,7 @@ class GorillaTitanCondition implements Condition {
Player p = game.getPlayer(source.getControllerId());
if (p != null)
{
return p.getGraveyard().size() == 0;
return p.getGraveyard().isEmpty();
}
return false;
}

View file

@ -102,7 +102,7 @@ class CloneShellEffect extends OneShotEffect {
cards.add(card);
}
if (cards.size() == 0) {
if (cards.isEmpty()) {
return false;
}

View file

@ -89,7 +89,7 @@ class AEtherFlashTriggeredAbility extends TriggeredAbilityImpl {
UUID targetId = event.getTargetId();
Permanent permanent = game.getPermanent(targetId);
if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
if (getTargets().size() == 0) {
if (getTargets().isEmpty()) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(targetId));
}

View file

@ -134,7 +134,7 @@ class HollowbornBarghestTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null && opponent.getHand().size() == 0) {
if (opponent != null && opponent.getHand().isEmpty()) {
opponent.loseLife(2, game);
return true;
}

View file

@ -100,7 +100,7 @@ class ImmortalCoilAbility extends StateTriggeredAbility {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Player player = game.getPlayer(this.getControllerId());
return player != null && player.getGraveyard().size() == 0;
return player != null && player.getGraveyard().isEmpty();
}
@Override

View file

@ -94,7 +94,7 @@ class RivalryTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (getTargets().size() == 0) {
if (getTargets().isEmpty()) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}

View file

@ -133,7 +133,7 @@ class QuestForTheNihilStoneTriggeredAbility2 extends TriggeredAbilityImpl {
if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null
&& opponent.getHand().size() == 0
&& opponent.getHand().isEmpty()
&& quest.getCounters(game).getCount(CounterType.QUEST) >= 2) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(opponent.getId()));

View file

@ -27,6 +27,8 @@
*/
package mage.sets.worldwake;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
@ -43,7 +45,6 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ElephantToken;
import mage.players.Player;
import mage.target.TargetPermanent;
/**
@ -100,18 +101,25 @@ class TerastodonEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
HashMap<UUID, Integer> destroyedPermanents = new HashMap<>();
for (UUID targetID : this.targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetID);
if (permanent != null) {
if (permanent.destroy(source.getSourceId(), game, false)) {
if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) {
Player controller = game.getPlayer(permanent.getControllerId());
ElephantToken elephantToken = new ElephantToken();
elephantToken.putOntoBattlefield(1, game, source.getSourceId(), controller.getId());
int numberPermanents = 0;
if (destroyedPermanents.containsKey(permanent.getControllerId())) {
numberPermanents = destroyedPermanents.get(permanent.getControllerId());
}
destroyedPermanents.put(permanent.getControllerId(), numberPermanents);
}
}
}
}
ElephantToken elephantToken = new ElephantToken();
for (Entry<UUID, Integer> entry : destroyedPermanents.entrySet()) {
elephantToken.putOntoBattlefield(entry.getValue(), game, source.getSourceId(), entry.getKey());
}
return true;
}
}

View file

@ -90,7 +90,7 @@ class GuulDrazSpecterCondition implements Condition {
Set<UUID> opponents = game.getOpponents(source.getControllerId());
for (UUID opponentId : opponents) {
result |= game.getPlayer(opponentId).getHand().size() == 0;
result |= game.getPlayer(opponentId).getHand().isEmpty();
}
return result;