Correctly reduce left click item delay
This commit is contained in:
@@ -110,7 +110,8 @@ toggleEquipmentAt rbops invid cr w = case rbops ^? opAllocateEquipment of
|
||||
useLeftItem :: Int -> World -> World
|
||||
useLeftItem cid w
|
||||
| _crInvLock cr = w
|
||||
| itmShouldBeUsed = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| itmIsConsumable = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| itmIsEquipable = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| otherwise = fromMaybe w $ do
|
||||
invid <- _crLeftInvSel cr
|
||||
itm <- cr ^? crInv . ix invid
|
||||
@@ -121,9 +122,10 @@ useLeftItem cid w
|
||||
$ w
|
||||
where
|
||||
cr = _creatures (_cWorld w) IM.! cid
|
||||
itmShouldBeUsed =
|
||||
itmIsConsumable =
|
||||
isJust (cr ^? crInv . ix (crSel cr) . itUse . cUse)
|
||||
|| ( isJust (cr ^? crInv . ix (crSel cr) . itUse . equipEffect . eeUse)
|
||||
itmIsEquipable =
|
||||
( isJust (cr ^? crInv . ix (crSel cr) . itUse . equipEffect . eeUse)
|
||||
&& _crLeftInvSel cr /= Just (crSel cr)
|
||||
)
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ newExtraAwareness ::
|
||||
Int ->
|
||||
Maybe Awareness
|
||||
newExtraAwareness cr w cid
|
||||
| dist cpos tpos > 600 = Nothing
|
||||
| not $ canSeeIndirect (_crID cr) cid w = Nothing
|
||||
| otherwise = Just . Suspicious $ doFloatFloat (_viFOV vi) ang * doFloatFloat (_viDist vi) d * awakeLevelPerception cr
|
||||
where
|
||||
|
||||
@@ -202,6 +202,8 @@ movementSideEff cr w
|
||||
useUpdate :: ItemUse -> ItemUse
|
||||
useUpdate =
|
||||
(heldHammer %~ moveHammerUp)
|
||||
. (leftHammer %~ moveHammerUp)
|
||||
. (leftDelay . rateTime %~ decreaseToZero)
|
||||
. (heldDelay . warmTime %~ decreaseToZero)
|
||||
. (heldDelay . rateTime %~ decreaseToZero)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user