Remove vestigial romhack camera code from mods

This commit is contained in:
MysterD 2023-06-22 02:16:26 -07:00
parent c92b62fe58
commit 274594cbaf
6 changed files with 2 additions and 140 deletions

View File

@ -329,8 +329,6 @@ function mario_local_update(m)
local s = gPlayerSyncTable[m.playerIndex] local s = gPlayerSyncTable[m.playerIndex]
local e = gMarioStateExtras[m.playerIndex] local e = gMarioStateExtras[m.playerIndex]
override_camera()
-- decrease cooldown -- decrease cooldown
if e.attackCooldown > 0 then if e.attackCooldown > 0 then
e.attackCooldown = e.attackCooldown - 1 e.attackCooldown = e.attackCooldown - 1

View File

@ -1,40 +0,0 @@
camera_set_use_course_specific_settings(false)
sOverrideCameraModes = {
[CAMERA_MODE_RADIAL] = true,
[CAMERA_MODE_OUTWARD_RADIAL] = true,
[CAMERA_MODE_CLOSE] = true,
[CAMERA_MODE_SLIDE_HOOT] = true,
[CAMERA_MODE_PARALLEL_TRACKING] = true,
[CAMERA_MODE_FIXED] = true,
[CAMERA_MODE_8_DIRECTIONS] = true,
[CAMERA_MODE_FREE_ROAM] = true,
[CAMERA_MODE_SPIRAL_STAIRS] = true,
}
local m = gMarioStates[0]
function override_camera()
local np = gNetworkPlayers[0]
if sOverrideCameraModes[m.area.camera.mode] == nil or np.currLevelNum == LEVEL_BOWSER_1 or np.currLevelNum == LEVEL_BOWSER_2 or np.currLevelNum == LEVEL_BOWSER_3 then
return
end
set_camera_mode(m.area.camera, CAMERA_MODE_ROM_HACK, 0)
end
function on_set_camera_mode(c, mode, frames)
if sOverrideCameraModes[mode] ~= nil and mode ~= CAMERA_MODE_ROM_HACK then
-- do not allow change
set_camera_mode(c, CAMERA_MODE_ROM_HACK, frames)
return false
end
end
hook_event(HOOK_ON_SET_CAMERA_MODE, on_set_camera_mode)
hook_event(HOOK_UPDATE, function()
if (m.controller.buttonPressed & L_TRIG) ~= 0 then
center_rom_hack_camera()
end
end)

View File

@ -1,38 +0,0 @@
sOverrideCameraModes = {
[CAMERA_MODE_RADIAL] = true,
[CAMERA_MODE_OUTWARD_RADIAL] = true,
[CAMERA_MODE_CLOSE] = true,
[CAMERA_MODE_SLIDE_HOOT] = true,
[CAMERA_MODE_PARALLEL_TRACKING] = true,
[CAMERA_MODE_FIXED] = true,
[CAMERA_MODE_8_DIRECTIONS] = true,
[CAMERA_MODE_FREE_ROAM] = true,
[CAMERA_MODE_SPIRAL_STAIRS] = true,
}
local m = gMarioStates[0]
function override_camera()
local np = gNetworkPlayers[0]
if sOverrideCameraModes[m.area.camera.mode] == nil or np.currLevelNum == LEVEL_BOWSER_1 or np.currLevelNum == LEVEL_BOWSER_2 or np.currLevelNum == LEVEL_BOWSER_3 then
return
end
set_camera_mode(m.area.camera, CAMERA_MODE_ROM_HACK, 0)
end
function on_set_camera_mode(c, mode, frames)
if sOverrideCameraModes[mode] ~= nil and mode ~= CAMERA_MODE_ROM_HACK then
-- do not allow change
set_camera_mode(c, CAMERA_MODE_ROM_HACK, frames)
return false
end
end
hook_event(HOOK_ON_SET_CAMERA_MODE, on_set_camera_mode)
hook_event(HOOK_UPDATE, function()
if (m.controller.buttonPressed & L_TRIG) ~= 0 then
center_rom_hack_camera()
end
end)

View File

