Fold aiming parameters into item use datatype
This commit is contained in:
@@ -22,7 +22,7 @@ crMvBy p' cr = advanceStepCounter (magV p) cr
|
||||
= product $ map equipAimSpeed $ IM.elems $ _crInv cr
|
||||
| otherwise = product $ map equipSpeed $ IM.elems $ _crInv cr
|
||||
aimingFactor
|
||||
| _posture (_crStance cr) == Aiming = fromMaybe 1 $ it ^? itAimingSpeed
|
||||
| _posture (_crStance cr) == Aiming = fromMaybe 1 $ it ^? itUse . useAim . aimSpeed
|
||||
| otherwise = 1
|
||||
it = _crInv cr IM.! _crInvSel cr
|
||||
|
||||
@@ -40,7 +40,7 @@ crMvAbsolute p' cr = advanceStepCounter (magV p) cr
|
||||
= product $ map equipAimSpeed $ IM.elems $ _crInv cr
|
||||
| otherwise = product $ map equipSpeed $ IM.elems $ _crInv cr
|
||||
aimingFactor
|
||||
| _posture (_crStance cr) == Aiming = fromMaybe 1 $ it ^? itAimingSpeed
|
||||
| _posture (_crStance cr) == Aiming = fromMaybe 1 $ it ^? itUse . useAim . aimSpeed
|
||||
| otherwise = 1
|
||||
it = _crInv cr IM.! _crInvSel cr
|
||||
|
||||
|
||||
@@ -182,17 +182,17 @@ scalp cr
|
||||
fhead = colorSH (greyN 0.9) . upperPrismPolyHalf 5 $ polyCirc 4 5
|
||||
|
||||
oneH :: Creature -> Bool
|
||||
oneH cr = crIsAiming' cr && crIt ^? itAimStance == Just OneHand
|
||||
oneH cr = crIsAiming' cr && crIt ^? itUse . useAim . aimStance == Just OneHand
|
||||
where
|
||||
crIt = _crInv cr IM.! _crInvSel cr
|
||||
|
||||
twoFlat :: Creature -> Bool
|
||||
twoFlat cr = crIsAiming' cr && crIt ^? itAimStance == Just TwoHandFlat
|
||||
twoFlat cr = crIsAiming' cr && crIt ^? itUse . useAim . aimStance == Just TwoHandFlat
|
||||
where
|
||||
crIt = _crInv cr IM.! _crInvSel cr
|
||||
|
||||
twists :: Creature -> Bool
|
||||
twists cr = crIsAiming' cr && crIt ^? itAimStance == Just TwoHandTwist
|
||||
twists cr = crIsAiming' cr && crIt ^? itUse . useAim . aimStance == Just TwoHandTwist
|
||||
where
|
||||
crIt = _crInv cr IM.! _crInvSel cr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user