Cleanup launchers

This commit is contained in:
2022-03-02 08:36:16 +00:00
parent b3ba0697b4
commit be1fda266a
7 changed files with 44 additions and 60 deletions
+5 -5
View File
@@ -1,4 +1,8 @@
module Dodge.Reloading where
module Dodge.Reloading
( stepReloading
, startReloadingWeapon
, crStopReloading
) where
import Dodge.Data
import Dodge.Base
--import qualified Data.IntMap.Strict as IM
@@ -6,7 +10,6 @@ import Dodge.Base
--import Data.Maybe
import Control.Lens
startReloadingWeapon :: Creature -> World -> Maybe World
startReloadingWeapon cr = (creatures . ix (_crID cr) . crInv . ix (_crInvSel cr))
icTryStartReloading
@@ -23,9 +26,6 @@ icTryStartReloading it
crStopReloading :: Creature -> Creature
crStopReloading cr = cr & crInv . ix (_crInvSel cr) . itConsumption . reloadState .~ Nothing'
crUpCrUp :: (Creature -> Creature) -> Creature -> World -> World
crUpCrUp f cr = creatures . ix (_crID cr) %~ f
stepReloading :: Creature -> Creature
stepReloading cr = case cr ^? crInv . ix isel . itConsumption . reloadState . _Just' of
Just 0 -> cr & crInv . ix isel %~ doload