From 86173f9f6a2f4254462afc83bf51cfcd4a19f0d8 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 4 Jan 2025 21:08:46 +0000 Subject: [PATCH] Cleanup --- src/Dodge/Base/Arithmetic.hs | 10 ---------- src/Dodge/Creature/State.hs | 5 +---- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 src/Dodge/Base/Arithmetic.hs diff --git a/src/Dodge/Base/Arithmetic.hs b/src/Dodge/Base/Arithmetic.hs deleted file mode 100644 index 5a7ef4d01..000000000 --- a/src/Dodge/Base/Arithmetic.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Dodge.Base.Arithmetic where -import MaybeHelp - -decreaseToZero :: Int -> Int -decreaseToZero = max 0 . subtract 1 - -decreaseToNothing' :: (Num a, Ord a) => Maybe' a -> Maybe' a -decreaseToNothing' ma = case ma of - Just' x | x > 0 -> Just' (x - 1) - _ -> Nothing' diff --git a/src/Dodge/Creature/State.hs b/src/Dodge/Creature/State.hs index 71db43f2b..45324ac23 100644 --- a/src/Dodge/Creature/State.hs +++ b/src/Dodge/Creature/State.hs @@ -159,7 +159,7 @@ applyPastDamages cr w -- a map updating all inventory items updateInv :: Creature -> World -> World updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv . each - . itUse . heldDelay %~ useDelayUpdate + . itUse . heldDelay . warmTime %~ (max 0 . subtract 1) -- a loop going over all inventory items invSideEff :: Creature -> World -> World @@ -426,9 +426,6 @@ setRBCreatureTargeting cr w ituse cpos <- w ^? cWorld . lWorld . creatures . ix cid . crPos Just $ hasLOS cpos (_crPos cr) w -useDelayUpdate :: UseDelay -> UseDelay -useDelayUpdate = ( warmTime %~ decreaseToZero) - --updateAutoRecharge :: Item -> Item --updateAutoRecharge it = case it ^? itUse . leftConsumption of -- Just (AutoRecharging l m t p)