1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-08 01:01:04 -09:00

- Added Jaws of Stone, Knollspine Dragon, Initimidator Initiate. There are 2 more cards in Shadowmoor in anyone wants to finish knocking out the set.

This commit is contained in:
Jeff 2015-03-04 17:40:08 -06:00
parent 4d0dbb2327
commit ef79d70620
7 changed files with 369 additions and 9 deletions

View file

@ -29,11 +29,11 @@ package mage.sets.mirrodin;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddManaOfAnyTypeProducedEffect;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -125,11 +125,10 @@ class ExtraplanarLensImprintEffect extends OneShotEffect {
}
class ExtraplanarLensTriggeredAbility extends TriggeredAbilityImpl {
class ExtraplanarLensTriggeredAbility extends TriggeredManaAbility {
public ExtraplanarLensTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddManaOfAnyTypeProducedEffect());
this.usesStack = false;
}
public ExtraplanarLensTriggeredAbility(final ExtraplanarLensTriggeredAbility ability) {

View file

@ -0,0 +1,79 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SpellCastAllTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author jeffwadsworth
*/
public class IntimidatorInitiate extends CardImpl {
private static final FilterSpell filter = new FilterSpell("red spell");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
private static final String rule = "Whenever a player casts a red spell, you may pay {1}. If you do, target creature can't block this turn";
public IntimidatorInitiate(UUID ownerId) {
super(ownerId, 96, "Intimidator Initiate", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "SHM";
this.subtype.add("Goblin");
this.subtype.add("Shaman");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever a player casts a red spell, you may pay {1}. If you do, target creature can't block this turn.
this.addAbility(new SpellCastAllTriggeredAbility(new DoIfCostPaid(new CantBlockTargetEffect(Duration.EndOfTurn), new GenericManaCost(1)), filter, true, rule));
}
public IntimidatorInitiate(final IntimidatorInitiate card) {
super(card);
}
@Override
public IntimidatorInitiate copy() {
return new IntimidatorInitiate(this);
}
}

View file

@ -0,0 +1,76 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageMultiEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCreatureOrPlayerAmount;
/**
*
* @author jeffwadsworth
*/
public class JawsOfStone extends CardImpl {
static final private FilterControlledLandPermanent filter = new FilterControlledLandPermanent("mountains you control");
static {
filter.add(new SubtypePredicate("Mountain"));
}
static final private String rule = "{this} deals X damage divided as you choose among any number of target creatures and/or players, where X is the number of Mountains you control as you cast {this}";
public JawsOfStone(UUID ownerId) {
super(ownerId, 97, "Jaws of Stone", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{5}{R}");
this.expansionSetCode = "SHM";
// Jaws of Stone deals X damage divided as you choose among any number of target creatures and/or players, where X is the number of Mountains you control as you cast Jaws of Stone.
PermanentsOnBattlefieldCount mountains = new PermanentsOnBattlefieldCount(filter, null);
Effect effect = new DamageMultiEffect(mountains);
effect.setText(rule);
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(mountains));
}
public JawsOfStone(final JawsOfStone card) {
super(card);
}
@Override
public JawsOfStone copy() {
return new JawsOfStone(this);
}
}

View file

@ -0,0 +1,116 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
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.common.TargetOpponent;
import mage.watchers.common.AmountOfDamageAPlayerReceivedThisTurnWatcher;
/**
*
* @author jeffwadsworth
*/
public class KnollspineDragon extends CardImpl {
public KnollspineDragon(UUID ownerId) {
super(ownerId, 98, "Knollspine Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
this.expansionSetCode = "SHM";
this.subtype.add("Dragon");
this.power = new MageInt(7);
this.toughness = new MageInt(5);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Knollspine Dragon enters the battlefield, you may discard your hand and draw cards equal to the damage dealt to target opponent this turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new KnollspineDragonEffect(), true);
ability.addTarget(new TargetOpponent());
this.addAbility(ability, new AmountOfDamageAPlayerReceivedThisTurnWatcher());
}
public KnollspineDragon(final KnollspineDragon card) {
super(card);
}
@Override
public KnollspineDragon copy() {
return new KnollspineDragon(this);
}
}
class KnollspineDragonEffect extends OneShotEffect {
public KnollspineDragonEffect() {
super(Outcome.Neutral);
staticText = "you may discard your hand and draw cards equal to the damage dealt to target opponent this turn";
}
public KnollspineDragonEffect(KnollspineDragonEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player targetOpponent = game.getPlayer(targetPointer.getFirst(game, source));
if (controller != null) {
new DiscardHandControllerEffect().apply(game, source);
if (targetOpponent != null) {
AmountOfDamageAPlayerReceivedThisTurnWatcher watcher = (AmountOfDamageAPlayerReceivedThisTurnWatcher) game.getState().getWatchers().get("AmountOfDamageReceivedThisTurn");
if (watcher != null) {
int drawAmount = watcher.getAmountOfDamageReceivedThisTurn(targetOpponent.getId());
controller.drawCards(drawAmount, game);
game.informPlayers(controller.getName() + "draws " + drawAmount + " cards");
return true;
}
}
game.informPlayers(controller.getName() + "drew no cards");
return true;
}
return false;
}
@Override
public KnollspineDragonEffect copy() {
return new KnollspineDragonEffect(this);
}
}

View file

@ -36,6 +36,7 @@ import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
@ -74,7 +75,7 @@ public class Valleymaker extends CardImpl {
this.addAbility(ability);
// {tap}, Sacrifice a Forest: Choose a player. That player adds {G}{G}{G} to his or her mana pool.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(new Mana(0,3,0,0,0,0,0), "chosen player"), new TapSourceCost(), false);
Ability ability2 = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaToManaPoolTargetControllerEffect(new Mana(0,3,0,0,0,0,0), "chosen player"), new TapSourceCost());
ability2.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2)));
ability2.addTarget(new TargetPlayer(1, 1, true));
this.addAbility(ability2);

