Held item rclick use, tweak reload on lclick
This commit is contained in:
@@ -5,8 +5,6 @@ module Dodge.Creature.Impulse.UseItem (
|
||||
useItemHotkey,
|
||||
) where
|
||||
|
||||
import Dodge.Inventory.RBList
|
||||
import Dodge.Hotkey
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Foldable
|
||||
@@ -15,7 +13,9 @@ import Dodge.Cuse
|
||||
import Dodge.Data.World
|
||||
import Dodge.Euse
|
||||
import Dodge.HeldUse
|
||||
import Dodge.Hotkey
|
||||
import Dodge.Inventory
|
||||
import Dodge.Item.Location
|
||||
import Dodge.Luse
|
||||
import Dodge.Reloading
|
||||
import qualified IntMapHelp as IM
|
||||
@@ -28,6 +28,7 @@ useItemRightClick cr' w = fromMaybe (f w) $ do
|
||||
return $
|
||||
itemEffect cr it w
|
||||
& worldEventFlags . at InventoryChange ?~ ()
|
||||
& f
|
||||
where
|
||||
f = cWorld . lWorld . creatures . ix (_crID cr') . crHammerPosition .~ HammerDown
|
||||
|
||||
@@ -35,6 +36,7 @@ itemEffect :: Creature -> Item -> World -> World
|
||||
itemEffect cr it w = case it ^. itUse of
|
||||
HeldUse{_heldUse = eff, _heldMods = usemods} ->
|
||||
foldl' (&) (useHeld eff) (useMod usemods) it cr w
|
||||
& pointerToItem it . itUse . heldHammer .~ HammerDown
|
||||
LeftUse{} -> doequipmentchange
|
||||
EquipUse{} -> doequipmentchange
|
||||
-- ConsumeUse will cause problems if the item is not selected
|
||||
|
||||
Reference in New Issue
Block a user