Implement targeting launcher shells using separate item
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module Dodge.Creature.Impulse.UseItem (
|
||||
useRootItem,
|
||||
useItemLeftClick,
|
||||
itemEffect,
|
||||
itemUseEffect,
|
||||
useItemHotkey,
|
||||
) where
|
||||
|
||||
@@ -29,11 +29,11 @@ useRootItem crid w = fromMaybe w $ do
|
||||
itRef <- cr ^? crManipulation . manObject . imRootItem
|
||||
it <- invTrees (_crInv cr) ^? ix itRef
|
||||
return $
|
||||
itemEffect cr it w
|
||||
itemUseEffect cr it w
|
||||
& worldEventFlags . at InventoryChange ?~ ()
|
||||
|
||||
itemEffect :: Creature -> LabelDoubleTree ComposeLinkType Item -> World -> World
|
||||
itemEffect cr it w = case it ^. ldtValue . itUse of
|
||||
itemUseEffect :: Creature -> LabelDoubleTree ComposeLinkType Item -> World -> World
|
||||
itemUseEffect cr it w = case it ^. ldtValue . itUse of
|
||||
HeldUse{ _heldMods = usemods} ->
|
||||
heldEffect usemods it cr w
|
||||
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
||||
@@ -42,6 +42,7 @@ itemEffect cr it w = case it ^. ldtValue . itUse of
|
||||
(ConsumeUse eff) -> useC eff (_ldtValue it) cr w
|
||||
CraftUse{} -> w
|
||||
AttachUse{} -> selectUse it cr w
|
||||
TargetingUse {} -> w
|
||||
AmmoMagUse{} -> w
|
||||
ScopeUse{} -> w
|
||||
where
|
||||
@@ -118,7 +119,7 @@ useItemLeftClick' cr' w = fromMaybe w $ do
|
||||
itRef <- cr ^? crManipulation . manObject . imSelectedItem
|
||||
it <- invTrees (_crInv cr) ^? ix itRef
|
||||
return $
|
||||
itemEffect cr it w
|
||||
itemUseEffect cr it w
|
||||
& worldEventFlags . at InventoryChange ?~ ()
|
||||
-- & f
|
||||
-- where
|
||||
|
||||
Reference in New Issue
Block a user