Assorted changes, cleanup menu selection text
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user