Some minor formatting for extisting cards.

This commit is contained in:
LevelX2 2014-04-28 14:55:06 +02:00
parent 718c220471
commit c875b764a0
4 changed files with 42 additions and 37 deletions

View file

@ -113,7 +113,7 @@ class DjinnOfWishesEffect extends OneShotEffect<DjinnOfWishesEffect> {
if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) {
if (card.getCardType().contains(CardType.LAND)) {
// If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) {
if (game.getActivePlayerId().equals(player.getId()) && player.canPlayLand()) {
used = true;
player.playLand(card, game);
}

View file

@ -58,6 +58,7 @@ public class Galvanoth extends CardImpl<Galvanoth> {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of your upkeep, you may look at the top card of your library. If it's an instant or sorcery card, you may cast it without paying its mana cost.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GalvanothEffect(), TargetController.YOU, true));
}
@ -84,21 +85,19 @@ class GalvanothEffect extends OneShotEffect<GalvanothEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.getLibrary().size() > 0) {
Card card = player.getLibrary().getFromTop(game);
Cards cards = new CardsImpl();
cards.add(card);
player.lookAtCards("Galvanoth", cards, game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
Cards cards = new CardsImpl(card);
controller.lookAtCards("Galvanoth", cards, game);
if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
String message = "Cast " + card.getName() + " without paying its mana cost?";
if (player.chooseUse(Outcome.PlayForFree, message, game)) {
player.getLibrary().removeFromTop(game);
player.cast(card.getSpellAbility(), game, true);
StringBuilder message = new StringBuilder("Cast ").append(card.getName()).append(" without paying its mana cost?");
if (controller.chooseUse(Outcome.PlayForFree, message.toString(), game)) {
controller.getLibrary().removeFromTop(game);
controller.cast(card.getSpellAbility(), game, true);
}
}
return true;
}
return false;

View file

@ -95,15 +95,15 @@ class QuestForUlasTempleEffect extends OneShotEffect<QuestForUlasTempleEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.getLibrary().size() > 0) {
Card card = player.getLibrary().getFromTop(game);
Cards cards = new CardsImpl();
cards.add(card);
player.lookAtCards("This card", cards, game);
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourcePermanent != null && controller != null && controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
Cards cards = new CardsImpl(card);
controller.lookAtCards(sourcePermanent.getName(), cards, game);
if (card.getCardType().contains(CardType.CREATURE)) {
if (player.chooseUse(Outcome.DrawCard, "Do you wish to reveal the creature card at the top of the library?", game)) {
player.revealCards("Quest for Ula's Temple", cards, game);
if (controller.chooseUse(Outcome.DrawCard, "Do you wish to reveal the creature card at the top of the library?", game)) {
controller.revealCards(sourcePermanent.getName(), cards, game);
Permanent questForUlasTemple = game.getPermanent(source.getSourceId());
if (questForUlasTemple != null) {
questForUlasTemple.addCounters(CounterType.QUEST.createInstance(), game);
@ -133,11 +133,9 @@ class QuestForUlasTempleTriggeredAbility extends TriggeredAbilityImpl<QuestForUl
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent quest = game.getPermanent(super.getSourceId());
if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE
&& quest != null
&& quest.getCounters().getCount(CounterType.QUEST) >= 3) {
return true;
if (event.getType().equals(GameEvent.EventType.END_TURN_STEP_PRE)) {
Permanent quest = game.getPermanent(super.getSourceId());
return quest != null && quest.getCounters().getCount(CounterType.QUEST) >= 3;
}
return false;
}
@ -171,17 +169,19 @@ class QuestForUlasTempleEffect2 extends OneShotEffect<QuestForUlasTempleEffect2>
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, query, game)) {
return false;
}
TargetCardInHand target = new TargetCardInHand(filter);
if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId());
return true;
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
TargetCardInHand target = new TargetCardInHand(filter);
if (target.canChoose(source.getSourceId(), controller.getId(), game)
&&controller.chooseUse(Outcome.PutCreatureInPlay, query, game)) {
if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
}
return true;
}
return false;
}

View file

@ -39,14 +39,20 @@ import mage.ObjectColor;
public class WolfToken extends Token {
public WolfToken() {
this("ISD");
}
public WolfToken(String setCode) {
super("Wolf", "2/2 green Wolf creature token");
this.setOriginalExpansionSetCode(setCode);
if (setCode.equals("ISD")) {
setTokenType(Type.SECOND.code);
}
cardType.add(CardType.CREATURE);
color = ObjectColor.GREEN;
subtype.add("Wolf");
power = new MageInt(2);
toughness = new MageInt(2);
setTokenType(Type.SECOND.code);
this.setOriginalExpansionSetCode("ISD");
}
public WolfToken(Token.Type type) {