From 70c10e6526e5d9e13e6cdab106410f6bf68b59c1 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Sat, 16 Dec 2023 13:57:24 -0500 Subject: [PATCH] Add DX checks to Arena --- mods/arena/aa-arena-constants.lua | 12 ++++++++++++ mods/arena/arena-custom-animations.lua | 2 ++ mods/arena/arena-flag.lua | 2 ++ mods/arena/arena-hud.lua | 2 ++ mods/arena/arena-item-held.lua | 2 ++ mods/arena/arena-item.lua | 4 +++- mods/arena/arena-koth-point.lua | 2 ++ mods/arena/arena-lighting.lua | 2 ++ mods/arena/arena-moveset.lua | 2 ++ mods/arena/arena-network.lua | 2 ++ mods/arena/arena-player.lua | 2 ++ mods/arena/arena-proj-bobomb.lua | 2 ++ mods/arena/arena-proj-cannon-ball.lua | 2 ++ mods/arena/arena-proj-flame.lua | 2 ++ mods/arena/arena-scrolling-textures.lua | 2 ++ mods/arena/arena-sound.lua | 2 ++ mods/arena/arena-sparkle.lua | 2 ++ mods/arena/arena-spawn.lua | 2 ++ mods/arena/arena-spring.lua | 2 ++ mods/arena/arena-utils.lua | 1 + mods/arena/main.lua | 3 +++ 21 files changed, 53 insertions(+), 1 deletion(-) diff --git a/mods/arena/aa-arena-constants.lua b/mods/arena/aa-arena-constants.lua index fdfda77b1..4b3b3d8ed 100644 --- a/mods/arena/aa-arena-constants.lua +++ b/mods/arena/aa-arena-constants.lua @@ -1,3 +1,15 @@ +if SM64COOPDX_VERSION == nil then + local first = false + hook_event(HOOK_ON_LEVEL_INIT, function() + if not first then + first = true + play_sound(SOUND_MENU_CAMERA_BUZZ, gMarioStates[0].marioObj.header.gfx.cameraToObject) + djui_chat_message_create("\\#ff7f7f\\This version of Arena is not supported with sm64ex-coop\nas it uses sm64coopdx exclusive Lua functionality.\n\\#dcdcdc\\To play this mod, try out sm64coopdx at\n\\#7f7fff\\https://sm64coopdx.com") + end + end) + return +end + ITEM_NONE = 0 ITEM_METAL_CAP = 1 ITEM_HAMMER = 2 diff --git a/mods/arena/arena-custom-animations.lua b/mods/arena/arena-custom-animations.lua index 00de09679..a2c9ebbb5 100644 --- a/mods/arena/arena-custom-animations.lua +++ b/mods/arena/arena-custom-animations.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + smlua_anim_util_register_animation("luigi_run", 0, 0, diff --git a/mods/arena/arena-flag.lua b/mods/arena/arena-flag.lua index 9ed13d7b5..0351823ae 100644 --- a/mods/arena/arena-flag.lua +++ b/mods/arena/arena-flag.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + ARENA_FLAG_INVALID_GLOBAL = 0xFF --- diff --git a/mods/arena/arena-hud.lua b/mods/arena/arena-hud.lua index f10cebaaa..9f962e639 100644 --- a/mods/arena/arena-hud.lua +++ b/mods/arena/arena-hud.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + gHudIcons = { flags = { [0] = { tex = TEX_FLAG, prevX = 0, prevY = 0, r = 255, g = 255, b = 255 }, diff --git a/mods/arena/arena-item-held.lua b/mods/arena/arena-item-held.lua index cd54abdf4..b2de864dd 100644 --- a/mods/arena/arena-item-held.lua +++ b/mods/arena/arena-item-held.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + gItemHeld = {} -- setup held items diff --git a/mods/arena/arena-item.lua b/mods/arena/arena-item.lua index afac21047..5a36000be 100644 --- a/mods/arena/arena-item.lua +++ b/mods/arena/arena-item.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + local arenaItemTimeout = 30 * 15 -- 15 seconds ----------------- @@ -58,7 +60,7 @@ function bhv_arena_item_collect_metal_cap(obj) m.flags = m.flags | MARIO_CAP_ON_HEAD - play_sound(SOUND_MENU_STAR_SOUND, m.marioObj.header.gfx.cameraToObject) + play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource) play_character_sound(m, CHAR_SOUND_HERE_WE_GO) play_cap_music(capMusic) diff --git a/mods/arena/arena-koth-point.lua b/mods/arena/arena-koth-point.lua index e62dce22d..7b8fa82b5 100644 --- a/mods/arena/arena-koth-point.lua +++ b/mods/arena/arena-koth-point.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + sArenaKothPoints = {} function bhv_arena_koth_init(obj) diff --git a/mods/arena/arena-lighting.lua b/mods/arena/arena-lighting.lua index 8e73ad698..e441300bb 100644 --- a/mods/arena/arena-lighting.lua +++ b/mods/arena/arena-lighting.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + -- lighting for Rainbow Road function on_level_init() diff --git a/mods/arena/arena-moveset.lua b/mods/arena/arena-moveset.lua index 3161894b3..319d5e071 100644 --- a/mods/arena/arena-moveset.lua +++ b/mods/arena/arena-moveset.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + ---------------- -- Teching v2 -- ---------------- diff --git a/mods/arena/arena-network.lua b/mods/arena/arena-network.lua index e394c9f57..b98d24874 100644 --- a/mods/arena/arena-network.lua +++ b/mods/arena/arena-network.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + PACKET_ARENA_DEATH = 1 PACKET_ARENA_HAMMER_HIT = 2 PACKET_ARENA_RESPAWN = 3 diff --git a/mods/arena/arena-player.lua b/mods/arena/arena-player.lua index 0b578f52d..22c7191b0 100644 --- a/mods/arena/arena-player.lua +++ b/mods/arena/arena-player.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + ------------ -- tables -- ------------ diff --git a/mods/arena/arena-proj-bobomb.lua b/mods/arena/arena-proj-bobomb.lua index 533eb36d2..2906b24c8 100644 --- a/mods/arena/arena-proj-bobomb.lua +++ b/mods/arena/arena-proj-bobomb.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + define_custom_obj_fields({ oArenaBobombGlobalOwner = 'u32', }) diff --git a/mods/arena/arena-proj-cannon-ball.lua b/mods/arena/arena-proj-cannon-ball.lua index 3a99e8f1e..176631916 100644 --- a/mods/arena/arena-proj-cannon-ball.lua +++ b/mods/arena/arena-proj-cannon-ball.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + define_custom_obj_fields({ oArenaCannonBallGlobalOwner = 'u32', oArenaCannonBallSize = 'f32', diff --git a/mods/arena/arena-proj-flame.lua b/mods/arena/arena-proj-flame.lua index 537f69023..ac85be875 100644 --- a/mods/arena/arena-proj-flame.lua +++ b/mods/arena/arena-proj-flame.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + define_custom_obj_fields({ oArenaFlameGlobalOwner = 'u32', }) diff --git a/mods/arena/arena-scrolling-textures.lua b/mods/arena/arena-scrolling-textures.lua index af77493d2..7f99ef43a 100644 --- a/mods/arena/arena-scrolling-textures.lua +++ b/mods/arena/arena-scrolling-textures.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + --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) diff --git a/mods/arena/arena-sound.lua b/mods/arena/arena-sound.lua index c852e9d15..b48b979c9 100644 --- a/mods/arena/arena-sound.lua +++ b/mods/arena/arena-sound.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + local pauseMenuShouldShowMusic = true local pauseMenuMusicRGBA = {200,200,200,255} local pauseMenuShowLevelID = false diff --git a/mods/arena/arena-sparkle.lua b/mods/arena/arena-sparkle.lua index 7c31b4927..fb7525aec 100644 --- a/mods/arena/arena-sparkle.lua +++ b/mods/arena/arena-sparkle.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + define_custom_obj_fields({ oArenaSparkleOwner = 'u32', oArenaSparkleOffsetX = 'f32', diff --git a/mods/arena/arena-spawn.lua b/mods/arena/arena-spawn.lua index 87bd0f133..0f619163e 100644 --- a/mods/arena/arena-spawn.lua +++ b/mods/arena/arena-spawn.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + sArenaSpawns = {} function bhv_arena_spawn_init(obj) diff --git a/mods/arena/arena-spring.lua b/mods/arena/arena-spring.lua index 0ac7eebfe..f5c45c169 100644 --- a/mods/arena/arena-spring.lua +++ b/mods/arena/arena-spring.lua @@ -1,3 +1,5 @@ +if SM64COOPDX_VERSION == nil then return end + define_custom_obj_fields({ oArenaSpringSprung = 'u32', }) diff --git a/mods/arena/arena-utils.lua b/mods/arena/arena-utils.lua index b19032046..6d9f1eda4 100644 --- a/mods/arena/arena-utils.lua +++ b/mods/arena/arena-utils.lua @@ -1,3 +1,4 @@ +if SM64COOPDX_VERSION == nil then return end function active_player(m) local np = gNetworkPlayers[m.playerIndex] diff --git a/mods/arena/main.lua b/mods/arena/main.lua index d65083290..a9e69edea 100644 --- a/mods/arena/main.lua +++ b/mods/arena/main.lua @@ -1,6 +1,9 @@ -- name: Arena -- description: A arena-shooter inspired game mode with custom weapons and levels.\nSeven gamemodes in one, three custom stages, five weapons. -- incompatible: gamemode arena +-- deluxe: true + +if SM64COOPDX_VERSION == nil then return end GAME_STATE_ACTIVE = 1 GAME_STATE_INACTIVE = 2