Start to add respawn points, re-fix semi-auto triggers

This commit is contained in:
2025-08-11 00:00:32 +01:00
parent 38e8f91346
commit dd1f3b2ef5
10 changed files with 116 additions and 113 deletions
+9 -6
View File
@@ -7,6 +7,7 @@ Description : Simulation update
-}
module Dodge.Update (updateUniverse) where
import Dodge.SpawnAt
import Dodge.Prop.Moving
import Dodge.WorldEvent.Explosion
import Dodge.Data.Object
@@ -39,7 +40,7 @@ import Dodge.Laser.Update
import Dodge.LinearShockwave.Update
import Dodge.ListDisplayParams
import Dodge.Machine.Update
import Dodge.Menu
--import Dodge.Menu
import Dodge.ModificationEffect
import Dodge.PressPlate
import Dodge.Projectile.Update
@@ -185,7 +186,7 @@ timeFlowUpdate u = case u ^. uvWorld . timeFlow of
CameraScrollTimeFlow{} -> u
RewindLeftClick 0 _ -> u & uvWorld . timeFlow .~ NormalTimeFlow
RewindLeftClick _ _ -> over uvWorld scrollTimeBack u -- & uvWorld . cWorld . timeFlow .~ NormalTimeFlow
DeathTime{} -> u
RespawnDelay{} -> functionalUpdate u
PausedTimeFlow _ itmloc -> over uvWorld (pauseTime itmloc) u
pauseTime :: NewInt ItmInt -> World -> World
@@ -798,10 +799,12 @@ ppEvents w = IM.foldl' (flip $ \pp -> doPressPlateEvent (_ppEvent pp) pp) w $ w
--markSeen wl = wl{_wlSeen = True}
checkEndGame :: Universe -> Universe
checkEndGame uv = case w ^? timeFlow . deathDelay of
Just x | x < 0 -> uv & uvScreenLayers .~ [gameOverMenu uv]
Just _ -> uv & uvWorld . timeFlow . deathDelay -~ 1
_ | _crHP (you w) < 1 -> uv & uvWorld . timeFlow .~ DeathTime 50
checkEndGame uv = case w ^? timeFlow . respawnDelay of
Just x | x < 0 -> uv -- & uvScreenLayers .~ [gameOverMenu uv]
& uvWorld . timeFlow .~ NormalTimeFlow
& uvWorld %~ spawnAt (w ^. cWorld . lWorld . respawnPos)
Just _ -> uv & uvWorld . timeFlow . respawnDelay -~ 1
_ | _crHP (you w) < 1 -> uv & uvWorld . timeFlow .~ RespawnDelay 50
_ -> uv
where
w = _uvWorld uv