mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
* Necropotence - Fixed that the name of the exiled cards was shown in the log.
This commit is contained in:
parent
80f06a22c6
commit
b737cbfe24
144 changed files with 198 additions and 194 deletions
|
|
@ -94,7 +94,7 @@ public class ExileFromGraveCost extends CostImpl {
|
|||
return false;
|
||||
}
|
||||
exiledCards.add(card);
|
||||
paid |= controller.moveCardToExileWithInfo(card, null, null, sourceId, game, Zone.GRAVEYARD);
|
||||
paid |= controller.moveCardToExileWithInfo(card, null, null, sourceId, game, Zone.GRAVEYARD, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public class ExileFromHandCost extends CostImpl {
|
|||
}
|
||||
cmc += card.getManaCost().convertedManaCost();
|
||||
this.cards.add(card);
|
||||
paid |= player.moveCardToExileWithInfo(card, null, null, ability.getSourceId(), game, Zone.HAND);
|
||||
paid |= player.moveCardToExileWithInfo(card, null, null, ability.getSourceId(), game, Zone.HAND, true);
|
||||
}
|
||||
if (paid && setXFromCMC) {
|
||||
VariableManaCost vmc = new VariableManaCost();
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class ExileSourceCost extends CostImpl {
|
|||
exileZoneId = CardUtil.getExileZoneId(game, ability.getSourceId(), ability.getSourceObjectZoneChangeCounter());
|
||||
exileZoneName = sourceObject.getLogName();
|
||||
}
|
||||
paid = controller.moveCardToExileWithInfo((Card) sourceObject, exileZoneId, exileZoneName, sourceId, game, game.getState().getZone(sourceObject.getId()));
|
||||
paid = controller.moveCardToExileWithInfo((Card) sourceObject, exileZoneId, exileZoneName, sourceId, game, game.getState().getZone(sourceObject.getId()), true);
|
||||
}
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class ExileSourceFromGraveCost extends CostImpl {
|
|||
if (controller != null) {
|
||||
Card card = game.getCard(sourceId);
|
||||
if (card != null && game.getState().getZone(sourceId).equals(Zone.GRAVEYARD)) {
|
||||
paid = controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.GRAVEYARD);
|
||||
paid = controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.GRAVEYARD, true);
|
||||
}
|
||||
}
|
||||
return paid;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class ExileTargetCost extends CostImpl {
|
|||
// Even if they are, meaning the actions that are performed don't match the actions
|
||||
// that are called for, the cost has still been paid.
|
||||
// so return state here is not important because the user indended to exile the target anyway
|
||||
game.getPlayer(ability.getControllerId()).moveCardToExileWithInfo(permanent, null, null, sourceId, game, Zone.BATTLEFIELD);
|
||||
game.getPlayer(ability.getControllerId()).moveCardToExileWithInfo(permanent, null, null, sourceId, game, Zone.BATTLEFIELD, true);
|
||||
}
|
||||
paid = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public class CounterTargetWithReplacementEffect extends OneShotEffect {
|
|||
controller.moveCardToLibraryWithInfo(card, sourceId, game, Zone.STACK, flag, true);
|
||||
break;
|
||||
case EXILED:
|
||||
controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.STACK);
|
||||
controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.STACK, true);
|
||||
break;
|
||||
default:
|
||||
card.moveToZone(targetZone, sourceId, game, flag);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class ExileAllEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent permanent: permanents) {
|
||||
controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||
controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class ExileCardYouChooseTargetOpponentEffect extends OneShotEffect {
|
|||
if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
|
||||
Card card = opponent.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.HAND);
|
||||
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.HAND, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class ExileSourceEffect extends OneShotEffect {
|
|||
exileZoneName = sourceObject.getLogName();
|
||||
}
|
||||
Card sourceCard = (Card) sourceObject;
|
||||
return controller.moveCardToExileWithInfo(sourceCard, exileZoneId, exileZoneName, source.getSourceId(), game, game.getState().getZone(sourceCard.getId()));
|
||||
return controller.moveCardToExileWithInfo(sourceCard, exileZoneId, exileZoneName, source.getSourceId(), game, game.getState().getZone(sourceCard.getId()), true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class ExileSpellEffect extends OneShotEffect implements MageSingleton {
|
|||
if (controller != null) {
|
||||
Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard();
|
||||
if (spellCard != null) {
|
||||
controller.moveCardToExileWithInfo(spellCard, null, "", source.getSourceId(), game, Zone.STACK);
|
||||
controller.moveCardToExileWithInfo(spellCard, null, "", source.getSourceId(), game, Zone.STACK, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,14 +90,14 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
Zone currentZone = game.getState().getZone(permanent.getId());
|
||||
if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(Zone.BATTLEFIELD))) {
|
||||
controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, currentZone);
|
||||
controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, currentZone, true);
|
||||
}
|
||||
} else {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
Zone currentZone = game.getState().getZone(card.getId());
|
||||
if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(currentZone))) {
|
||||
controller.moveCardToExileWithInfo(card, exileId, exileZone, source.getSourceId(), game, currentZone);
|
||||
controller.moveCardToExileWithInfo(card, exileId, exileZone, source.getSourceId(), game, currentZone, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ public class ExileTargetForSourceEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
if (permanent != null) {
|
||||
return controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||
return controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
} else {
|
||||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (card != null) {
|
||||
return controller.moveCardToExileWithInfo(card, exileId, sourceObject.getLogName(), source.getSourceId(), game, game.getState().getZone(card.getId()));
|
||||
return controller.moveCardToExileWithInfo(card, exileId, sourceObject.getLogName(), source.getSourceId(), game, game.getState().getZone(card.getId()), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class DealtDamageToCreatureBySourceDies extends ReplacementEffectImpl {
|
|||
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && permanent != null) {
|
||||
return controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||
return controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
|
|||
Card targetCard = targetPlayer.getGraveyard().get(targetId, game);
|
||||
if (targetCard != null) {
|
||||
targetPlayer.getGraveyard().remove(targetCard);
|
||||
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.GRAVEYARD);
|
||||
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.GRAVEYARD, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
|
|||
Card targetCard = targetPlayer.getHand().get(targetId, game);
|
||||
if (targetCard != null) {
|
||||
targetPlayer.getHand().remove(targetCard);
|
||||
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.HAND);
|
||||
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.HAND, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
|
|||
for (UUID targetId : targets) {
|
||||
Card targetCard = targetPlayer.getLibrary().remove(targetId, game);
|
||||
if (targetCard != null) {
|
||||
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.LIBRARY);
|
||||
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class CascadeAbility extends TriggeredAbilityImpl {
|
|||
if (card == null) {
|
||||
break;
|
||||
}
|
||||
player.moveCardToExileWithInfo(card, exile.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY);
|
||||
player.moveCardToExileWithInfo(card, exile.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
} while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);
|
||||
player.getLibrary().reset();
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class ChampionExileCost extends CostImpl {
|
|||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName() + " championed permanents", sourceId, game, Zone.BATTLEFIELD);
|
||||
paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName() + " championed permanents", sourceId, game, Zone.BATTLEFIELD, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ class FlashbackReplacementEffect extends ReplacementEffectImpl {
|
|||
if (controller != null) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null) {
|
||||
return controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, game.getState().getZone(card.getId()));
|
||||
return controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, game.getState().getZone(card.getId()), true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -269,4 +269,4 @@ class FlashbackReplacementEffect extends ReplacementEffectImpl {
|
|||
&& ((ZoneChangeEvent)event).getFromZone() == Zone.STACK
|
||||
&& ((ZoneChangeEvent)event).getToZone() != Zone.EXILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class MadnessReplacementEffect extends ReplacementEffectImpl {
|
|||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null) {
|
||||
if (controller.chooseUse(outcome, "Move " + card.getLogName() + " to exile to cast it by Madness?", game)) {
|
||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), "Madness", source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone());
|
||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), "Madness", source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone(), true);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.MADNESS_CARD_EXILED, card.getId(), card.getId(),controller.getId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl {
|
|||
Card sourceCard = (Card) game.getObject(source.getSourceId());
|
||||
Player player = game.getPlayer(sourceCard.getOwnerId());
|
||||
if (player != null) {
|
||||
player.moveCardToExileWithInfo(sourceCard, this.cardId, new StringBuilder(player.getName()).append(" Rebound").toString(), source.getSourceId(), game, Zone.HAND);
|
||||
player.moveCardToExileWithInfo(sourceCard, this.cardId, new StringBuilder(player.getName()).append(" Rebound").toString(), source.getSourceId(), game, Zone.HAND, true);
|
||||
this.used = true;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ class SuspendExileEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (card != null && controller != null) {
|
||||
UUID exileId = SuspendAbility.getSuspendExileId(controller.getId(), game);
|
||||
if (controller.moveCardToExileWithInfo(card, exileId, "Suspended cards of " + controller.getName(), source.getSourceId(), game, Zone.HAND)) {
|
||||
if (controller.moveCardToExileWithInfo(card, exileId, "Suspended cards of " + controller.getName(), source.getSourceId(), game, Zone.HAND, true)) {
|
||||
if (suspend == Integer.MAX_VALUE) {
|
||||
suspend = source.getManaCostsToPay().getX();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
* @param fromZone if null, this info isn't postet
|
||||
* @return
|
||||
*/
|
||||
boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone);
|
||||
boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone, boolean withName);
|
||||
|
||||
/**
|
||||
* Uses card.moveToZone and posts a inform message about moving the card to graveyard
|
||||
|
|
|
|||
|
|
@ -2784,13 +2784,19 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
if (card instanceof PermanentCard) {
|
||||
card = game.getCard(card.getId());
|
||||
}
|
||||
if (!game.isSimulation())
|
||||
game.informPlayers(new StringBuilder(this.getName())
|
||||
.append(" puts ")
|
||||
.append(withName ? card.getLogName() : "a face down card")
|
||||
.append(" ")
|
||||
.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") : "")
|
||||
.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand").toString());
|
||||
if (!game.isSimulation()) {
|
||||
StringBuilder sb = new StringBuilder(this.getName()).append(" puts ").append(withName ? card.getLogName() : "a face down card ");
|
||||
switch(fromZone) {
|
||||
case EXILED:
|
||||
sb.append("from exile zone ");
|
||||
break;
|
||||
default:
|
||||
sb.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") : "");
|
||||
break;
|
||||
}
|
||||
sb.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand");
|
||||
game.informPlayers(sb.toString());
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
|
|
@ -2915,7 +2921,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone) {
|
||||
public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone, boolean withName) {
|
||||
boolean result = false;
|
||||
if (card.moveToExile(exileId, exileName, sourceId, game)) {
|
||||
if (!game.isSimulation()) {
|
||||
|
|
@ -2923,9 +2929,9 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
card = game.getCard(card.getId());
|
||||
}
|
||||
game.informPlayers(new StringBuilder(this.getName())
|
||||
.append(" moves ").append(card.getLogName()).append(" ")
|
||||
.append(" moves ").append(withName ? card.getLogName() : "a card face down ")
|
||||
.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") : "")
|
||||
.append("to exile").toString());
|
||||
.append("to the exile zone").toString());
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue