Correctly reduce left click item delay

This commit is contained in:
2022-09-04 10:22:53 +01:00
parent 920bfdbc8e
commit 8c0ad639ad
9 changed files with 30 additions and 56 deletions
+5 -3
View File
@@ -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)
)
+1
View File
@@ -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
+2
View File
@@ -202,6 +202,8 @@ movementSideEff cr w
useUpdate :: ItemUse -> ItemUse
useUpdate =
(heldHammer %~ moveHammerUp)
. (leftHammer %~ moveHammerUp)
. (leftDelay . rateTime %~ decreaseToZero)
. (heldDelay . warmTime %~ decreaseToZero)
. (heldDelay . rateTime %~ decreaseToZero)