This commit is contained in:
2022-02-21 22:42:19 +00:00
parent f626fce105
commit ff84363a13
11 changed files with 79 additions and 99 deletions
+4 -4
View File
@@ -282,7 +282,7 @@ remoteLauncher = launcher
& useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist
, _itAttachment = ItScope (V2 0 0) 0 1 True
, _itScope = RemoteScope (V2 0 0) 1 True
-- , _itParams = ShellLauncher
-- { _tweakSel = 0
-- , _tweakParams = basicAmPjMoves -- TODO change to allow tweaking rocket speed
@@ -409,7 +409,7 @@ remoteShellPic t
| otherwise = red
retireRemoteRocket :: Int -> Int -> Int -> World -> World
retireRemoteRocket itid 0 pjid w =
set (pointToItem (_itemPositions w IM.! itid) . itAttachment . scopePos) (V2 0 0)
set (pointToItem (_itemPositions w IM.! itid) . itScope . scopePos) (V2 0 0)
$ set (pointToItem (_itemPositions w IM.! itid) . itUse . rUse) (const fireRemoteLauncher)
(w & props %~ IM.delete pjid)
retireRemoteRocket itid t pjid w = setScope w
@@ -417,7 +417,7 @@ retireRemoteRocket itid t pjid w = setScope w
where
setScope w' = case _itemPositions w' IM.! itid of
InInv cid invid -> w'
& creatures . ix cid . crInv . ix invid . itAttachment
& creatures . ix cid . crInv . ix invid . itScope
. scopePos .~ (pos -.- _crPos (_creatures w' IM.! cid))
_ -> w'
pos = fromMaybe (V2 0 0) $ w ^? props . ix pjid . pjPos
@@ -425,6 +425,6 @@ retireRemoteRocket itid t pjid w = setScope w
setRemoteScope :: Int -> Prop -> World -> World
setRemoteScope itid pj w' = case w' ^? itemPositions . ix itid of
Just (InInv cid' invid )
-> w' & creatures . ix cid' . crInv . ix invid . itAttachment
-> w' & creatures . ix cid' . crInv . ix invid . itScope
. scopePos .~ (_pjPos pj -.- _crPos (_creatures w' IM.! cid'))
_ -> w'