Make aiming speed be gouverned by strength
This commit is contained in:
@@ -3,18 +3,20 @@ module Dodge.Creature.Statistics
|
||||
) where
|
||||
import Dodge.Data
|
||||
import qualified IntMapHelp as IM
|
||||
import LensHelp
|
||||
|
||||
import Data.Maybe
|
||||
import Data.IntMap.Merge.Strict
|
||||
|
||||
getCrStrength :: Creature -> Int
|
||||
getCrStrength cr = strFromEquipment cr + _crStrength (_crStatistics cr)
|
||||
getCrStrength cr = strFromHeldItem cr + strFromEquipment cr + _crStrength (_crStatistics cr)
|
||||
|
||||
strFromEquipment :: Creature -> Int
|
||||
strFromEquipment = sum . fmap equipmentStrValue . crCurrentEquipment
|
||||
|
||||
equipmentStrValue :: Item -> Int
|
||||
equipmentStrValue itm = case _itType itm of
|
||||
FRONTARMOUR -> negate 2
|
||||
FRONTARMOUR -> negate 1
|
||||
POWERLEGS -> 3
|
||||
_ -> 0
|
||||
|
||||
@@ -23,3 +25,8 @@ crCurrentEquipment cr = merge dropMissing dropMissing (zipWithMatched (\_ _ itm
|
||||
(_crInvEquipped cr)
|
||||
(_crInv cr)
|
||||
|
||||
strFromHeldItem :: Creature -> Int
|
||||
strFromHeldItem cr
|
||||
| _posture (_crStance cr) == Aiming || _posture (_crStance cr) == Reloading
|
||||
= negate $ fromMaybe 0 $ cr ^? crInv . ix (_crInvSel cr) . itUse . useAim . aimWeight
|
||||
| otherwise = 0
|
||||
|
||||
Reference in New Issue
Block a user