Work on cleaning up item effects/attachments etc

This commit is contained in:
2022-07-27 16:39:58 +01:00
parent 8d17ce66e9
commit b52adddd5d
39 changed files with 696 additions and 844 deletions
+5 -5
View File
@@ -69,9 +69,9 @@ explodeRemoteRocket' mitid thepj w =
where
updateitem = fromMaybe (cWorld . projectiles . at pjid .~ Nothing) $ do
itid <- mitid
itpos <- w ^? cWorld . itemPositions . ix itid
itpos <- w ^? cWorld . itemLocations . ix itid
return $
(pointerToItem itpos . itUse . rUse .~ HeldDoNothing)
(pointerToItemLocation itpos . itUse . rUse .~ HeldDoNothing)
. (cWorld . projectiles . ix pjid . prjUpdates .~ [PJRetireRemote itid 30 pjid])
pjid = _prjID thepj
@@ -125,7 +125,7 @@ upProjectile pu pj = case pu of
retireRemoteProj'' :: Int -> Int -> World -> World
retireRemoteProj'' itid pjid w =
w
& pointerToItem (_itemPositions (_cWorld w) IM.! itid)
& pointerToItemLocation (_itemLocations (_cWorld w) IM.! itid)
%~ ( (itScope . scopePos .~ V2 0 0)
. (itUse . rUse .~ HeldFireRemoteShell)
)
@@ -138,7 +138,7 @@ setRemoteDir cid itid pj w = w & cWorld . projectiles . ix (_prjID pj) . prjDir
newdir
| SDL.ButtonRight `M.member` _mouseButtons w
&& w ^? cWorld . creatures . ix cid . crInvSel . iselPos
== w ^? cWorld . itemPositions . ix itid . ipInvID =
== w ^? cWorld . itemLocations . ix itid . ipInvID =
_cameraRot (_cWorld w) + argV (_mousePos w)
| otherwise = _prjDir pj
@@ -189,7 +189,7 @@ pjTrack' itid pj w = rotateToTarget pj w
(_prjPos pj)
tpos
(argV $ _prjAcc pj)
itPoint = pointerToItem $ _itemPositions (_cWorld w) IM.! itid
itPoint = pointerToItemLocation $ _itemLocations (_cWorld w) IM.! itid
reduceSpinBy' :: Float -> Proj -> World -> World
reduceSpinBy' x pj = cWorld . projectiles . ix (_prjID pj) . prjSpin *~ x