Refactor sound

This commit is contained in:
2021-09-12 17:52:34 +01:00
parent ea333a363b
commit 51a85bd1ec
97 changed files with 409 additions and 177 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import Dodge.Item.Data
import Dodge.Picture.Layer
import Dodge.Default
import Dodge.SoundLogic
import Dodge.SoundLogic.Synonyms
import Dodge.SoundLogic.LoadSound
import Dodge.Item.Draw
@@ -32,7 +32,7 @@ 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 $ soundFrom (CrSound $ _crID cr) (_crPos cr) healSound Nothing w
| otherwise = Just $ soundFrom (CrSound $ _crID cr) (_crPos cr) healS Nothing w
& creatures . ix n . crHP %~ min 10000 . (+ hp)
where
cr = _creatures w IM.! n