Card fixes

This commit is contained in:
North 2011-08-31 16:58:29 +03:00
parent 7053c84ded
commit a63cebc455
4 changed files with 24 additions and 70 deletions

View file

@ -36,7 +36,6 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;
import mage.game.Game;
@ -79,12 +78,6 @@ class LightwielderPaladinTriggeredAbility extends TriggeredAbilityImpl<Lightwiel
public LightwielderPaladinTriggeredAbility() {
super(Zone.BATTLEFIELD, new ExileTargetEffect(), true);
FilterPermanent filter = new FilterPermanent("black or red permanent");
filter.getColor().setBlack(true);
filter.getColor().setRed(true);
filter.setUseColor(true);
filter.setScopeColor(ComparisonScope.Any);
this.addTarget(new TargetPermanent(filter));
}
public LightwielderPaladinTriggeredAbility(final LightwielderPaladinTriggeredAbility ability) {
@ -100,12 +93,14 @@ class LightwielderPaladinTriggeredAbility extends TriggeredAbilityImpl<Lightwiel
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
&& ((DamagedPlayerEvent) event).isCombatDamage()) {
Filter filter = this.getTargets().get(0).getFilter();
if (filter instanceof FilterPermanent) {
FilterPermanent filterPermanent = ((FilterPermanent) filter);
filterPermanent.getControllerId().add(event.getTargetId());
filterPermanent.setNotController(false);
}
FilterPermanent filter = new FilterPermanent("black or red permanent");
filter.getColor().setBlack(true);
filter.getColor().setRed(true);
filter.setUseColor(true);
filter.setScopeColor(ComparisonScope.Any);
filter.getControllerId().add(event.getTargetId());
filter.setNotController(false);
this.addTarget(new TargetPermanent(filter));
return true;
}
return false;

View file

@ -97,26 +97,22 @@ class GruesomeEncoreEffect extends OneShotEffect<GruesomeEncoreEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(source.getFirstTarget());
if (player != null & card != null) {
if (card != null) {
Player opponent = game.getPlayer(card.getOwnerId());
if (opponent != null) {
opponent.removeFromGraveyard(card, game);
if (opponent != null && opponent.removeFromGraveyard(card, game)) {
card.addAbility(HasteAbility.getInstance());
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
card.addAbility(HasteAbility.getInstance());
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
return false;

View file

@ -93,7 +93,7 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl<PawnOfUlamogTrig
if (event.getType() == EventType.ZONE_CHANGE) {
UUID targetId = event.getTargetId();
Card card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
if (card != null && card instanceof Permanent) {
if (card != null && card instanceof Permanent && !(card instanceof PermanentToken)) {
Permanent permanent = (Permanent) card;
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD

View file

@ -50,7 +50,7 @@ import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInOpponentsGraveyard;
/**
*
@ -77,7 +77,7 @@ public class GethLordOfTheVault extends CardImpl<GethLordOfTheVault> {
this.addAbility(IntimidateAbility.getInstance());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}"));
ability.addTarget(new GethLordOfTheVaultEffectTarget(filter));
ability.addTarget(new TargetCardInOpponentsGraveyard(filter));
this.addAbility(ability);
}
@ -156,40 +156,3 @@ class GethLordOfTheVaultEffect extends OneShotEffect<GethLordOfTheVaultEffect> {
}
}
class GethLordOfTheVaultEffectTarget extends TargetCard<GethLordOfTheVaultEffectTarget> {
public GethLordOfTheVaultEffectTarget(FilterCard filter) {
this(1, 1, filter);
}
public GethLordOfTheVaultEffectTarget(int minNumTargets, int maxNumTargets, FilterCard filter) {
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter);
this.targetName = filter.getMessage() + " from an opponent's graveyard";
}
public GethLordOfTheVaultEffectTarget(final GethLordOfTheVaultEffectTarget target) {
super(target);
}
@Override
public boolean canTarget(UUID id, Ability source, Game game) {
Card card = game.getCard(id);
if (card != null && game.getZone(card.getId()) == Zone.GRAVEYARD) {
if (game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) {
return filter.match(card);
}
}
return false;
}
@Override
public boolean canChoose(UUID sourceControllerId, Game game) {
return true;
}
@Override
public GethLordOfTheVaultEffectTarget copy() {
return new GethLordOfTheVaultEffectTarget(this);
}
}