From 0c5fe56414a323f49d7b086c0a64a216443a22bb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 13 Jun 2016 20:03:24 +0200 Subject: action log --- src/Sequence/Contact/Archetypes.hs | 2 +- src/Sequence/Types.hs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Sequence') diff --git a/src/Sequence/Contact/Archetypes.hs b/src/Sequence/Contact/Archetypes.hs index 626104b..1bf2b7e 100644 --- a/src/Sequence/Contact/Archetypes.hs +++ b/src/Sequence/Contact/Archetypes.hs @@ -50,7 +50,7 @@ archetypes = [ ("Mensch", human) cTable :: Ord v => [(Integer, Integer, v)] -> Table v cTable = Map.fromList . map (\(from, to, value) -> (value, (abs (to - from) + 1) % 100)) -death :: Hitzone -> FormulaM Stats (Maybe Stats) +death :: Hitzone -> Effect death zone = Effect "Tod" . runMaybeT $ do maxVitality <- (MaybeT . preview $ ctx . sMaxVitality) >>= lift currentDmg <- MaybeT . preview $ ctx . sDamage' zone diff --git a/src/Sequence/Types.hs b/src/Sequence/Types.hs index 4aa55d3..b5f6b4b 100644 --- a/src/Sequence/Types.hs +++ b/src/Sequence/Types.hs @@ -1,7 +1,7 @@ {-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, TypeSynonymInstances, ViewPatterns, OverloadedStrings, TemplateHaskell, GeneralizedNewtypeDeriving, TypeOperators, UndecidableInstances #-} module Sequence.Types - ( GameState, gEntities, gEntityNames, gFocus, gNextId' + ( GameState, gEntities, gEntityNames, gFocus, gNextId', gLog , Faction, faction, faction' , Entity(..), eFaction, eSeqVal, eStats, eNotes , EntityName(..), entityName @@ -20,6 +20,9 @@ import qualified Data.CaseInsensitive as CI import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map +import Data.Sequence (Seq) +import qualified Data.Sequence as Seq + import Data.Bimap (Bimap) import qualified Data.Bimap as Bimap @@ -102,6 +105,7 @@ data GameState = GameState , _gEntityNames :: Bimap EntityIdentifier EntityName , _gFocus :: Maybe EntityIdentifier , _gNextId :: EntityIdentifier + , _gLog :: Seq (EntityIdentifier, String) } makeLenses ''GameState @@ -111,6 +115,7 @@ instance Default GameState where , _gEntityNames = Bimap.empty , _gFocus = Nothing , _gNextId = toEnum 0 + , _gLog = Seq.empty } inhabitedFactions :: Getter GameState [Faction] -- cgit v1.2.3