sm64coopdx/mods/arena/arena-lighting.lua

46 lines
1.6 KiB
Lua
Raw Normal View History

2024-03-13 02:59:47 +00:00
local function on_level_init()
2023-12-16 14:07:37 +00:00
if gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_RAINBOW then
set_lighting_dir(1, -10)
2024-03-13 02:59:47 +00:00
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_CITY then
set_lighting_dir(1, -1)
2023-12-16 14:07:37 +00:00
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_CITADEL then
set_lighting_dir(1, -10)
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_FORTS then
set_lighting_dir(1, -10)
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_ORIGIN then
set_lighting_dir(1, -10)
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_PILLARS then
set_lighting_dir(1, -10)
2024-03-13 21:06:25 +00:00
else
2023-12-16 14:07:37 +00:00
set_lighting_dir(1, 0)
end
2024-03-13 02:59:47 +00:00
end
--- @param m MarioState
local function mario_update(m)
if gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_CITY then
m.marioBodyState.lightR = 255
m.marioBodyState.lightG = 225
m.marioBodyState.lightB = 115
m.marioBodyState.shadeR = 19
m.marioBodyState.shadeG = 58
m.marioBodyState.shadeB = 212
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_RAINBOW then
m.marioBodyState.lightR = 255
m.marioBodyState.lightG = 255
m.marioBodyState.lightB = 255
m.marioBodyState.shadeR = 19
m.marioBodyState.shadeG = 58
m.marioBodyState.shadeB = 212
else
m.marioBodyState.lightR = 255
m.marioBodyState.lightG = 255
m.marioBodyState.lightB = 255
m.marioBodyState.shadeR = 127
m.marioBodyState.shadeG = 127
m.marioBodyState.shadeB = 127
2023-12-16 14:07:37 +00:00
end
end
2024-03-13 02:59:47 +00:00
hook_event(HOOK_MARIO_UPDATE, mario_update)
2023-12-16 14:07:37 +00:00
hook_event(HOOK_ON_LEVEL_INIT, on_level_init)