This commit is contained in:
2021-12-05 12:29:01 +00:00
parent 1bb1a06101
commit d9c5cfc26d
22 changed files with 148 additions and 144 deletions
+2 -2
View File
@@ -111,6 +111,6 @@ equipSpeed _ = 1
{- | Speed modifier of an item when aiming. -}
equipAimSpeed :: Item -> Float -- TODO remove/rethink
equipAimSpeed it
| _itCombineType it == FRONTARMOUR = 0.5
| _itCombineType it == FLAMESHIELD = 0.5
| _itType it == FRONTARMOUR = 0.5
| _itType it == FLAMESHIELD = 0.5
| otherwise = 1
+1 -1
View File
@@ -11,7 +11,7 @@ import Control.Lens
crIsArmouredFrom :: Point2 -> Creature -> Bool
crIsArmouredFrom p cr
= p /= _crPos cr
&& any (\it -> it ^? itCombineType == Just FRONTARMOUR) (_crInv cr)
&& any (\it -> it ^? itType == Just FRONTARMOUR) (_crInv cr)
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
-- even though angleVV can generate NaN, the comparison seems to deal with it
+1 -1
View File
@@ -110,7 +110,7 @@ movementSideEff cr w
_ -> w
| otherwise = footstepSideEffect cr w
where
hasJetPack = any (\it -> it ^? itCombineType == Just JETPACK) $ _crInv cr
hasJetPack = any (\it -> it ^? itType == Just JETPACK) $ _crInv cr
oldPos = _crOldPos cr
momentum' = 0.97 *.* (_crPos cr -.- _crOldPos cr)
momentum'' | magV momentum' > 3 = 3 *.* normalizeV momentum'