Some fixes to M15 cards or by M15 used classes.

This commit is contained in:
LevelX2 2014-07-06 16:00:32 +02:00
parent 9ad45a6ab9
commit 18e78b8294
23 changed files with 105 additions and 50 deletions

View file

@ -27,8 +27,7 @@
*/
package mage.sets.avacynrestored;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -36,7 +35,9 @@ import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
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.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
@ -50,8 +51,6 @@ import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author noxx
*/
@ -112,7 +111,7 @@ class GallowsAtWillowHillEffect extends OneShotEffect {
Player controller = game.getPlayer(permanent.getControllerId());
permanent.destroy(source.getId(), game, false);
if (controller != null) {
Token spirit = new SpiritWhiteToken();
Token spirit = new SpiritWhiteToken("AVR", 1);
spirit.putOntoBattlefield(1, game, source.getSourceId(), controller.getId());
}
affectedTargets++;

View file

@ -28,13 +28,12 @@
package mage.sets.darkascension;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.game.permanent.token.SpiritWhiteToken;
@ -51,7 +50,7 @@ public class LingeringSouls extends CardImpl {
this.color.setWhite(true);
// Put two 1/1 white Spirit creature tokens with flying onto the battlefield.
this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken(), 2));
this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken("ISD"), 2));
// Flashback {1}{B}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{B}"), TimingRule.SORCERY));
}

View file

@ -130,7 +130,7 @@ class EvershrikeEffect extends OneShotEffect {
Card aura = game.getCard(targetAura.getFirstTarget());
if (aura != null) {
game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent);
aura.putOntoBattlefield(game, Zone.HAND, source.getId(), you.getId());
aura.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), you.getId());
evershrikePermanent.addAttachment(aura.getId(), game);
exiled = false;
count = you.getHand().count(filterAuraCard, game);

View file

@ -27,8 +27,7 @@
*/
package mage.sets.innistrad;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -37,13 +36,13 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.permanent.token.SpiritWhiteToken;
import java.util.UUID;
/**
* @author nantuko
*/
@ -65,7 +64,7 @@ public class GeistHonoredMonk extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame)));
// When Geist-Honored Monk enters the battlefield, put two 1/1 white Spirit creature tokens with flying onto the battlefield.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken(), 2)));
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken("ISD"), 2)));
}
public GeistHonoredMonk(final GeistHonoredMonk card) {

View file

@ -27,16 +27,15 @@
*/
package mage.sets.innistrad;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.SpiritWhiteToken;
import java.util.UUID;
/**
* @author nantuko
*/
@ -53,7 +52,7 @@ public class MausoleumGuard extends CardImpl {
this.toughness = new MageInt(2);
// When Mausoleum Guard dies, put two 1/1 white Spirit creature tokens with flying onto the battlefield.
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken(), 2)));
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken("ISD"), 2)));
}
public MausoleumGuard(final MausoleumGuard card) {

View file

@ -28,10 +28,10 @@
package mage.sets.innistrad;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.SpiritWhiteToken;
/**
@ -47,7 +47,7 @@ public class MidnightHaunting extends CardImpl {
this.color.setWhite(true);
// Put two 1/1 white Spirit creature tokens with flying onto the battlefield.
this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken(), 2));
this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken("ISD"), 2));
}
public MidnightHaunting(final MidnightHaunting card) {

View file

@ -118,6 +118,7 @@ public class AjaniSteadfast extends CardImpl {
class AjaniSteadfastEmblem extends Emblem {
public AjaniSteadfastEmblem() {
setName("Emblem Ajani Steadfast");
this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new AjaniSteadfastPreventEffect()));
this.setExpansionSetCodeForImage("M15");
}

View file

@ -118,7 +118,7 @@ class BoonweaverGiantEffect extends OneShotEffect {
}
}
}
if (player.chooseUse(Outcome.Neutral, "Search your Hand for an Aura card?", game)) {
if (card == null && player.chooseUse(Outcome.Neutral, "Search your Hand for an Aura card?", game)) {
TargetCardInHand target = new TargetCardInHand(filter);
if (player.choose(Outcome.PutCardInPlay, player.getHand(), target, game)) {
card = game.getCard(target.getFirstTarget());
@ -140,9 +140,9 @@ class BoonweaverGiantEffect extends OneShotEffect {
if (card != null) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
game.getState().setValue("attachTo:" + card.getId(), permanent.getId());
game.getState().setValue("attachTo:" + card.getId(), permanent);
}
card.putOntoBattlefield(game, zone, source.getSourceId(), source.getControllerId());
player.putOntoBattlefieldWithInfo(card, game, zone, source.getSourceId());
if (permanent != null) {
return permanent.addAttachment(card.getId(), game);
}

View file

@ -35,7 +35,6 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityAllEffect;
import mage.cards.Card;
@ -81,7 +80,7 @@ public class ConstrictingSliver extends CardImpl {
// Sliver creatures you control have "When this creature enters the battlefield, you may exile target creature an opponent controls
// until this creature leaves the battlefield."
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(1), true);
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(), true);
ability.addTarget(new TargetCreaturePermanent(filterTarget));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability,

View file

@ -92,6 +92,11 @@ class ResoluteArchangelEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.setLife(game.getLife(), game);
return true;
}
return false;
}
}

View file

@ -74,9 +74,9 @@ public class ReturnToTheRanks extends CardImpl {
public void adjustTargets(Ability ability, Game game) {
for (Effect effect : ability.getEffects()) {
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
int xValue = new GetXValue().calculate(game, ability);
int xValue = ability.getManaCostsToPay().getX();
ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, filter));
}
}
}