mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- More correct implementation of the way GameEventCardModeChosen game event is processed.
This commit is contained in:
@@ -100,8 +100,11 @@ public class GameLogFormatter extends IGameEventVisitor.Base<GameLogEntry> {
|
||||
|
||||
@Override
|
||||
public GameLogEntry visit(GameEventCardModeChosen ev) {
|
||||
String modeChoiceOutcome = String.format("%s has chosen %s for %s.", ev.player, ev.mode, ev.cardName);
|
||||
if (!ev.log) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String modeChoiceOutcome = String.format("%s has chosen %s for %s.", ev.player, ev.mode, ev.cardName);
|
||||
return new GameLogEntry(GameLogEntryType.STACK_RESOLVE, modeChoiceOutcome);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,14 +57,14 @@ public class ChooseGenericEffect extends SpellAbilityEffect {
|
||||
chosenName = choices[idxChosen];
|
||||
}
|
||||
SpellAbility chosenSA = AbilityFactory.getAbility(host.getSVar(chosenName), host);
|
||||
String chosenValue = abilities.get(idxChosen).getDescription();
|
||||
if (sa.hasParam("ShowChoice")) {
|
||||
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);
|
||||
p.getGame().fireEvent(new GameEventCardModeChosen(p, host.getName(), chosenValue, sa.hasParam("ShowChoice")));
|
||||
AbilityUtils.resolve(chosenSA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,13 @@ public class GameEventCardModeChosen extends GameEvent {
|
||||
public final Player player;
|
||||
public final String cardName;
|
||||
public final String mode;
|
||||
public final boolean log;
|
||||
|
||||
public GameEventCardModeChosen(Player player, String cardName, String mode) {
|
||||
public GameEventCardModeChosen(Player player, String cardName, String mode, boolean log) {
|
||||
this.player = player;
|
||||
this.cardName = cardName;
|
||||
this.mode = mode;
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user