View file

@ -52,11 +52,6 @@ public class SimpleActivatedAbility extends ActivatedAbilityImpl {
public SimpleActivatedAbility(Zone zone, Effect effect, Cost cost) {
super(zone, effect, cost);
}
public SimpleActivatedAbility(Zone zone, Effect effect, Cost cost, boolean usesStack) {
super(zone, effect, cost);
this.usesStack = usesStack;
}
public SimpleActivatedAbility(SimpleActivatedAbility ability) {
super(ability);

View file

@ -0,0 +1,94 @@
/*
* 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.watchers.common;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import mage.constants.WatcherScope;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.Watcher;
/**
*
* @author jeffwadsworth
*
* Amount of damage received by a player this turn
*
*/
public class AmountOfDamageAPlayerReceivedThisTurnWatcher extends Watcher {
private final Map<UUID, Integer> amountOfDamageReceivedThisTurn = new HashMap<>();
public AmountOfDamageAPlayerReceivedThisTurnWatcher() {
super("AmountOfDamageReceivedThisTurn", WatcherScope.GAME);
}
public AmountOfDamageAPlayerReceivedThisTurnWatcher(final AmountOfDamageAPlayerReceivedThisTurnWatcher watcher) {
super(watcher);
for (Entry<UUID, Integer> entry : watcher.amountOfDamageReceivedThisTurn.entrySet()) {
amountOfDamageReceivedThisTurn.put(entry.getKey(), entry.getValue());
}
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
UUID playerId = event.getTargetId();
if (playerId != null) {
Integer amount = amountOfDamageReceivedThisTurn.get(playerId);
if (amount == null) {
amount = Integer.valueOf(event.getAmount());
} else {
amount = Integer.valueOf(amount + event.getAmount());
}
amountOfDamageReceivedThisTurn.put(playerId, amount);
}
}
}
public int getAmountOfDamageReceivedThisTurn(UUID playerId) {
Integer amount = amountOfDamageReceivedThisTurn.get(playerId);
if (amount != null) {
return amount;
}
return 0;
}
@Override
public void reset() {
amountOfDamageReceivedThisTurn.clear();
}
@Override
public AmountOfDamageAPlayerReceivedThisTurnWatcher copy() {
return new AmountOfDamageAPlayerReceivedThisTurnWatcher(this);
}
}