werewolf-0.4.10.0: A game engine for running werewolf in a chat client

Copyright(c) Henry J. Wylde, 2016
LicenseBSD3
Maintainerpublic@hjwylde.com
Safe HaskellNone
LanguageHaskell2010

Game.Werewolf.Role

Contents

Description

Roles are split into four categories:

  • The Ambiguous.
  • The Loners.
  • The Villagers.
  • The Werewolves.

Synopsis

Role

data Role Source

Role definitions require only a few pieces of information. Most of the game logic behind a role is implemented in Game.Werewolf.Command and Game.Werewolf.Engine.

The balance attribute on a role indicates the allegiance it favours. For example, a Simple Werewolf has a balance of -4 while the Seer has a balance of 2. A balance of 0 means it favours neither allegiance.

N.B., role equality is defined on just the name as a role's allegiance may change throughout the game.

data Allegiance Source

The Loner allegiances are seldom used, rather they are present for correctness.

Constructors

Angel 
Villagers 
Werewolves 

Instances

allRoles :: [Role] Source

A list containing all the roles defined in this file.

restrictedRoles :: [Role] Source

A list containing roles that are restricted to a single instance per Game.

  restrictedRoles = allRoles \\ [simpleVillagerRole, simpleWerewolfRole]
  

allAllegiances :: [Allegiance] Source

A list containing all the allegiances defined in this file.

TODO (hjw): use reflection to get this list

The Ambiguous

They could very well be allies of the village or become its enemies. During the game, they can change sides or characters.

The Ambiguous must aid their side to achieve victory.

devotedServantRole :: Role Source

Who could dream of a better servant than one willing to give up her life for that of her masters? Don't rejoice too fast, as the devouring ambition within her could spell the end of the village!

Before the revelation of the card of the player eliminated by the village's vote, she can reveal herself by showing her card and taking on the role of the eliminated player.

wildChildRole :: Role Source

Abandoned in the woods by his parents at a young age, he was raised by wolves. As soon as he learned how to walk on all fours, the Wild-child began to wander around Miller's Hollow. One day, fascinated by an inhabitant of the village who was walking upright with grace and presence, he made them his secret role model. He then decided to integrate himself into the community of Miller's Hollow and entered, worried, in the village. The community was moved by his frailty, adopted him, and welcomed him in their fold. What will become of him: honest Villager or terrible Werewolf? For all of his life, the heart of the Wild-child will swing between these two alternatives. May his model confirm him in his newfound humanity.

On the first night, the Wild-child may choose a player to become his role model. If during the game the chosen player is eliminated, the Wild-child becomes a Werewolf. He will then wake up the next night with his peers and will devour with them each night until the end of the game. However for as long as the Wild-child's role model is alive, he remains a Villager.

wolfHoundRole :: Role Source

All dogs know in the depths of their soul that their ancestors were wolves and that it's mankind who has kept them in the state of childishness and fear, the faithful and generous companions. In any case, only the Wolf-hound can decide if he'll obey his human and civilized master or if he'll listen to the call of wild nature buried within him.

On the first night, he chooses if he wants to be a Simple Villager or Werewolf. The choice is final.

The Loners

Their past could no doubt reveal to us why they hate the inhabitants of Miller's Hollow. One thing is known for sure: they really scare everyone!

The Loners have their own objectives, no matter which side they're on.

angelRole :: Role Source

The muddy life of a village infested with evil creatures repulses him; he wishes to believe he's the victim of a terrible nightmare, in order to finally wake up in his comfortable bed.

When the Angel is in play, the game always begins with the village's debate followed by an elimination vote, and then the first night.

The Angel wins if he manages to get eliminated on the first round (day or night). If he fails, then he becomes a Simple Villager for the rest of the game.

The Villagers

Attached to the village's survival, the following characters defend its harmony with determination. Faced with various menaces, they will be brought to eliminate those they suspect of being too dangerous, even if that might be painful to them.

The Villagers must lynch all of the Werewolves.

bearTamerRole :: Role Source

Ah! How sweet it is, in my memory, the sound of chains slipping onto the cobblestones of the "Three Road" plaza, accompanied by the grunting of Ursus. Ah! How long ago it was that Titan, the Bear Tamer, would lead his companion in a ballet so gravious that we'd cry every summer in Miller's Hollow. Ursus even had the oh-so-previous ability to detect lycanthropes hidden near him.

Each morning, right after the revelation of any possible nocturnal victims, if at least one Werewolf is or ends up directly next to the Bear Tamer, then Ursus grunts to indicate danger to all of the other players.

defenderRole :: Role Source

This character can save the Villagers from the bite of the Werewolves.

Each night the Defender is called before the Werewolves to select a player deserving of his protection. That player is safe during the night (and only that night) against the Werewolves.

scapegoatRole :: Role Source

It's sad to say, but in Miller's Hollow, when something doesn't go right it's always him who unjustly suffers the consequences.

If the village's vote ends in a tie, it's the Scapegoat who is eliminated instead of no-one.

In this event, the Scapegoat has one last task to complete: he must choose whom is permitted to vote or not on the next day.

seerRole :: Role Source

A fortunate teller by other names, with the ability to see into fellow townsfolk and determine their allegiance.

Each night the Seer sees the allegiance of a player of her choice.

simpleVillagerRole :: Role Source

A simple, ordinary townsperson in every way. Their only weapons are the ability to analyze behaviour to identify Werewolves, and the strength of their conviction to prevent the execution of the innocents like themselves.

villageIdiotRole :: Role Source

What is a village without an idiot? He does pretty much nothing important, but he's so charming that no one would want to hurt him.

If the village votes against the Village Idiot, his identity is revealed. At that moment the Villagers understand their mistake and immediately let him be.

The Village Idiot continues to play but may no longer vote, as what would the vote of an idiot be worth?

villagerVillagerRole :: Role Source

This person has a soul as clear and transparent as the water from a mountain stream. They will deserve the attentive ear of their peers and will make their word decisive in crucial moments.

When the game begins, the village is told the identity of the Villager-Villager, thus ensuring certainty that its owner is truly an innocent Villager.

witchRole :: Role Source

She knows how to brew two extremely powerful potions: a healing potion, to resurrect the player devoured by the Werewolves, and a poison potion, used at night to eliminate a player.

The Witch is called after the Werewolves. She is allowed to use both potions in the same night and is also allowed to heal herself.

The Werewolves

They can be lethally dangerous and put in doubt the village's survival.

The Werewolves must devour all of the Villagers.

simpleWerewolfRole :: Role Source

Each night they devour a Villager. During the day they try to hide their nocturnal identity to avoid mob justice.

A Werewolf may never devour another Werewolf.

Utility functions

is :: Getting Any s a -> s -> Bool Source

The counter-part to isn't, but more general as it takes a Getting instead.

isn't :: Getting All s a -> s -> Bool Source

A re-write of isn't to be more general by taking a Getting instead.

filteredBy :: Eq b => Lens' a b -> b -> Traversal' a a Source

A companion to filtered that, rather than using a predicate, filters on the given lens for matches.