Fix burst rifle rate delay bug, various cleanups

This commit is contained in:
2025-06-25 23:47:41 +01:00
parent 1bdf426c42
commit 5b35b4c6c8
19 changed files with 440 additions and 469 deletions
+4 -8
View File
@@ -24,9 +24,8 @@ useItem invid pt w = fmap (worldEventFlags . at InventoryChange ?~ ()) $ do
let usedloc = useLocation itmloc
useItemLoc cr usedloc pt w
useItemLoc ::
Creature ->
LocationLDT ItemLink ComposedItem ->
useItemLoc :: Creature ->
LocationLDT ItemLink CItem ->
PressType ->
World ->
Maybe World
@@ -63,7 +62,7 @@ useItemLoc cr loc pt w
ldt = loc ^. locLDT
itm = ldt ^. ldtValue . _1
useLocation :: LocationLDT ItemLink ComposedItem -> LocationLDT ItemLink ComposedItem
useLocation :: LocationLDT ItemLink CItem -> LocationLDT ItemLink CItem
useLocation loc
| isJust $ loc ^? locLDT . ldtValue . _1 . itType . ibtEquip = loc
| isJust $ loc ^? locLDT . ldtValue . _1 . itUse . uaParams . apProjectiles . ix 0 =
@@ -81,10 +80,7 @@ structureUseAtLoc = \case
MapperSF -> True
_ -> False
activateDetonator ::
LabelDoubleTree ItemLink ComposedItem ->
World ->
World
activateDetonator :: LabelDoubleTree ItemLink CItem -> World -> World
activateDetonator det = fromMaybe id $ do
pjid <- det ^? ldtValue . _1 . itUse . uaParams . apProjectiles . ix 0
return $ cWorld . lWorld . projectiles . ix pjid . pjTimer .~ 0