Improve item use hammer, improve wide laser
This commit is contained in:
@@ -281,7 +281,6 @@ youDropItem' w = case yourItem w ^? _Just . itCurseStatus of
|
||||
copyInvItemToFloor :: Creature -> Int -> World -> World
|
||||
copyInvItemToFloor cr i = copyItemToFloor (_crPos cr)
|
||||
$ _crInv cr IM.! i
|
||||
& itPos .~ VoidItm
|
||||
& itIsHeld .~ False
|
||||
|
||||
sizeSelf :: Float -> Creature -> World -> Maybe World
|
||||
|
||||
@@ -44,8 +44,8 @@ tryClickReload :: Creature -> Item -> World -> (World -> World) -> World -> Worl
|
||||
tryClickReload cr it w f
|
||||
| _crID cr == _yourID w && itNeedsLoading it && _mouseButtons w M.!? SDL.ButtonLeft == Just False
|
||||
= crToggleReloading cr
|
||||
| otherwise =
|
||||
(runIdentity . pointToItem (_itPos it) (return . (itUse . useHammer' .~ HammerDown)))
|
||||
| otherwise
|
||||
= (runIdentity . pointToItem (_itPos it) (return . (itUse . useHammer .~ HammerDown)))
|
||||
. f
|
||||
|
||||
itNeedsLoading :: Item -> Bool
|
||||
@@ -96,12 +96,15 @@ toggleEquipmentAt rbops invid cr w = case rbops ^? opAllocateEquipment of
|
||||
useLeftItem :: Int -> World -> World
|
||||
useLeftItem cid w
|
||||
| _crInvLock cr = w
|
||||
| itmShouldBeUsed = useItem cr w
|
||||
| itmShouldBeUsed = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| otherwise = fromMaybe w $ do
|
||||
invid <- _crLeftInvSel cr
|
||||
itm <- cr ^? crInv . ix invid
|
||||
f <- cr ^? crInv . ix invid . itUse . lUse
|
||||
return $ f itm cr w
|
||||
f <- cr ^? crInv . ix invid . itUse . lUse
|
||||
return
|
||||
. (runIdentity . pointToItem (_itPos itm) (return . (itUse . useHammer .~ HammerDown)))
|
||||
. f itm cr
|
||||
$ w
|
||||
where
|
||||
cr = _creatures w IM.! cid
|
||||
itmShouldBeUsed = isJust (cr ^? crInv . ix (crSel cr) . itUse . cUse)
|
||||
|
||||
@@ -195,7 +195,7 @@ movementSideEff cr w
|
||||
(randAng,_) = randomR (0,2*pi) $ _randGen w
|
||||
|
||||
useUpdate :: ItemUse -> ItemUse
|
||||
useUpdate = (useHammer' %~ moveHammerUp)
|
||||
useUpdate = (useHammer %~ moveHammerUp)
|
||||
. (useDelay . warmTime %~ decreaseToZero)
|
||||
. (useDelay . rateTime %~ decreaseToZero)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user