Cleanup
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user