diff --git a/Mage.Sets/src/mage/sets/bornofthegods/ForgestokerDragon.java b/Mage.Sets/src/mage/sets/bornofthegods/ForgestokerDragon.java new file mode 100644 index 0000000000..8a32979f25 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/ForgestokerDragon.java @@ -0,0 +1,82 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.SourceAttackingCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ForgestokerDragon extends CardImpl { + + public ForgestokerDragon(UUID ownerId) { + super(ownerId, 98, "Forgestoker Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Dragon"); + + this.color.setRed(true); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{R}: Forgestoker Dragon deals 1 damage to target creature. That creature can't block this combat. Activate this ability only if Forgestoker Dragon is attacking. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}"), new SourceAttackingCondition()); + ability.addTarget(new TargetCreaturePermanent(true)); + Effect effect = new CantBlockTargetEffect(Duration.EndOfCombat); + effect.setText("That creature can't block this combat"); + ability.addEffect(effect); + this.addAbility(ability); + + } + + public ForgestokerDragon(final ForgestokerDragon card) { + super(card); + } + + @Override + public ForgestokerDragon copy() { + return new ForgestokerDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/NyxbornRollicker.java b/Mage.Sets/src/mage/sets/bornofthegods/NyxbornRollicker.java new file mode 100644 index 0000000000..cd73ed5146 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/NyxbornRollicker.java @@ -0,0 +1,70 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.keyword.BestowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class NyxbornRollicker extends CardImpl { + + public NyxbornRollicker(UUID ownerId) { + super(ownerId, 102, "Nyxborn Rollicker", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Satyr"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Bestow {1}{R} + this.addAbility(new BestowAbility(this, "{1}{R}")); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1,1, Duration.WhileOnBattlefield ))); + } + + public NyxbornRollicker(final NyxbornRollicker card) { + super(card); + } + + @Override + public NyxbornRollicker copy() { + return new NyxbornRollicker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/OracleOfBones.java b/Mage.Sets/src/mage/sets/bornofthegods/OracleOfBones.java new file mode 100644 index 0000000000..e6bee13f93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/OracleOfBones.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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.TributeNotPaidCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TributeAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInHand; + +/** + * + * @author LevelX2 + */ +public class OracleOfBones extends CardImpl { + + public OracleOfBones(UUID ownerId) { + super(ownerId, 103, "Oracle of Bones", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Minotaur"); + this.subtype.add("Shaman"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Tribute 2 + this.addAbility(new TributeAbility(2)); + // When Oracle of Bones enters the battlefield, if tribute wasn't paid, you may cast an instant or sorcery card from your hand without paying its mana cost. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new OracleOfBonesCastEffect(), false); + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + "When {this} enters the battlefield, if its tribute wasn't paid, you may cast an instant or sorcery card from your hand without paying its mana cost.")); + } + + public OracleOfBones(final OracleOfBones card) { + super(card); + } + + @Override + public OracleOfBones copy() { + return new OracleOfBones(this); + } +} + +class OracleOfBonesCastEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterInstantOrSorceryCard("instant or sorcery card from your hand"); + + public OracleOfBonesCastEffect() { + super(Outcome.PlayForFree); + this.staticText = "you may cast an instant or sorcery card from your hand without paying its mana cost"; + } + + public OracleOfBonesCastEffect(final OracleOfBonesCastEffect effect) { + super(effect); + } + + @Override + public OracleOfBonesCastEffect copy() { + return new OracleOfBonesCastEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetCardInHand(filter); + target.setRequired(true); + if (target.canChoose(source.getSourceId(), controller.getId(), game) && + controller.chooseUse(outcome, "Cast an instant or sorcery card from your hand without paying its mana cost?", game)) { + Card cardToCast = null; + boolean cancel = false; + while (!cancel) { + if (controller.chooseTarget(outcome, target, source, game)) { + cardToCast = game.getCard(target.getFirstTarget()); + if (cardToCast != null && cardToCast.getSpellAbility().canChooseTarget(game)) { + cancel = true; + } + } else { + cancel = true; + } + } + if (cardToCast != null) { + controller.cast(cardToCast.getSpellAbility(), game, true); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/PharagaxGiant.java b/Mage.Sets/src/mage/sets/bornofthegods/PharagaxGiant.java new file mode 100644 index 0000000000..0dd966df13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/PharagaxGiant.java @@ -0,0 +1,74 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.TributeNotPaidCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.keyword.TributeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LevelX2 + */ +public class PharagaxGiant extends CardImpl { + + public PharagaxGiant(UUID ownerId) { + super(ownerId, 104, "Pharagax Giant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Giant"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Tribute 2 + this.addAbility(new TributeAbility(2)); + // When Pharagax Giant enters the battlefield, if tribute wasn't paid, Pharagax Giant deals 5 damage to each opponent. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(5, TargetController.OPPONENT), false); + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + "When {this} enters the battlefield, if its tribute wasn't paid, {this} deals 5 damage to each opponent.")); + } + + public PharagaxGiant(final PharagaxGiant card) { + super(card); + } + + @Override + public PharagaxGiant copy() { + return new PharagaxGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SatyrFiredancer.java b/Mage.Sets/src/mage/sets/bornofthegods/SatyrFiredancer.java new file mode 100644 index 0000000000..2fc608318e --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/SatyrFiredancer.java @@ -0,0 +1,174 @@ +/* + * 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.bornofthegods; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class SatyrFiredancer extends CardImpl { + + public SatyrFiredancer(UUID ownerId) { + super(ownerId, 108, "Satyr Firedancer", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Satyr"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever an instant or sorcery spell you control deals damage to an opponent, Satyr Firedancer deals that much damage to target creature that player controls. + this.addAbility(new SatyrFiredancerTriggeredAbility()); + } + + public SatyrFiredancer(final SatyrFiredancer card) { + super(card); + } + + @Override + public SatyrFiredancer copy() { + return new SatyrFiredancer(this); + } +} + +class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl { + + private List handledStackObjects = new ArrayList(); + + public SatyrFiredancerTriggeredAbility() { + super(Zone.BATTLEFIELD, new SatyrFiredancerDamageEffect(), false); + } + + public SatyrFiredancerTriggeredAbility(final SatyrFiredancerTriggeredAbility ability) { + super(ability); + } + + @Override + public SatyrFiredancerTriggeredAbility copy() { + return new SatyrFiredancerTriggeredAbility(this); + } + + @Override + public void reset(Game game) { + handledStackObjects.clear(); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.DAMAGED_PLAYER) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + if (stackObject != null && stackObject.getControllerId().equals(getControllerId())) { + MageObject object = game.getObject(stackObject.getSourceId()); + if (object.getCardType().contains(CardType.INSTANT) || object.getCardType().contains(CardType.SORCERY)) { + if (game.getOpponents(getControllerId()).contains(event.getTargetId())) { + if (!handledStackObjects.contains(stackObject.getId())) { + handledStackObjects.add(stackObject.getId()); + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setValue("damage", event.getAmount()); + } + return true; + } + } + } + } + } + return false; + } + + @Override + public String getRule() { + return new StringBuilder("Whenever an instant or sorcery spell you control deals damage to an opponent, ").append(super.getRule()).toString(); + } +} + +class SatyrFiredancerDamageEffect extends OneShotEffect { + + public SatyrFiredancerDamageEffect() { + super(Outcome.Damage); + this.staticText = "{this} deals that much damage to target creature that player controls"; + } + + public SatyrFiredancerDamageEffect(final SatyrFiredancerDamageEffect effect) { + super(effect); + } + + @Override + public SatyrFiredancerDamageEffect copy() { + return new SatyrFiredancerDamageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (targetPlayer != null && controller != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature that player controls"); + filter.add(new ControllerIdPredicate(targetPlayer.getId())); + Target target = new TargetCreaturePermanent(filter, true); + if (target.canChoose(source.getSourceId(), controller.getId(), game)) { + if (controller.chooseTarget(outcome, target, source, game)) { + Permanent targetCreature = game.getPermanent(target.getFirstTarget()); + int damage = (Integer) this.getValue("damage"); + if (targetCreature != null && damage > 0) { + targetCreature.damage(damage, source.getSourceId(), game, true, false); + return true; + } + } + } + + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java b/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java new file mode 100644 index 0000000000..39e3dd6b66 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java @@ -0,0 +1,168 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SearingBlood extends CardImpl { + + public SearingBlood(UUID ownerId) { + super(ownerId, 111, "Searing Blood", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}{R}"); + this.expansionSetCode = "BNG"; + + this.color.setRed(true); + + // Searing Blood deals 2 damage to target creature. When that creature dies this turn, Searing Blood deals 3 damage to that creature's controller. + this.getSpellAbility().addEffect(new SearingBloodEffect()); + } + + public SearingBlood(final SearingBlood card) { + super(card); + } + + @Override + public SearingBlood copy() { + return new SearingBlood(this); + } +} + +class SearingBloodEffect extends OneShotEffect { + + public SearingBloodEffect() { + super(Outcome.Damage); + this.staticText = "{this} deals 2 damage to target creature. When that creature dies this turn, {this} deals 3 damage to that creature's controller"; + } + + public SearingBloodEffect(final SearingBloodEffect effect) { + super(effect); + } + + @Override + public SearingBloodEffect copy() { + return new SearingBloodEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + DelayedTriggeredAbility delayedAbility = new SearingBloodDelayedTriggeredAbility(source.getFirstTarget()); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + + return new DamageTargetEffect(2).apply(game, source); + } +} + +class SearingBloodDelayedTriggeredAbility extends DelayedTriggeredAbility { + + private UUID target; + + public SearingBloodDelayedTriggeredAbility(UUID target) { + super(new SearingBloodDelayedEffect(target), Duration.EndOfTurn); + this.target = target; + } + + public SearingBloodDelayedTriggeredAbility(SearingBloodDelayedTriggeredAbility ability) { + super(ability); + this.target = ability.target; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { + return true; + } + } + return false; + } + + @Override + public SearingBloodDelayedTriggeredAbility copy() { + return new SearingBloodDelayedTriggeredAbility(this); + } + + @Override + public String getRule() { + return "When that creature dies this turn, {this} deals 3 damage to that creature's controller."; + } +} + +class SearingBloodDelayedEffect extends OneShotEffect { + + protected UUID target; + + public SearingBloodDelayedEffect(UUID target) { + super(Outcome.Damage); + this.target = target; + } + + public SearingBloodDelayedEffect(final SearingBloodDelayedEffect effect) { + super(effect); + this.target = effect.target; + } + + @Override + public SearingBloodDelayedEffect copy() { + return new SearingBloodDelayedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) game.getLastKnownInformation(target, Zone.BATTLEFIELD); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + player.damage(3, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/ThunderousMight.java b/Mage.Sets/src/mage/sets/bornofthegods/ThunderousMight.java new file mode 100644 index 0000000000..952fd9d431 --- /dev/null +++ b/Mage.Sets/src/mage/sets/bornofthegods/ThunderousMight.java @@ -0,0 +1,83 @@ +/* + * 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.bornofthegods; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAttachedTriggeredAbility; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ThunderousMight extends CardImpl { + + public ThunderousMight(UUID ownerId) { + super(ownerId, 114, "Thunderous Might", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Aura"); + + this.color.setRed(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Whenever enchanted creature attacks, it gets +X/+0 until end of turn, where X is your devotion to red. + Effect effect = new BoostEnchantedEffect(new DevotionCount(ColoredManaSymbol.R), new StaticValue(0), Duration.EndOfTurn); + effect.setText("it gets +X/+0 until end of turn, where X is your devotion to red"); + this.addAbility(new AttacksAttachedTriggeredAbility(effect, AttachmentType.AURA, false)); + } + + public ThunderousMight(final ThunderousMight card) { + super(card); + } + + @Override + public ThunderousMight copy() { + return new ThunderousMight(this); + } +} diff --git a/Mage/src/mage/abilities/condition/common/SourceAttackingCondition.java b/Mage/src/mage/abilities/condition/common/SourceAttackingCondition.java new file mode 100644 index 0000000000..c850bf9ce4 --- /dev/null +++ b/Mage/src/mage/abilities/condition/common/SourceAttackingCondition.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.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ + +public class SourceAttackingCondition implements Condition { + + private static final SourceAttackingCondition fInstance = new SourceAttackingCondition(); + + public static SourceAttackingCondition getInstance() { + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); + if (permanent != null) { + return permanent.isAttacking(); + } + return false; + } + + @Override + public String toString() { + return "{this} is attacking"; + } + + +} \ No newline at end of file