Add Rainbow Road to Arena

This commit is contained in:
Agent X 2023-12-16 09:07:37 -05:00
parent 0a210993ae
commit 237753e63b
8 changed files with 3209 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,33 @@
-- lighting for Rainbow Road
function on_level_init()
if gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_RAINBOW then
set_lighting_dir(1, -10)
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_SPACE then
set_lighting_dir(1, -10)
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)
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_SKY_BEACH then
set_lighting_dir(1, 0)
elseif gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_SPIRE then
set_lighting_dir(1, 0)
end
if gNetworkPlayers[0].currLevelNum == LEVEL_ARENA_RAINBOW then
set_lighting_color(0, 179)
set_lighting_color(1, 189)
set_lighting_color(2, 255)
else
set_lighting_color(0, 255)
set_lighting_color(1, 255)
set_lighting_color(2, 255)
end
end
hook_event(HOOK_ON_LEVEL_INIT, on_level_init)

View file

@ -0,0 +1,285 @@
----------------
-- Teching v2 --
----------------
local TECH_KB = {
[ACT_GROUND_BONK] = ACT_BACKWARD_ROLLOUT,
[ACT_BACKWARD_GROUND_KB] = ACT_BACKWARD_ROLLOUT,
[ACT_HARD_BACKWARD_GROUND_KB] = ACT_BACKWARD_ROLLOUT,
[ACT_HARD_FORWARD_GROUND_KB] = ACT_FORWARD_ROLLOUT,
[ACT_FORWARD_GROUND_KB] = ACT_FORWARD_ROLLOUT,
}
local tech_tmr = 0
local function mario_on_set_action(m)
if TECH_KB[m.action] then
tech_tmr = 0
end
end
local function mario_update(m)
if TECH_KB[m.action] then
tech_tmr = tech_tmr + 1
if tech_tmr <= 9.9 and (m.input & INPUT_Z_PRESSED) ~= 0 then
m.vel.y = 21.0
m.particleFlags = m.particleFlags | ACTIVE_PARTICLE_SPARKLES
tech_tmr = 0
return set_mario_action(m, TECH_KB[m.action], 1)
end
end
end
hook_event(HOOK_MARIO_UPDATE, mario_update)
hook_event(HOOK_ON_SET_MARIO_ACTION, mario_on_set_action)
---------------------------------------------
-- Jump and Crouch Leniency by SMS Alfredo --
---------------------------------------------
gGlobalSyncTable.jumpLeniency = 5
--Actions you're allowed leniency out of
LNCY_AIR_ACTIONS = {
[ACT_BACKFLIP_LAND] = true,
[ACT_BACKFLIP_LAND_STOP] = true,
[ACT_BEGIN_SLIDING] = true,
[ACT_BRAKING] = true,
[ACT_BRAKING_STOP] = true,
[ACT_BURNING_FALL] = true,
[ACT_BURNING_GROUND] = true,
[ACT_BUTT_SLIDE] = true,
[ACT_BUTT_SLIDE_AIR] = true,
[ACT_BUTT_SLIDE_STOP] = true,
[ACT_COUGHING] = true,
[ACT_CRAWLING] = true,
[ACT_CROUCHING] = true,
[ACT_CROUCH_SLIDE] = true,
[ACT_DECELERATING] = true,
[ACT_DIVE_SLIDE] = true,
[ACT_DOUBLE_JUMP_LAND] = true,
[ACT_DOUBLE_JUMP_LAND_STOP] = true,
[ACT_FINISH_TURNING_AROUND] = true,
[ACT_FREEFALL] = true,
[ACT_FREEFALL_LAND] = true,
[ACT_FREEFALL_LAND_STOP] = true,
[ACT_HOLD_BUTT_SLIDE] = true,
[ACT_HOLD_BUTT_SLIDE_AIR] = true,
[ACT_HOLD_BUTT_SLIDE_STOP] = true,
[ACT_HOLD_DECELERATING] = true,
[ACT_HOLD_FREEFALL] = true,
[ACT_HOLD_FREEFALL_LAND] = true,
[ACT_HOLD_FREEFALL_LAND_STOP] = true,
[ACT_HOLD_HEAVY_IDLE] = true,
[ACT_HOLD_HEAVY_WALKING] = true,
[ACT_HOLD_JUMP_LAND] = true,
[ACT_HOLD_JUMP_LAND_STOP] = true,
[ACT_HOLD_METAL_WATER_FALLING] = true,
[ACT_HOLD_METAL_WATER_FALL_LAND] = true,
[ACT_HOLD_METAL_WATER_JUMP_LAND] = true,
[ACT_HOLD_METAL_WATER_STANDING] = true,
[ACT_HOLD_METAL_WATER_WALKING] = true,
[ACT_HOLD_QUICKSAND_JUMP_LAND] = true,
[ACT_HOLD_STOMACH_SLIDE] = true,
[ACT_HOLD_WALKING] = true,
[ACT_IDLE] = true,
[ACT_IN_QUICKSAND] = true,
[ACT_JUMP_LAND] = true,
[ACT_JUMP_LAND_STOP] = true,
[ACT_LAVA_BOOST_LAND] = true,
[ACT_LONG_JUMP_LAND] = true,
[ACT_LONG_JUMP_LAND_STOP] = true,
[ACT_METAL_WATER_FALLING] = true,
[ACT_METAL_WATER_FALL_LAND] = true,
[ACT_METAL_WATER_JUMP_LAND] = true,
[ACT_METAL_WATER_STANDING] = true,
[ACT_METAL_WATER_WALKING] = true,
[ACT_MOVE_PUNCHING] = true,
[ACT_PUNCHING] = true,
[ACT_SIDE_FLIP_LAND] = true,
[ACT_SIDE_FLIP_LAND_STOP] = true,
[ACT_SLIDE_KICK_SLIDE] = true,
[ACT_SLIDE_KICK_SLIDE_STOP] = true,
[ACT_STANDING_AGAINST_WALL] = true,
[ACT_START_CRAWLING] = true,
[ACT_START_CROUCHING] = true,
[ACT_STOMACH_SLIDE] = true,
[ACT_STOMACH_SLIDE_STOP] = true,
[ACT_STOP_CRAWLING] = true,
[ACT_STOP_CROUCHING] = true,
[ACT_TRIPLE_JUMP_LAND] = true,
[ACT_TRIPLE_JUMP_LAND_STOP] = true,
[ACT_TURNING_AROUND] = true,
[ACT_WALKING] = true,
}
--Special jump actions for certain actions
LNCY_TRANS = {
[ACT_JUMP_LAND] = ACT_DOUBLE_JUMP,
[ACT_JUMP_LAND_STOP] = ACT_DOUBLE_JUMP,
[ACT_DOUBLE_JUMP_LAND] = ACT_TRIPLE_JUMP,
[ACT_DOUBLE_JUMP_LAND_STOP] = ACT_TRIPLE_JUMP,
[ACT_FINISH_TURNING_AROUND] = ACT_SIDE_FLIP,
[ACT_TURNING_AROUND] = ACT_SIDE_FLIP,
[ACT_DIVE] = ACT_FORWARD_ROLLOUT,
[ACT_DIVE_SLIDE] = ACT_FORWARD_ROLLOUT,
[ACT_SLIDE_KICK] = ACT_FORWARD_ROLLOUT,
[ACT_SLIDE_KICK_SLIDE] = ACT_FORWARD_ROLLOUT,
[ACT_SLIDE_KICK_SLIDE_STOP] = ACT_FORWARD_ROLLOUT,
[ACT_STOMACH_SLIDE] = ACT_FORWARD_ROLLOUT,
[ACT_STOMACH_SLIDE_STOP] = ACT_FORWARD_ROLLOUT,
[ACT_DIVE_PICKING_UP] = ACT_HOLD_JUMP,
[ACT_HOLD_BUTT_SLIDE] = ACT_HOLD_JUMP,
[ACT_HOLD_BUTT_SLIDE_AIR] = ACT_HOLD_JUMP,
[ACT_HOLD_BUTT_SLIDE_STOP] = ACT_HOLD_JUMP,
[ACT_HOLD_DECELERATING] = ACT_HOLD_JUMP,
[ACT_HOLD_FREEFALL] = ACT_HOLD_JUMP,
[ACT_HOLD_FREEFALL_LAND] = ACT_HOLD_JUMP,
[ACT_HOLD_FREEFALL_LAND_STOP] = ACT_HOLD_JUMP,
[ACT_HOLD_HEAVY_IDLE] = ACT_HOLD_JUMP,
[ACT_HOLD_HEAVY_WALKING] = ACT_HOLD_JUMP,
[ACT_HOLD_JUMP_LAND] = ACT_HOLD_JUMP,
[ACT_HOLD_JUMP_LAND_STOP] = ACT_HOLD_JUMP,
[ACT_HOLD_METAL_WATER_FALLING] = ACT_HOLD_METAL_WATER_JUMP,
[ACT_HOLD_METAL_WATER_FALL_LAND] = ACT_HOLD_METAL_WATER_JUMP,
[ACT_HOLD_METAL_WATER_JUMP_LAND] = ACT_HOLD_METAL_WATER_JUMP,
[ACT_HOLD_METAL_WATER_STANDING] = ACT_HOLD_METAL_WATER_JUMP,
[ACT_HOLD_METAL_WATER_WALKING] = ACT_HOLD_METAL_WATER_JUMP,
[ACT_METAL_WATER_FALLING] = ACT_METAL_WATER_JUMP,
[ACT_METAL_WATER_FALL_LAND] = ACT_METAL_WATER_JUMP,
[ACT_METAL_WATER_JUMP_LAND] = ACT_METAL_WATER_JUMP,
[ACT_METAL_WATER_STANDING] = ACT_METAL_WATER_JUMP,
[ACT_METAL_WATER_WALKING] = ACT_METAL_WATER_JUMP,
}
gStateExtras = {}
--Custom Variables
for i=0,(MAX_PLAYERS-1) do
gStateExtras[i] = {}
local e = gStateExtras[i]
e.jumpLeniency = 0 --Jump Leniency timer
e.lncyWallkick = 0 --Controls Wall Kicking being as lenient as Jump Leniency
end
--Main function
--- @param m MarioState
function jump_leniency(m)
local e = gStateExtras[m.playerIndex]
--Air Jump Leniency (pressing A late after having fallen off a ledge)
if gGlobalSyncTable.jumpLeniency > 0
and (m.action & ACT_FLAG_AIR) ~= 0
and LNCY_AIR_ACTIONS[m.prevAction] ~= nil
and LNCY_AIR_ACTIONS[m.action] ~= nil then
e.jumpLeniency = e.jumpLeniency + 1
if e.jumpLeniency <= gGlobalSyncTable.jumpLeniency
and (m.controller.buttonPressed & A_BUTTON) ~= 0 then
m.flags = m.flags | MARIO_ACTION_SOUND_PLAYED
local trans = LNCY_TRANS[m.prevAction]
if trans == ACT_TRIPLE_JUMP then
set_triple_jump_action(m, trans, 0)
elseif trans ~= nil then
set_mario_action(m, trans, 0)
elseif (m.input & INPUT_Z_DOWN) ~= 0
and (m.forwardVel > 10.0) then
set_mario_action(m, ACT_LONG_JUMP, 0)
else
set_mario_action(m, ACT_JUMP, 0)
end
end
else
e.jumpLeniency = 0
end
--Make wall kick timing also match the Jump Leniency
if e.lncyWallkick ~= m.wallKickTimer then
if e.lncyWallkick == 0 then
m.wallKickTimer = math.max(m.wallKickTimer, gGlobalSyncTable.jumpLeniency)
end
e.lncyWallkick = m.wallKickTimer
end
end
hook_event(HOOK_BEFORE_MARIO_UPDATE, jump_leniency)
--Crouching
--Actions you're allowed leniency out of
--LNCY_CROUCH allows for crouch leniency
LNCY_GROUND = 1
LNCY_CROUCH = 2
LNCY_GROUND_ACTIONS = {
[ACT_BACKFLIP_LAND] = LNCY_GROUND,
[ACT_BACKFLIP_LAND_STOP] = LNCY_GROUND,
[ACT_BRAKING] = LNCY_CROUCH,
[ACT_COUGHING] = LNCY_CROUCH,
[ACT_CROUCHING] = LNCY_GROUND,
[ACT_DECELERATING] = LNCY_CROUCH,
[ACT_DOUBLE_JUMP_LAND] = LNCY_GROUND,
[ACT_DOUBLE_JUMP_LAND_STOP] = LNCY_GROUND,
[ACT_FINISH_TURNING_AROUND] = LNCY_GROUND,
[ACT_FREEFALL_LAND] = LNCY_GROUND,
[ACT_FREEFALL_LAND_STOP] = LNCY_GROUND,
[ACT_HOLD_DECELERATING] = LNCY_CROUCH,
[ACT_HOLD_FREEFALL_LAND] = LNCY_GROUND,
[ACT_HOLD_FREEFALL_LAND_STOP] = LNCY_GROUND,
[ACT_JUMP_LAND] = LNCY_GROUND,
[ACT_JUMP_LAND_STOP] = LNCY_GROUND,
[ACT_LONG_JUMP_LAND] = LNCY_GROUND,
[ACT_LONG_JUMP_LAND_STOP] = LNCY_GROUND,
[ACT_PUNCHING] = LNCY_GROUND,
[ACT_SIDE_FLIP_LAND] = LNCY_GROUND,
[ACT_SIDE_FLIP_LAND_STOP] = LNCY_GROUND,
[ACT_STANDING_AGAINST_WALL] = LNCY_CROUCH,
[ACT_START_CROUCHING] = LNCY_GROUND,
[ACT_STOP_CROUCHING] = LNCY_GROUND,
[ACT_TRIPLE_JUMP_LAND] = LNCY_GROUND,
[ACT_TRIPLE_JUMP_LAND_STOP] = LNCY_GROUND,
[ACT_TURNING_AROUND] = LNCY_CROUCH,
[ACT_WALKING] = LNCY_CROUCH,
}
--Main function
--- @param m MarioState
function crouch_leniency(m)
--Ground Jump Leniency (pressing Z and A/B together)
if (m.action & ACT_FLAG_AIR) == 0
and LNCY_GROUND_ACTIONS[m.action] ~= nil and LNCY_GROUND_ACTIONS[m.action] >= LNCY_GROUND
and (m.controller.buttonDown & Z_TRIG) ~= 0 then
if (m.controller.buttonPressed & (A_BUTTON|B_BUTTON)) ~= 0 then
--Standing actions
if (m.action & ACT_FLAG_STATIONARY) ~= 0 then
if (m.controller.buttonPressed & A_BUTTON) ~= 0 then
set_jumping_action(m, ACT_BACKFLIP, 0)
else
set_mario_action(m, ACT_PUNCHING, 9)
end
--Moving actions
elseif m.forwardVel > 10.0 then
if (m.controller.buttonPressed & A_BUTTON) ~= 0 then
set_jumping_action(m, ACT_LONG_JUMP, 0)
else
set_mario_action(m, ACT_SLIDE_KICK, 0)
end
end
--Crouch Leniency (hold Z to crouch instead of needing to press it)
elseif LNCY_GROUND_ACTIONS[m.action] >= LNCY_CROUCH then
set_mario_action(m, (m.action & ACT_FLAG_STATIONARY) == 0 and ACT_CROUCH_SLIDE or ACT_START_CROUCHING, 0)
end
end
end
hook_event(HOOK_BEFORE_MARIO_UPDATE, crouch_leniency)

