diff --git a/Mage.Sets/src/mage/sets/fifthdawn/ChannelTheSuns.java b/Mage.Sets/src/mage/sets/fifthdawn/ChannelTheSuns.java new file mode 100644 index 00000000000..573de831991 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/ChannelTheSuns.java @@ -0,0 +1,64 @@ +/* + * 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.fifthdawn; + +import mage.Mana; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AddManaToControllersManaPoolEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +import java.util.UUID; + +/** + * + * @author magenoxx + */ +public class ChannelTheSuns extends CardImpl { + + public ChannelTheSuns(UUID ownerId) { + super(ownerId, 84, "Channel the Suns", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "5DN"; + + this.color.setGreen(true); + + // Add {W}{U}{B}{R}{G} to your mana pool. + Effect effect = new AddManaToControllersManaPoolEffect(new Mana(1, 1, 1, 1, 1, 0, 0)); + this.getSpellAbility().addEffect(effect); + } + + public ChannelTheSuns(final ChannelTheSuns card) { + super(card); + } + + @Override + public ChannelTheSuns copy() { + return new ChannelTheSuns(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/CruelBargain.java b/Mage.Sets/src/mage/sets/portal/CruelBargain.java new file mode 100644 index 00000000000..ef4fff99c24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/CruelBargain.java @@ -0,0 +1,51 @@ +/* + * 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.portal; + +import java.util.UUID; + +/** + * @author magenoxx + */ +public class CruelBargain extends mage.sets.vintagemasters.CruelBargain { + + public CruelBargain(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "POR"; + } + + public CruelBargain(final CruelBargain card) { + super(card); + } + + @Override + public CruelBargain copy() { + return new CruelBargain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/InfernalContract.java b/Mage.Sets/src/mage/sets/seventhedition/InfernalContract.java index b1ae033c8dd..102a69b1772 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/InfernalContract.java +++ b/Mage.Sets/src/mage/sets/seventhedition/InfernalContract.java @@ -27,16 +27,13 @@ */ package mage.sets.seventhedition; -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseHalfLifeEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.players.Player; +import mage.constants.CardType; +import mage.constants.Rarity; + +import java.util.UUID; /** * @@ -52,7 +49,7 @@ public class InfernalContract extends CardImpl { // Draw four cards. You lose half your life, rounded up. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4)); - this.getSpellAbility().addEffect(new InfernalContractLoseLifeEffect()); + this.getSpellAbility().addEffect(new LoseHalfLifeEffect()); } public InfernalContract(final InfernalContract card) { @@ -65,32 +62,3 @@ public class InfernalContract extends CardImpl { } } -class InfernalContractLoseLifeEffect extends OneShotEffect { - - public InfernalContractLoseLifeEffect() { - super(Outcome.LoseLife); - staticText = "You lose half your life, rounded up"; - } - - public InfernalContractLoseLifeEffect(final InfernalContractLoseLifeEffect effect) { - super(effect); - } - - @Override - public InfernalContractLoseLifeEffect copy() { - return new InfernalContractLoseLifeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - int amount = (player.getLife() + 1) / 2; - if (amount > 0) { - player.loseLife(amount, game); - return true; - } - } - return false; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/vintagemasters/CruelBargain.java b/Mage.Sets/src/mage/sets/vintagemasters/CruelBargain.java new file mode 100644 index 00000000000..d893b58156d --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/CruelBargain.java @@ -0,0 +1,63 @@ +/* + * 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.vintagemasters; + +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseHalfLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +import java.util.UUID; + +/** + * + * @author magenoxx + */ +public class CruelBargain extends CardImpl { + + public CruelBargain(UUID ownerId) { + super(ownerId, 111, "Cruel Bargain", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}{B}{B}"); + this.expansionSetCode = "VMA"; + + this.color.setBlack(true); + + // Draw four cards. You lose half your life, rounded up. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4)); + this.getSpellAbility().addEffect(new LoseHalfLifeEffect()); + } + + public CruelBargain(final CruelBargain card) { + super(card); + } + + @Override + public CruelBargain copy() { + return new CruelBargain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Doomsday.java b/Mage.Sets/src/mage/sets/weatherlight/Doomsday.java index 00dd0cd6879..a6a687b65fe 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/Doomsday.java +++ b/Mage.Sets/src/mage/sets/weatherlight/Doomsday.java @@ -27,23 +27,23 @@ */ package mage.sets.weatherlight; -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; +import java.util.UUID; + /** * * @author Plopman @@ -135,8 +135,9 @@ class DoomsdayEffect extends OneShotEffect { int amount = (player.getLife() + 1) / 2; if (amount > 0) { player.loseLife(amount, game); - return true; } + + return true; } return false; } diff --git a/Mage/src/mage/abilities/effects/common/AddManaToControllersManaPoolEffect.java b/Mage/src/mage/abilities/effects/common/AddManaToControllersManaPoolEffect.java new file mode 100644 index 00000000000..51e09a7264d --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/AddManaToControllersManaPoolEffect.java @@ -0,0 +1,49 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package mage.abilities.effects.common; + +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author magenoxx + */ +public class AddManaToControllersManaPoolEffect extends OneShotEffect { + + protected Mana mana; + + public AddManaToControllersManaPoolEffect(Mana mana) { + super(Outcome.PutManaInPool); + this.mana = mana; + this.staticText = "Add " + mana.toString() + " to your mana pool"; + } + + public AddManaToControllersManaPoolEffect(final AddManaToControllersManaPoolEffect effect) { + super(effect); + this.mana = effect.mana; + } + + @Override + public AddManaToControllersManaPoolEffect copy() { + return new AddManaToControllersManaPoolEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.getManaPool().addMana(mana, game, source); + return true; + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java b/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java new file mode 100644 index 00000000000..90d6b589300 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java @@ -0,0 +1,40 @@ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +/** + * @author magenoxx + */ +public class LoseHalfLifeEffect extends OneShotEffect { + + public LoseHalfLifeEffect() { + super(Outcome.LoseLife); + staticText = "You lose half your life, rounded up"; + } + + public LoseHalfLifeEffect(final LoseHalfLifeEffect effect) { + super(effect); + } + + @Override + public LoseHalfLifeEffect copy() { + return new LoseHalfLifeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int amount = (player.getLife() + 1) / 2; + if (amount > 0) { + player.loseLife(amount, game); + return true; + } + } + return false; + } +} \ No newline at end of file