3
list ($user_id, $role) = $args;
5
$knew_role = isset ($this->known_roles[$user_id]);
7
$this->known_roles[$user_id] = $role;
8
$this->claimed_roles[$user_id] = $role;
10
$user = $this->game->players[$user_id];
12
if (!isset ($this->known_alignments[$user_id]))
14
$this->known_alignments[$user_id] = isset ($this->server->custom_vars->yandere_yandere_odds[$role]);
17
// Respond with own role.
19
if ($user_id != $this->user_id && !in_array($role, $this->server->custom_vars->yandere_enemies))
23
$user->claim_role($this->user_id, $this->role);
31
// Inform trusted players.
33
foreach ($this->game->players as $player_id => $player)
35
if ($player_id == $this->user_id)
37
// I already know what I know.
41
if (isset ($this->known_alignments[$player_id]) && $this->known_alignments[$player_id] === false)
43
if (isset ($player->known_alignments[$this->user_id]) && $player->known_alignments[$this->user_id] === false)
45
// Mutual trust. The recipient should consider this information as fact.
47
foreach ($this->known_alignments as $user_id => $role)
49
if (!isset ($player->known_roles[$user_id]))
51
$player->learn_role($user_id, $role);