Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -13,19 +13,19 @@ import LensHelp
|
||||
updateLampoid :: Creature -> World -> World
|
||||
updateLampoid cr w = case cr ^?! crType . lampLSID of
|
||||
Nothing ->
|
||||
let i = IM.newKey (_lightSources (_cWorld w))
|
||||
in w & cWorld . lightSources %~ IM.insert i (lsColPosID lcol (addZ h cpos) i)
|
||||
& cWorld . creatures . ix (_crID cr) . crType . lampLSID ?~ i
|
||||
let i = IM.newKey (w ^. cWorld . lWorld . lightSources)
|
||||
in w & cWorld . lWorld . lightSources %~ IM.insert i (lsColPosID lcol (addZ h cpos) i)
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crType . lampLSID ?~ i
|
||||
Just i
|
||||
| _crHP cr < 0 ->
|
||||
w
|
||||
& explosionFlashAt cpos
|
||||
& originsIDsAt [MaterialSound Glass n | n <- [0, 1, 2]] (destroyMatS Glass) cpos
|
||||
& cWorld . lightSources . at i .~ Nothing
|
||||
& cWorld . creatures . at cid .~ Nothing
|
||||
& cWorld . lWorld . lightSources . at i .~ Nothing
|
||||
& cWorld . lWorld . creatures . at cid .~ Nothing
|
||||
| otherwise ->
|
||||
w
|
||||
& cWorld . lightSources . ix i . lsParam . lsPos .~ addZ h cpos
|
||||
& cWorld . lWorld . lightSources . ix i . lsParam . lsPos .~ addZ h cpos
|
||||
& doDamage cr
|
||||
where
|
||||
cpos = _crPos cr
|
||||
|
||||
Reference in New Issue
Block a user