Cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user