@ -86,20 +86,11 @@ smlua_audio_utils_replace_sequence(0x31, 0x11, 80, "31_Seq_sm74EE_custom")
------------ ------------
-- camera -- -- camera --
------------ ------------
camera_set_romhack_override(RCO_ALL_EXCEPT_BOWSER)
camera_set_use_course_specific_settings(false) camera_set_use_course_specific_settings(false)
---------------------------------- ----------------------------------
function mario_update_local(m)
override_camera()
end
function mario_update(m)
if m.playerIndex == 0 then
mario_update_local(m)
end
end
function on_level_init() function on_level_init()
local m = gMarioStates[0] local m = gMarioStates[0]
local np = gNetworkPlayers[0] local np = gNetworkPlayers[0]
@ -129,7 +120,6 @@ function on_swap_command(msg)
return true return true
end end
hook_event(HOOK_MARIO_UPDATE, mario_update)
hook_event(HOOK_ON_LEVEL_INIT, on_level_init) hook_event(HOOK_ON_LEVEL_INIT, on_level_init)
hook_event(HOOK_GET_STAR_COLLECTION_DIALOG, get_star_collection_dialog) hook_event(HOOK_GET_STAR_COLLECTION_DIALOG, get_star_collection_dialog)
hook_chat_command('swap', "swap between Extreme Edition and normal", on_swap_command) hook_chat_command('swap', "swap between Extreme Edition and normal", on_swap_command)

View File

@ -1,38 +0,0 @@
sOverrideCameraModes = {
[CAMERA_MODE_RADIAL] = true,
[CAMERA_MODE_OUTWARD_RADIAL] = true,
[CAMERA_MODE_CLOSE] = true,
[CAMERA_MODE_SLIDE_HOOT] = true,
[CAMERA_MODE_PARALLEL_TRACKING] = true,
[CAMERA_MODE_FIXED] = true,
[CAMERA_MODE_8_DIRECTIONS] = true,
[CAMERA_MODE_FREE_ROAM] = true,
[CAMERA_MODE_SPIRAL_STAIRS] = true,
}
local m = gMarioStates[0]
function override_camera()
local np = gNetworkPlayers[0]
if sOverrideCameraModes[m.area.camera.mode] == nil or np.currLevelNum == LEVEL_BOWSER_1 or np.currLevelNum == LEVEL_BOWSER_2 or np.currLevelNum == LEVEL_BOWSER_3 then
return
end
set_camera_mode(m.area.camera, CAMERA_MODE_ROM_HACK, 0)
end
function on_set_camera_mode(c, mode, frames)
if sOverrideCameraModes[mode] ~= nil and mode ~= CAMERA_MODE_ROM_HACK then
-- do not allow change
set_camera_mode(c, CAMERA_MODE_ROM_HACK, frames)
return false
end
end
hook_event(HOOK_ON_SET_CAMERA_MODE, on_set_camera_mode)
hook_event(HOOK_UPDATE, function()
if (m.controller.buttonPressed & L_TRIG) ~= 0 then
center_rom_hack_camera()
end
end)

View File

@ -101,20 +101,11 @@ smlua_audio_utils_replace_sequence(0x32, 0x25, 80, "32_Seq_smsrdeluxe_custom")
------------ ------------
-- camera -- -- camera --
------------ ------------
camera_set_romhack_override(RCO_ALL_EXCEPT_BOWSER)
camera_set_use_course_specific_settings(false) camera_set_use_course_specific_settings(false)
---------------------------------- ----------------------------------
function mario_update_local(m)
override_camera()
end
function mario_update(m)
if m.playerIndex == 0 then
mario_update_local(m)
end
end
function on_death() function on_death()
local m = gMarioStates[0] local m = gMarioStates[0]
if m.numLives <= 0 then if m.numLives <= 0 then
@ -130,7 +121,6 @@ function on_warp_and_init() -- 130 stars castle grounds music
end end
end end
hook_event(HOOK_MARIO_UPDATE, mario_update)
hook_event(HOOK_ON_DEATH, on_death) hook_event(HOOK_ON_DEATH, on_death)
hook_event(HOOK_ON_LEVEL_INIT, on_warp_and_init) hook_event(HOOK_ON_LEVEL_INIT, on_warp_and_init)
hook_event(HOOK_ON_WARP, on_warp_and_init) hook_event(HOOK_ON_WARP, on_warp_and_init)