LambdaHack-0.2.10.6: A roguelike game engine in early and active development

Safe HaskellNone

Game.LambdaHack.Common.Faction

Description

Factions taking part in the game: e.g., two human players controlling the hero faction battling the monster and the animal factions.

Synopsis

Documentation

data FactionId Source

A unique identifier of a faction in a game.

type FactionDict = EnumMap FactionId FactionSource

All factions in the game, indexed by faction identifier.

data Faction Source

Constructors

Faction 

Fields

gkind :: !(Id FactionKind)

the kind of the faction

gname :: !Text

individual name

gcolor :: !Color

color of actors or their frames

gplayer :: !Player

the player spec for this faction

gdipl :: !Dipl

diplomatic mode

gquit :: !(Maybe Status)

cause of game end/exit

gleader :: !(Maybe ActorId)

the leader of the faction, if any

data Diplomacy Source

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

Constructors

Unknown 
Neutral 
Alliance 
War 

data Outcome Source

Outcome of a game.

Constructors

Killed

the faction was eliminated

Defeated

the faction lost the game in another way

Camping

game is supended

Conquer

the player won by eliminating all rivals

Escape

the player escaped the dungeon alive

Restart

game is restarted

data Status Source

Current game status.

Constructors

Status 

Fields

stOutcome :: !Outcome

current game outcome

stDepth :: !Int

depth of the final encounter

stInfo :: !Text

extra information

isSpawnFact :: COps -> Faction -> BoolSource

Tell whether the faction can spawn actors.

isSummonFact :: COps -> Faction -> BoolSource

Tell whether actors of the faction can be summoned by items, etc.

isAtWar :: Faction -> FactionId -> BoolSource

Check if factions are at war. Assumes symmetry.

isAllied :: Faction -> FactionId -> BoolSource

Check if factions are allied. Assumes symmetry.