mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixed some effects apply return value. Some changes to game logging.
This commit is contained in:
parent
9fb718c0c0
commit
03b51d1f34
8 changed files with 16 additions and 12 deletions
|
@ -86,16 +86,17 @@ class PathToExileEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
if (controller != null && permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (permanent.moveToZone(Zone.EXILED, source.getId(), game, false)) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Use Path to Exile effect?", game)) {
|
||||
if (controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD)) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", game)) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
||||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
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);
|
||||
|
|
|
@ -92,11 +92,12 @@ class MoltenBirthEffect extends OneShotEffect {
|
|||
Card molten = game.getCard(source.getSourceId());
|
||||
if (you != null) {
|
||||
ElementalToken token = new ElementalToken();
|
||||
token.putOntoBattlefield(2, game, source.getId(), source.getControllerId());
|
||||
token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId());
|
||||
if (you.flipCoin(game)) {
|
||||
molten.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
game.informPlayers(new StringBuilder(you.getName()).append(" won the flip. Molten Birth is returned to ").append(you.getName()).append(" hand.").toString());
|
||||
molten.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -112,6 +112,7 @@ class VendilionCliqueEffect extends OneShotEffect {
|
|||
player.drawCards(1, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -133,8 +133,8 @@ class StoneforgeMysticEffect extends OneShotEffect {
|
|||
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,9 +102,10 @@ class GoblinGuideEffect extends OneShotEffect {
|
|||
defender.revealCards("Goblin Guide", cards, game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
defender.getLibrary().removeFromTop(game);
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
defender.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect {
|
|||
if (!costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false)) {
|
||||
return game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -66,7 +66,7 @@ class PersistEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
game.addEffect(new PersistReplacementEffect(), source);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -313,7 +313,6 @@ class SuspendPlayCardEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (player != null && card != null) {
|
||||
|
@ -340,7 +339,7 @@ class SuspendPlayCardEffect extends OneShotEffect {
|
|||
card.getAbilities().removeAll(abilitiesToRemove);
|
||||
}
|
||||
// cast the card for free
|
||||
player.cast(card.getSpellAbility(), game, true);
|
||||
return player.cast(card.getSpellAbility(), game, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue