Move held item scrolling into dedicated datatype

This commit is contained in:
2022-07-20 15:17:56 +01:00
parent 2755a4ffdd
commit 2c6e5e818a
10 changed files with 79 additions and 58 deletions
+5 -25
View File
@@ -10,6 +10,8 @@ circular imports are probably not a good idea.
{-# LANGUAGE DerivingStrategies #-}
module Dodge.Data
( module Dodge.Data
, module Dodge.Data.Item.HeldScroll
, module Dodge.Data.Item.Consumption
, module Dodge.Data.Gas
, module Dodge.Data.Ammo
, module Dodge.Data.Payload
@@ -56,6 +58,8 @@ module Dodge.Data
, module Dodge.Data.RadarBlip
, module Dodge.Data.PathGraph
) where
import Dodge.Data.Item.HeldScroll
import Dodge.Data.Item.Consumption
import Dodge.Data.Gas
import Dodge.Data.Ammo
import Dodge.Data.Payload
@@ -401,7 +405,7 @@ data ItemUse
, _useMods :: [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
, _useHammer :: HammerPosition
, _useAim :: AimParams
, _heldScroll :: Float -> Creature -> Item -> Item
, _heldScroll :: HeldScroll --Float -> Creature -> Item -> Item
}
| LeftUse
{ _lUse :: Item -> Creature -> World -> World
@@ -428,29 +432,6 @@ data Equipment = Equipment
_itUseAimStance :: Item -> AimStance
_itUseAimStance = _aimStance . _useAim . _itUse
data ItemConsumption
= LoadableAmmo
{ _laAmmoType :: AmmoType
, _laMax :: Int
, _laLoaded :: Int
, _laPrimed :: Bool
, _laCycle :: [LoadAction]
, _laProgress :: Maybe [LoadAction]
}
| AutoRecharging
{ _arLoaded :: Int
, _arMax :: Int
, _arTime :: Int
, _arProgress :: Int
}
| ChargeableAmmo
{ _wpMaxCharge :: Int
, _wpCharge :: Int
}
| ItemItselfConsumable
{ _icAmount :: IcAmount
}
| NoConsumption
data Item = Item
{ _itConsumption :: ItemConsumption
, _itUse :: ItemUse
@@ -1279,7 +1260,6 @@ makeLenses ''Item
makeLenses ''ItemUse
makeLenses ''ItEffect
makeLenses ''FloorItem
makeLenses ''ItemConsumption
makeLenses ''TweakParam
makeLenses ''Prop
makeLenses ''Proj