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ZU6EZ72YHJSQKBIOYZPLGWHAJIMSH5ZN3WBWDKJWQC
array('key' => 'cube_blue_{INDEX}', 'nbr' => 10),
array('key' => 'cube_green_{INDEX}', 'nbr' => 10),
array('key' => 'cube_purple_{INDEX}', 'nbr' => 10),
array('key' => 'cube_red_{INDEX}', 'nbr' => 10),
array('key' => 'cube_yellow_{INDEX}', 'nbr' => 10),
array('key' => 'disc_blue_{INDEX}', 'nbr' => 3),
array('key' => 'disc_green_{INDEX}', 'nbr' => 3),
array('key' => 'disc_purple_{INDEX}', 'nbr' => 3),
array('key' => 'disc_red_{INDEX}', 'nbr' => 3),
array('key' => 'disc_yellow_{INDEX}', 'nbr' => 3),
array('key' => 'cube_blue_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_green_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_purple_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_red_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_yellow_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'disc_blue_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_green_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_purple_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_red_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_yellow_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'pi_blue_{INDEX}', 'nbr' => 5),
array('key' => 'pi_green_{INDEX}', 'nbr' => 5),
array('key' => 'pi_purple_{INDEX}', 'nbr' => 5),
array('key' => 'pi_red_{INDEX}', 'nbr' => 5),
array('key' => 'pi_yellow_{INDEX}', 'nbr' => 5),
array('key' => 'pi_blue_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_green_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_purple_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_red_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_yellow_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
// TODO: Init game statistics
// (note: statistics used in this file must be defined in your stats.inc.php file)
//self::initStat( 'table', 'table_teststat1', 0 ); // Init a table statistics
//self::initStat( 'player', 'player_teststat1', 0 ); // Init a player statistics (for all players)
// Init game statistics
self::initStat('table', 'turns_number', 0);
self::initStat('table', 'rounds_1', 0);
self::initStat('table', 'rounds_2', 0);
self::initStat('table', 'rounds_3', 0);
self::initStat('player', 'turns_number', 0);
self::initStat('player', 'cards_taken_1', 0);
self::initStat('player', 'cards_taken_2', 0);
self::initStat('player', 'cards_taken_3', 0);
self::initStat('player', 'investigators_used_1', 0);
self::initStat('player', 'investigators_used_2', 0);
self::initStat('player', 'investigators_used_3', 0);
self::initStat('player', 'penalty_1', 0);
self::initStat('player', 'penalty_2', 0);
self::initStat('player', 'penalty_3', 0);
self::initStat('player', 'vp_1', 0);
self::initStat('player', 'vp_2', 0);
self::initStat('player', 'vp_3', 0);
self::initStat('player', 'solved_minigames', 0);
self::initStat('player', 'avg_investigator_neighborhood', $this->constants['AVG_LOCATION_NEIGHBORS']);
self::initStat('player', 'neighbor_case_cards_taken', 0);
self::initStat('player', 'avg_cubes_to_solve', $this->constants['CUBES_PER_PLAYER']);
self::initStat('player', 'avg_discs_to_solve', $this->constants['DISCS_PER_PLAYER']);
// Calculate the 'average investigator location neighborhood' stat.
$number_of_loc_neighbors = count($this->locations[$location_id]['neighbors']);
$total_pis_used = $this->constants["PIS_PER_PLAYER"] - $pis_in_supply;
$current_val = self::getStat('avg_investigator_neighborhood', $player_id);
// Calculate the "rolling average".
self::setStat(
($current_val * $total_pis_used + $number_of_loc_neighbors) / ($total_pis_used + 1),
'avg_investigator_neighborhood',
$player_id
);
// Increase the 'cards taken' stats.
self::incStat(1, "cards_taken_" . self::getGameStateValue('minigame'), $player_id);
// If card takes was one of the aspects from the player's hand,
// increase that stat too.
$hand_cards = $this->cards->getPlayerHand($player_id);
if (in_array($currentCard['type_arg'] + 36, array_pluck($hand_cards, 'type_arg'))) {
self::incStat(1, "neighbor_case_cards_taken", $player_id);
}
self::setStat($points_winnable, "vp_{$minigame}", $player_id);
// Calculate the 'average cubes required to solve' stats
$cubes_on_board = $this->constants['CUBES_PER_PLAYER'] - $this->tokens->countTokensInLocation("cubes_{$player_id}");
$solved_mg_so_far = self::getStat("solved_minigames", $player_id);
$current_val = self::getStat('avg_cubes_to_solve', $player_id);
// Calculate the "rolling average".
self::setStat(
($current_val * $solved_mg_so_far + $cubes_on_board) / ($solved_mg_so_far + 1),
'avg_cubes_to_solve',
$player_id
);
// Calculate the 'average discs required to solve' stats
$discs_on_board = $this->constants['DISCS_PER_PLAYER'] - $this->tokens->countTokensInLocation("discs_{$player_id}");
$solved_mg_so_far = self::getStat("solved_minigames", $player_id);
$current_val = self::getStat('avg_discs_to_solve', $player_id);
// Calculate the "rolling average".
self::setStat(
($current_val * $solved_mg_so_far + $discs_on_board) / ($solved_mg_so_far + 1),
'avg_discs_to_solve',
$player_id
);
// Increment the solve_minigames stat.
self::incStat(1, "solved_minigames", $player_id);
$this->gamestate->nextState('nextPlayer');
self::incStat(1, "turns_number");
self::incStat(1, "turns_number", $next_player_id);
$this->gamestate->nextState('nextPlayer'); // -> STATE_PLAYER_TURN
/*
Examples:
"rounds_1" => array("id"=> 20,
"name" => totranslate("Number of rounds (1. mini-game)"),
"type" => "int"),
"rounds_2" => array("id"=> 21,
"name" => totranslate("Number of rounds (2. mini-game)"),
"type" => "int"),
"rounds_3" => array("id"=> 22,
"name" => totranslate("Number of rounds (3. mini-game)"),
"type" => "int"),
"name" => totranslate("Number of turns"),
"type" => "int" ),
/*
Examples:
"player_teststat1" => array( "id"=> 10,
"name" => totranslate("player test stat 1"),
"type" => "int" ),
"player_teststat2" => array( "id"=> 11,
"name" => totranslate("player test stat 2"),
"type" => "float" )
"name" => totranslate("Number of turns"),
"type" => "int"),
*/
)
"investigators_used_1" => array("id"=> 20,
"name" => totranslate("Investigators used (1. mini-game)"),
"type" => "int"),
"investigators_used_2" => array("id"=> 21,
"name" => totranslate("Investigators used (2. mini-game)"),
"type" => "int"),
"investigators_used_3" => array("id"=> 22,
"name" => totranslate("Investigators used (3. mini-game)"),
"type" => "int"),
"cards_taken_1" => array("id"=> 30,
"name" => totranslate("Cards taken (1. mini-game)"),
"type" => "int"),
"cards_taken_2" => array("id"=> 31,
"name" => totranslate("Cards taken (2. mini-game)"),
"type" => "int"),
"cards_taken_3" => array("id"=> 32,
"name" => totranslate("Cards taken (3. mini-game)"),
"type" => "int"),
"penalty_1" => array("id"=> 40,
"name" => totranslate("Penalty points (1. mini-game)"),
"type" => "int"),
"penalty_2" => array("id"=> 41,
"name" => totranslate("Penalty points (2. mini-game)"),
"type" => "int"),
"penalty_3" => array("id"=> 42,
"name" => totranslate("Penalty points (3. mini-game)"),
"type" => "int"),
// Achievable VPs are dependent on player count, so this is not too
// expressive.
"vp_1" => array("id"=> 50,
"name" => totranslate("VP scored, ignoring penalty (1. mini-game)"),
"type" => "int"),
"vp_2" => array("id"=> 51,
"name" => totranslate("VP scored, ignoring penalty (2. mini-game)"),
"type" => "int"),
"vp_3" => array("id"=> 52,
"name" => totranslate("VP scored, ignoring penalty (3. mini-game)"),
"type" => "int"),
// *How* the player plays (strategy?)
"avg_investigator_neighborhood" => array("id"=> 80,
"name" => totranslate("Avg. neighborhood size of investigator placements (3-6; 4.143 means 'no preference')"),
"type" => "float"),
"neighbor_case_cards_taken" => array("id"=> 81,
"name" => totranslate("Cards taken that are part of the neighbor's case solution"),
"type" => "int"),
// How quick the player can solve...
"solved_minigames" => array("id"=> 90,
"name" => totranslate("Solved mini-games"),
"type" => "int"),
"avg_cubes_to_solve" => array("id"=> 91,
"name" => totranslate("Cubes on board before able to solve"),
"type" => "float"),
"avg_discs_to_solve" => array("id"=> 92,
"name" => totranslate("Discs on board before able to solve"),
"type" => "float"),
)