Start refactoring held item use

This commit is contained in:
2022-07-20 16:03:35 +01:00
parent 2c6e5e818a
commit eeb98eb151
18 changed files with 164 additions and 109 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import Dodge.Data
import Dodge.Inventory
import Dodge.Reloading
import Dodge.Item.Location
import Dodge.HeldUse
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
@@ -25,7 +26,7 @@ useItem cr' w = fromMaybe (f w) $ do
itemEffect :: Creature -> Item -> World -> World
itemEffect cr it w = case it ^? itUse of
Just RightUse {_rUse = eff,_useMods = usemods}
-> hammerTest $ tryReload cr it w $ foldr ($) eff usemods it cr
-> hammerTest $ tryReload cr it w $ foldr ($) (useHeld eff) usemods it cr
Just LeftUse {} -> doequipmentchange
Just EquipUse{} -> doequipmentchange
-- ConsumeUse will cause problems if the item is not selected