First implementation of creatures detecting sounds

This commit is contained in:
2021-09-08 21:56:58 +01:00
parent c3d567353c
commit a2288110ae
8 changed files with 22 additions and 20 deletions
+3 -1
View File
@@ -47,7 +47,9 @@ tryMeleeAttack cr tcr
setMvPos :: Creature -> Reader World Creature
setMvPos cr = pure $ cr & crMvTarget .~ mpos
where
mpos = (_crPos <$> _crTarget cr) <|> listToMaybe (_soundsToInvestigate $ _crMemory cr)
mpos = (_crPos <$> _crTarget cr)
<|> _crMvTarget cr
<|> listToMaybe (_soundsToInvestigate $ _crMemory cr)
setTargetMv
:: (Creature -> Reader World (Maybe Creature)) -- ^ Function for determining target