Add delay before game over

This commit is contained in:
2022-06-03 10:45:20 +01:00
parent 0c5eeb405f
commit 60f75fb133
5 changed files with 15 additions and 5 deletions
+6 -3
View File
@@ -269,9 +269,12 @@ markWallSeen w wl = w { _walls = IM.adjust mw (_wlID wl) $ _walls w }
mw wl' = wl' {_wlSeen = True}
checkEndGame :: World -> World
checkEndGame w
| _crHP (you w) < 1 = w & sideEffects %~ ( . (menuLayers .~ [gameOverMenu]))
| otherwise = w
checkEndGame w = case _deathDelay w of
Just x | x < 0 -> w & sideEffects %~ ( . (menuLayers .~ [gameOverMenu]))
& deathDelay .~ Nothing
Just _ -> w & deathDelay . _Just -~ 1
_ | _crHP (you w) < 1 -> w & deathDelay ?~ 50
_ -> w
updateGusts :: World -> World
updateGusts w = w