View file

@ -0,0 +1,18 @@
--Scrolling Textures
add_scroll_target(0, "arena_rainbow_dl_StarRoad_mesh_layer_5_vtx_0", 0, 539)
add_scroll_target(1, "arena_rainbow_dl_RoadBuilding_mesh_layer_1_vtx_0", 0, 122)
add_scroll_target(2, "arena_rainbow_dl_StarRoad_mesh_layer_5_vtx_3", 0, 587)
add_scroll_target(3, "arena_rainbow_dl_StarRoad_mesh_layer_5_vtx_2", 0, 249)
add_scroll_target(4, "arena_rainbow_dl_StarRoad_mesh_layer_5_vtx_1", 0, 1096)
add_scroll_target(5, "arena_rainbow_dl_Main_Platform_mesh_layer_5_vtx_0", 0, 1060)
add_scroll_target(6, "arena_rainbow_dl_Torus_mesh_layer_5_vtx_0", 0, 880)
--Stars
add_scroll_target(7, "arena_rainbow_dl_FlagPositionsStars1_mesh_layer_5_vtx_0", 0, 68)
add_scroll_target(8, "arena_rainbow_dl_FlagPositionsStars1_mesh_layer_5_vtx_1", 0, 68)
add_scroll_target(9, "arena_rainbow_dl_FlagPositionsStars2_mesh_layer_5_vtx_0", 0, 68)
add_scroll_target(10, "arena_rainbow_dl_FlagPositionsStars2_mesh_layer_5_vtx_1", 0, 68)
--MidStarRoad
add_scroll_target(11, "arena_rainbow_dl_StarRoadMidAmbience_mesh_layer_5_vtx_1", 0, 290)
--GreyStars
add_scroll_target(12, "arena_rainbow_dl_FlagPositionsGraySideStars_mesh_layer_5_vtx_0", 0, 272)
add_scroll_target(13, "arena_rainbow_dl_FlagPositionsGrayTopStars_mesh_layer_5_vtx_0", 0, 136)

