Project:Dying

The  module is the only interface to kill off players in the game.

add_dying
Marks a player as dying.


 * var is the game state for DI.
 * player is the player we're killing off.
 * killer_role is the role responsible for killing player. The role must be an actual role. "wolf" is used for generic wolf kills.
 * reason is the reason the playing is dying, which can assist event listeners in determining how to react to the death.
 * death_triggers determines whether or not killing this user triggers things that happen on death.

This does not kill the player immediately. Call  to do that, provided your code is guaranteed to be top level. It is an error to call  as part of a nested/chain death.

Returns True if the player was successfully marked as dying, or False if the player is already dead or dying.

kill_players
Kills off all dying players.


 * var is the game state for DI.

Internally, this fires off the  event for each dying player and then the   event after all chained deaths have fully resolved.

del_player
Event parameters


 * evt is the Event object.  has no effect for this event.
 * var is the game state for DI
 * player is the dead user
 * all_roles is the set of all of player's roles
 * death_triggers is a bool for whether or not death triggers should fire for this player
 * killer_role is the role name of player's killer
 * main_role is player's main role
 * reveal_role is the role player is revealed as to the channel
 * reason is the dying reason passed to add_dying
 * There is no event data dict.

At the point this event is fired, player is already dead. As such, they will not show up in get_players, nor will get_main_role or get_all_roles work on them. In general, assume anything (other than stuff in your own module) has already purged all state it had for this player.

To kill someone else in a listener (i.e. chained death), simply call add_dying on the target. They will be killed automatically once the current batch of players has been killed. Do not call kill_players during a del_player listener.

kill_players

 * evt is the Event object.  has no effect for this event.
 * var is the game state for DI
 * players is the set of all players that died during the call (main deaths and chained deaths)
 * There is no event data dict.

This is called after del_player has been fired for every player and all chained deaths resolved. This event can be used to update state after all deaths have been handled. The base game logic uses this event to fire update_stats, reconfigure_stats, and devoice dead players.