Make aiming speed be gouverned by strength

This commit is contained in:
2022-05-22 14:33:34 +01:00
parent 6891bd7541
commit fd40da2d4a
15 changed files with 35 additions and 37 deletions
+2 -11
View File
@@ -3,7 +3,7 @@ import Dodge.Data
import Dodge.Creature.Statistics
import Geometry
import Data.Maybe
--import Data.Maybe
--import qualified Data.IntMap.Strict as IM
import Control.Lens
{- | Creature attempts to moves under its own steam.
@@ -23,16 +23,7 @@ crMvAbsolute p' cr = advanceStepCounter (magV p) cr
& crPos %~ (+.+ p)
& crMvDir .~ argV p
where
--p = (equipFactor * aimingFactor) *.* p'
p = (strengthFactor (getCrStrength cr) * aimingFactor) *.* p'
isAiming = _posture (_crStance cr) == Aiming || _posture (_crStance cr) == Reloading
invItSpeed
| isAiming = equipAimSpeed
| otherwise = equipSpeed
equipFactor = product $ invItSpeed <$> _crInv cr
aimingFactor
| isAiming = fromMaybe 1 $ cr ^? crInv . ix (_crInvSel cr) . itUse . useAim . aimSpeed
| otherwise = 1
p = strengthFactor (getCrStrength cr) *.* p'
strengthFactor :: Int -> Float
strengthFactor i