125
mods/arena/arena-sound.lua Normal file
View file

@ -0,0 +1,125 @@
local pauseMenuShouldShowMusic = true
local pauseMenuMusicRGBA = {200,200,200,255}
local pauseMenuShowLevelID = false
local curMap = -1
local audioMainPaused = false
local audioMain = nil --Used for the main audio
local audioSpecial = nil --Used for things like cap music
local audioCurSeq = nil
local bgms = {
[56] = {audio='rainbow.ogg', loopEnd = 218.781, loopStart = 06.975, volume = -5, name="Ric Fellini - All my Loving"}, --B1
[57] = {audio='space.ogg', loopEnd = 300, loopStart = 06.975, volume = -5, name="Echo the Dolphin - Title Screen"}, --B1
}
-- disable cap music
function music()
local np = gNetworkPlayers[0]
if np.currLevelNum == LEVEL_ARENA_RAINBOW or LEVEL_ARENA_SPACE then
stop_cap_music()
end
end
hook_event(HOOK_UPDATE, music)
function handleMusic()
------------------------------------------------------
-- Handle stopping/starting of music --
------------------------------------------------------
--Handle main course music
if (curMap ~= gNetworkPlayers[0].currLevelNum and gMarioStates[0].area.macroObjects ~= nil) then
curMap = gNetworkPlayers[0].currLevelNum
audioCurSeq = get_current_background_music()
if (audioMain ~= nil) then
audio_stream_stop(audioMain)
audio_stream_destroy(audioMain)
audioMain = nil
end
if (bgms[curMap] ~= nil and bgms[curMap].audio ~= nil) then
set_background_music(0,0,0)
audioMain = audio_stream_load(bgms[curMap].audio)
if (audioMain ~= nil) then
audio_stream_set_looping(audioMain, true)
audio_stream_play(audioMain, true, bgms[curMap].volume);
print("Playing new audio " .. bgms[curMap].name)
else
djui_popup_create('Missing audio!: ' .. bgms[curMap].audio, 10)
print("Attempted to load filed audio file, but couldn't find it on the system: " .. bgms[curMap].audio)
end
else
print("No audio for this map, so not stopping default: " .. curMap)
end
end
--Handle cap music
if (gMarioStates[0].capTimer > 0 and bgms[-2] ~= nil) then
--Handle pausing main streamed music, if applicable.
if (audioMain ~= nil and audioMainPaused == false) then
audioMainPaused = true
audio_stream_pause(audioMain)
end
--Start up cap music if it's defined.
if (audioSpecial == nil) then
set_background_music(0,0,0)
stop_cap_music()
audioSpecial = audio_stream_load(bgms[-2].audio)
if (audioSpecial ~= nil) then
audio_stream_set_looping(audioSpecial, true)
audio_stream_play(audioSpecial, true, bgms[-2].volume)
print("Playing cap audio " .. bgms[-2].name)
else
djui_popup_create('Missing audio!: ' .. bgms[-2].audio, 3)
print("Attempted to load filed audio file, but couldn't find it on the system: " .. bgms[-2].audio)
end
end
else
if (audioSpecial ~= nil) then
audio_stream_stop(audioSpecial)
audio_stream_destroy(audioSpecial)
audioSpecial = nil
if (audioMain ~= nil and audioMainPaused == true) then
audioMainPaused = false
audio_stream_play(audioMain, false, bgms[curMap].volume)
else
set_background_music(0, audioCurSeq, 10)
end
end
end
if (audioMain ~= nil) then
local curPosition = audio_stream_get_position(audioMain)
if (curPosition >= bgms[curMap].loopEnd ) then
local minus = bgms[curMap].loopStart - bgms[curMap].loopEnd
audio_stream_set_position(audioMain, curPosition - math.abs(minus))
end
end
if (audioSpecial ~= nil) then
local curPosition = audio_stream_get_position(audioSpecial)
if (curPosition >= bgms[-2].loopEnd) then
local minus = bgms[-2].loopStart - bgms[-2].loopEnd
audio_stream_set_position(audioSpecial, curPosition - math.abs(minus))
end
end
end
function hud_render()
if (pauseMenuShouldShowMusic == true and is_game_paused()) then
djui_hud_set_resolution(RESOLUTION_DJUI);
djui_hud_set_font(FONT_NORMAL);
local screenWidth = djui_hud_get_screen_width()
local screenHeight = djui_hud_get_screen_height()
local height = 64
local y = screenHeight - height
djui_hud_set_color(pauseMenuMusicRGBA[1], pauseMenuMusicRGBA[2], pauseMenuMusicRGBA[3], pauseMenuMusicRGBA[4]);
local text = "";
if (pauseMenuShowLevelID == true) then
text = "Level ID: " .. gNetworkPlayers[0].currLevelNum
elseif (audioSpecial ~= nil) then
text = "Music: " .. bgms[-2].name
elseif (audioMain ~= nil) then
text = "Music: " .. bgms[curMap].name
end
djui_hud_print_text(text, 5, y, 1);
end
end
hook_event(HOOK_ON_HUD_RENDER, hud_render)
hook_event(HOOK_UPDATE, handleMusic)

