Project:Lycanthropy

Goals
The lycanthropy system must:
 * Allow for adding and removing lycanthropy on and from players
 * Allow to apply lycanthropy effect to players at any point

Additionally, lycanthropy is used during the  event and cleared during the   event.

Design
The  module contains a method-based API to manipulate the lycanthropy status on players. For shorthand and convenience, the  package exposes the relevant lycanthropy-related public API.

add_lycanthropy method
Marks the user as being effected by lycanthropy.
 * var is the game state for DI purposes
 * target is the user who will be affected by lycanthropy

This method fires the  event, and looks for the   attribute -- if True, lycanthropy will not be applied.

remove_lycanthropy method
Removes the lycanthropy status from the target. If the target is not affected by lycanthropy, this is a no-op.


 * var is the game state for DI purposes
 * target is the user to remove the lycanthropy effect from

add_scope method
Adds a scope to the lycanthropy system. This is used to properly update stats when a lycanthropy turn arises. An alive wolf shaman for example will add a scope of All if it has the possibility of a lycanthropy totem.


 * var is the game state for DI purposes (unused, here for consistency)
 * scope is the scope that the role can affect with lycanthropy

There is no mirror  function. Scopes are cleared every morning in.

add_lycanthropy event
Fired before the lycanthropy effect is applied


 * evt is the Event object. Setting  will prevent the lycanthropy effect from being applied. The data dict is empty.
 * var is the game state for DI purposes
 * target is the player whom lycanthropy is being applied to

The actual lycanthropy effect is applied after the event is dispatched, and if  has a false value. The  function returns.

Role considerations

 * Doctor listens on the  event and sets   if the target is immunized
 * Doctor calls  on any newly-immunized target (the function is a no-op if the person isn't effected by lycanthropy)
 * Lycan sets itself with lycanthropy at the beginning of every night
 * An immunized lycan no longer turns into a villager, and still tries to set itself with lycanthropy every night, which doctor blocks
 * Lycan calls  every night
 * Other lycan-able roles (e.g. shamans with the possibility of lycanthropy totem) will call  every night

Stats handling
As soon as a "chilling howl" message is played, stats have to be updated to reflect the possible new roles in play. Considerations:


 * Dispatch the  event with the   kind.
 * Check the role against the current scopes - if the role is in none of these scopes, nothing happens
 * Otherwise, if  contains the   key and   is in the roleset, add the value to the roleset.