From ab0e0a773543ea25c6177e2f011dc720533fac5e Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 4 Aug 2013 18:18:25 -0500 Subject: [PATCH] - Added 4 cards from Conflux. --- .../mage/sets/conflux/CylianSunsinger.java | 78 +++++++++ .../sets/conflux/GwafaHazidProfiteer.java | 163 ++++++++++++++++++ .../src/mage/sets/conflux/MagisterSphinx.java | 107 ++++++++++++ .../src/mage/sets/conflux/SuicidalCharge.java | 108 ++++++++++++ Mage/src/mage/counters/CounterType.java | 3 +- .../mage/counters/common/BriberyCounter.java | 50 ++++++ 6 files changed, 508 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/conflux/CylianSunsinger.java create mode 100644 Mage.Sets/src/mage/sets/conflux/GwafaHazidProfiteer.java create mode 100644 Mage.Sets/src/mage/sets/conflux/MagisterSphinx.java create mode 100644 Mage.Sets/src/mage/sets/conflux/SuicidalCharge.java create mode 100644 Mage/src/mage/counters/common/BriberyCounter.java diff --git a/Mage.Sets/src/mage/sets/conflux/CylianSunsinger.java b/Mage.Sets/src/mage/sets/conflux/CylianSunsinger.java new file mode 100644 index 00000000000..d074a1af80b --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/CylianSunsinger.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.conflux; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostAllEffect; +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.NamePredicate; + +/** + * + * @author jeffwadsworth + */ +public class CylianSunsinger extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Cylian Sunsinger and each other creature with the same name"); + + static { + filter.add(new NamePredicate("Cylian Sunsinger")); + } + + public CylianSunsinger(UUID ownerId) { + super(ownerId, 80, "Cylian Sunsinger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "CON"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}{G}{W}: Cylian Sunsinger and each other creature with the same name as it get +3/+3 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(3, 3, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{R}{G}{W}"))); + + } + + public CylianSunsinger(final CylianSunsinger card) { + super(card); + } + + @Override + public CylianSunsinger copy() { + return new CylianSunsinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conflux/GwafaHazidProfiteer.java b/Mage.Sets/src/mage/sets/conflux/GwafaHazidProfiteer.java new file mode 100644 index 00000000000..ee2b21555f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/GwafaHazidProfiteer.java @@ -0,0 +1,163 @@ +/* + * 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.conflux; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.counters.common.BriberyCounter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class GwafaHazidProfiteer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + public GwafaHazidProfiteer(UUID ownerId) { + super(ownerId, 110, "Gwafa Hazid, Profiteer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{U}"); + this.expansionSetCode = "CON"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Rogue"); + + this.color.setBlue(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {W}{U}, {tap}: Put a bribery counter on target creature you don't control. Its controller draws a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GwafaHazidProfiteerEffect1(), new ManaCostsImpl("{W}{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + // Creatures with bribery counters on them can't attack or block. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GwafaHazidProfiteerEffect2())); + + } + + public GwafaHazidProfiteer(final GwafaHazidProfiteer card) { + super(card); + } + + @Override + public GwafaHazidProfiteer copy() { + return new GwafaHazidProfiteer(this); + } +} + +class GwafaHazidProfiteerEffect1 extends OneShotEffect { + + GwafaHazidProfiteerEffect1() { + super(Outcome.Detriment); + staticText = "Put a bribery counter on target creature you don't control. Its controller draws a card"; + } + + public GwafaHazidProfiteerEffect1(final GwafaHazidProfiteerEffect1 effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (targetCreature != null) { + Player controller = game.getPlayer(targetCreature.getControllerId()); + targetCreature.addCounters(new BriberyCounter(), game); + if (controller != null) { + controller.drawCards(1, game); + } + return true; + } + return false; + } + + @Override + public GwafaHazidProfiteerEffect1 copy() { + return new GwafaHazidProfiteerEffect1(this); + } + + +} + +class GwafaHazidProfiteerEffect2 extends RestrictionEffect { + + public GwafaHazidProfiteerEffect2() { + super(Duration.WhileOnBattlefield); + staticText = "Creatures with bribery counters on them can't attack or block"; + } + + public GwafaHazidProfiteerEffect2(final GwafaHazidProfiteerEffect2 effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getCounters().containsKey(CounterType.BRIBERY); + } + + @Override + public boolean canAttack(Game game) { + return false; + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } + + @Override + public GwafaHazidProfiteerEffect2 copy() { + return new GwafaHazidProfiteerEffect2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conflux/MagisterSphinx.java b/Mage.Sets/src/mage/sets/conflux/MagisterSphinx.java new file mode 100644 index 00000000000..2a373761aee --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/MagisterSphinx.java @@ -0,0 +1,107 @@ +/* + * 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.conflux; + +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.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author jeffwadsworth + */ +public class MagisterSphinx extends CardImpl { + + public MagisterSphinx(UUID ownerId) { + super(ownerId, 116, "Magister Sphinx", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{W}{U}{B}"); + this.expansionSetCode = "CON"; + this.subtype.add("Sphinx"); + + this.color.setBlue(true); + this.color.setBlack(true); + this.color.setWhite(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Magister Sphinx enters the battlefield, target player's life total becomes 10. + Ability ability = new EntersBattlefieldTriggeredAbility(new MagisterSphinxEffect(), false); + ability.addTarget(new TargetPlayer(true)); + this.addAbility(ability); + + } + + public MagisterSphinx(final MagisterSphinx card) { + super(card); + } + + @Override + public MagisterSphinx copy() { + return new MagisterSphinx(this); + } +} + +class MagisterSphinxEffect extends OneShotEffect { + + MagisterSphinxEffect() { + super(Outcome.Detriment); + staticText = "target player's life total becomes 10"; + } + + MagisterSphinxEffect(final MagisterSphinxEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + if (targetPlayer != null) { + targetPlayer.setLife(10, game); + return true; + } + return false; + } + + @Override + public MagisterSphinxEffect copy() { + return new MagisterSphinxEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/SuicidalCharge.java b/Mage.Sets/src/mage/sets/conflux/SuicidalCharge.java new file mode 100644 index 00000000000..b91508501ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/SuicidalCharge.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.conflux; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.continious.BoostOpponentsEffect; +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.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class SuicidalCharge extends CardImpl { + + public SuicidalCharge(UUID ownerId) { + super(ownerId, 128, "Suicidal Charge", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{R}"); + this.expansionSetCode = "CON"; + + this.color.setRed(true); + this.color.setBlack(true); + + // Sacrifice Suicidal Charge: Creatures your opponents control get -1/-1 until end of turn. Those creatures attack this turn if able. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostOpponentsEffect(-1, -1, Duration.EndOfTurn), new SacrificeSourceCost()); + ability.addEffect(new SuicidalChargeEffect()); + this.addAbility(ability); + + } + + public SuicidalCharge(final SuicidalCharge card) { + super(card); + } + + @Override + public SuicidalCharge copy() { + return new SuicidalCharge(this); + } +} + +class SuicidalChargeEffect extends RequirementEffect { + + public SuicidalChargeEffect() { + super(Duration.EndOfTurn); + staticText = "Those creatures attack this turn if able"; + } + + public SuicidalChargeEffect(final SuicidalChargeEffect effect) { + super(effect); + } + + @Override + public SuicidalChargeEffect copy() { + return new SuicidalChargeEffect(this); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (!permanent.getControllerId().equals(source.getControllerId())) { + return true; + } + return false; + } + + @Override + public boolean mustAttack(Game game) { + return true; + } + + @Override + public boolean mustBlock(Game game) { + return false; + } + +} \ No newline at end of file diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index f143b20cff6..ab6304b27e8 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -72,7 +72,8 @@ public enum CounterType { THEFT(new TheftCounter().name), AGE(new AgeCounter().name), BLAZE(new BlazeCounter().name), - ICE(new IceCounter().name); + ICE(new IceCounter().name), + BRIBERY(new BriberyCounter().name); private String name; diff --git a/Mage/src/mage/counters/common/BriberyCounter.java b/Mage/src/mage/counters/common/BriberyCounter.java new file mode 100644 index 00000000000..5d4ff2e33f9 --- /dev/null +++ b/Mage/src/mage/counters/common/BriberyCounter.java @@ -0,0 +1,50 @@ +/* +* 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.counters.common; + +import mage.counters.Counter; + +/** + * Bribery counter. + * + * @author jeffwadsworth + */ +public class BriberyCounter extends Counter { + + public BriberyCounter() { + super("bribery"); + this.count = 1; + } + + public BriberyCounter(int amount) { + super("bribery"); + this.count = amount; + } + +}