Work on AttachUse -> UseAttach

This commit is contained in:
2024-10-01 14:21:40 +01:00
parent 36238669f5
commit f90bbc1cd0
15 changed files with 436 additions and 374 deletions
+2 -2
View File
@@ -47,8 +47,8 @@ createShell homing payload muz cr w = w
thrustdelay = 20
updatescreen = fromMaybe id $ do
screenid <- homing ^? phRemoteID
return $ pointerToItemID screenid . itUse
. atLinkedProjectile
return $ pointerToItemID screenid . itUse . uaParams
. apLinkedProjectile
?~ i
i = IM.newKey $ w ^. cWorld . lWorld . projectiles
dir = _crDir cr + _mzRot muz
+2 -2
View File
@@ -66,9 +66,9 @@ destroyProjectile mitid pjid w = w & cWorld . lWorld . projectiles %~ IM.delete
removelink = fromMaybe id $ do
itid <- fmap _unNInt mitid
loc <- w ^? cWorld . lWorld . itemLocations . ix itid
itm <- w ^? pointerToItemLocation loc . itUse . atLinkedProjectile . _Just
itm <- w ^? pointerToItemLocation loc . itUse . uaParams . apLinkedProjectile . _Just
guard $ itm == pjid
return $ pointerToItemLocation loc . itUse . atLinkedProjectile .~ Nothing
return $ pointerToItemLocation loc . itUse . uaParams . apLinkedProjectile .~ Nothing
doThrust :: Projectile -> World -> World
doThrust pj w =