Assorted changes, cleanup menu selection text

This commit is contained in:
2022-04-25 23:27:39 +01:00
parent 67e6c4a5bd
commit fa8d8b5899
22 changed files with 217 additions and 108 deletions
+17 -3
View File
@@ -9,6 +9,7 @@ module Dodge.Creature.ReaderUpdate
, overrideInternal
, goToTarget
, flockACC
, chaseCritMv
, setMvPos
, setViewPos
) where
@@ -38,11 +39,16 @@ tryMeleeAttack cr tcr
where
cpos = _crPos cr
setMvPos :: Creature -> Creature
setMvPos cr = cr & crIntention . mvToPoint .~ mpos
setMvPos :: World -> Creature -> Creature
setMvPos w cr = cr & crIntention . mvToPoint .~ mpos
where
int = _crIntention cr
mpos = (_crPos <$> _targetCr int)
mtpos = do
tpos <- _crPos <$> _targetCr int
if hasLOS (_crPos cr) tpos w
then Just tpos
else Nothing
mpos = mtpos
<|> _mvToPoint int
-- <|> listToMaybe (_soundsToInvestigate $ _crMemory cr)
@@ -80,6 +86,14 @@ flockACC w cr = case cr ^? crIntention . targetCr . _Just of
else negate r *.* horDir
in cr & crIntention . mvToPoint ?~ tpos +.+ horShift
chaseCritMv :: World -> Creature -> Creature
chaseCritMv w cr = case _crStrategy (_crActionPlan cr) of
StrategyActions _ _ -> cr
WarningCry -> cr
_ -> case cr ^? crIntention . mvToPoint . _Just of
Just p -> cr & crActionPlan . crAction .~ [PathTo p]
_ -> viewTarget w cr
goToTarget :: World -> Creature -> Creature
goToTarget w cr =
case cr ^? crIntention . mvToPoint . _Just of