Resolve #144: Fix bug where play order was not shuffled in event.

This commit is contained in:
Gareth Latty
2020-05-23 04:36:19 +01:00
parent 275d266294
commit cd591c4af1
4 changed files with 10 additions and 13 deletions
+5 -3
View File
@@ -15,7 +15,7 @@ Massive Decks is a free, open source comedy party game based on [Cards against H
- Play together in the same room or online.
- Use any device (Mobile phone, PC, Chromecast, anything with a web browser).
- You can set up a central screen, but you don't need to (no need to stream anything for other players online).
- Custom decks.
- Custom decks (via [Many Decks][many-decks]).
- Customise the rules:
- Custom cards.
- House rules.
@@ -24,6 +24,8 @@ Massive Decks is a free, open source comedy party game based on [Cards against H
- Spectators.
- Keeps your game private by default, you can also set a game password if needed.
[many-decks]: https://decks.md.rereadgames.com/
## About
The game is open source software available under [the AGPLv3 license](LICENSE).
@@ -84,8 +86,8 @@ by [Cards against Humanity][cah].
[cah-license]: https://creativecommons.org/licenses/by-nc-sa/2.0/
Massive Decks is also inspired by:
* [CardCast][cardcast] - an app you to play on a Chromecast.
* [Pretend You're Xyzzy][xyzzy] - a web game where you can jump in with people you don't know.
* [CardCast][cardcast] - an app that allowed you to play on a Chromecast, now dead.
* [Pretend You're Xyzzy][xyzzy] - another web implementation.
[cardcast]: https://www.cardcastgame.com/
[xyzzy]: http://pretendyoure.xyz/zy/
+1
View File
@@ -55,6 +55,7 @@
// reboot: { cost: 1 },
// comedyWriter: { number: 300, exclusive: true },
// rando: { number: 1 },
// neverHaveIEver: {}
},
stages: {
timeLimitMode: "Soft",
+3 -4
View File
@@ -289,9 +289,7 @@ export class Revealing extends Base<"Revealing"> implements Timed {
events?: Iterable<Event.Distributor>;
timeouts?: Iterable<Timeout.After>;
} {
const playsToBeRevealed = Array.from(
wu(game.round.plays).map((play) => play.id)
);
const playsToBeRevealed = Array.from(wu(this.plays).map((play) => play.id));
const events = Util.asOptionalIterable(
Event.additionally(
StartRevealing.of(playsToBeRevealed),
@@ -299,7 +297,7 @@ export class Revealing extends Base<"Revealing"> implements Timed {
)
);
const timeouts = Util.asOptionalIterable(
RoundStageTimerDone.ifEnabled(game.round, game.rules.stages)
RoundStageTimerDone.ifEnabled(this, game.rules.stages)
);
return { events, timeouts };
}
@@ -444,6 +442,7 @@ export class Playing extends Base<"Playing"> implements Timed {
this.call,
Util.shuffled(this.plays)
);
game.round = revealing;
return {
round: revealing,
...(doNotStart ? {} : revealing.start(game)),
+1 -6
View File
@@ -1,14 +1,9 @@
import wu from "wu";
import * as Event from "../event";
import * as StartRevealing from "../events/game-event/start-revealing";
import * as Card from "../games/cards/card";
import * as Round from "../games/game/round";
import * as Timeout from "../timeout";
import * as Util from "../util";
import * as RoundStageTimerDone from "./round-stage-timer-done";
import * as Rules from "../games/rules";
import * as User from "../user";
import * as Game from "../games/game";
/**
* Indicates that the round should start the revealing phase if it is appropriate
* to do so.