Cleanup
This commit is contained in:
@@ -50,22 +50,22 @@ crHoldReloading cr w =
|
||||
|
||||
tryStartLoading :: Creature -> Creature
|
||||
tryStartLoading cr = case cr ^? crInv . ix (crSel cr) . itUse . heldConsumption of
|
||||
Just hc -> tryStartLoading' hc cr
|
||||
Just hc -> startLoading hc cr
|
||||
Nothing -> cr
|
||||
|
||||
tryStartLoading' :: HeldConsumption -> Creature -> Creature
|
||||
tryStartLoading' ic cr = case ic ^? laProgress . _Just . ix 0 of
|
||||
Just la -> cr & startLoadAction la
|
||||
startLoading :: HeldConsumption -> Creature -> Creature
|
||||
startLoading ic cr = case ic ^? laProgress . _Just . ix 0 of
|
||||
Just la -> cr & startLoadingStep la
|
||||
Nothing -> case ic ^? laCycle of
|
||||
Nothing -> cr
|
||||
Just [] -> error ("item has empty load cycle" ++ show (cr ^?! crInv . ix (crSel cr) . itType))
|
||||
Just _ | _laLoaded ic >= _laMax ic -> cr
|
||||
Just (la : las) ->
|
||||
cr & startLoadAction la
|
||||
cr & startLoadingStep la
|
||||
& crInv . ix (crSel cr) . itUse . heldConsumption . laProgress ?~ (la : las)
|
||||
|
||||
startLoadAction :: LoadAction -> Creature -> Creature
|
||||
startLoadAction la cr = cr & crInvSel . iselAction .~ ReloadAction (_actionTime la) la NoHammer
|
||||
startLoadingStep :: LoadAction -> Creature -> Creature
|
||||
startLoadingStep la cr = cr & crInvSel . iselAction .~ ReloadAction (_actionTime la) la NoHammer
|
||||
|
||||
rotateActionProgress :: HeldConsumption -> HeldConsumption
|
||||
rotateActionProgress ic = case ic ^? laProgress . _Just of
|
||||
|
||||
Reference in New Issue
Block a user