Cleanup
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
module Dodge.Creature.Statistics
|
||||
( getCrStrength
|
||||
, getCrDexterity
|
||||
) where
|
||||
import Dodge.Data
|
||||
module Dodge.Creature.Statistics (
|
||||
getCrStrength,
|
||||
getCrDexterity,
|
||||
) where
|
||||
|
||||
--import Data.Strict.IntMap.Autogen.Merge.Strict
|
||||
import Data.IntMap.Merge.Strict
|
||||
import Data.Maybe
|
||||
import Dodge.Creature.Test
|
||||
import Dodge.Data
|
||||
import qualified IntMapHelp as IM
|
||||
import LensHelp
|
||||
|
||||
import Data.Maybe
|
||||
import Data.Strict.IntMap.Autogen.Merge.Strict
|
||||
--import Data.IntMap.Merge.Strict
|
||||
|
||||
getCrDexterity :: Creature -> Int
|
||||
getCrDexterity cr = _dexterity (_crStatistics cr)
|
||||
|
||||
@@ -23,16 +23,20 @@ strFromEquipment = sum . fmap equipmentStrValue . crCurrentEquipment
|
||||
equipmentStrValue :: Item -> Int
|
||||
equipmentStrValue itm = case _iyBase $ _itType itm of
|
||||
EQUIP FRONTARMOUR -> negate 3
|
||||
EQUIP POWERLEGS -> 3
|
||||
EQUIP POWERLEGS -> 3
|
||||
_ -> 0
|
||||
|
||||
crCurrentEquipment :: Creature -> IM.IntMap Item
|
||||
crCurrentEquipment cr = merge dropMissing dropMissing (zipWithMatched (\_ _ itm -> itm))
|
||||
(_crInvEquipped cr)
|
||||
(_crInv cr)
|
||||
crCurrentEquipment cr =
|
||||
merge
|
||||
dropMissing
|
||||
dropMissing
|
||||
(zipWithMatched (\_ _ itm -> itm))
|
||||
(_crInvEquipped cr)
|
||||
(_crInv cr)
|
||||
|
||||
strFromHeldItem :: Creature -> Int
|
||||
strFromHeldItem cr
|
||||
| _posture (_crStance cr) == Aiming || crIsReloading cr
|
||||
= negate $ fromMaybe 0 $ cr ^? crInv . ix (crSel cr) . itUse . useAim . aimWeight
|
||||
| _posture (_crStance cr) == Aiming || crIsReloading cr =
|
||||
negate $ fromMaybe 0 $ cr ^? crInv . ix (crSel cr) . itUse . useAim . aimWeight
|
||||
| otherwise = 0
|
||||
|
||||
Reference in New Issue
Block a user