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
+6 -6
View File
@@ -31,7 +31,7 @@ useE eo = case eo of
EoffWristShield -> onRemoveWristShield
useMagShield :: Item -> Creature -> World -> World
useMagShield it cr w = w & cWorld . magnets . at mgid ?~ themagnet
useMagShield it cr w = w & cWorld . lWorld . magnets . at mgid ?~ themagnet
where
themagnet =
Magnet
@@ -42,16 +42,16 @@ useMagShield it cr w = w & cWorld . magnets . at mgid ?~ themagnet
}
mgid = case it ^? itParams . magShieldMgMIX . _Just of
Just mgid' -> mgid'
Nothing -> IM.newKey $ _magnets (_cWorld w)
Nothing -> IM.newKey $ w ^. cWorld . lWorld . magnets
onEquipWristShield :: Item -> Creature -> World -> World
onEquipWristShield itm cr w =
w
& pointerToItem itm . itUse . equipEffect . eeParams .~ EquipID i
& cWorld . walls . at i ?~ forceField{_wlID = i}
& cWorld . lWorld . walls . at i ?~ forceField{_wlID = i}
& setWristShieldPos (itm & itUse . equipEffect . eeParams .~ EquipID i) cr
where
i = IM.newKey (_walls (_cWorld w))
i = IM.newKey (w ^. cWorld . lWorld . walls)
onRemoveWristShield :: Item -> Creature -> World -> World
onRemoveWristShield itm _ =
@@ -122,7 +122,7 @@ removeShieldWall it _ w = case it ^? itParams . flatShieldWlMIX . _Just of
createHeadLamp :: Item -> Creature -> World -> World
createHeadLamp _ cr =
cWorld . tempLightSources
cWorld . lWorld . tempLightSources
.:~ tlsTimeRadColPos
1
200
@@ -130,4 +130,4 @@ createHeadLamp _ cr =
((_crPos cr `v2z` 0) +.+.+ rotate3 (_crDir cr) (translatePointToHead cr (V3 5 0 3)))
overCID :: (Creature -> Creature) -> Item -> Creature -> World -> World
overCID f _ cr = cWorld . creatures . ix (_crID cr) %~ f
overCID f _ cr = cWorld . lWorld . creatures . ix (_crID cr) %~ f