Remove creature move type record

This commit is contained in:
2025-06-06 15:32:19 +01:00
parent e9b69be7de
commit 7292bc9012
16 changed files with 193 additions and 183 deletions
+34 -4
View File
@@ -1,7 +1,9 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Creature.Statistics (
getCrMoveSpeed,
getCrDexterity,
crStrength,
crDexterity,
crIntelligence,
) where
import Data.Maybe
@@ -9,11 +11,39 @@ import Dodge.Data.Creature
import qualified IntMapHelp as IM
import LensHelp
getCrDexterity :: Creature -> Int
getCrDexterity = _dexterity . _crStatistics
crDexterity :: Creature -> Int
crDexterity cr = case cr ^. crType of
Avatar { _avDexterity = x } -> x
AvatarDead -> 0
ChaseCrit {} -> 46
SwarmCrit -> 46
AutoCrit -> 46
BarrelCrit {} -> 0
LampCrit {} -> 0
crStrength :: Creature -> Int
crStrength cr = case cr ^. crType of
Avatar { _avStrength = x } -> x
AvatarDead -> 0
ChaseCrit {} -> 46
SwarmCrit -> 40
AutoCrit -> 46
BarrelCrit {} -> 0
LampCrit {} -> 0
crIntelligence :: Creature -> Int
crIntelligence cr = case cr ^. crType of
Avatar { _avIntelligence = x } -> x
AvatarDead -> 0
ChaseCrit {} -> 20
SwarmCrit -> 20
AutoCrit -> 20
BarrelCrit {} -> 0
LampCrit {} -> 0
getCrMoveSpeed :: Creature -> Int
getCrMoveSpeed cr = strFromHeldItem cr + strFromEquipment cr + _strength (_crStatistics cr)
getCrMoveSpeed cr = strFromHeldItem cr + strFromEquipment cr + crStrength cr
strFromEquipment :: Creature -> Int
strFromEquipment = sum . fmap equipmentStrValue . crCurrentEquipment