Skip to main content

PlayerStats

The Player Stats includes the statistics tracked for an individual player in the game. The GameSave type includes a PlayerStats object for each player in the game.

Data Type

The data type for PlayerStats is defined here, and is reproduced below for convenience:

export type PlayerStats = {
/** who the player voted to accuse */
accusationVotes: {
day: number
playerNum: number
}[]
/** player's votes for the outcome of trials */
judgementVotes: {
day: number
playerNum: number
vote: JudgementVote | undefined
}[]
/** player's targets for their night actions */
nightActions: {
day: number
target: number | undefined
}[]
/** the day and phase in which the player died, or undefined if the player is still alive */
death?: {
day: number
time: 'day' | 'night'
}
/** the number of other players the player has killed */
numKills: number
/** the number of times the player was put on trial */
numTrials: number
}

Sample Data

{
"accusationVotes": {
"0": {
"day": 2,
"playerNum": 6
},
"1": {
"day": 3,
"playerNum": 5
}
},
"judgementVotes": {
"0": {
"day": 2,
"playerNum": 6
},
"1": {
"day": 3,
"playerNum": 5,
"vote": "execute"
}
},
"nightActions": {
"0": {
"day": 1,
"target": 1
},
"1": {
"day": 2,
"target": 2
}
},
"numKills": 2,
"numTrials": 0
}