diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-13 20:03:24 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-13 20:03:24 +0200 |
commit | 0c5fe56414a323f49d7b086c0a64a216443a22bb (patch) | |
tree | eb0fee8a463e09bc2dada338de5f42c5bbb3f552 /src/Sequence | |
parent | 1ca2b48b49d559158cda4feffa145bdfded2c1c2 (diff) | |
download | 2017-01-16_17:13:37-0c5fe56414a323f49d7b086c0a64a216443a22bb.tar 2017-01-16_17:13:37-0c5fe56414a323f49d7b086c0a64a216443a22bb.tar.gz 2017-01-16_17:13:37-0c5fe56414a323f49d7b086c0a64a216443a22bb.tar.bz2 2017-01-16_17:13:37-0c5fe56414a323f49d7b086c0a64a216443a22bb.tar.xz 2017-01-16_17:13:37-0c5fe56414a323f49d7b086c0a64a216443a22bb.zip |
action log
Diffstat (limited to 'src/Sequence')
-rw-r--r-- | src/Sequence/Contact/Archetypes.hs | 2 | ||||
-rw-r--r-- | src/Sequence/Types.hs | 7 |
2 files changed, 7 insertions, 2 deletions
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) | |||
50 | cTable :: Ord v => [(Integer, Integer, v)] -> Table v | 50 | cTable :: Ord v => [(Integer, Integer, v)] -> Table v |
51 | cTable = Map.fromList . map (\(from, to, value) -> (value, (abs (to - from) + 1) % 100)) | 51 | cTable = Map.fromList . map (\(from, to, value) -> (value, (abs (to - from) + 1) % 100)) |
52 | 52 | ||
53 | death :: Hitzone -> FormulaM Stats (Maybe Stats) | 53 | death :: Hitzone -> Effect |
54 | death zone = Effect "Tod" . runMaybeT $ do | 54 | death zone = Effect "Tod" . runMaybeT $ do |
55 | maxVitality <- (MaybeT . preview $ ctx . sMaxVitality) >>= lift | 55 | maxVitality <- (MaybeT . preview $ ctx . sMaxVitality) >>= lift |
56 | currentDmg <- MaybeT . preview $ ctx . sDamage' zone | 56 | 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 @@ | |||
1 | {-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, TypeSynonymInstances, ViewPatterns, OverloadedStrings, TemplateHaskell, GeneralizedNewtypeDeriving, TypeOperators, UndecidableInstances #-} | 1 | {-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, TypeSynonymInstances, ViewPatterns, OverloadedStrings, TemplateHaskell, GeneralizedNewtypeDeriving, TypeOperators, UndecidableInstances #-} |
2 | 2 | ||
3 | module Sequence.Types | 3 | module Sequence.Types |
4 | ( GameState, gEntities, gEntityNames, gFocus, gNextId' | 4 | ( GameState, gEntities, gEntityNames, gFocus, gNextId', gLog |
5 | , Faction, faction, faction' | 5 | , Faction, faction, faction' |
6 | , Entity(..), eFaction, eSeqVal, eStats, eNotes | 6 | , Entity(..), eFaction, eSeqVal, eStats, eNotes |
7 | , EntityName(..), entityName | 7 | , EntityName(..), entityName |
@@ -20,6 +20,9 @@ import qualified Data.CaseInsensitive as CI | |||
20 | import Data.Map.Strict (Map) | 20 | import Data.Map.Strict (Map) |
21 | import qualified Data.Map.Strict as Map | 21 | import qualified Data.Map.Strict as Map |
22 | 22 | ||
23 | import Data.Sequence (Seq) | ||
24 | import qualified Data.Sequence as Seq | ||
25 | |||
23 | import Data.Bimap (Bimap) | 26 | import Data.Bimap (Bimap) |
24 | import qualified Data.Bimap as Bimap | 27 | import qualified Data.Bimap as Bimap |
25 | 28 | ||
@@ -102,6 +105,7 @@ data GameState = GameState | |||
102 | , _gEntityNames :: Bimap EntityIdentifier EntityName | 105 | , _gEntityNames :: Bimap EntityIdentifier EntityName |
103 | , _gFocus :: Maybe EntityIdentifier | 106 | , _gFocus :: Maybe EntityIdentifier |
104 | , _gNextId :: EntityIdentifier | 107 | , _gNextId :: EntityIdentifier |
108 | , _gLog :: Seq (EntityIdentifier, String) | ||
105 | } | 109 | } |
106 | makeLenses ''GameState | 110 | makeLenses ''GameState |
107 | 111 | ||
@@ -111,6 +115,7 @@ instance Default GameState where | |||
111 | , _gEntityNames = Bimap.empty | 115 | , _gEntityNames = Bimap.empty |
112 | , _gFocus = Nothing | 116 | , _gFocus = Nothing |
113 | , _gNextId = toEnum 0 | 117 | , _gNextId = toEnum 0 |
118 | , _gLog = Seq.empty | ||
114 | } | 119 | } |
115 | 120 | ||
116 | inhabitedFactions :: Getter GameState [Faction] | 121 | inhabitedFactions :: Getter GameState [Faction] |