From 38adc7518dde8a90e8d31334c29195d2e762f407 Mon Sep 17 00:00:00 2001 From: MarcoMarin Date: Mon, 25 Apr 2016 14:23:36 -0300 Subject: [PATCH] A few fixes after suggestions thanks to LevelX2 for spotting them --- .../mage/sets/fallenempires/DelifsCube.java | 2 +- .../src/mage/sets/fallenempires/Necrite.java | 2 +- .../sets/fallenempires/ThrullChampion.java | 52 +++++++++++ .../sets/fallenempires/ThrullRetainer.java | 52 +++++++++++ .../sets/fifthedition/ThrullRetainer.java | 80 +++++++++++++++++ .../sets/mastersedition/ThrullChampion.java | 88 +++++++++++++++++++ .../sets/mastersedition/ThrullRetainer.java | 54 ++++++++++++ .../sets/masterseditionii/SoulExchange.java | 22 +++-- 8 files changed, 341 insertions(+), 11 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/fallenempires/ThrullChampion.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/ThrullRetainer.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/ThrullRetainer.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/ThrullChampion.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/ThrullRetainer.java diff --git a/Mage.Sets/src/mage/sets/fallenempires/DelifsCube.java b/Mage.Sets/src/mage/sets/fallenempires/DelifsCube.java index 1e129dda28..f25a17efea 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/DelifsCube.java +++ b/Mage.Sets/src/mage/sets/fallenempires/DelifsCube.java @@ -96,7 +96,7 @@ class DelifsCubeEffect extends OneShotEffect{ public DelifsCubeEffect(UUID cubeId) { super(Outcome.Benefit); this.cubeId = cubeId; - this.setText("This turn, when target creature you control attacks and isn't blocked, it assigns no combat damage this turn and you put a cube counter on Delif's Cube."); + this.setText("This turn, when target creature you control attacks and isn't blocked, it assigns no combat damage this turn and you put a cube counter on Delif's Cube"); } public DelifsCubeEffect(final DelifsCubeEffect effect) { diff --git a/Mage.Sets/src/mage/sets/fallenempires/Necrite.java b/Mage.Sets/src/mage/sets/fallenempires/Necrite.java index 6da52cbdbc..9effea0242 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/Necrite.java +++ b/Mage.Sets/src/mage/sets/fallenempires/Necrite.java @@ -64,7 +64,6 @@ public class Necrite extends CardImpl { // Whenever Necrite attacks and isn't blocked, you may sacrifice it. If you do, destroy target creature defending player controls. It can't be regenerated. DoIfCostPaid effect = new DoIfCostPaid(new DestroyTargetEffect(true), new SacrificeSourceCost(), "Sacrifice {this} to destroy target creature defending player controls?"); effect.setText("you may sacrifice it. If you do, destroy target creature defending player controls. It can't be regenerated."); - effect.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn)); Ability ability = new NecriteTriggeredAbility(effect); this.addAbility(ability); @@ -102,6 +101,7 @@ class NecriteTriggeredAbility extends AttacksAndIsNotBlockedTriggeredAbility{ FilterPermanent filter = new FilterCreaturePermanent(); filter.add(new ControllerIdPredicate(defendingPlayerId)); Target target = new TargetPermanent(filter); + this.getTargets().clear(); this.addTarget(target); return true; } diff --git a/Mage.Sets/src/mage/sets/fallenempires/ThrullChampion.java b/Mage.Sets/src/mage/sets/fallenempires/ThrullChampion.java new file mode 100644 index 0000000000..e1350b3b42 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ThrullChampion.java @@ -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.fallenempires; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class ThrullChampion extends mage.sets.mastersedition.ThrullChampion { + + public ThrullChampion(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "FEM"; + } + + public ThrullChampion(final ThrullChampion card) { + super(card); + } + + @Override + public ThrullChampion copy() { + return new ThrullChampion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ThrullRetainer.java b/Mage.Sets/src/mage/sets/fallenempires/ThrullRetainer.java new file mode 100644 index 0000000000..7c6a1c2dbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ThrullRetainer.java @@ -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.fallenempires; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class ThrullRetainer extends mage.sets.fifthedition.ThrullRetainer { + + public ThrullRetainer(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "FEM"; + } + + public ThrullRetainer(final ThrullRetainer card) { + super(card); + } + + @Override + public ThrullRetainer copy() { + return new ThrullRetainer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/ThrullRetainer.java b/Mage.Sets/src/mage/sets/fifthedition/ThrullRetainer.java new file mode 100644 index 0000000000..b0fbb34938 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/ThrullRetainer.java @@ -0,0 +1,80 @@ +/* + * 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.fifthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.RegenerateAttachedEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author MarcoMarin + */ +public class ThrullRetainer extends CardImpl { + + public ThrullRetainer(UUID ownerId) { + super(ownerId, 60, "Thrull Retainer", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // Sacrifice Thrull Retainer: Regenerate enchanted creature. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.AURA), new SacrificeSourceCost())); + } + + public ThrullRetainer(final ThrullRetainer card) { + super(card); + } + + @Override + public ThrullRetainer copy() { + return new ThrullRetainer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/ThrullChampion.java b/Mage.Sets/src/mage/sets/mastersedition/ThrullChampion.java new file mode 100644 index 0000000000..3d44aba1f2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/ThrullChampion.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author MarcoMarin + */ +public class ThrullChampion extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Thrull creatures"); + + static { + filter.add(new SubtypePredicate("Thrull")); + } + + public ThrullChampion(UUID ownerId) { + super(ownerId, 83, "Thrull Champion", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "MED"; + this.subtype.add("Thrull"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Thrull creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); + // {tap}: Gain control of target Thrull for as long as you control Thrull Champion. + ConditionalContinuousEffect ThrullChampionGainControlEffect = new ConditionalContinuousEffect( + new GainControlTargetEffect(Duration.Custom), + new SourceOnBattlefieldControlUnchangedCondition(), + "Gain control of target Thrull for as long as you control {this}"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, ThrullChampionGainControlEffect, new TapSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public ThrullChampion(final ThrullChampion card) { + super(card); + } + + @Override + public ThrullChampion copy() { + return new ThrullChampion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/ThrullRetainer.java b/Mage.Sets/src/mage/sets/mastersedition/ThrullRetainer.java new file mode 100644 index 0000000000..62a5229b98 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/ThrullRetainer.java @@ -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.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class ThrullRetainer extends mage.sets.fifthedition.ThrullRetainer { + + public ThrullRetainer(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public ThrullRetainer(final ThrullRetainer card) { + super(card); + } + + @Override + public ThrullRetainer copy() { + return new ThrullRetainer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SoulExchange.java b/Mage.Sets/src/mage/sets/masterseditionii/SoulExchange.java index 71b74b2aa6..215fec4f80 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/SoulExchange.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/SoulExchange.java @@ -33,6 +33,7 @@ import mage.abilities.costs.Cost; import mage.abilities.costs.common.ExileTargetCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -95,17 +96,20 @@ class SoulExchangeEffect extends OneShotEffect{ if (!effect.apply(game, source)) return false; for (Cost c : source.getCosts()){ - if (!c.getTargets().isEmpty()){ + /* if (!c.getTargets().isEmpty()){ UUID t = c.getTargets().getFirstTarget(); - Permanent exiled = game.getPermanentOrLKIBattlefield(t); - if (exiled == null) return false; - if (exiled.getSubtype().contains("Thrull")){ - game.getPermanent(source.getFirstTarget()).addCounters(CounterType.P2P2.createInstance(), game); - } + Permanent exiled = game.getPermanentOrLKIBattlefield(t);*/ + if (c.isPaid() && c instanceof ExileTargetCost) { + for (Permanent exiled : ((ExileTargetCost) c).getPermanents()) { + if (exiled != null){ + if(exiled.getSubtype().contains("Thrull")){ + game.getPermanent(source.getFirstTarget()).addCounters(CounterType.P2P2.createInstance(), game); + return true; + } + } else return false; + } } - } - - + } return true; } } \ No newline at end of file