Refactor bullet particles
This commit is contained in:
@@ -2,6 +2,7 @@ module Dodge.Creature.State where
|
||||
import Dodge.Data
|
||||
import Dodge.Creature.State.Data
|
||||
import Dodge.Creature.Stance.Data
|
||||
--import Dodge.Creature.Test
|
||||
import Dodge.Base
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.RandomHelp
|
||||
@@ -40,7 +41,7 @@ stateUpdate u w (f,g) cr =
|
||||
((f',g') , maybeCr) ->
|
||||
( (invSideEff cr . movementSideEff cr . deathEff . f'
|
||||
, g')
|
||||
, fmap (updateReloadCounter . doDamage . crAutoReload) $ crOrCorpse =<< maybeCr
|
||||
, fmap (stepReloading . stepItemUseCooldown . doDamage . crAutoReload) $ crOrCorpse =<< maybeCr
|
||||
)
|
||||
where
|
||||
crOrCorpse cr'
|
||||
@@ -153,10 +154,16 @@ isFrictionless cr = case cr ^? crStance . carriage of
|
||||
Just Floating -> True
|
||||
_ -> False
|
||||
|
||||
updateReloadCounter :: Creature -> Creature
|
||||
updateReloadCounter cr = over (crInv . ix iSel . itUseTime) decreaseToZero
|
||||
. over (crInv . ix iSel . wpReloadState) decreaseToZero
|
||||
$ cr
|
||||
stepItemUseCooldown :: Creature -> Creature
|
||||
stepItemUseCooldown cr = over (crInv . ix iSel . itUseTime) decreaseToZero cr
|
||||
where
|
||||
iSel = _crInvSel cr
|
||||
|
||||
stepReloading :: Creature -> Creature
|
||||
stepReloading cr
|
||||
-- | crIsAiming' cr = cr
|
||||
-- | otherwise
|
||||
= over (crInv . ix iSel . wpReloadState) decreaseToZero cr
|
||||
where
|
||||
iSel = _crInvSel cr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user