Fixed some effects apply return value. Some changes to game logging.

This commit is contained in:
LevelX2 2014-07-23 08:11:11 +02:00
parent 9fb718c0c0
commit 03b51d1f34
8 changed files with 16 additions and 12 deletions

View file

@ -86,16 +86,17 @@ class PathToExileEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget()); Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) { if (controller != null && permanent != null) {
Player player = game.getPlayer(permanent.getControllerId()); Player player = game.getPlayer(permanent.getControllerId());
if (permanent.moveToZone(Zone.EXILED, source.getId(), game, false)) { if (controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD)) {
if (player.chooseUse(Outcome.PutCardInPlay, "Use Path to Exile effect?", game)) { if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", game)) {
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
if (player.searchLibrary(target, game)) { if (player.searchLibrary(target, game)) {
Card card = player.getLibrary().getCard(target.getFirstTarget(), game); Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
if (card != null) { if (card != null) {
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), permanent.getControllerId(), true); player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
} }
} }
player.shuffleLibrary(game); player.shuffleLibrary(game);

View file

@ -92,11 +92,12 @@ class MoltenBirthEffect extends OneShotEffect {
Card molten = game.getCard(source.getSourceId()); Card molten = game.getCard(source.getSourceId());
if (you != null) { if (you != null) {
ElementalToken token = new ElementalToken(); ElementalToken token = new ElementalToken();
token.putOntoBattlefield(2, game, source.getId(), source.getControllerId()); token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId());
if (you.flipCoin(game)) { if (you.flipCoin(game)) {
molten.moveToZone(Zone.HAND, source.getId(), game, true); molten.moveToZone(Zone.HAND, source.getSourceId(), game, true);
game.informPlayers(new StringBuilder(you.getName()).append(" won the flip. Molten Birth is returned to ").append(you.getName()).append(" hand.").toString()); game.informPlayers(new StringBuilder(you.getName()).append(" won the flip. ").append(molten.getLogName()).append(" is returned to ").append(you.getName()).append(" hand.").toString());
} }
return true;
} }
return false; return false;
} }

View file

@ -112,6 +112,7 @@ class VendilionCliqueEffect extends OneShotEffect {
player.drawCards(1, game); player.drawCards(1, game);
} }
} }
return true;
} }
return false; return false;
} }

View file

@ -133,8 +133,8 @@ class StoneforgeMysticEffect extends OneShotEffect {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
} }
} }
return true;
} }
return false; return false;
} }
} }

View file

@ -102,9 +102,10 @@ class GoblinGuideEffect extends OneShotEffect {
defender.revealCards("Goblin Guide", cards, game); defender.revealCards("Goblin Guide", cards, game);
if (card.getCardType().contains(CardType.LAND)) { if (card.getCardType().contains(CardType.LAND)) {
defender.getLibrary().removeFromTop(game); defender.getLibrary().removeFromTop(game);
card.moveToZone(Zone.HAND, source.getId(), game, true); defender.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
} }
} }
return true;
} }
return false; return false;
} }

View file

@ -89,6 +89,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect {
if (!costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false)) { if (!costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false)) {
return game.getStack().counter(spell.getId(), source.getSourceId(), game); return game.getStack().counter(spell.getId(), source.getSourceId(), game);
} }
return true;
} }
} }
return false; return false;

View file

@ -66,7 +66,7 @@ class PersistEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
game.addEffect(new PersistReplacementEffect(), source); game.addEffect(new PersistReplacementEffect(), source);
return false; return true;
} }
} }

View file

@ -313,7 +313,6 @@ class SuspendPlayCardEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(source.getSourceId()); Card card = game.getCard(source.getSourceId());
if (player != null && card != null) { if (player != null && card != null) {
@ -340,7 +339,7 @@ class SuspendPlayCardEffect extends OneShotEffect {
card.getAbilities().removeAll(abilitiesToRemove); card.getAbilities().removeAll(abilitiesToRemove);
} }
// cast the card for free // cast the card for free
player.cast(card.getSpellAbility(), game, true); return player.cast(card.getSpellAbility(), game, true);
} }
return false; return false;
} }