Fold in more ammo parameters, distinguish loadable and charging weapons

This commit is contained in:
2021-11-27 14:29:44 +00:00
parent 92a8dd59b8
commit 224db733f6
19 changed files with 112 additions and 111 deletions
+17 -10
View File
@@ -290,31 +290,38 @@ data ItemPos
= InInv { _itCrId :: Int , _itInvId :: Int }
| OnFloor { _itFlID :: Int }
data ItemUse
= RightUse { _rUse :: Item -> Creature -> World -> World }
| LeftUse { _lUse :: Creature -> Int -> World -> World }
= RightUse
{ _rUse :: Item -> Creature -> World -> World
}
| LeftUse
{ _lUse :: Creature -> Int -> World -> World
}
| NoUse
data ItemAmmo
= LoadableAmmo
{ _aoType :: AmmoType
, _wpMaxAmmo :: Int
, _wpLoadedAmmo :: Int
, _wpReloadTime :: Int
, _wpReloadState :: Int
, _wpReloadType :: ReloadType
}
| ChargeableAmmo
{ _wpMaxCharge :: Int
, _wpCharge :: Int
}
data Item
= Weapon
{ _itName :: String
, _wpAmmo :: ItemAmmo
, _wpReloadTime :: Int
, _wpReloadState :: Int
, _wpReloadType :: ReloadType
, _wpMaxWarmUp :: Int
, _wpCurWarmUp :: Int
, _wpMaxCoolDown :: Int
, _wpCurCoolDown :: Int
, _wpMaxWarmUp :: Int
, _wpCurWarmUp :: Int
, _wpMaxCoolDown :: Int
, _wpCurCoolDown :: Int
, _itUseRate :: Int
, _itUseTime :: Int
, _itUse :: ItemUse
, _itUseModifiers :: [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
--, _itLeftClickUse :: Maybe (Creature -> Int -> World -> World)
, _wpSpread :: Float
, _wpRange :: Float
, _itHammer :: HammerPosition