LambdaHack-0.9.5.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Faction

Contents

Description

Factions taking part in the game, e.g., a hero faction, a monster faction and an animal faction.

Synopsis

Documentation

type FactionDict = EnumMap FactionId Faction Source #

All factions in the game, indexed by faction identifier.

data Faction Source #

The faction datatype.

Constructors

Faction 

Fields

Instances
Eq Faction Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Methods

(==) :: Faction -> Faction -> Bool #

(/=) :: Faction -> Faction -> Bool #

Show Faction Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Generic Faction Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Associated Types

type Rep Faction :: Type -> Type #

Methods

from :: Faction -> Rep Faction x #

to :: Rep Faction x -> Faction #

Binary Faction Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Methods

put :: Faction -> Put #

get :: Get Faction #

putList :: [Faction] -> Put #

type Rep Faction Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

data Diplomacy Source #

Diplomacy states. Higher overwrite lower in case of asymmetric content.

Constructors

Unknown 
Neutral 
Alliance 
War 
Instances
Enum Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Eq Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Ord Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Show Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Generic Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Associated Types

type Rep Diplomacy :: Type -> Type #

Binary Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Diplomacy Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Diplomacy = D1 (MetaData "Diplomacy" "Game.LambdaHack.Common.Faction" "LambdaHack-0.9.5.0-inplace" False) ((C1 (MetaCons "Unknown" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Neutral" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Alliance" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "War" PrefixI False) (U1 :: Type -> Type)))

data Status Source #

Current game status.

Constructors

Status 

Fields

Instances
Eq Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Methods

(==) :: Status -> Status -> Bool #

(/=) :: Status -> Status -> Bool #

Ord Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Show Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Generic Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Associated Types

type Rep Status :: Type -> Type #

Methods

from :: Status -> Rep Status x #

to :: Rep Status x -> Status #

Binary Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Methods

put :: Status -> Put #

get :: Get Status #

putList :: [Status] -> Put #

type Rep Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

data Challenge Source #

Constructors

Challenge 

Fields

  • cdiff :: Int

    game difficulty level (HP bonus or malus)

  • cwolf :: Bool

    lone wolf challenge (only one starting character)

  • cfish :: Bool

    cold fish challenge (no healing from enemies)

Instances
Eq Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Ord Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Show Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Generic Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Associated Types

type Rep Challenge :: Type -> Type #

Binary Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

isHorrorFact :: Faction -> Bool Source #

Tell whether the faction consists of summoned horrors only.

Horror player is special, for summoned actors that don't belong to any of the main players of a given game. E.g., animals summoned during a skirmish game between two hero factions land in the horror faction. In every game, either all factions for which summoning items exist should be present or a horror player should be added to host them.

isFoe :: FactionId -> Faction -> FactionId -> Bool Source #

Check if factions are at war. Assumes symmetry.

isFriend :: FactionId -> Faction -> FactionId -> Bool Source #

Check if factions are allied or are the same faction. Assumes symmetry.

Internal operations