Some minor changes.

This commit is contained in:
LevelX2 2017-08-15 00:32:53 +02:00
parent 6f216ee764
commit 5cf3e4ed12
3 changed files with 22 additions and 25 deletions

View file

@ -42,6 +42,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
@ -96,20 +97,19 @@ class LilianaVessEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Set<Card> creatureCards = new LinkedHashSet<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
Set<Card> creatureCards = new LinkedHashSet<>(); creatureCards.addAll(player.getGraveyard().getCards(new FilterCreatureCard(), game));
for (Card card : player.getGraveyard().getCards(game)) {
if (card.isCreature()) {
creatureCards.add(card);
} }
} }
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, false, null); controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, false, null);
}
}
return true; return true;
} }
return false;
}
@Override @Override
public LilianaVessEffect copy() { public LilianaVessEffect copy() {

View file

@ -31,7 +31,6 @@ import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
@ -39,7 +38,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
@ -79,8 +77,6 @@ public class RealitySmasher extends CardImpl {
class RealitySmasherTriggeredAbility extends TriggeredAbilityImpl { class RealitySmasherTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterSpell spellCard = new FilterSpell("a spell");
public RealitySmasherTriggeredAbility() { public RealitySmasherTriggeredAbility() {
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new DiscardCardCost()), false); super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new DiscardCardCost()), false);
} }
@ -106,11 +102,8 @@ class RealitySmasherTriggeredAbility extends TriggeredAbilityImpl {
return false; return false;
} else { } else {
if (event.getTargetId().equals(this.getSourceId()) if (event.getTargetId().equals(this.getSourceId())
&& game.getOpponents(this.controllerId).contains(event.getPlayerId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
&& spellCard.match(spell, getSourceId(), getControllerId(), game)) { getEffects().setTargetPointer(new FixedTarget(spell.getId()));
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(spell.getId()));
}
return true; return true;
} }
} }

View file

@ -77,6 +77,10 @@ sub get_name_of_card_from_class
} }
$card_name =~ s/(.)([A-Z])/$1 $2/g; $card_name =~ s/(.)([A-Z])/$1 $2/g;
$card_name =~ s/\d//g; $card_name =~ s/\d//g;
$card_name =~ s/ The / the /g;
$card_name =~ s/ Of / of /g;
$card_name =~ s/ To / to /g;
$card_name =~ s/ And / and /g;
return $card_name; return $card_name;
} }
return ""; return "";