Krark's Thumb - fixed that it can generates too many flip triggers (#12152)

---------

Co-authored-by: Susucre <34709007+Susucre@users.noreply.github.com>
This commit is contained in:
jimga150 2024-04-22 03:22:42 -04:00 committed by GitHub
parent c0c05579ba
commit 28a1442899
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 169 additions and 3 deletions

View file

@ -12,12 +12,14 @@ public class CoinFlippedEvent extends GameEvent {
private final boolean result;
private final boolean chosen;
private final boolean winnable;
private final int flipCount; // Number of flips that lead to this event. see [[Krark's Thumb]]
CoinFlippedEvent(UUID playerId, UUID sourceId, boolean result, boolean chosen, boolean winnable) {
CoinFlippedEvent(UUID playerId, UUID sourceId, int flipCount, boolean result, boolean chosen, boolean winnable) {
super(GameEvent.EventType.COIN_FLIPPED, playerId, null, playerId);
this.result = result;
this.chosen = chosen;
this.winnable = winnable;
this.flipCount = flipCount;
this.setSourceId(sourceId);
}
@ -25,6 +27,10 @@ public class CoinFlippedEvent extends GameEvent {
return result;
}
public int getFlipCount() {
return flipCount;
}
public String getResultName() {
return CardUtil.booleanToFlipName(result);
}

View file

@ -54,6 +54,6 @@ public class FlipCoinEvent extends GameEvent {
}
public CoinFlippedEvent createFlippedEvent() {
return new CoinFlippedEvent(playerId, sourceId, result, chosen, winnable);
return new CoinFlippedEvent(playerId, sourceId, flipCount, result, chosen, winnable);
}
}