Fix burst rifle rate delay bug, various cleanups
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user