Refactor light sources

This commit is contained in:
2021-11-28 16:53:26 +00:00
parent 1d9dd3e4e0
commit 618653a86e
28 changed files with 169 additions and 155 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ twinSlowDoorRoom w h x = defaultRoom
[ pContID (PS (V2 0 (h-5)) pi) ( PutButton $ makeButton col id)
$ \btid -> jsps0J (PutSlideDr False col (cond' btid) (V2 x 1) (V2 x h) wlSpeed)
$ ps0 (PutSlideDr False col (cond' btid) (V2 (-x) 1) (V2 (-x) h) wlSpeed)
$ \did -> jps0 (PutLS (colorLightAt (V3 0.75 0 0) (V3 0 (h-1) lampHeight) 0))
$ \did -> jps0 (PutLS (lsColPos (V3 0.75 0 0) (V3 0 (h-1) lampHeight)))
$ \lsid -> jsps0 $ PutProp $ addColorChange lsid did $ lampCoverWhen (drmoving did) (V2 0 (h-1)) lampHeight
]
, _rmBound = ps
@@ -58,8 +58,8 @@ twinSlowDoorRoom w h x = defaultRoom
addColorChange lsid drid' = over pjUpdate $ dbArgChain $ const f
where
f w' | _drStatus (_doors w' IM.! drid') == DoorHalfway
= w' & lightSources . ix lsid . lsIntensity .~ V3 8 0 0
| otherwise = w' & lightSources . ix lsid . lsIntensity .~ 0.7
= w' & lightSources . ix lsid . lsParam . lsCol .~ V3 8 0 0
| otherwise = w' & lightSources . ix lsid . lsParam . lsCol .~ 0.7
drmoving i w' = DoorHalfway == _drStatus (_doors w' IM.! i)
lampHeight = 41
ps =
+2 -5
View File
@@ -3,6 +3,7 @@ import Dodge.LevelGen.Data
--import Dodge.PlacementSpot
--import Dodge.Room.RunPast
import Dodge.RoomLink
import Dodge.LightSource
--import Dodge.Room.LasTurret
import Dodge.Data
import Dodge.Default
@@ -130,11 +131,7 @@ rezColor = do
col <- takeOne [V3 0.0 0.1 0.5, V3 0.0 0.5 0.1]
h <- takeOne [30,50,80,90,90,90,90]
rad <- takeOne [150,200,200,250,250,300,300,300]
return defaultLS
{ _lsPos = V3 0 0 h
, _lsIntensity = col
, _lsRad = rad
}
return $ lsPosColRad (V3 0 0 h) col rad
rezInvBox :: LightSource -> Room
rezInvBox = swapInOutLinks . rezBox
+2 -5
View File
@@ -1,5 +1,6 @@
module Dodge.Room.RunPast where
import Dodge.LevelGen.Data
import Dodge.LightSource
import Dodge.RoomLink
import Dodge.Data
import Dodge.Default
@@ -40,11 +41,7 @@ roomCritLS = do
col <- takeOne [0.5, 0.6]
h <- takeOne [30,35]
rad <- takeOne [300]
return defaultLS
{ _lsPos = V3 0 0 h
, _lsIntensity = col
, _lsRad = rad
}
return $ lsPosColRad (V3 0 0 h) col rad
critRoom :: Room
critRoom = corridorWallN