Allow for partial reloading

This commit is contained in:
2021-12-01 17:40:09 +00:00
parent d75ea2b252
commit 016a1faf80
21 changed files with 181 additions and 143 deletions
+15 -7
View File
@@ -314,11 +314,11 @@ _itUseAimStance = _aimStance . _useAim . _itUse
data ItemConsumption
= LoadableAmmo
{ _aoType :: AmmoType
, _wpMaxAmmo :: Int
, _wpLoadedAmmo :: Int
, _wpReloadTime :: Int
, _wpReloadState :: Int
, _wpReloadType :: ReloadType
, _ammoMax :: Int
, _ammoLoaded :: Int
, _reloadTime :: Int
, _reloadState :: Maybe' Int
, _reloadType :: ReloadType
}
| ChargeableAmmo
{ _wpMaxCharge :: Int
@@ -424,7 +424,10 @@ data ItemDimension = ItemDimension
, _muzzleLength :: Float
}
data ReloadType = ActiveReload | PassiveReload SoundID
data ReloadType
= ActiveReload
| PartialActive Int
| PassiveReload SoundID
-- I believe this is called every frame, not sure when though
data ItEffect
@@ -721,7 +724,11 @@ data WallStructure
, _wlStDamCreature :: DamageType -> Wall -> Int -> World -> World
}
-- | Strict maybe
data Maybe' a = Just' a | Nothing'
data Maybe' a = Just' {__Just' :: a} | Nothing'
deriving (Eq,Ord,Show)
strictify :: Maybe a -> Maybe' a
strictify Nothing = Nothing'
strictify (Just x) = Just' x
data ActionPlan
= Inanimate
@@ -921,3 +928,4 @@ makeLenses ''Universe
makeLenses ''LSParam
makeLenses ''ItemParams
makeLenses ''ItemTweaks
makeLenses ''Maybe'