Lower water level on Football/Shell Rush (#194)

On 0 star saves, the water is not lowered so the gameplay experience is impaired.
This commit is contained in:
Agent X 2022-09-18 22:00:39 -04:00 committed by GitHub
parent 40a291eb08
commit 37aa44d2d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -1298,6 +1298,14 @@ function update()
end end
end end
function on_level_init()
-- lower water level on castle grounds
if gNetworkPlayers[0].currLevelNum == LEVEL_CASTLE_GROUNDS then
set_environment_region(1, -800)
set_environment_region(2, -800)
end
end
----------- -----------
-- hooks -- -- hooks --
----------- -----------
@ -1307,6 +1315,7 @@ hook_event(HOOK_UPDATE, update)
hook_event(HOOK_ON_HUD_RENDER, on_hud_render) hook_event(HOOK_ON_HUD_RENDER, on_hud_render)
hook_event(HOOK_ON_PLAYER_CONNECTED, on_player_connected) hook_event(HOOK_ON_PLAYER_CONNECTED, on_player_connected)
hook_event(HOOK_ALLOW_PVP_ATTACK, allow_pvp_attack) hook_event(HOOK_ALLOW_PVP_ATTACK, allow_pvp_attack)
hook_event(HOOK_ON_LEVEL_INIT, on_level_init)
if network_is_server() then if network_is_server() then
hook_chat_command('football-reset', "[game|ball] resets the game or ball", on_football_reset_command) hook_chat_command('football-reset', "[game|ball] resets the game or ball", on_football_reset_command)
end end

View File

@ -87,6 +87,12 @@ function on_level_init()
-- reset rankings -- reset rankings
race_clear_rankings() race_clear_rankings()
-- lower water level on castle grounds
if gNetworkPlayers[0].currLevelNum == LEVEL_CASTLE_GROUNDS then
set_environment_region(1, -800)
set_environment_region(2, -800)
end
end end
function spawn_custom_level_objects() function spawn_custom_level_objects()