diff --git a/Mage.Sets/src/mage/cards/s/SeasonsBeatings.java b/Mage.Sets/src/mage/cards/s/SeasonsBeatings.java new file mode 100644 index 0000000000..31672cc71a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SeasonsBeatings.java @@ -0,0 +1,120 @@ +/* + * 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.s; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.util.RandomUtil; + +/** + * + * @author spjspj + */ +public class SeasonsBeatings extends CardImpl { + + public SeasonsBeatings(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}{R}{R}{R}"); + + // Family gathering - Each creature target player controls deals damage equal to its power to another random creature that player controls. + this.getSpellAbility().addEffect(new SeasonsBeatingsEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + } + + public SeasonsBeatings(final SeasonsBeatings card) { + super(card); + } + + @Override + public SeasonsBeatings copy() { + return new SeasonsBeatings(this); + } +} + +class SeasonsBeatingsEffect extends OneShotEffect { + + SeasonsBeatingsEffect() { + super(Outcome.Damage); + staticText = "Family gathering <i>Each creature target player controls deals damage equal to its power to another random creature that player controls.</i>"; + } + + SeasonsBeatingsEffect(final SeasonsBeatingsEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null) { + Map<Integer, UUID> creatures = new HashMap<>(); + int numCreature = 0; + + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) { + if (permanent != null) { + creatures.put(numCreature, permanent.getId()); + numCreature++; + } + } + if (numCreature < 2) { + return true; + } + for (Integer i : creatures.keySet()) { + Permanent creature = game.getPermanent(creatures.get(i)); + + int other = RandomUtil.nextInt(numCreature); + while (other == i) { + other = RandomUtil.nextInt(numCreature); + } + Permanent creature2 = game.getPermanent(creatures.get(other)); + if (creature != null && creature2 != null) { + creature2.damage(creature.getPower().getValue(), creature.getId(), game, false, true); + } + } + + return true; + } + return false; + } + + @Override + public SeasonsBeatingsEffect copy() { + return new SeasonsBeatingsEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/HappyHolidays.java b/Mage.Sets/src/mage/sets/HappyHolidays.java index cbe37471ba..fe9b3e62dd 100644 --- a/Mage.Sets/src/mage/sets/HappyHolidays.java +++ b/Mage.Sets/src/mage/sets/HappyHolidays.java @@ -20,6 +20,7 @@ public class HappyHolidays extends ExpansionSet { super("Happy Holidays", "HHO", ExpansionSet.buildDate(2006, 12, 31), SetType.JOKESET); cards.add(new SetCardInfo("Fruitcake Elemental", 6, Rarity.RARE, mage.cards.f.FruitcakeElemental.class)); + cards.add(new SetCardInfo("Season's Beatings", 9, Rarity.RARE, mage.cards.s.SeasonsBeatings.class)); cards.add(new SetCardInfo("Snow Mercy", 10, Rarity.RARE, mage.cards.s.SnowMercy.class)); } } diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index b22cb0b2de..5ffce6bc34 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -33076,3 +33076,4 @@ Spatula of the Ages|Unglued|81|U|{4}|Artifact|||{4}, {T}, Sacrifice Spatula of t Urza's Science Fair Project|Unglued|83|U|{6}|Artifact Creature - Construct|4|4| {2}: Roll a six-sided die. Urza's Science Fair Project gets the indicated result. 1 - It gets -2/-2 until end of turn. 2 - Prevent all combat damage it would deal this turn. 3 - It gains vigilance until end of turn. 4 - It gains first strike until end of turn. 5 - It gains flying until end of turn. 6 - It gets +2/+2 until end of turn.| Snow Mercy|Happy Holidays|10|R|{2}{W}{W}|Snow Enchantment|||Whenever a creature deals damage to you, put a globe counter on it.${t},{untap},{t},{untap},{t}: Tap all creatures with globe counters on them.| Fruitcake Elemental|Happy Holidays|6|R|{1}{G}{G}|Creature - Elemental|7|7|Fruitcake Elemental is indestructible.$At the end of your turn, Fruitcake Elemental deals 7 damage to you.${3}: Target player gains control of Fruitcake Elemental.| +Season's Beatings|Happy Holidays|9|R|{R}{R}{R}{R}|Sorcery|||Family gathering - Each creature target player controls deals damage equal to its power to another random creature that player controls.|