Continue weapon effect chain work
Start work on using muzzles to determine the effect of the ammo when loaded
This commit is contained in:
@@ -214,7 +214,7 @@ withWarmUp soundID f item cr w
|
||||
& soundContinue (CrWeaponSound cid 0) (_crPos cr) soundID (Just 2)
|
||||
| otherwise =
|
||||
w
|
||||
& pointertoitem . itUse . heldDelay . warmTime .~ maxWarmUp
|
||||
& pointertoitem . itUse . heldDelay . warmTime .~ (maxWarmUp + 1)
|
||||
& f item cr
|
||||
where
|
||||
item' = _ldtValue item
|
||||
@@ -376,8 +376,15 @@ useAmmoAmount amAmount eff item cr = fromMaybe id $ do
|
||||
Applies a world effect after an item use cooldown check.
|
||||
-}
|
||||
useTimeCheck :: ChainEffect
|
||||
useTimeCheck f item cr w = case item ^? ldtValue . itUse . heldDelay . rateTime of
|
||||
Just 0 -> f item cr $ setUseTime w
|
||||
useTimeCheck f item cr w = case item ^? ldtValue . itUse . heldDelay of
|
||||
Just (FixedRate _ 0) -> f item cr $ setUseTime w
|
||||
Just (FixedRate _ _) -> w
|
||||
Just (WarmUpNoDelay wt wm ws) | wt < wm -> w
|
||||
& soundContinue (CrWeaponSound cid 0) (_crPos cr) ws (Just 2)
|
||||
& cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . warmTime +~2
|
||||
Just (WarmUpNoDelay _ wm _) -> f item cr w
|
||||
& cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . warmTime .~ (wm+1)
|
||||
Just NoDelay -> f item cr w
|
||||
_ -> w
|
||||
where
|
||||
cid = _crID cr
|
||||
|
||||
Reference in New Issue
Block a user