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.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
@ -54,7 +55,7 @@ import mage.target.common.TargetCardInLibrary;
public class LilianaVess extends CardImpl {
public LilianaVess(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}");
this.subtype.add("Liliana");
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
@ -96,19 +97,18 @@ class LilianaVessEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
Set<Card> creatureCards = new LinkedHashSet<>();
for (Card card : player.getGraveyard().getCards(game)) {
if (card.isCreature()) {
creatureCards.add(card);
}
if (controller != null) {
Set<Card> creatureCards = new LinkedHashSet<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
creatureCards.addAll(player.getGraveyard().getCards(new FilterCreatureCard(), game));
}
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

View file

@ -31,7 +31,6 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.TrampleAbility;
@ -39,7 +38,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -54,7 +52,7 @@ import mage.target.targetpointer.FixedTarget;
public class RealitySmasher extends CardImpl {
public RealitySmasher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{C}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{C}");
this.subtype.add("Eldrazi");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
@ -66,7 +64,7 @@ public class RealitySmasher extends CardImpl {
// Whenever Reality Smasher becomes the target of a spell an opponent controls, counter that spell unless its controller discards a card.
this.addAbility(new RealitySmasherTriggeredAbility());
}
public RealitySmasher(final RealitySmasher card) {
super(card);
}
@ -79,8 +77,6 @@ public class RealitySmasher extends CardImpl {
class RealitySmasherTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterSpell spellCard = new FilterSpell("a spell");
public RealitySmasherTriggeredAbility() {
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new DiscardCardCost()), false);
}
@ -106,11 +102,8 @@ class RealitySmasherTriggeredAbility extends TriggeredAbilityImpl {
return false;
} else {
if (event.getTargetId().equals(this.getSourceId())
&& game.getOpponents(this.controllerId).contains(event.getPlayerId())
&& spellCard.match(spell, getSourceId(), getControllerId(), game)) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(spell.getId()));
}
&& game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
getEffects().setTargetPointer(new FixedTarget(spell.getId()));
return true;
}
}

View file

@ -42,7 +42,7 @@ foreach $num (sort {$a<=>$b} keys (%new_order))
}
}
print ("Choose your preferred tag: ");
print ("Choose your preferred tag: ");
my $cmd = <STDIN>;
chomp $cmd;
@ -77,6 +77,10 @@ sub get_name_of_card_from_class
}
$card_name =~ s/(.)([A-Z])/$1 $2/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 "";
@ -85,8 +89,8 @@ sub get_name_of_card_from_class
if (exists ($new_order{$cmd}))
{
my $tag = $new_order{$cmd};
$tag =~ s/You chose //;
$tag =~ s/,.*//;
$tag =~ s/You chose //;
$tag =~ s/,.*//;
chomp $tag;
print ("You chose $tag\n");