LambdaHack-0.8.3.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

data FactionId Source #

A unique identifier of a faction in a game.

Instances
Enum FactionId Source # 
Instance details

Defined in Game.LambdaHack.Common.Misc

Eq FactionId Source # 
Instance details

Defined in Game.LambdaHack.Common.Misc

Ord FactionId Source # 
Instance details

Defined in Game.LambdaHack.Common.Misc

Show FactionId Source # 
Instance details

Defined in Game.LambdaHack.Common.Misc

Binary FactionId Source # 
Instance details

Defined in Game.LambdaHack.Common.Misc

Hashable FactionId Source # 
Instance details

Defined in Game.LambdaHack.Common.Misc

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

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 Source #

Binary Faction Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

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 Source #

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.8.3.0-Ezh08XnEAZCGads34ZqXQD" 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

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 Source #

Binary Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Status Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Status = D1 (MetaData "Status" "Game.LambdaHack.Common.Faction" "LambdaHack-0.8.3.0-Ezh08XnEAZCGads34ZqXQD" False) (C1 (MetaCons "Status" PrefixI True) (S1 (MetaSel (Just "stOutcome") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Outcome) :*: (S1 (MetaSel (Just "stDepth") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "stNewGame") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe (GroupName ModeKind))))))

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

TPoint TGoal LevelId Point

target a concrete spot

TVector Vector

target position relative to actor

Instances
Eq Target Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Ord Target Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Show Target Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Generic Target Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Associated Types

type Rep Target :: Type -> Type Source #

Binary Target Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Target Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

data TGoal Source #

The goal of an actor.

Constructors

TEnemyPos ActorId Bool

last seen position of the targeted actor

TEmbed ItemBag Point

embedded item that can be triggered; in TPoint (TEmbed bag p) _ q usually bag is embbedded in p and q is an adjacent open tile

TItem ItemBag

item lying on the ground

TSmell

smell potentially left by enemies

TUnknown

an unknown tile to be explored

TKnown

a known tile to be patrolled

TAny

an unspecified goal

Instances
Eq TGoal Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Methods

(==) :: TGoal -> TGoal -> Bool Source #

(/=) :: TGoal -> TGoal -> Bool Source #

Ord TGoal Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Show TGoal Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Generic TGoal Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

Associated Types

type Rep TGoal :: Type -> Type Source #

Methods

from :: TGoal -> Rep TGoal x Source #

to :: Rep TGoal x -> TGoal Source #

Binary TGoal Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep TGoal 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 Source #

Binary Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Challenge Source # 
Instance details

Defined in Game.LambdaHack.Common.Faction

type Rep Challenge = D1 (MetaData "Challenge" "Game.LambdaHack.Common.Faction" "LambdaHack-0.8.3.0-Ezh08XnEAZCGads34ZqXQD" False) (C1 (MetaCons "Challenge" PrefixI True) (S1 (MetaSel (Just "cdiff") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: (S1 (MetaSel (Just "cwolf") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: S1 (MetaSel (Just "cfish") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool))))

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