Simplify creature update

This commit is contained in:
2022-04-07 19:40:12 +01:00
parent 7ca9afeb5f
commit ac74ae0ed1
17 changed files with 104 additions and 45 deletions
+3
View File
@@ -11,6 +11,9 @@ import Control.Monad.State
--import System.Random
import Data.List
applyNoDamage :: [Damage] -> Creature -> World -> World
applyNoDamage _ _ = id
defaultApplyDamage :: [Damage] -> Creature -> World -> World
defaultApplyDamage ds cr w = foldl' (applyIndividualDamage cr) w ds'
& creatures . ix (_crID cr) %~ doPoisonDam