Continue to refactor item datatypes, add a shape to rockets

This commit is contained in:
2021-11-27 22:05:12 +00:00
parent 652af6b0a9
commit fe02739621
15 changed files with 135 additions and 78 deletions
+19 -9
View File
@@ -291,10 +291,20 @@ data ItemPos
| OnFloor { _itFlID :: Int }
data UseDelay -- should just be Delay
= NoDelay
| DelayRate
| FixedRate
{_rateMax :: Int
,_rateTime :: Int
}
| VariableRate
{_rateMax :: Int
,_rateTime :: Int
,_rateMaxMax :: Int
,_rateMinMax :: Int
}
| WarmUpNoDelay
{_warmTime :: Int
,_warmMax :: Int
}
data ItemUse
= RightUse
{ _rUse :: Item -> Creature -> World -> World
@@ -334,23 +344,19 @@ data Item
= Weapon
{ _itName :: String
, _wpAmmo :: ItemAmmo
, _wpMaxWarmUp :: Int
, _wpCurWarmUp :: Int
, _wpMaxCoolDown :: Int
, _wpCurCoolDown :: Int
, _itUse :: ItemUse
, _wpSpread :: Float
, _wpRange :: Float
, _itFloorPict :: Item -> SPic
, _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> SPic
, _itScroll :: Float -> Creature -> Item -> Item
, _itIdentity :: ItemIdentity
, _itScroll :: Float -> Creature -> Item -> Item
, _itIdentity :: ItemIdentity
, _itAttachment :: ItAttachment
, _itID :: Maybe Int
, _itEffect :: ItEffect
, _itEffect :: ItEffect
, _itInvDisplay :: Item -> String
, _itInvColor :: Color
, _itInvColor :: Color
, _itTargeting :: Maybe (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture)
, _itWorldTrigger :: Maybe (Int -> World -> Bool)
, _wpNumBarrels :: Int
@@ -433,6 +439,10 @@ data ReloadType = ActiveReload | PassiveReload SoundID
-- I believe this is called every frame, not sure when though
data ItEffect = NoItEffect
| ItSimpleInvEffect
{_itInvEffect :: ItEffect -> Creature -> Int -> World -> World
-- the Int is the items inventory position
}
| ItInvEffect
{_itInvEffect :: ItEffect -> Creature -> Int -> World -> World
-- the Int is the items inventory position