Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+3 -3
View File
@@ -24,8 +24,8 @@ medkit i = defaultConsumable
heal25 :: Int -> World -> Maybe World
heal25 = heal 25
heal :: Int -> Int -> World -> Maybe World
heal hp n w | _crHP (_creatures w IM.! n) >= 10000 = Nothing
heal hp n w | _crHP (_creatures (_cWorld w) IM.! n) >= 10000 = Nothing
| otherwise = Just $ soundStart (CrSound $ _crID cr) (_crPos cr) healS Nothing w
& creatures . ix n . crHP %~ min 10000 . (+ hp)
& cWorld . creatures . ix n . crHP %~ min 10000 . (+ hp)
where
cr = _creatures w IM.! n
cr = _creatures (_cWorld w) IM.! n