LambdaHack-0.2.10: 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

A unique identifier of a faction in a game.

type FactionDict = EnumMap FactionId Faction

All factions in the game, indexed by faction identifier.

data Faction

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

Instances

data Diplomacy

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

Constructors

Unknown 
Neutral 
Alliance 
War 

data Outcome

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

Instances

data Status

Current game status.

Constructors

Status 

Fields

stOutcome :: !Outcome

current game outcome

stDepth :: !Int

depth of the final encounter

stInfo :: !Text

extra information

Instances

isSpawnFact :: COps -> Faction -> Bool

Tell whether the faction can spawn actors.

isSummonFact :: COps -> Faction -> Bool

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

isAtWar :: Faction -> FactionId -> Bool

Check if factions are at war. Assumes symmetry.

isAllied :: Faction -> FactionId -> Bool

Check if factions are allied. Assumes symmetry.