From 111f198f3db9138461920c4c8ab52ef28af857da Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Wed, 1 May 2013 10:27:48 -0500 Subject: [PATCH] - Added some cards. AI will no longer attack with creatures at 0 power. --- .../src/mage/player/ai/ComputerPlayer6.java | 3 +- .../alarareborn/EtherswornShieldmage.java | 134 ++++++++++++++++++ .../mage/sets/morningtide/TaureanMauler.java | 52 +++++++ .../src/mage/sets/odyssey/RecklessCharge.java | 52 +++++++ .../mage/sets/planechase/RecklessCharge.java | 71 ++++++++++ .../mage/sets/planechase/TaureanMauler.java | 71 ++++++++++ 6 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/alarareborn/EtherswornShieldmage.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/TaureanMauler.java create mode 100644 Mage.Sets/src/mage/sets/odyssey/RecklessCharge.java create mode 100644 Mage.Sets/src/mage/sets/planechase/RecklessCharge.java create mode 100644 Mage.Sets/src/mage/sets/planechase/TaureanMauler.java diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java index 25be5b66c1c..5de2155cfe8 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java @@ -1102,7 +1102,8 @@ public class ComputerPlayer6 extends ComputerPlayer implements for (Permanent blocker : possibleBlockers) { int blockerValue = eval.evaluate(blocker, game); if (attacker.getPower().getValue() <= blocker.getToughness().getValue() - && attacker.getToughness().getValue() <= blocker.getPower().getValue()) { + && attacker.getToughness().getValue() <= blocker.getPower().getValue() + && attacker.getPower().getValue() == 0) { safeToAttack = false; } diff --git a/Mage.Sets/src/mage/sets/alarareborn/EtherswornShieldmage.java b/Mage.Sets/src/mage/sets/alarareborn/EtherswornShieldmage.java new file mode 100644 index 00000000000..f2641d2f7bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/alarareborn/EtherswornShieldmage.java @@ -0,0 +1,134 @@ +/* + * 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.alarareborn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class EtherswornShieldmage extends CardImpl { + + final private static FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creatures"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public EtherswornShieldmage(UUID ownerId) { + super(ownerId, 4, "Ethersworn Shieldmage", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{W}{U}"); + this.expansionSetCode = "ARB"; + this.subtype.add("Vedalken"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // When Ethersworn Shieldmage enters the battlefield, prevent all damage that would be dealt to artifact creatures this turn. + this.addAbility(new EntersBattlefieldTriggeredAbility(new PreventAllDamageToCreatureEffect(Duration.EndOfTurn, filter), false)); + } + + public EtherswornShieldmage(final EtherswornShieldmage card) { + super(card); + } + + @Override + public EtherswornShieldmage copy() { + return new EtherswornShieldmage(this); + } +} + +class PreventAllDamageToCreatureEffect extends PreventionEffectImpl { + + protected FilterCreaturePermanent filter; + + public PreventAllDamageToCreatureEffect(Duration duration, FilterCreaturePermanent filter) { + super(duration); + this.filter = filter; + staticText = "Prevent all damage that would be dealt to " + filter.getMessage() + " " + duration.toString(); + } + + public PreventAllDamageToCreatureEffect(final PreventAllDamageToCreatureEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + } + + @Override + public PreventAllDamageToCreatureEffect copy() { + return new PreventAllDamageToCreatureEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/TaureanMauler.java b/Mage.Sets/src/mage/sets/morningtide/TaureanMauler.java new file mode 100644 index 00000000000..1132f6166a2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/TaureanMauler.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.morningtide; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class TaureanMauler extends mage.sets.planechase.TaureanMauler { + + public TaureanMauler(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "MOR"; + } + + public TaureanMauler(final TaureanMauler card) { + super(card); + } + + @Override + public TaureanMauler copy() { + return new TaureanMauler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/RecklessCharge.java b/Mage.Sets/src/mage/sets/odyssey/RecklessCharge.java new file mode 100644 index 00000000000..7392a44ee9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/RecklessCharge.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.odyssey; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class RecklessCharge extends mage.sets.planechase.RecklessCharge { + + public RecklessCharge(UUID ownerId) { + super(ownerId); + this.cardNumber = 215; + this.expansionSetCode = "ODY"; + } + + public RecklessCharge(final RecklessCharge card) { + super(card); + } + + @Override + public RecklessCharge copy() { + return new RecklessCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/RecklessCharge.java b/Mage.Sets/src/mage/sets/planechase/RecklessCharge.java new file mode 100644 index 00000000000..a35246fb2fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase/RecklessCharge.java @@ -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.planechase; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class RecklessCharge extends CardImpl { + + public RecklessCharge(UUID ownerId) { + super(ownerId, 61, "Reckless Charge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); + this.expansionSetCode = "HOP"; + + this.color.setRed(true); + + // Target creature gets +3/+0 and gains haste until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 0, Constants.Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Constants.Duration.EndOfTurn)); + + // Flashback {2}{R} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), Constants.TimingRule.INSTANT)); + } + + public RecklessCharge(final RecklessCharge card) { + super(card); + } + + @Override + public RecklessCharge copy() { + return new RecklessCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/TaureanMauler.java b/Mage.Sets/src/mage/sets/planechase/TaureanMauler.java new file mode 100644 index 00000000000..a05d23a1703 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase/TaureanMauler.java @@ -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.planechase; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.OpponentCastsSpellTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.ChangelingAbility; +import mage.cards.CardImpl; +import mage.counters.CounterType; + +/** + * + * @author jeffwadsworth + */ +public class TaureanMauler extends CardImpl { + + public TaureanMauler(UUID ownerId) { + super(ownerId, 67, "Taurean Mauler", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "HOP"; + this.subtype.add("Shapeshifter"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Changeling + this.addAbility(ChangelingAbility.getInstance()); + + // Whenever an opponent casts a spell, you may put a +1/+1 counter on Taurean Mauler. + this.addAbility(new OpponentCastsSpellTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true)); + + } + + public TaureanMauler(final TaureanMauler card) { + super(card); + } + + @Override + public TaureanMauler copy() { + return new TaureanMauler(this); + } +}