- Cards which need a mode choice (e.g. the Siege cycle, Master of Predicaments etc.) will now log the choice that was made.

- The Siege cycle cards will now also report the choice in a message box so that it's immediately apparent what was chosen for them.
- Changed the default value of "Display Tokens in a Separate Row" to "disabled" (tokens are now displayed on the same row as non-token cards).
This commit is contained in:
Agetian
2015-05-19 17:56:38 +00:00
parent 73bef51fcc
commit 4e56670a23
12 changed files with 52 additions and 16 deletions

View File

@@ -13,6 +13,7 @@ import forge.game.event.GameEventAttackersDeclared;
import forge.game.event.GameEventBlockersDeclared;
import forge.game.event.GameEventCardDamaged;
import forge.game.event.GameEventCardDamaged.DamageType;
import forge.game.event.GameEventCardModeChosen;
import forge.game.event.GameEventGameOutcome;
import forge.game.event.GameEventLandPlayed;
import forge.game.event.GameEventMulligan;
@@ -97,6 +98,13 @@ public class GameLogFormatter extends IGameEventVisitor.Base<GameLogEntry> {
return new GameLogEntry(GameLogEntryType.STACK_ADD, sb.toString());
}
@Override
public GameLogEntry visit(GameEventCardModeChosen ev) {
String modeChoiceOutcome = String.format("%s has chosen %s for %s.", ev.player, ev.mode, ev.cardName);
return new GameLogEntry(GameLogEntryType.STACK_RESOLVE, modeChoiceOutcome);
}
private static GameLogEntry generateSummary(final List<GameOutcome> gamesPlayed) {
final GameOutcome outcome1 = gamesPlayed.get(0);
final List<Player> players = outcome1.getPlayers();

View File

@@ -4,6 +4,7 @@ import forge.game.ability.AbilityFactory;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.event.GameEventCardModeChosen;
import forge.game.player.Player;
import forge.game.spellability.AbilitySub;
import forge.game.spellability.SpellAbility;
@@ -57,7 +58,10 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
}
SpellAbility chosenSA = AbilityFactory.getAbility(host.getSVar(chosenName), host);
if (sa.hasParam("ShowChoice")) {
p.getGame().getAction().nofityOfValue(sa, p, abilities.get(idxChosen).getDescription(), null);
boolean dontNotifySelf = sa.getParam("ShowChoice").equals("ExceptSelf");
String chosenValue = abilities.get(idxChosen).getDescription();
p.getGame().getAction().nofityOfValue(sa, p, chosenValue, dontNotifySelf ? sa.getActivatingPlayer() : null);
p.getGame().fireEvent(new GameEventCardModeChosen(p, host.getName(), chosenValue));
}
chosenSA.setActivatingPlayer(sa.getActivatingPlayer());
((AbilitySub) chosenSA).setParent(sa);

View File

@@ -0,0 +1,23 @@
package forge.game.event;
import forge.game.player.Player;
public class GameEventCardModeChosen extends GameEvent {
public final Player player;
public final String cardName;
public final String mode;
public GameEventCardModeChosen(Player player, String cardName, String mode) {
this.player = player;
this.cardName = cardName;
this.mode = mode;
}
@Override
public <T> T visit(IGameEventVisitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@@ -12,6 +12,7 @@ public interface IGameEventVisitor<T> {
T visit(GameEventCardDestroyed event);
T visit(GameEventCardAttachment event);
T visit(GameEventCardChangeZone event);
T visit(GameEventCardModeChosen event);
T visit(GameEventCardRegenerated event);
T visit(GameEventCardSacrificed event);
T visit(GameEventCardPhased event);
@@ -56,6 +57,7 @@ public interface IGameEventVisitor<T> {
public T visit(GameEventCardDestroyed event) { return null; }
public T visit(GameEventCardAttachment event) { return null; }
public T visit(GameEventCardChangeZone event) { return null; }
public T visit(GameEventCardModeChosen event) { return null; }
public T visit(GameEventCardRegenerated event) { return null; }
public T visit(GameEventCardSacrificed event) { return null; }
public T visit(GameEventCardTapped event) { return null; }