Remove more LDTs

This commit is contained in:
2025-07-11 00:49:36 +01:00
parent 05ff4651bd
commit 8ff607675b
3 changed files with 18 additions and 19 deletions
+4 -4
View File
@@ -26,17 +26,17 @@ useItemLoc cr loc pt w
| HeldPlatformSF <- sf
, fromMaybe False $ loc ^? locLDT . ldtValue . _1 . itLocation . ilIsAttached
, Aiming{} <- cr ^. crStance . posture =
return $ gadgetEffect pt loc cr w
return $ gadgetEffect pt (locLDTToLocDT loc) cr w
| LaserWeaponSF <- sf
, fromMaybe False $ loc ^? locLDT . ldtValue . _1 . itLocation . ilIsAttached
, Aiming{} <- cr ^. crStance . posture =
return $ gadgetEffect pt loc cr w
return $ gadgetEffect pt (locLDTToLocDT loc) cr w
| GadgetPlatformSF <- sf =
return $ gadgetEffect pt loc cr w
return $ gadgetEffect pt (locLDTToLocDT loc) cr w
| UnderBarrelPlatformSF <- sf
, fromMaybe False $ loc ^? locLDT . ldtValue . _1 . itLocation . ilIsAttached
, Aiming{} <- cr ^. crStance . posture =
return $ gadgetEffect pt loc cr w
return $ gadgetEffect pt (locLDTToLocDT loc) cr w
| RemoteDetonatorSF <- sf
, pt == InitialPress =
return $ activateDetonator ldt w
+3 -3
View File
@@ -153,7 +153,7 @@ invRootItemEffs cr =
invItemLocUpdate :: Creature -> LocationLDT ItemLink OItem -> World -> World
invItemLocUpdate cr loc w = doAnyEquipmentEffect loc cr $ case itm ^. itType of
ATTACH BULLETSYNTH -> trySynthBullet loc w
EQUIP WRIST_ECG | haspulse -> tryUseParent loc w
EQUIP WRIST_ECG | haspulse -> tryUseParent (locLDTToLocDT loc) w
COPIER _ -> copierItemUpdate itm cr w
HELD FLATSHIELD -> rootNotrootEff createShieldWall removeShieldWall itm cr w
HELD MINIGUNX{} -> coolMinigun itm w
@@ -223,9 +223,9 @@ doAnyEquipmentEffect :: LocationLDT ItemLink OItem -> Creature -> World -> World
doAnyEquipmentEffect loc cr = maybe id (equipBackgroundEffect loc cr)
$ loc ^? locLDT . ldtValue . _1 . itLocation . ilEquipSite . _Just
tryUseParent :: LocationLDT ItemLink OItem -> World -> World
tryUseParent :: LocationDT OItem -> World -> World
tryUseParent loc w = fromMaybe w $ do
t <- locUp loc
t <- locUp' loc
cr <- w ^? cWorld . lWorld . creatures . ix 0
return $ gadgetEffect InitialPress t cr w