Binary file not shown.

View file

@ -20,7 +20,7 @@ gGameModes = {
[GAME_MODE_FT] = { shortName = 'FT', name = 'Flag Tag', teams = false, teamSpawns = false, useScore = true, scoreCap = 60, minPlayers = 0, maxPlayers = 99 },
[GAME_MODE_TFT] = { shortName = 'TFT', name = 'Team Flag Tag', teams = true, teamSpawns = false, useScore = true, scoreCap = 120, minPlayers = 4, maxPlayers = 99 },
[GAME_MODE_KOTH] = { shortName = 'KOTH', name = 'King of the Hill', teams = false, teamSpawns = false, useScore = true, scoreCap = 45, minPlayers = 0, maxPlayers = 6 },
[GAME_MODE_TKOTH] = { shortName = 'TKOTH', name = 'Team King of the Hill', teams = true, teamSpawns = false, useScore = true, scoreCap = 90, minPlayers = 4, maxPlayers = 99 },
[GAME_MODE_TKOTH] = { shortName = 'TKOTH', name = 'Team King of the Hill', teams = true, teamSpawns = false, useScore = true, scoreCap = 90, minPlayers = 4, maxPlayers = 99 }
}
LEVEL_ARENA_ORIGIN = level_register('level_arena_origin_entry', COURSE_NONE, 'Origin', 'origin', 28000, 0x28, 0x28, 0x28)
@ -29,14 +29,16 @@ LEVEL_ARENA_PILLARS = level_register('level_arena_pillars_entry', COURSE_NON
LEVEL_ARENA_FORTS = level_register('level_arena_forts_entry', COURSE_NONE, 'Forts', 'forts', 28000, 0x28, 0x28, 0x28)
LEVEL_ARENA_CITADEL = level_register('level_arena_citadel_entry', COURSE_NONE, 'Citadel', 'citadel', 28000, 0x28, 0x28, 0x28)
LEVEL_ARENA_SPIRE = level_register('level_arena_spire_entry', COURSE_NONE, 'Spire', 'spire', 28000, 0x28, 0x28, 0x28)
LEVEL_ARENA_RAINBOW = level_register('level_arena_rainbow_entry', COURSE_NONE, 'Rainbow', 'rainbow', 28000, 0x28, 0x28, 0x28)
local gGameLevels = {
{ level = LEVEL_ARENA_ORIGIN, name = 'Origin' },
{ level = LEVEL_ARENA_SKY_BEACH, name = 'Sky Beach' },
{ level = LEVEL_ARENA_PILLARS, name = 'Pillars' },
{ level = LEVEL_ARENA_FORTS, name = 'Forts' },
{ level = LEVEL_ARENA_CITADEL, name = 'Citadel' },
{ level = LEVEL_ARENA_SPIRE, name = 'Spire' },
{ level = LEVEL_ARENA_CITADEL, name = 'Citadel' },
{ level = LEVEL_ARENA_SPIRE, name = 'Spire' },
{ level = LEVEL_ARENA_RAINBOW, name = 'Rainbow' }
}
-- expose certain functions to other mods
@ -464,7 +466,7 @@ function on_gamemode_command(msg)
end
if msg == 'random' then
djui_chat_message_create('Setting to random gamemode.')
djui_chat_message_create("[Arena] Setting to random gamemode.")
sRandomizeMode = true
round_end()
sWaitTimer = 1
@ -473,7 +475,7 @@ function on_gamemode_command(msg)
end
if setMode ~= nil then
djui_chat_message_create('Setting game mode.')
djui_chat_message_create("[Arena] Setting game mode.")
gGlobalSyncTable.gameMode = setMode
sRandomizeMode = false
round_end()
@ -508,6 +510,21 @@ function on_level_command(msg)
return true
end
function on_jump_leniency_command(msg)
local num = tonumber(msg)
if not network_is_server and not network_is_moderator() then
djui_chat_message_create("\\#ffa0a0\\[Arena] You need to be a moderator to use this command.")
return true
elseif num == nil then
djui_chat_message_create("\\#ffa0a0\\[Arena] Invalid number!")
return true
else
gGlobalSyncTable.jumpLeniency = num
djui_chat_message_create("[Arena] The number of jump leniency frames has been set to " .. num)
return true
end
end
local function on_arena_command(msg)
local args = split(msg)
if args[1] == "gamemode" then
@ -518,9 +535,11 @@ local function on_arena_command(msg)
name = name .. " " .. args[3]
end
return on_level_command(name or "")
elseif args[1] == "jump-leniency" then
return on_jump_leniency_command(args[2] or "")
end
djui_chat_message_create("/arena \\#00ffff\\[gamemode|level]")
djui_chat_message_create("/arena \\#00ffff\\[gamemode|level|jump-leniency]")
return true
end
@ -548,7 +567,7 @@ function get_level_choices()
end
if network_is_server() then
hook_chat_command("arena", "\\#00ffff\\[gamemode|level]", on_arena_command)
hook_chat_command("arena", "\\#00ffff\\[gamemode|level|jump-leniency]", on_arena_command)
end
if _G.dayNightCycleApi ~= nil then

Binary file not shown.