Separate out concrete part of world
This commit is contained in:
@@ -10,16 +10,16 @@ import LensHelp
|
||||
import qualified IntMapHelp as IM
|
||||
updateLampoid :: Creature -> World -> World
|
||||
updateLampoid cr w = case cr ^?! crType . lampLSID of
|
||||
Nothing -> let i = IM.newKey (_lightSources w)
|
||||
in w & lightSources %~ IM.insert i (lsColPosID lcol (addZ h cpos) i)
|
||||
Nothing -> let i = IM.newKey (_lightSources (_cWorld w))
|
||||
in w & cWorld . lightSources %~ IM.insert i (lsColPosID lcol (addZ h cpos) i)
|
||||
Just i
|
||||
| _crHP cr < 0 -> w
|
||||
& explosionFlashAt cpos
|
||||
& originsIDsAt [MaterialSound Glass n | n <- [0,1,2]] (destroyMatS Glass) cpos
|
||||
& lightSources . at i .~ Nothing
|
||||
& creatures . at cid .~ Nothing
|
||||
& cWorld . lightSources . at i .~ Nothing
|
||||
& cWorld . creatures . at cid .~ Nothing
|
||||
| otherwise -> w
|
||||
& lightSources . ix i . lsParam . lsPos .~ addZ h cpos
|
||||
& cWorld . lightSources . ix i . lsParam . lsPos .~ addZ h cpos
|
||||
& doDamage cr
|
||||
where
|
||||
cpos = _crPos cr
|
||||
|
||||
Reference in New Issue
Block a user