From 66a59dddcc9d96298c3ecced2a13f9a2daf9af16 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 30 May 2018 15:29:46 -0400 Subject: [PATCH] Implemented Victory Chimes --- Mage.Sets/src/mage/cards/v/VictoryChimes.java | 106 ++++++++++++++++++ Mage.Sets/src/mage/sets/Battlebond.java | 1 + 2 files changed, 107 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/VictoryChimes.java diff --git a/Mage.Sets/src/mage/cards/v/VictoryChimes.java b/Mage.Sets/src/mage/cards/v/VictoryChimes.java new file mode 100644 index 00000000000..95141cfcfc2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VictoryChimes.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.v; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.ChoosePlayerEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class VictoryChimes extends CardImpl { + + public VictoryChimes(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // Untap Victory Chimes during each other player's untap step. + // {T}: A player of your choice adds {C}. + ManaEffect effect = new VictoryChimesManaEffect("chosen player"); + effect.setText("a player of your choice adds {C}"); + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + // choosing player as first effect, before adding mana effect + ability.getEffects().add(0, new ChoosePlayerEffect(Outcome.PutManaInPool).setText("")); + this.addAbility(ability); + } + + public VictoryChimes(final VictoryChimes card) { + super(card); + } + + @Override + public VictoryChimes copy() { + return new VictoryChimes(this); + } +} + +class VictoryChimesManaEffect extends ManaEffect { + + public VictoryChimesManaEffect(String textManaPoolOwner) { + super(); + this.staticText = "a player of your choice adds {C}"; + } + + public VictoryChimesManaEffect(final VictoryChimesManaEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer((UUID) game.getState().getValue(source.getSourceId() + "_player")); + if (player != null) { + checkToFirePossibleEvents(getMana(game, source), game, source); + player.getManaPool().addMana(getMana(game, source), game, source); + return true; + } + return false; + } + + @Override + public Mana produceMana(boolean netMana, Game game, Ability source) { + return Mana.ColorlessMana(1); + } + + @Override + public VictoryChimesManaEffect copy() { + return new VictoryChimesManaEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/Battlebond.java b/Mage.Sets/src/mage/sets/Battlebond.java index d7e3b98ea9a..e9a9331f36f 100644 --- a/Mage.Sets/src/mage/sets/Battlebond.java +++ b/Mage.Sets/src/mage/sets/Battlebond.java @@ -292,6 +292,7 @@ public final class Battlebond extends ExpansionSet { cards.add(new SetCardInfo("Urborg Drake", 231, Rarity.COMMON, mage.cards.u.UrborgDrake.class)); cards.add(new SetCardInfo("Vampire Charmseeker", 78, Rarity.UNCOMMON, mage.cards.v.VampireCharmseeker.class)); cards.add(new SetCardInfo("Veteran Explorer", 214, Rarity.UNCOMMON, mage.cards.v.VeteranExplorer.class)); + cards.add(new SetCardInfo("Victory Chimes", 80, Rarity.RARE, mage.cards.v.VictoryChimes.class)); cards.add(new SetCardInfo("Vigor", 215, Rarity.RARE, mage.cards.v.Vigor.class)); cards.add(new SetCardInfo("Virtus the Veiled", 7, Rarity.RARE, mage.cards.v.VirtusTheVeiled.class)); cards.add(new SetCardInfo("Wandering Wolf", 216, Rarity.COMMON, mage.cards.w.WanderingWolf.class));