Push item use delay inside datatype, currently broken
This commit is contained in:
@@ -20,6 +20,54 @@ defaultAmmo = LoadableAmmo
|
||||
, _wpReloadType = ActiveReload
|
||||
}
|
||||
|
||||
ruseRate :: Int
|
||||
-> (Item -> Creature -> World -> World)
|
||||
-> HammerType
|
||||
-> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||
-> ItemUse
|
||||
ruseRate i f ht usemods = RightUse
|
||||
{ _rUse = f
|
||||
, _useDelay = DelayRate
|
||||
{ _rateMax = i
|
||||
, _rateTime = 0
|
||||
}
|
||||
, _useMods = usemods
|
||||
, _useHammer = ht
|
||||
}
|
||||
|
||||
ruseInstant
|
||||
:: (Item -> Creature -> World -> World)
|
||||
-> HammerType
|
||||
-> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||
-> ItemUse
|
||||
ruseInstant f ht usemods = RightUse
|
||||
{ _rUse = f
|
||||
, _useDelay = NoDelay
|
||||
, _useMods = usemods
|
||||
, _useHammer = ht
|
||||
}
|
||||
|
||||
defaultrUse :: ItemUse
|
||||
defaultrUse = RightUse
|
||||
{ _rUse = \_ _ -> id
|
||||
, _useDelay = DelayRate {_rateMax = 8, _rateTime = 0}
|
||||
, _useMods = []
|
||||
, _useHammer = HasHammer HammerUp
|
||||
}
|
||||
defaultlUse :: ItemUse
|
||||
defaultlUse = LeftUse
|
||||
{ _lUse = \_ _ -> id
|
||||
, _itUseDelay = DelayRate {_rateMax = 8, _rateTime = 0}
|
||||
, _itHammer = NoHammer
|
||||
}
|
||||
|
||||
luseInstantNoH :: (Creature -> Int -> World -> World) -> ItemUse
|
||||
luseInstantNoH f = LeftUse
|
||||
{ _lUse = f
|
||||
, _itUseDelay = NoDelay
|
||||
, _itHammer = NoHammer
|
||||
}
|
||||
|
||||
defaultGun :: Item
|
||||
defaultGun = Weapon
|
||||
{ _itName = "default"
|
||||
@@ -30,13 +78,9 @@ defaultGun = Weapon
|
||||
, _wpCurWarmUp = 0
|
||||
, _wpMaxCoolDown = 0
|
||||
, _wpCurCoolDown = 0
|
||||
, _itUseRate = 8
|
||||
, _itUseTime = 0
|
||||
, _itUse = RightUse $ \_ _ -> id
|
||||
, _itUseModifiers = []
|
||||
, _itUse = defaultrUse
|
||||
, _wpSpread = 0.02
|
||||
, _wpRange = 20
|
||||
, _itHammer = HammerUp
|
||||
, _itFloorPict = const $ noPic $ colorSH green (prismPoly
|
||||
(map (addZ 3) $ rectNESW 3 3 (-3) (-3))
|
||||
(map (addZ 0) $ rectNESW 5 3 (-5) (-7))
|
||||
|
||||
Reference in New Issue
Block a user