Refactor projectiles

This commit is contained in:
2022-07-20 09:55:07 +01:00
parent 9daf872878
commit 330a81a955
14 changed files with 196 additions and 200 deletions
+3 -3
View File
@@ -40,9 +40,9 @@ setRemoteBombScope itid pj w' = case _itemPositions w' IM.! itid of
.~ (defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5})
_ -> w'
setRemoteScope :: Int -> Prop -> World -> World
setRemoteScope itid pj w' = case w' ^? itemPositions . ix itid of
setRemoteScope :: Int -> Point2 -> World -> World
setRemoteScope itid pos w' = case w' ^? itemPositions . ix itid of
Just (InInv cid' invid )
-> w' & creatures . ix cid' . crInv . ix invid . itScope
. scopePos .~ (_prPos pj -.- _crPos (_creatures w' IM.! cid'))
. scopePos .~ (pos -.- _crPos (_creatures w' IM.! cid'))
_ -> w'