Cleanup (remove momentum code)

This commit is contained in:
2025-06-19 13:51:57 +01:00
parent add192741c
commit c035f82b0e
+5 -20
View File
@@ -62,10 +62,8 @@ crUpdate f =
foldCr foldCr
[ doDamage -- these two [ doDamage -- these two
, checkDeath -- must be in this order 24/7/22 , checkDeath -- must be in this order 24/7/22
-- , internalCreatureUpdate
, footstepSideEffect , footstepSideEffect
, f , f
-- , footstepSideEffect
-- , updateInv -- upInv must be called before invSideEff 22.05.23 -- , updateInv -- upInv must be called before invSideEff 22.05.23
, invRootItemEffs , invRootItemEffs
, invSideEff , invSideEff
@@ -119,9 +117,6 @@ scorchSPic = _1 %~ overColSH (mixColors 0.9 0.1 black . normalizeColor)
poisonSPic :: SPic -> SPic poisonSPic :: SPic -> SPic
poisonSPic = _1 %~ overColSH (mixColors 0.5 0.5 green . normalizeColor) poisonSPic = _1 %~ overColSH (mixColors 0.5 0.5 green . normalizeColor)
internalCreatureUpdate :: Creature -> World -> World
internalCreatureUpdate cr = cWorld . lWorld . creatures . ix (_crID cr) %~ updateMovement
{- | Drop items according to the creature state. {- | Drop items according to the creature state.
TODO make sure this doesn't mess up any ItemPosition TODO make sure this doesn't mess up any ItemPosition
-} -}
@@ -421,18 +416,8 @@ setRBCreatureTargeting cr w ituse
cpos <- w ^? cWorld . lWorld . creatures . ix cid . crPos cpos <- w ^? cWorld . lWorld . creatures . ix cid . crPos
Just $ hasLOS cpos (_crPos cr) w Just $ hasLOS cpos (_crPos cr) w
updateMovement :: Creature -> Creature --isFrictionless :: Creature -> Bool
updateMovement cr --isFrictionless cr = case cr ^? crStance . carriage of
| isFrictionless cr = over crPos (+.+ momentum) cr -- Just (Boosting _) -> True
| otherwise = cr & crStance %~ updateWalkCycle -- Just Floating -> True
where -- _ -> False
momentum' = 0.98 *.* (_crPos cr - _crOldPos cr)
momentum
| magV momentum' > 1 = normalizeV momentum'
| otherwise = momentum'
isFrictionless :: Creature -> Bool
isFrictionless cr = case cr ^? crStance . carriage of
Just (Boosting _) -> True
Just Floating -> True
_ -> False