This commit is contained in:
2025-05-31 08:17:26 +01:00
parent cdf300b824
commit ceb7a4f04c
6 changed files with 99 additions and 133 deletions
+5 -8
View File
@@ -9,7 +9,7 @@ import qualified IntMapHelp as IM
import LensHelp
getCrDexterity :: Creature -> Int
getCrDexterity cr = _dexterity (_crStatistics cr)
getCrDexterity = _dexterity . _crStatistics
getCrMoveSpeed :: Creature -> Int
getCrMoveSpeed cr = strFromHeldItem cr + strFromEquipment cr + _strength (_crStatistics cr)
@@ -27,10 +27,7 @@ crCurrentEquipment :: Creature -> IM.IntMap Item
crCurrentEquipment = IM.filter (isJust . (^? itLocation . ilEquipSite . _Just)) . _crInv
strFromHeldItem :: Creature -> Int
strFromHeldItem cr
--x--- | _posture (_crStance cr) == Aiming || crIsReloading cr = negate $ fromMaybe 0 $ do
-- | _posture (_crStance cr) == Aiming = negate $ fromMaybe 0 $ do
| Aiming {} <- _posture (_crStance cr) = negate $ fromMaybe 0 $ do
i <- cr ^? crManipulation . manObject . imRootSelectedItem
cr ^? crInv . ix i . itUse . heldAim . aimWeight
| otherwise = 0
strFromHeldItem cr = fromMaybe 0 $ do
Aiming <- cr ^? crStance . posture
i <- cr ^? crManipulation . manObject . imRootSelectedItem
fmap negate $ cr ^? crInv . ix i . itUse . heldAim . aimWeight