diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/FlamesOfTheBloodHand.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/FlamesOfTheBloodHand.java new file mode 100644 index 00000000000..af4e2c04949 --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/FlamesOfTheBloodHand.java @@ -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.betrayersofkamigawa; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continious.CantGainLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class FlamesOfTheBloodHand extends CardImpl { + + public FlamesOfTheBloodHand(UUID ownerId) { + super(ownerId, 101, "Flames of the Blood Hand", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "BOK"; + + this.color.setRed(true); + + // Flames of the Blood Hand deals 4 damage to target player. The damage can't be prevented. + this.getSpellAbility().addEffect(new DamageTargetEffect(4, false)); + // If that player would gain life this turn, that player gains no life instead. + Effect effect = new CantGainLifeTargetEffect(Duration.EndOfTurn); + effect.setText("If that player would gain life this turn, that player gains no life instead"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer(true)); + } + + public FlamesOfTheBloodHand(final FlamesOfTheBloodHand card) { + super(card); + } + + @Override + public FlamesOfTheBloodHand copy() { + return new FlamesOfTheBloodHand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IshiIshiAkkiCrackshot.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IshiIshiAkkiCrackshot.java new file mode 100644 index 00000000000..3cbe4d439ac --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IshiIshiAkkiCrackshot.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.betrayersofkamigawa; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterSpiritOrArcaneCard; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class IshiIshiAkkiCrackshot extends CardImpl { + + private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public IshiIshiAkkiCrackshot(UUID ownerId) { + super(ownerId, 110, "Ishi-Ishi, Akki Crackshot", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "BOK"; + this.supertype.add("Legendary"); + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever an opponent casts a Spirit or Arcane spell, Ishi-Ishi, Akki Crackshot deals 2 damage to that player. + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2, true, "that player"), filter, false, true)); + } + + public IshiIshiAkkiCrackshot(final IshiIshiAkkiCrackshot card) { + super(card); + } + + @Override + public IshiIshiAkkiCrackshot copy() { + return new IshiIshiAkkiCrackshot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KumanosBlessing.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KumanosBlessing.java new file mode 100644 index 00000000000..4a3736d391a --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KumanosBlessing.java @@ -0,0 +1,173 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.betrayersofkamigawa; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +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.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.watchers.WatcherImpl; + +/** + * + * @author LevelX2 + */ +public class KumanosBlessing extends CardImpl { + + public KumanosBlessing(UUID ownerId) { + super(ownerId, 111, "Kumano's Blessing", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "BOK"; + this.subtype.add("Aura"); + + this.color.setRed(true); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // If a creature dealt damage by enchanted creature this turn would die, exile it instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KumanosBlessingEffect())); + this.addWatcher(new DamagedByEnchantedWatcher()); + } + + public KumanosBlessing(final KumanosBlessing card) { + super(card); + } + + @Override + public KumanosBlessing copy() { + return new KumanosBlessing(this); + } +} + +class KumanosBlessingEffect extends ReplacementEffectImpl { + + public KumanosBlessingEffect() { + super(Duration.WhileOnBattlefield, Outcome.Exile); + staticText = "If a creature dealt damage by enchanted creature this turn would die, exile it instead"; + } + + public KumanosBlessingEffect(final KumanosBlessingEffect effect) { + super(effect); + } + + @Override + public KumanosBlessingEffect copy() { + return new KumanosBlessingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && permanent != null) { + return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD); + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + DamagedByEnchantedWatcher watcher = (DamagedByEnchantedWatcher) game.getState().getWatchers().get("DamagedByEnchantedWatcher", source.getSourceId()); + if (watcher != null) { + return watcher.damagedCreatures.contains(event.getTargetId()); + } + } + return false; + } + +} + +class DamagedByEnchantedWatcher extends WatcherImpl { + + public List damagedCreatures = new ArrayList<>(); + + public DamagedByEnchantedWatcher() { + super("DamagedByEnchantedWatcher", WatcherScope.CARD); + } + + public DamagedByEnchantedWatcher(final DamagedByEnchantedWatcher watcher) { + super(watcher); + this.damagedCreatures.addAll(watcher.damagedCreatures); + } + + @Override + public DamagedByEnchantedWatcher copy() { + return new DamagedByEnchantedWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_CREATURE) { + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (enchantment.getAttachedTo().equals(event.getSourceId()) && !damagedCreatures.contains(event.getTargetId())) { + damagedCreatures.add(event.getTargetId()); + } + } + } + } + + @Override + public void reset() { + super.reset(); + damagedCreatures.clear(); + } + +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MannichiTheFeveredDream.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MannichiTheFeveredDream.java new file mode 100644 index 00000000000..b3fb73268fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MannichiTheFeveredDream.java @@ -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.betrayersofkamigawa; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.SwitchPowerToughnessAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class MannichiTheFeveredDream extends CardImpl { + + public MannichiTheFeveredDream(UUID ownerId) { + super(ownerId, 112, "Mannichi, the Fevered Dream", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BOK"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}{R}: Switch each creature's power and toughness until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessAllEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"))); + } + + public MannichiTheFeveredDream(final MannichiTheFeveredDream card) { + super(card); + } + + @Override + public MannichiTheFeveredDream copy() { + return new MannichiTheFeveredDream(this); + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Overblaze.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Overblaze.java new file mode 100644 index 00000000000..85a12a9a66d --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Overblaze.java @@ -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.betrayersofkamigawa; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.SpliceOntoArcaneAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import static mage.game.events.GameEvent.EventType.DAMAGE_CREATURE; +import static mage.game.events.GameEvent.EventType.DAMAGE_PLAYER; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class Overblaze extends CardImpl { + + public Overblaze(UUID ownerId) { + super(ownerId, 114, "Overblaze", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{R}"); + this.expansionSetCode = "BOK"; + this.subtype.add("Arcane"); + + this.color.setRed(true); + + // Each time target permanent would deal damage to a creature or player this turn, it deals double that damage to that creature or player instead. + this.getSpellAbility().addEffect(new FireServantEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(true)); + // Splice onto Arcane {2}{R}{R} + this.addAbility(new SpliceOntoArcaneAbility("{2}{R}{R}")); + } + + public Overblaze(final Overblaze card) { + super(card); + } + + @Override + public Overblaze copy() { + return new Overblaze(this); + } +} + +class FireServantEffect extends ReplacementEffectImpl { + + public FireServantEffect() { + super(Duration.EndOfTurn, Outcome.Damage); + staticText = "Each time target permanent would deal damage to a creature or player this turn, it deals double that damage to that creature or player instead."; + } + + public FireServantEffect(final FireServantEffect effect) { + super(effect); + } + + @Override + public FireServantEffect copy() { + return new FireServantEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + switch (event.getType()) { + case DAMAGE_CREATURE: + case DAMAGE_PLAYER: + if (event.getSourceId().equals(this.getTargetPointer().getFirst(game, source))) { + event.setAmount(event.getAmount() * 2); + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninCliffrider.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninCliffrider.java new file mode 100644 index 00000000000..ae2dcdfe028 --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninCliffrider.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.betrayersofkamigawa; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.keyword.BushidoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class RoninCliffrider extends CardImpl { + + public RoninCliffrider(UUID ownerId) { + super(ownerId, 116, "Ronin Cliffrider", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "BOK"; + this.subtype.add("Human"); + this.subtype.add("Samurai"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Bushido 1 + this.addAbility(new BushidoAbility(1)); + // Whenever Ronin Cliffrider attacks, you may have it deal 1 damage to each creature defending player controls. + this.addAbility(new AttacksTriggeredAbility(new RoninCliffriderEffect(), true)); + } + + public RoninCliffrider(final RoninCliffrider card) { + super(card); + } + + @Override + public RoninCliffrider copy() { + return new RoninCliffrider(this); + } +} +class RoninCliffriderEffect extends OneShotEffect { + + public RoninCliffriderEffect() { + super(Outcome.Damage); + this.staticText = "you may have it deal 1 damage to each creature defending player controls"; + } + + public RoninCliffriderEffect(final RoninCliffriderEffect effect) { + super(effect); + } + + @Override + public RoninCliffriderEffect copy() { + return new RoninCliffriderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID defenderId = game.getCombat().getDefenderId(source.getSourceId()); + if (defenderId != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new ControllerIdPredicate(defenderId)); + List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); + for (Permanent permanent : permanents) { + permanent.damage(1, source.getSourceId(), game, true, false); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java index 25069e27703..75b362e764e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanosPupils.java @@ -103,7 +103,7 @@ class KumanosPupilsEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent)event).getTarget(); if (permanent != null) { - return permanent.moveToExile(null, "", source.getId(), game); + return permanent.moveToExile(null, "", source.getSourceId(), game); } return false; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java index 8bf3add6e20..1b6aeb3a309 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java @@ -115,6 +115,7 @@ class LordOfShatterskullPassEffect extends OneShotEffect possibleTargets = new HashSet<>(); for (StackObject stackObject : game.getStack()) { if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) { - Targets targets = stackObject.getStackAbility().getTargets(); - if(!targets.isEmpty()) { - for (Target target : targets) { + Targets objectTargets = stackObject.getStackAbility().getTargets(); + if(!objectTargets.isEmpty()) { + for (Target target : objectTargets) { for (UUID targetId : target.getTargets()) { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); if (targetedPermanent.getControllerId().equals(sourceControllerId)) { diff --git a/Mage/src/mage/abilities/effects/common/continious/CantGainLifeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/CantGainLifeTargetEffect.java new file mode 100644 index 00000000000..3fd92779d6f --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continious/CantGainLifeTargetEffect.java @@ -0,0 +1,81 @@ +/* + * 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.abilities.effects.common.continious; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class CantGainLifeTargetEffect extends ContinuousEffectImpl { + + public CantGainLifeTargetEffect(Duration duration) { + super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); + StringBuilder sb = new StringBuilder("If that player would gain life"); + if (!this.duration.toString().isEmpty()) { + if (duration.equals(Duration.EndOfTurn)) { + sb.append("this turn, "); + } else { + sb.append(" ").append(duration.toString()); + } + } + sb.append("that player gains no life instead"); + staticText = sb.toString(); + } + + public CantGainLifeTargetEffect(final CantGainLifeTargetEffect effect) { + super(effect); + } + + @Override + public CantGainLifeTargetEffect copy() { + return new CantGainLifeTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for(UUID playerId: this.getTargetPointer().getTargets(game, source) ) { + Player targetPlayer = game.getPlayer(playerId); + if (targetPlayer != null) { + targetPlayer.setCanGainLife(false); + } + } + return true; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessAllEffect.java b/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessAllEffect.java new file mode 100644 index 00000000000..0ea723ea40a --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continious/SwitchPowerToughnessAllEffect.java @@ -0,0 +1,90 @@ +/* + * 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.abilities.effects.common.continious; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ + +public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl { + + static FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public SwitchPowerToughnessAllEffect(Duration duration) { + super(duration, Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, Outcome.BoostCreature); + } + + public SwitchPowerToughnessAllEffect(final SwitchPowerToughnessAllEffect effect) { + super(effect); + } + + @Override + public SwitchPowerToughnessAllEffect copy() { + return new SwitchPowerToughnessAllEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (Permanent creature :game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + int power = creature.getPower().getValue(); + creature.getPower().setValue(creature.getToughness().getValue()); + creature.getToughness().setValue(power); + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("Switch each creature's power and toughness"); + if (!duration.toString().isEmpty()) { + sb.append(" "); + sb.append(duration.toString()); + } + return sb.toString(); + } + +} diff --git a/Mage/src/mage/watchers/common/DamagedByWatcher.java b/Mage/src/mage/watchers/common/DamagedByWatcher.java index 59095ff40cf..220d3c37360 100644 --- a/Mage/src/mage/watchers/common/DamagedByWatcher.java +++ b/Mage/src/mage/watchers/common/DamagedByWatcher.java @@ -43,7 +43,7 @@ import java.util.UUID; */ public class DamagedByWatcher extends WatcherImpl { - public List damagedCreatures = new ArrayList(); + public List damagedCreatures = new ArrayList<>(); public DamagedByWatcher() { super("DamagedByWatcher", WatcherScope.CARD);