Refactor sounds
This commit is contained in:
@@ -31,5 +31,8 @@ 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
|
||||
| otherwise = Just $ soundOnce healSound w & creatures . ix n . crHP %~ min 10000 . (+ hp)
|
||||
| otherwise = Just $ soundFrom (CrSound $ _crID cr) (_crPos cr) healSound Nothing w
|
||||
& creatures . ix n . crHP %~ min 10000 . (+ hp)
|
||||
where
|
||||
cr = _creatures w IM.! n
|
||||
|
||||
|
||||
Reference in New Issue
Block a user