LambdaHack-0.5.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Faction

Contents

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

type FactionDict = EnumMap FactionId Faction Source #

All factions in the game, indexed by faction identifier.

data Faction Source #

Constructors

Faction 

Fields

data Status Source #

Current game status.

Constructors

Status 

Fields

data Target Source #

The type of na actor target.

Constructors

TEnemy !ActorId !Bool

target an actor; cycle only trough seen foes, unless the flag is set

TEnemyPos !ActorId !LevelId !Point !Bool

last seen position of the targeted actor

TPoint !LevelId !Point

target a concrete spot

TVector !Vector

target position relative to actor

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. Actors that can be summoned should have "horror" in their ifreq set.

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

Check if factions are at war. Assumes symmetry.

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

Check if factions are allied. Assumes symmetry.

Internal operations