This commit is contained in:
igoudt 2017-07-25 21:06:33 +02:00
commit 3ddb889923
10 changed files with 245 additions and 51 deletions

View file

@ -352,7 +352,8 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return target.isChosen();
}
if (target.getOriginalTarget() instanceof TargetCardInYourGraveyard) {
if (target.getOriginalTarget() instanceof TargetCardInYourGraveyard
|| target.getOriginalTarget() instanceof TargetCardInASingleGraveyard) {
List<UUID> alreadyTargetted = target.getTargets();
List<Card> cards = new ArrayList<>(game.getPlayer(abilityControllerId).getGraveyard().getCards(game));
while (!cards.isEmpty()) {

View file

@ -105,7 +105,7 @@ class BomatCourierExileEffect extends OneShotEffect {
if (controller != null && sourceObject != null) {
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
UUID exileZoneId = CardUtil.getCardExileZoneId(game, source);
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), 0);
card.setFaceDown(true, game);
controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName());
card.setFaceDown(true, game);
@ -136,7 +136,7 @@ class BomatCourierReturnEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source.getSourceId(), true));
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), 0));
if (exileZone != null) {
controller.moveCards(exileZone, Zone.HAND, source, game);
}

View file

@ -48,8 +48,8 @@ import mage.target.common.TargetControlledPermanent;
*/
public class DevourFlesh extends CardImpl {
public DevourFlesh (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}");
public DevourFlesh(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
// Target player sacrifices a creature, then gains life equal to that creature's toughness.
this.getSpellAbility().addEffect(new DevourFleshSacrificeEffect());
@ -61,7 +61,7 @@ public class DevourFlesh extends CardImpl {
}
@Override
public DevourFlesh copy() {
public DevourFlesh copy() {
return new DevourFlesh(this);
}
}
@ -99,8 +99,9 @@ class DevourFleshSacrificeEffect extends OneShotEffect {
if (permanent != null) {
int gainLife = permanent.getToughness().getValue();
permanent.sacrifice(source.getSourceId(), game);
game.applyEffects();
player.gainLife(gainLife, game);
} else{
} else {
return false;
}
}

View file

@ -95,7 +95,7 @@ public class DjeruWithEyesOpen extends CardImpl {
class DjeruWithEyesOpenPreventEffect extends PreventionEffectImpl {
public DjeruWithEyesOpenPreventEffect() {
super(Duration.EndOfGame, 1, false, false);
super(Duration.WhileOnBattlefield, 1, false, false);
this.staticText = "If a source would deal damage to a planeswalker you control, prevent 1 of that damage";
}

View file

@ -0,0 +1,102 @@
/*
* 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.k;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageAllEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class KindleTheCarnage extends CardImpl {
public KindleTheCarnage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
// Discard a card at random. If you do, Kindle the Carnage deals damage equal to that card's converted mana cost to each creature. You may repeat this process any number of times.
this.getSpellAbility().addEffect(new KindleTheCarnageEffect());
}
public KindleTheCarnage(final KindleTheCarnage card) {
super(card);
}
@Override
public KindleTheCarnage copy() {
return new KindleTheCarnage(this);
}
}
class KindleTheCarnageEffect extends OneShotEffect {
public KindleTheCarnageEffect() {
super(Outcome.AIDontUseIt);
this.staticText = "Discard a card at random. If you do, {this} deals damage equal to that card's converted mana cost to each creature. You may repeat this process any number of times";
}
public KindleTheCarnageEffect(final KindleTheCarnageEffect effect) {
super(effect);
}
@Override
public KindleTheCarnageEffect copy() {
return new KindleTheCarnageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Cards hand = controller.getHand();
while (hand != null
&& hand.size() > 0
&& controller.isInGame()
&& controller.chooseUse(Outcome.AIDontUseIt, "Discard a card randomly from your hand?", source, game)) {
Card discardedCard = controller.discardOne(true, source, game);
if (discardedCard != null) {
new DamageAllEffect(discardedCard.getConvertedManaCost(), new FilterCreaturePermanent()).apply(game, source);
}
}
return true;
}
return false;
}
}

View file

@ -32,6 +32,7 @@ import mage.ObjectColor;
import mage.abilities.AbilitiesImpl;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -65,7 +66,7 @@ public class OozeGarden extends CardImpl {
// {1}{G}, Sacrifice a non-Ooze creature: Create an X/X green Ooze creature token, where X is the sacrificed creature's power. Activate this ability only any time you could cast a sorcery.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new OozeGardenCreateTokenEffect(), new ManaCostsImpl("{1}{G}"));
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new OozeGardenCreateTokenEffect(), new ManaCostsImpl("{1}{G}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true)));
this.addAbility(ability);
}

View file

@ -0,0 +1,108 @@
/*
* 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.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.TargetSpell;
/**
*
* @author jeffwadsworth
*/
public class RitesOfRefusal extends CardImpl {
public RitesOfRefusal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Discard any number of cards. Counter target spell unless its controller pays {3} for each card discarded this way.
this.getSpellAbility().addEffect(new RitesOfRefusalEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
public RitesOfRefusal(final RitesOfRefusal card) {
super(card);
}
@Override
public RitesOfRefusal copy() {
return new RitesOfRefusal(this);
}
}
class RitesOfRefusalEffect extends OneShotEffect {
RitesOfRefusalEffect() {
super(Outcome.AIDontUseIt);
this.staticText = "Discard any number of cards. Counter target spell unless its controller pays {3} for each card discarded this way";
}
RitesOfRefusalEffect(final RitesOfRefusalEffect effect) {
super(effect);
}
@Override
public RitesOfRefusalEffect copy() {
return new RitesOfRefusalEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Spell targetSpell = game.getStack().getSpell(source.getFirstTarget());
if (targetSpell != null) {
Player controllerOfTargetedSpell = game.getPlayer(targetSpell.getControllerId());
if (controller != null
&& controllerOfTargetedSpell != null) {
int numToDiscard = controller.getAmount(0, controller.getHand().size(), "How many cards do you want to discard?", game);
Cards discardedCards = controller.discard(numToDiscard, false, source, game);
int actualNumberDiscarded = discardedCards.size();
GenericManaCost cost = new GenericManaCost(actualNumberDiscarded * 3);
if (controllerOfTargetedSpell.chooseUse(Outcome.AIDontUseIt, "Do you want to pay " + cost.convertedManaCost() + " to prevent " + targetSpell.getName() + " from gettting countered?", source, game)
&& cost.pay(source, game, source.getSourceId(), controllerOfTargetedSpell.getId(), false)) {
return true;
} else {
targetSpell.counter(source.getSourceId(), game);
return true;
}
}
}
return false;
}
}

View file

@ -56,24 +56,22 @@ import mage.target.common.TargetArtifactPermanent;
public class XenicPoltergeist extends CardImpl {
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent();
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public XenicPoltergeist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.subtype.add("Spirit");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {tap}: Until your next upkeep, target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost.
XenicPoltergeistEffect effect = new XenicPoltergeistEffect(Duration.Custom);
effect.setDurationToPhase(PhaseStep.UPKEEP);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new XenicPoltergeistEffect(), new TapSourceCost());
ability.addTarget(new TargetArtifactPermanent(filter));
this.addAbility(ability);
}
public XenicPoltergeist(final XenicPoltergeist card) {
@ -85,19 +83,18 @@ public class XenicPoltergeist extends CardImpl {
return new XenicPoltergeist(this);
}
}
class XenicPoltergeistEffect extends ContinuousEffectImpl {
private PhaseStep durationPhaseStep = null;
private UUID durationPlayerId;
private boolean sameStep;
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent();
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public XenicPoltergeistEffect(Duration duration) {
super(duration, Outcome.BecomeCreature);
staticText = "Each noncreature artifact loses its abilities and is an artifact creature with power and toughness each equal to its converted mana cost";
public XenicPoltergeistEffect() {
super(Duration.Custom, Outcome.BecomeCreature);
staticText = "Until your next upkeep, target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost";
}
public XenicPoltergeistEffect(final XenicPoltergeistEffect effect) {
@ -108,35 +105,17 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
public XenicPoltergeistEffect copy() {
return new XenicPoltergeistEffect(this);
}
public void setDurationToPhase(PhaseStep phaseStep) {
durationPhaseStep = phaseStep;
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
if (durationPhaseStep != null) {
durationPlayerId = source.getControllerId();
sameStep = true;
}
}
@Override
public boolean isInactive(Ability source, Game game) {
if (super.isInactive(source, game)) {
return true;
}
if (durationPhaseStep != null && durationPhaseStep == game.getPhase().getStep().getType()) {
if (!sameStep && game.getActivePlayerId().equals(durationPlayerId) || game.getPlayer(durationPlayerId).hasReachedNextTurnAfterLeaving()) {
if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) {
if (game.getActivePlayerId().equals(source.getControllerId())) {
return true;
}
} else {
sameStep = false;
}
return false;
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
switch (layer) {
@ -144,22 +123,22 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
if (sublayer == SubLayer.NA) {
UUID permanentId = targetPointer.getFirst(game, source);
Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId);
if(permanent != null){
if (permanent != null) {
permanent.addCardType(CardType.CREATURE);
}
}
}
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
UUID permanentId = targetPointer.getFirst(game, source);
Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId);
if (permanent != null){
if (permanent != null) {
int manaCost = permanent.getConvertedManaCost();
permanent.getPower().setValue(manaCost);
permanent.getToughness().setValue(manaCost);
}
}
}
}
return true;
}
@ -169,10 +148,10 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4;
return layer == Layer.PTChangingEffects_7
|| layer == Layer.TypeChangingEffects_4;
}
}

View file

@ -115,6 +115,7 @@ public class Dissension extends ExpansionSet {
cards.add(new SetCardInfo("Infernal Tutor", 46, Rarity.RARE, mage.cards.i.InfernalTutor.class));
cards.add(new SetCardInfo("Isperia the Inscrutable", 114, Rarity.RARE, mage.cards.i.IsperiaTheInscrutable.class));
cards.add(new SetCardInfo("Kill-Suit Cultist", 65, Rarity.COMMON, mage.cards.k.KillSuitCultist.class));
cards.add(new SetCardInfo("Kindle the Carnage", 66, Rarity.UNCOMMON, mage.cards.k.KindleTheCarnage.class));
cards.add(new SetCardInfo("Leafdrake Roost", 116, Rarity.UNCOMMON, mage.cards.l.LeafdrakeRoost.class));
cards.add(new SetCardInfo("Loaming Shaman", 87, Rarity.RARE, mage.cards.l.LoamingShaman.class));
cards.add(new SetCardInfo("Lyzolda, the Blood Witch", 117, Rarity.RARE, mage.cards.l.LyzoldaTheBloodWitch.class));

View file

@ -281,6 +281,7 @@ public class Odyssey extends ExpansionSet {
cards.add(new SetCardInfo("Repentant Vampire", 157, Rarity.RARE, mage.cards.r.RepentantVampire.class));
cards.add(new SetCardInfo("Resilient Wanderer", 43, Rarity.UNCOMMON, mage.cards.r.ResilientWanderer.class));
cards.add(new SetCardInfo("Rites of Initiation", 217, Rarity.COMMON, mage.cards.r.RitesOfInitiation.class));
cards.add(new SetCardInfo("Rites of Refusal", 99, Rarity.COMMON, mage.cards.r.RitesOfRefusal.class));
cards.add(new SetCardInfo("Roar of the Wurm", 266, Rarity.UNCOMMON, mage.cards.r.RoarOfTheWurm.class));
cards.add(new SetCardInfo("Rotting Giant", 158, Rarity.UNCOMMON, mage.cards.r.RottingGiant.class));
cards.add(new SetCardInfo("Sacred Rites", 44, Rarity.COMMON, mage.cards.s.SacredRites.class));