module Game.Werewolf.Variant (
Variant,
tag, name, description,
allVariants,
standardVariant, noRoleKnowledgeVariant, noRoleKnowledgeOrRevealVariant, noRoleRevealVariant,
spitefulVillageVariant,
standard, noRoleKnowledge, noRoleKnowledgeOrReveal, noRoleReveal, spitefulVillage,
) where
import Control.Lens
import Data.String.Humanise
import Data.String.Interpolate.Extra
import Data.Text as T
import Game.Werewolf.Role hiding (description, name, tag)
data Variant = Variant
{ _tag :: Text
, _name :: Text
, _description :: Text
} deriving (Eq, Read, Show)
makeLenses ''Variant
instance Humanise Variant where
humanise = view name
allVariants :: [Variant]
allVariants =
[ standardVariant
, noRoleKnowledgeVariant
, noRoleKnowledgeOrRevealVariant
, noRoleRevealVariant
, spitefulVillageVariant
]
standardVariant :: Variant
standardVariant = Variant
{ _tag = "standard"
, _name = T.strip [iFile|variant/standard/name.txt|]
, _description = T.strip [iFile|variant/standard/description.txt|]
}
noRoleKnowledgeVariant :: Variant
noRoleKnowledgeVariant = Variant
{ _tag = "no-role-knowledge"
, _name = T.strip [iFile|variant/noroleknowledge/name.txt|]
, _description = T.strip [iFile|variant/noroleknowledge/description.txt|]
}
noRoleKnowledgeOrRevealVariant :: Variant
noRoleKnowledgeOrRevealVariant = Variant
{ _tag = "no-role-knowledge-or-reveal"
, _name = T.strip [iFile|variant/noroleknowledgeorreveal/name.txt|]
, _description = T.strip [iFile|variant/noroleknowledgeorreveal/description.txt|]
}
noRoleRevealVariant :: Variant
noRoleRevealVariant = Variant
{ _tag = "no-role-reveal"
, _name = T.strip [iFile|variant/norolereveal/name.txt|]
, _description = T.strip [iFile|variant/norolereveal/description.txt|]
}
spitefulVillageVariant :: Variant
spitefulVillageVariant = Variant
{ _tag = "spiteful-village"
, _name = T.strip [iFile|variant/spitefulvillage/name.txt|]
, _description = T.strip [iFile|variant/spitefulvillage/description.txt|]
}
standard :: Traversal' Variant ()
standard = only standardVariant
noRoleKnowledge :: Traversal' Variant ()
noRoleKnowledge = only noRoleKnowledgeVariant
noRoleKnowledgeOrReveal :: Traversal' Variant ()
noRoleKnowledgeOrReveal = only noRoleKnowledgeOrRevealVariant
noRoleReveal :: Traversal' Variant ()
noRoleReveal = only noRoleRevealVariant
spitefulVillage :: Traversal' Variant ()
spitefulVillage = only spitefulVillageVariant