Rename Perception datatype/fields

This commit is contained in:
2022-06-18 10:08:06 +01:00
parent 66fda3fb93
commit a1c7abedaf
13 changed files with 76 additions and 85 deletions
+7 -13
View File
@@ -90,8 +90,8 @@ creatureDisplayText cfig w cr
. scale theScale theScale
. stackText
$ clockCycle 25 (V.fromList
[ \cr' -> [crDisplayAwake cr']
, \cr' -> [crDisplayAlert cr']
[ \cr' -> [crDisplayVigilance cr']
, \cr' -> [crDisplayAwareness cr']
]
) w cr
where
@@ -101,13 +101,13 @@ creatureDisplayText cfig w cr
v = cpos -.- campos
(V2 x y) = campos +.+ v +.+ _crRad cr *.* normalizeV v
crDisplayAlert :: Creature -> String
crDisplayAlert cr
crDisplayAwareness :: Creature -> String
crDisplayAwareness cr
| isSuspicious = "?"
| isCognizant = "!"
| otherwise = "."
where
imAwarenesses = _crAwarenessLevel (_crPerception cr)
imAwarenesses = _cpAwareness (_crPerception cr)
isSuspicious = any f imAwarenesses && not (null imAwarenesses)
isCognizant = any g imAwarenesses && not (null imAwarenesses)
f (Suspicious _) = True
@@ -115,14 +115,8 @@ crDisplayAlert cr
g (Cognizant _) = True
g _ = False
crDisplayAwake :: Creature -> String
crDisplayAwake = show . _crAwakeLevel . _crPerception
--crDisplayAwake cr = case _crAwakeLevel (_crPerception cr) of
-- Comatose -> "-"
-- Asleep -> "Z"
-- Lethargic -> "L"
-- Vigilant -> "V"
-- Overstrung -> "O"
crDisplayVigilance :: Creature -> String
crDisplayVigilance = show . _cpVigilance . _crPerception
--damageMod :: Creature -> Picture -> Picture
--damageMod cr pic = piercingMod $ bluntScale pic