Add terminal temporary screen light
This commit is contained in:
@@ -24,10 +24,23 @@ updateMachine mc
|
||||
mcTypeUpdate :: Machine -> World -> World
|
||||
mcTypeUpdate mc = case mc ^. mcType of
|
||||
McStatic -> id
|
||||
McTerminal -> id
|
||||
McTerminal -> terminalScreenGlow mc
|
||||
McTurret tu -> updateTurret (_tuTurnSpeed tu) mc
|
||||
McSensor se -> mcSensorTriggerUpdate se mc . mcSensorUpdate se mc
|
||||
|
||||
terminalScreenGlow :: Machine -> World -> World
|
||||
terminalScreenGlow mc w = fromMaybe w $ do
|
||||
tid <- mc ^? mcMounts . ix ObTerminal
|
||||
term <- w ^? cWorld . lWorld . terminals . ix tid
|
||||
guard (_tmStatus term /= TerminalOff)
|
||||
let V4 x y z _ = _tmScreenColor term
|
||||
return $ w & cWorld . lWorld . tempLightSources .:~ TLS
|
||||
{ _tlsParam = LSParam (_mcPos mc `v2z` 20) 30 (V3 x y z)
|
||||
, _tlsUpdate = TimerTLS
|
||||
, _tlsTime = 1
|
||||
}
|
||||
|
||||
|
||||
updateTurret :: Float -> Machine -> World -> World
|
||||
updateTurret rotSpeed mc w =
|
||||
w
|
||||
|
||||
Reference in New Issue
Block a user