mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
fixed Barbed Shocker ,Cabal Slaver, Shoker
removed DiscardHandAndDrawEffect added author name
This commit is contained in:
parent
74a399343a
commit
f3f4849638
8 changed files with 97 additions and 113 deletions
|
@ -27,20 +27,26 @@
|
|||
*/
|
||||
package mage.sets.conspiracy;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
* @author markedagain
|
||||
*/
|
||||
public class BarbedShocker extends CardImpl {
|
||||
|
||||
|
@ -56,7 +62,7 @@ public class BarbedShocker extends CardImpl {
|
|||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
// Whenever Barbed Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards.
|
||||
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardHandAndDrawEffect(TargetController.OPPONENT), false, true));
|
||||
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new BarbedShockerEffect(), false, true));
|
||||
}
|
||||
|
||||
public BarbedShocker(final BarbedShocker card) {
|
||||
|
@ -67,4 +73,34 @@ public class BarbedShocker extends CardImpl {
|
|||
public BarbedShocker copy() {
|
||||
return new BarbedShocker(this);
|
||||
}
|
||||
}
|
||||
class BarbedShockerEffect extends OneShotEffect {
|
||||
|
||||
public BarbedShockerEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = " that player discards all the cards in his or her hand, then draws that many cards";
|
||||
}
|
||||
|
||||
public BarbedShockerEffect(final BarbedShockerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarbedShockerEffect copy() {
|
||||
return new BarbedShockerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
int count = targetPlayer.getHand().size();
|
||||
for (Card card : targetPlayer.getHand().getCards(game)) {
|
||||
targetPlayer.discard(card, source, game);
|
||||
}
|
||||
targetPlayer.drawCards(count, game);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -29,19 +29,25 @@ package mage.sets.onslaught;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect;
|
||||
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
* @author markedagain
|
||||
*/
|
||||
public class CabalSlaver extends CardImpl {
|
||||
private static final FilterPermanent filter = new FilterPermanent("Goblin");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Goblin"));
|
||||
}
|
||||
|
||||
public CabalSlaver(UUID ownerId) {
|
||||
super(ownerId, 131, "Cabal Slaver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
|
@ -52,7 +58,7 @@ public class CabalSlaver extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever a Goblin deals combat damage to a player, that player discards a card.
|
||||
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true));
|
||||
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(new DiscardTargetEffect(1),filter, false, SetTargetPointer.NONE, true));
|
||||
}
|
||||
|
||||
public CabalSlaver(final CabalSlaver card) {
|
||||
|
|
|
@ -29,16 +29,21 @@ package mage.sets.tempest;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardHandAndDrawEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
* @author markedagain
|
||||
*/
|
||||
public class Shocker extends CardImpl {
|
||||
|
||||
|
@ -50,7 +55,7 @@ public class Shocker extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards.
|
||||
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardHandAndDrawEffect(TargetController.OPPONENT), false, true));
|
||||
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new ShockerEffect(), false, true));
|
||||
}
|
||||
|
||||
public Shocker(final Shocker card) {
|
||||
|
@ -62,3 +67,33 @@ public class Shocker extends CardImpl {
|
|||
return new Shocker(this);
|
||||
}
|
||||
}
|
||||
class ShockerEffect extends OneShotEffect {
|
||||
|
||||
public ShockerEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = " that player discards all the cards in his or her hand, then draws that many cards";
|
||||
}
|
||||
|
||||
public ShockerEffect(final ShockerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShockerEffect copy() {
|
||||
return new ShockerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
int count = targetPlayer.getHand().size();
|
||||
for (Card card : targetPlayer.getHand().getCards(game)) {
|
||||
targetPlayer.discard(card, source, game);
|
||||
}
|
||||
targetPlayer.drawCards(count, game);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
* @author markedagain
|
||||
*/
|
||||
public class BarbedShocker extends mage.sets.conspiracy.BarbedShocker {
|
||||
|
||||
|
|
|
@ -33,33 +33,29 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.common.FilterBasicLandCard;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
* @author markedagain
|
||||
*/
|
||||
public class MwonvuliAcidMoss extends CardImpl {
|
||||
|
||||
public MwonvuliAcidMoss(UUID ownerId) {
|
||||
super(ownerId, 207, "Mwonvuli Acid-Moss", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}");
|
||||
this.expansionSetCode = "TSP";
|
||||
|
||||
FilterPermanent filter = new FilterPermanent("land");
|
||||
filter.add(Predicates.and(new CardTypePredicate(CardType.LAND)));
|
||||
|
||||
FilterCard filterForest = new FilterCard("a Forest card");
|
||||
FilterLandCard filterForest = new FilterLandCard();
|
||||
filterForest.add(new SubtypePredicate("Forest"));
|
||||
|
||||
// Destroy target land. Search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(new FilterLandPermanent()));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterForest), false, true));
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
* @author markedagain
|
||||
*/
|
||||
public class HarvestWurm extends CardImpl {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @author markedagain
|
||||
*/
|
||||
public class ReturnToHandFromGraveyardCost extends CostImpl {
|
||||
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* 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.effects.common.discard;
|
||||
|
||||
import java.util.Set;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author mluds
|
||||
*/
|
||||
public class DiscardHandAndDrawEffect extends OneShotEffect {
|
||||
|
||||
private int CardDrawOffset = 0;
|
||||
public DiscardHandAndDrawEffect(TargetController targetController) {
|
||||
this(targetController,0);
|
||||
}
|
||||
public DiscardHandAndDrawEffect(TargetController targetController, int cardDrawOffset) {
|
||||
super(Outcome.Discard);
|
||||
String PostText = "";
|
||||
if (cardDrawOffset >0){
|
||||
PostText = " plus " + cardDrawOffset;
|
||||
}else if(cardDrawOffset < 0){
|
||||
PostText = " minus " + cardDrawOffset;
|
||||
}
|
||||
this.CardDrawOffset = cardDrawOffset;
|
||||
switch(targetController) {
|
||||
case OPPONENT:
|
||||
this.staticText = "Opponent discards his hand then draws that many cards" + PostText;
|
||||
break;
|
||||
case YOU:
|
||||
this.staticText = "Discard your hand then draws that many cards" + PostText;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public DiscardHandAndDrawEffect(final DiscardHandAndDrawEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscardHandAndDrawEffect copy() {
|
||||
return new DiscardHandAndDrawEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
Set<Card> cards = player.getHand().getCards(game);
|
||||
int count = cards.size();
|
||||
for (Card card : cards) {
|
||||
player.discard(card, source, game);
|
||||
}
|
||||
player.drawCards(count + this.CardDrawOffset, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue