Simplify creature update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user