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