Make armour slow only on aiming
This commit is contained in:
@@ -18,7 +18,10 @@ crMvBy
|
|||||||
crMvBy p' cr = advanceStepCounter (magV p) $ over crPos (+.+ p) cr
|
crMvBy p' cr = advanceStepCounter (magV p) $ over crPos (+.+ p) cr
|
||||||
where
|
where
|
||||||
p = (*.*) (equipFactor * aimingFactor) $ rotateV (_crDir cr) p'
|
p = (*.*) (equipFactor * aimingFactor) $ rotateV (_crDir cr) p'
|
||||||
equipFactor = product $ map equipSpeed $ IM.elems $ _crInv cr
|
equipFactor
|
||||||
|
| _posture (_crStance cr) == Aiming
|
||||||
|
= product $ map equipAimSpeed $ IM.elems $ _crInv cr
|
||||||
|
| otherwise = product $ map equipSpeed $ IM.elems $ _crInv cr
|
||||||
aimingFactor
|
aimingFactor
|
||||||
| _posture (_crStance cr) == Aiming = fromMaybe 1 $ it ^? itAimingSpeed
|
| _posture (_crStance cr) == Aiming = fromMaybe 1 $ it ^? itAimingSpeed
|
||||||
| otherwise = 1
|
| otherwise = 1
|
||||||
@@ -68,6 +71,6 @@ equipSpeed _ = 1
|
|||||||
equipAimSpeed :: Item -> Float
|
equipAimSpeed :: Item -> Float
|
||||||
equipAimSpeed NoItem = 1
|
equipAimSpeed NoItem = 1
|
||||||
equipAimSpeed it
|
equipAimSpeed it
|
||||||
| _itIdentity it == FrontArmour = 0.75
|
| _itIdentity it == FrontArmour = 0.5
|
||||||
| _itIdentity it == FlameShield = 0.75
|
| _itIdentity it == FlameShield = 0.5
|
||||||
| otherwise = 1
|
| otherwise = 1
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ yourControl w (f,g) cr =
|
|||||||
, Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr
|
, Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
speed = 3 * equipFactor
|
speed = 3
|
||||||
equipFactor = product $ map equipSpeed $ IM.elems $ _crInv $ _creatures w IM.! 0
|
|
||||||
{- | Turn key presses into creature movement. -}
|
{- | Turn key presses into creature movement. -}
|
||||||
wasdWithAiming
|
wasdWithAiming
|
||||||
:: World
|
:: World
|
||||||
|
|||||||
Reference in New Issue
Block a user