Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+11 -12
View File
@@ -7,24 +7,23 @@ import Control.Lens
import Dodge.Data.World
import Dodge.Default
import Geometry
import qualified IntMapHelp as IM
setRemoteBombScope :: Int -> Prop -> World -> World
setRemoteBombScope itid pj w' = case _itemLocations (_cWorld w') IM.! itid of
setRemoteBombScope itid pj w = case w ^?! cWorld . lWorld . itemLocations . ix itid of
InInv cid invid ->
w'
& cWorld . creatures . ix cid . crInv . ix invid . itScope
w
& cWorld . lWorld . creatures . ix cid . crInv . ix invid . itScope
. scopePos
.~ (_prPos pj -.- _crPos (_creatures (_cWorld w') IM.! cid))
& cWorld . creatures . ix cid . crInv . ix invid . itUse . heldAim . aimZoom
.~ (_prPos pj -.- (w ^?! cWorld . lWorld . creatures . ix cid . crPos))
& cWorld . lWorld . creatures . ix cid . crInv . ix invid . itUse . heldAim . aimZoom
.~ (defaultItZoom{_itZoomMax = 0.5, _itZoomMin = 0.5})
_ -> w'
_ -> w
setRemoteScope :: Int -> Point2 -> World -> World
setRemoteScope itid pos w' = case w' ^? cWorld . itemLocations . ix itid of
setRemoteScope itid pos w = case w ^? cWorld . lWorld . itemLocations . ix itid of
Just (InInv cid' invid) ->
w'
& cWorld . creatures . ix cid' . crInv . ix invid . itScope
w
& cWorld . lWorld . creatures . ix cid' . crInv . ix invid . itScope
. scopePos
.~ (pos -.- _crPos (_creatures (_cWorld w') IM.! cid'))
_ -> w'
.~ (pos -.- (w ^?! cWorld . lWorld . creatures . ix cid' . crPos))
_ -> w