Add indexed world modifications, example use in flicker lights
This commit is contained in:
@@ -58,6 +58,7 @@ functionalUpdate w = case _menuLayers w of
|
||||
. updateDoors
|
||||
. resetWorldEvents
|
||||
. dbArg _worldEvents
|
||||
. updateModifications
|
||||
. updateParticles
|
||||
. updateProjectiles
|
||||
. updateLightSources
|
||||
@@ -82,6 +83,11 @@ functionalUpdate w = case _menuLayers w of
|
||||
where
|
||||
(x,y) = cloudZoneOfPoint $ stripZ $ _clPos cl
|
||||
|
||||
updateModifications :: World -> World
|
||||
updateModifications w = foldr f w (_modifications w)
|
||||
where
|
||||
f md = _mdUpdate md md
|
||||
|
||||
splinterBlock :: Block -> World -> World
|
||||
splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardCen w (_blWallIDs bl)
|
||||
& blocks . ix (_blID bl) . blHPs %~ tail
|
||||
|
||||
Reference in New Issue
Block a user