Tweak creature update

This commit is contained in:
2025-08-06 13:10:37 +01:00
parent af5bdf59b9
commit 9fb7440776
11 changed files with 196 additions and 191 deletions
+12 -12
View File
@@ -187,18 +187,18 @@ humanoidAIList ::
humanoidAIList
= impulsiveAIBefore . chainCreatureUpdates
-- bit of a hack to get new random generators after each creature's update
defaultImpulsive ::
[World -> Creature -> Creature] ->
Creature ->
World ->
World
defaultImpulsive
= fmap (fmap updateRandGen) . crUpdate . impulsiveAIBefore . chainCreatureUpdates
where
updateRandGen w =
let (_, g) = randomR (0, 1 :: Int) (_randGen w)
in w & randGen .~ g
---- bit of a hack to get new random generators after each creature's update
--defaultImpulsive ::
-- [World -> Creature -> Creature] ->
-- Creature ->
-- World ->
-- World
--defaultImpulsive
-- = fmap (fmap updateRandGen) . crUpdate . impulsiveAIBefore . chainCreatureUpdates
-- where
-- updateRandGen w =
-- let (_, g) = randomR (0, 1 :: Int) (_randGen w)
-- in w & randGen .~ g
chooseMovementPistol :: Creature -> World -> Action
chooseMovementPistol cr w =