From 57af112f3700eee1b197bb4abe84b10a2cc9aea5 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:45:48 -0400 Subject: [PATCH] Uncompile mQuake --- mods/mquake/_mquake_a_constants.lua | 585 +++++++++++++++ mods/mquake/_mquake_a_constants_32.luac | Bin 15251 -> 0 bytes mods/mquake/_mquake_a_constants_64.luac | Bin 15251 -> 0 bytes mods/mquake/_mquake_b_physics.lua | 370 ++++++++++ mods/mquake/_mquake_b_physics_32.luac | Bin 7631 -> 0 bytes mods/mquake/_mquake_b_physics_64.luac | Bin 7631 -> 0 bytes mods/mquake/_mquake_c_moveset_functions.lua | 313 ++++++++ .../_mquake_c_moveset_functions_32.luac | Bin 7854 -> 0 bytes .../_mquake_c_moveset_functions_64.luac | Bin 7854 -> 0 bytes mods/mquake/_mquake_d_actions.lua | 517 ++++++++++++++ mods/mquake/_mquake_d_actions_32.luac | Bin 13577 -> 0 bytes mods/mquake/_mquake_d_actions_64.luac | Bin 13577 -> 0 bytes mods/mquake/_mquake_e_hook_functions.lua | 666 ++++++++++++++++++ mods/mquake/_mquake_e_hook_functions_32.luac | Bin 17951 -> 0 bytes mods/mquake/_mquake_e_hook_functions_64.luac | Bin 17951 -> 0 bytes mods/mquake/_mquake_f_hooks.lua | 95 +++ mods/mquake/_mquake_f_hooks_32.luac | Bin 5808 -> 0 bytes mods/mquake/_mquake_f_hooks_64.luac | Bin 5808 -> 0 bytes mods/mquake/_mquake_g_api.lua | 143 ++++ mods/mquake/_mquake_g_api_32.luac | Bin 5474 -> 0 bytes mods/mquake/_mquake_g_api_64.luac | Bin 5474 -> 0 bytes mods/mquake/main.lua | 4 +- 22 files changed, 2690 insertions(+), 3 deletions(-) create mode 100644 mods/mquake/_mquake_a_constants.lua delete mode 100644 mods/mquake/_mquake_a_constants_32.luac delete mode 100644 mods/mquake/_mquake_a_constants_64.luac create mode 100644 mods/mquake/_mquake_b_physics.lua delete mode 100644 mods/mquake/_mquake_b_physics_32.luac delete mode 100644 mods/mquake/_mquake_b_physics_64.luac create mode 100644 mods/mquake/_mquake_c_moveset_functions.lua delete mode 100644 mods/mquake/_mquake_c_moveset_functions_32.luac delete mode 100644 mods/mquake/_mquake_c_moveset_functions_64.luac create mode 100644 mods/mquake/_mquake_d_actions.lua delete mode 100644 mods/mquake/_mquake_d_actions_32.luac delete mode 100644 mods/mquake/_mquake_d_actions_64.luac create mode 100644 mods/mquake/_mquake_e_hook_functions.lua delete mode 100644 mods/mquake/_mquake_e_hook_functions_32.luac delete mode 100644 mods/mquake/_mquake_e_hook_functions_64.luac create mode 100644 mods/mquake/_mquake_f_hooks.lua delete mode 100644 mods/mquake/_mquake_f_hooks_32.luac delete mode 100644 mods/mquake/_mquake_f_hooks_64.luac create mode 100644 mods/mquake/_mquake_g_api.lua delete mode 100644 mods/mquake/_mquake_g_api_32.luac delete mode 100644 mods/mquake/_mquake_g_api_64.luac diff --git a/mods/mquake/_mquake_a_constants.lua b/mods/mquake/_mquake_a_constants.lua new file mode 100644 index 00000000..d27928e7 --- /dev/null +++ b/mods/mquake/_mquake_a_constants.lua @@ -0,0 +1,585 @@ +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, { x = 0, y = 0, z = 0 }) + djui_chat_message_create("\\#ff7f7f\\mQuake is not supported with sm64ex-coop as 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 +local play_sound,clampf,allocate_mario_action,set_mario_action,vec3f_add,math_floor,get_id_from_behavior,obj_get_first,vec3f_dist,obj_get_next,obj_is_valid_for_interaction = play_sound,clampf,allocate_mario_action,set_mario_action,vec3f_add,math.floor,get_id_from_behavior,obj_get_first,vec3f_dist,obj_get_next,obj_is_valid_for_interaction + +gLevelValues.fixCollisionBugs = 1 +gLevelValues.fixCollisionBugsFalseLedgeGrab = 1 +gLevelValues.fixCollisionBugsGroundPoundBonks = 1 +gLevelValues.fixCollisionBugsPickBestWall = 1 +gLevelValues.fixCollisionBugsRoundedCorners = 1 +gLevelValues.fixVanishFloors = 1 +gServerSettings.stayInLevelAfterStar = 2 +gServerSettings.bubbleDeath = 0 + +if (network_is_server()) then + gGlobalSyncTable.Convar_StickySlope = false + gGlobalSyncTable.Convar_Gravity = 800 + gGlobalSyncTable.Convar_AirAccelerate = 10 + gGlobalSyncTable.Convar_AirClamp = 30 + gGlobalSyncTable.Convar_Accelerate = 10 + gGlobalSyncTable.Convar_PlayerSpeed = 1.0 + gGlobalSyncTable.Convar_PlayerFriction = 1.0 + gGlobalSyncTable.Convar_PlayerJumpHeight = 1.0 + gGlobalSyncTable.Convar_PlayerAllow_GroundPound = true + gGlobalSyncTable.Convar_PlayerAllow_WallJump = true + gGlobalSyncTable.Convar_PlayerAllow_Interact = true + + sv_sticky = false + sv_maxspeed = 180 + sv_maxspeed_crouch = 80 + sv_maxspeed_water = 180 + sv_playerspeed = 90 + sv_playerspeed_water = 90 + sv_playerspeed_water_shell = 300 + sv_upspeed_water = 180 + sv_playerspeed_crouch = 40 + sv_airaccelerate_value = 10 + sv_accelerate = 10 + sv_playerclamp_air = 30 + sv_gravity = 800 + + sv_waterfriction = 2.5 + sv_friction = 4 + sv_crouchfriction_scale = 0 + + sv_groundpound = true + sv_walljump = true + sv_interact = true + sv_jumpheight = 1.0 +else + sv_sticky = nil + sv_maxspeed = 0 + sv_maxspeed_crouch = 0 + sv_maxspeed_water = 0 + sv_maxvelocity = 0 + sv_playerspeed = 0 + sv_playerspeed_water = 0 + sv_playerspeed_water_shell = 0 + sv_upspeed_water = 0 + sv_playerspeed_crouch = 0 + sv_airaccelerate_value = 0 + sv_accelerate = 0 + sv_playerclamp_air = 0 + sv_gravity = 0 + + sv_waterfriction = 0 + sv_friction = 0 + sv_crouchfriction_scale = 0 + + sv_groundpound = nil + sv_walljump = nil + sv_interact = nil + sv_jumpheight = nil +end + +interactOverrides = { + [1]=function(m,o)end +} +throwOverrides = { + [1]=function(m,o)end +} +dropOverrides = { + [1]=function(m,o)end +} + +sv_maxvelocity = 1200 +sv_stopmovement = false +sv_playerheight = 160 +sv_crouchoffset = 60 +sv_playersubmergelevel = 100 +sv_camerayoffset = 8 +sv_stopspeed = 20 +sv_tickrate = 1/30 +sv_gravity_scale = 0.5 +sv_gaccel_scale = 0.75 +sv_physics_scale = 2 +sv_scalerate_inverse = 4 +sv_scalerate = 1 / sv_scalerate_inverse + +phys_friction_scale = sv_gaccel_scale * sv_physics_scale +phys_airaccel_scale = 4 + +cl_grounddefacto = 1 +cl_localangles = {forward={x=0,y=0,z=0},right={x=0,y=0,z=0},rawForward={x=0,y=0,z=0}} +cl_speedbuffer = {x=0,y=0,z=0} +cl_upwarpfix_vel = {x=0,y=0,z=0} +cl_upwarpfix_pos = {x=0,y=0,z=0} +cl_bowserthrow = false +cl_bowserthrow_previousYaw = 0 +cl_interacttimer = 0 +cl_red = 0 +cl_footstepTimer = 0 +cl_airstrafelimiter = 0 +cl_poleY = -1 + +cl_disableAccelPred = mod_storage_load_bool("mq_accelpred") +cl_altWalljumpKey = mod_storage_load_bool("mq_altwallj") +cl_fov = mod_storage_load_number("mq_fov") +if (cl_fov < 40 or cl_fov == nil) then cl_fov = 90 end + +-- Physics helpers +SurfaceStandableMinimum = { + [SURFACE_CLASS_NOT_SLIPPERY] = 0.01, + [SURFACE_HARD_NOT_SLIPPERY] = 0.01, + [SURFACE_CLASS_SLIPPERY] = 0.7, + [SURFACE_HARD_SLIPPERY] = 0.7, + [SURFACE_NO_CAM_COL_SLIPPERY] = 0.7, + [SURFACE_NOISE_SLIPPERY] = 0.7, + [SURFACE_SLIPPERY] = 0.7, + [SURFACE_CLASS_VERY_SLIPPERY] = 0.8, + [SURFACE_HARD_VERY_SLIPPERY] = 0.8, + [SURFACE_NO_CAM_COL_VERY_SLIPPERY] = 0.8, + [SURFACE_VERY_SLIPPERY] = 0.8, + [SURFACE_NOISE_VERY_SLIPPERY] = 0.8, + [SURFACE_NOISE_VERY_SLIPPERY_73] = 0.8, + [SURFACE_NOISE_VERY_SLIPPERY_74] = 0.8 +} + + +SurfaceFriction = { + [SURFACE_CLASS_NOT_SLIPPERY] = 1.0, + [SURFACE_HARD_NOT_SLIPPERY] = 1.0, + [SURFACE_CLASS_SLIPPERY] = 0.8, + [SURFACE_HARD_SLIPPERY] = 0.8, + [SURFACE_NO_CAM_COL_SLIPPERY] = 0.8, + [SURFACE_NOISE_SLIPPERY] = 0.8, + [SURFACE_SLIPPERY] = 0.8, + [SURFACE_CLASS_VERY_SLIPPERY] = 0.4, + [SURFACE_HARD_VERY_SLIPPERY] = 0.4, + [SURFACE_NO_CAM_COL_VERY_SLIPPERY] = 0.4, + [SURFACE_VERY_SLIPPERY] = 0.4, + [SURFACE_NOISE_VERY_SLIPPERY] = 0.4, + [SURFACE_NOISE_VERY_SLIPPERY_73] = 0.4, + [SURFACE_NOISE_VERY_SLIPPERY_74] = 0.4 +} + +AreaTypeFriction = { + [TERRAIN_SLIDE] = 0.225, -- incase i wanna give other types different friction values + [TERRAIN_SNOW] = 0.90 -- incase i wanna give other types different friction values +} +AreaTypeStandable = { + [TERRAIN_SLIDE] = 2.75, + [TERRAIN_SNOW] = 1.10 +} + +local function SV_GetAreaFriction(type) + if AreaTypeFriction[type] ~= nil then return AreaTypeFriction[type] end + return 1.0 +end +local function SV_GetAreaStandable(type) + if AreaTypeStandable[type] ~= nil then return AreaTypeStandable[type] end + return 1.0 +end + +function SV_GetSurfaceStandableMinimum(type,areaType) + areaFactor = SV_GetAreaStandable(areaType) + standableMinimum = 0.675 + if SurfaceStandableMinimum[type] ~= nil then standableMinimum = SurfaceStandableMinimum[type] end + return clampf(standableMinimum * areaFactor,0.01,0.999) +end + +function SV_GetSurfaceStandableFrictionMultiplier(type,areaType) + areaFactor = SV_GetAreaFriction(areaType) + standableMinimum = 1.0 + if SurfaceFriction[type] ~= nil then standableMinimum = SurfaceFriction[type] end + return clampf(standableMinimum * areaFactor,0.01,1.0) +end + +sv_gunmod_loaded = (_G.gunModApi ~= nil) + +-- Actions +ACT_DM_GROUNDED_MOVEMENT = allocate_mario_action(ACT_FLAG_MOVING | ACT_FLAG_CUSTOM_ACTION) +ACT_DM_GROUNDED_IDLE = allocate_mario_action(ACT_FLAG_MOVING | ACT_FLAG_IDLE | ACT_FLAG_CUSTOM_ACTION) -- fix for reading signs while moving on accident +ACT_DM_AIR_MOVEMENT = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_MOVING | ACT_FLAG_AIR | ACT_FLAG_CUSTOM_ACTION) +ACT_DM_GROUND_POUND_METAL = allocate_mario_action(ACT_GROUP_SUBMERGED | ACT_FLAG_ATTACKING | ACT_FLAG_MOVING | ACT_FLAG_CUSTOM_ACTION) +ACT_DM_GROUNDED_MOVEMENT_METAL = allocate_mario_action(ACT_GROUP_SUBMERGED | ACT_FLAG_MOVING | ACT_FLAG_WATER_OR_TEXT | ACT_FLAG_CUSTOM_ACTION) +ACT_DM_AIR_MOVEMENT_METAL = allocate_mario_action(ACT_GROUP_SUBMERGED | ACT_FLAG_MOVING | ACT_FLAG_WATER_OR_TEXT | ACT_FLAG_CUSTOM_ACTION) +ACT_DM_WATER_MOVEMENT = allocate_mario_action(ACT_GROUP_SUBMERGED | ACT_FLAG_MOVING | ACT_FLAG_WATER_OR_TEXT | ACT_FLAG_CUSTOM_ACTION) +ACT_DM_POLE_MOVEMENT = allocate_mario_action(ACT_GROUP_CUTSCENE | ACT_FLAG_MOVING | ACT_FLAG_CUSTOM_ACTION) + +-- Action helpers +DM_ACTIONS = { + [ACT_DM_GROUNDED_MOVEMENT] = 1, + [ACT_DM_GROUNDED_IDLE] = 1, + [ACT_DM_AIR_MOVEMENT] = 1, + [ACT_DM_GROUNDED_MOVEMENT_METAL] = 1, + [ACT_DM_AIR_MOVEMENT_METAL] = 1, + [ACT_DM_WATER_MOVEMENT] = 1, + [ACT_DM_POLE_MOVEMENT] = 1, + [ACT_TORNADO_TWIRLING] = 1, + [ACT_DM_GROUND_POUND_METAL] = 1, + [ACT_ELECTROCUTION] = 1, + [ACT_QUICKSAND_DEATH] = 1, + [ACT_SHOCKED] = 1, + [ACT_GRABBED] = 1, + [ACT_UNINITIALIZED] = 1, + [ACT_PULLING_DOOR] = 1, + [ACT_PUSHING_DOOR] = 1, + [ACT_EMERGE_FROM_PIPE] = 1, + [ACT_ENTERING_STAR_DOOR] = 1, + [ACT_SUFFOCATION] = 1, + [ACT_PUTTING_ON_CAP] = 1, + [ACT_DEATH_EXIT] = 1, + [ACT_DEATH_EXIT_LAND] = 1, + [ACT_SQUISHED] = 1, + [ACT_IDLE] = 1, + [ACT_DISAPPEARED] = 1, + [ACT_EXIT_AIRBORNE] = 1, + [ACT_EXIT_LAND_SAVE_DIALOG] = 1, + [ACT_HARD_BACKWARD_GROUND_KB] = 1, + [ACT_FALLING_DEATH_EXIT] = 1, + [ACT_FALLING_EXIT_AIRBORNE] = 1, + [ACT_DEATH_ON_BACK] = 1, + [ACT_DEATH_ON_STOMACH] = 1, + [ACT_DROWNING] = 1, + [ACT_BURNING_JUMP] = 1, + [ACT_SPECIAL_DEATH_EXIT] = 1, + [ACT_SPECIAL_EXIT_AIRBORNE] = 1, + [ACT_IN_CANNON] = 1, + [ACT_SHOT_FROM_CANNON] = 1, + [ACT_WAITING_FOR_DIALOG] = 1, + [ACT_READING_AUTOMATIC_DIALOG] = 1, + [ACT_READING_NPC_DIALOG] = 1, + [ACT_READING_SIGN] = 1, + [ACT_GRAB_POLE_FAST] = 1, + [ACT_GRAB_POLE_SLOW] = 1, + [ACT_CLIMBING_POLE] = 1, + [ACT_READING_SIGN] = 1, + [ACT_HOLDING_POLE] = 1, + [ACT_TOP_OF_POLE] = 1, + [ACT_TOP_OF_POLE_JUMP] = 1, + [ACT_WALL_KICK_AIR] = 1, + [ACT_TOP_OF_POLE_TRANSITION] = 1, + [ACT_GROUND_POUND] = 1, -- if marios y vel is low enough and you press crouch in the air while not holding jump, ground pound + [ACT_GROUND_POUND_LAND] = 1, -- manually added, if this is detected we can do a ground pound jump :3 + [ACT_STANDING_DEATH] = 1, + [ACT_INTRO_CUTSCENE] = 1, + [ACT_CREDITS_CUTSCENE] = 1, + [ACT_END_WAVING_CUTSCENE] = 1, + [ACT_END_PEACH_CUTSCENE] = 1, + [ACT_JUMBO_STAR_CUTSCENE] = 1, + -- [ACT_SPAWN_NO_SPIN_AIRBORNE] = 1, + [ACT_HOLDING_BOWSER] = 1, + -- [ACT_SPAWN_SPIN_AIRBORNE] = 1, + [ACT_CRAZY_BOX_BOUNCE] = 1, + [ACT_BBH_ENTER_JUMP] = 1, + [ACT_BBH_ENTER_SPIN] = 1, + [ACT_THROWN_FORWARD] = 1, + [ACT_THROWN_BACKWARD] = 1, + [ACT_GETTING_BLOWN] = 1, + [ACT_TELEPORT_FADE_IN] = 1, + [ACT_TELEPORT_FADE_OUT] = 1 +} + +DM_ACTIONS_CROUCHAIR = { + [ACT_DM_AIR_MOVEMENT] = 1, + [ACT_DM_AIR_MOVEMENT_METAL] = 1, + [ACT_GROUND_POUND] = 1, + [ACT_DM_GROUND_POUND_METAL] = 1 +} + +DM_ACTIONS_ALLOWGRAB = { + [ACT_DM_GROUNDED_MOVEMENT] = 1, + [ACT_DM_GROUNDED_IDLE] = 1, + [ACT_DM_AIR_MOVEMENT] = 1, + [ACT_DM_GROUNDED_MOVEMENT_METAL] = 1, + [ACT_DM_AIR_MOVEMENT_METAL] = 1, + [ACT_DM_WATER_MOVEMENT] = 1, + [ACT_GROUND_POUND] = 1, + [ACT_DM_GROUND_POUND_METAL] = 1, + [ACT_GROUND_POUND_LAND] = 1 +} + +DM_ACTION_QPHYS = { + [ACT_DM_GROUNDED_MOVEMENT] = 1, + [ACT_DM_GROUNDED_IDLE] = 1, + [ACT_DM_AIR_MOVEMENT] = 1, + [ACT_DM_GROUNDED_MOVEMENT_METAL] = 1, + [ACT_DM_AIR_MOVEMENT_METAL] = 1, + [ACT_DM_WATER_MOVEMENT] = 1, + [ACT_GROUND_POUND] = 1, + [ACT_DM_GROUND_POUND_METAL] = 1, + [ACT_DM_POLE_MOVEMENT] = 1 +} + +DM_ACTION_DONT_OVERRIDE_FP = {} + +DM_ACTION_FORCEANGLE = { + [ACT_GRAB_POLE_FAST] = 1, + [ACT_GRAB_POLE_SLOW] = 1, + [ACT_CLIMBING_POLE] = 1, + [ACT_HOLDING_POLE] = 1, + [ACT_TOP_OF_POLE] = 1 +} + +DM_ACTION_TRANSFERS = { + [ACT_TOP_OF_POLE_JUMP] = 1, + [ACT_WALL_KICK_AIR] = 1 +} + +DM_ACTION_PREFUNCS = { + [ACT_BURNING_JUMP] = function(m) + m.hurtCounter = 8 + m.invincTimer = 10 + -- if (m == gMarioStates[0]) then + gLakituState.roll = 1000 + gLakituState.oldRoll = gLakituState.roll + cl_red = 128 + -- end + return 1 + end, + [ACT_IDLE] = function(m) + if (m.prevAction ~= ACT_SHOCKED) then SV_PlayerMovement_Store(m,true) end + end, + [ACT_WATER_PLUNGE] = function(m) + if (m.prevAction ~= ACT_IDLE) then SV_PlayerMovement_Store(m,true) end + end, + [ACT_TORNADO_TWIRLING] = function(m) + m.vel.y = m.vel.y + 14 ; if (m.vel.y > 400) then m.vel.y = 400 end + return 1 + end, + [ACT_SHOCKED] = function(m) + SV_PlayerMovement_Store(m,true) + m.vel.y = m.vel.y * sv_scalerate + end, + [ACT_DEATH_ON_BACK] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_DEATH_ON_STOMACH] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_STANDING_DEATH] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_SUFFOCATION] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_DROWNING] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_ELECTROCUTION] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_TELEPORT_FADE_OUT] = function(m) + m.vel.x = 0 + m.vel.y = 0 + m.vel.z = 0 + m.forwardVel = 0 + end, + [ACT_ELECTROCUTION] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end, + [ACT_QUICKSAND_DEATH] = function(m) + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + end +} + +DM_ACTION_PREFUNCS_ALL = { + [ACT_STAR_DANCE_EXIT] = function(m) + return 1 + end +} + +DM_ACTION_FUNCTIONS = { + [ACT_HARD_BACKWARD_GROUND_KB] = function(m) + if (m.prevAction == ACT_SPECIAL_DEATH_EXIT) then m.healCounter = 32 end + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT, 0) + end, + [ACT_DEATH_EXIT_LAND] = function(m) + m.healCounter = 32 + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT, 0) + end, + [ACT_IDLE] = function(m) + set_mario_action(m, ifelse(m.pos.y <= m.waterLevel-sv_playersubmergelevel,ifelse((m.flags & MARIO_METAL_CAP) ~= 0,ACT_DM_AIR_MOVEMENT_METAL,ACT_DM_WATER_MOVEMENT),ACT_DM_AIR_MOVEMENT), 0) + end, + [ACT_WATER_PLUNGE] = function(m) + set_mario_action(m, ifelse((m.flags & MARIO_METAL_CAP) ~= 0,ACT_DM_AIR_MOVEMENT_METAL,ACT_DM_WATER_MOVEMENT), 0) + end, + [ACT_GETTING_BLOWN] = function(m) + cl_airstrafelimiter = clampf(cl_airstrafelimiter + 0.256,0,2.5) + vec3f_add(m.vel,{x=-coss(m.faceAngle.y)*75,y=50,z=-sins(m.faceAngle.y)*75}) + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + end, + [ACT_DM_WATER_MOVEMENT] = function(m) + if (m.prevAction == ACT_WATER_PLUNGE or m.prevAction == ACT_IDLE or m.prevAction == ACT_IDLE) then SV_PlayerMovement_Store(m,false) end + end +} + +--- General helper functions +function ifelse(a,b,c) + if (a) then return b else return c end +end + +function vec3_invert(a) + _x = a.x * -1.0 + _y = a.y * -1.0 + _z = a.z * -1.0 + return {x=_x,y=_y,z=_z} +end + +function vec3_qscale(a,b,c,d) + _x = a.x * b + _y = a.y * c + _z = a.z * d + return {x=_x,y=_y,z=_z} +end + +function vec3_scale(a,b) + _x = a.x * b + _y = a.y * b + _z = a.z * b + return {x=_x,y=_y,z=_z} +end + +function s16(num) + num = math.floor(num) & 0xFFFF + if num >= 32768 then return num - 65536 end + return num +end + +function mario_holding_underwater_shell(m) -- direction is true then we're checking a small range behind, otherwise we're checking the inverse of that range + if (m.heldObj == nil) then return false end + return get_id_from_behavior(m.heldObj.behavior) == id_bhvKoopaShellUnderwater +end + +function mario_is_within_object_angles(m, o, range, direction) -- direction is true then we're checking a small range behind, otherwise we're checking the inverse of that range + local dx = o.oPosX - m.pos.x + local dz = o.oPosZ - m.pos.z + + local dYaw = s16(o.oMoveAngleYaw - atan2s(dz, dx)) + + if (dYaw >= -range and dYaw <= range) then + return direction + else + return not direction + end +end + +function should_push_or_pull_door(m, o) + local dx = o.oPosX - m.pos.x + local dz = o.oPosZ - m.pos.z + + local dYaw = s16(o.oMoveAngleYaw - atan2s(dz, dx)) + + if (dYaw >= -0x4000 and dYaw <= 0x4000) then + return 0x00000001 + else + return 0x00000002 + end +end + +function get_object_closest_to_point(type,point) + local closestObj = nil + local obj = obj_get_first(type) + local minDist = 0x20000 + while obj ~= nil do + local objDist = vec3f_dist({x=obj.oPosX,y=obj.oPosY,z=obj.oPosZ}, point) + if objDist < minDist then + local rad = obj.hitboxRadius+16 + local hei = obj.hitboxHeight+16 + if (vec3f_dist({x=obj.oPosX,y=0,z=obj.oPosZ}, {x=point.x,y=0,z=point.z}) <= rad and point.y >= obj.oPosY and point.y <= obj.oPosY+hei) then + closestObj = obj + minDist = objDist + end + end + obj = obj_get_next(obj) + end + return closestObj +end + +ObjectLists = { + [0] = OBJ_LIST_PLAYER, + [1] = OBJ_LIST_DESTRUCTIVE, + [2] = OBJ_LIST_GENACTOR, + [3] = OBJ_LIST_PUSHABLE, + [4] = OBJ_LIST_LEVEL, + [5] = OBJ_LIST_DEFAULT, + [6] = OBJ_LIST_SURFACE, + [7] = OBJ_LIST_POLELIKE, + [8] = OBJ_LIST_SPAWNER, + [9] = OBJ_LIST_UNIMPORTANT +} +ObjectHeightAddon = { + [id_bhvPokey] = 30, + [id_bhvPokeyBodyPart] = 50, + [id_bhvGoomba] = 30, + [id_bhvSmallBully] = 30, + [id_bhvBobomb] = 30, + [id_bhvBigBully] = 50, + [id_bhvBigChillBully] = 50, + [id_bhvBobombBuddy] = 50, + [id_bhvMips] = 30, + [id_bhvBoo] = 30, + [id_bhvDoor] = 50, + [id_bhvDoorWarp] = 50, + [id_bhvStarDoor] = 50, + [id_bhvBowser] = 80, + [id_bhvKingBobomb] = 120, + [id_bhvChuckya] = 120, +} + +function get_any_object_closest_to_point(point) + local lastList = 0 + local closestObj = nil + local obj = obj_get_first(ObjectLists[lastList]) + local minDist = 0x20000 + while obj ~= nil do + if (obj_is_valid_for_interaction(obj)) then + local objDist = vec3f_dist({x=obj.oPosX,y=obj.oPosY,z=obj.oPosZ}, point) + if objDist < minDist then + local offset = ObjectHeightAddon[get_id_from_behavior(obj.behavior)] ; if offset == nil then offset = 0 end + local rad = obj.hitboxRadius+16 + local hei = obj.hitboxHeight+16+offset + if (vec3f_dist({x=obj.oPosX,y=0,z=obj.oPosZ}, {x=point.x,y=0,z=point.z}) <= rad and point.y >= obj.oPosY and point.y <= obj.oPosY+hei) then + closestObj = obj + minDist = objDist + end + end + end + + local nextObj = obj_get_next(obj) + + if (nextObj == nil) then + while nextObj == nil and lastList < 9 do + lastList = lastList + 1 + nextObj = obj_get_first(ObjectLists[lastList]) + end + end + + obj = nextObj + end + return closestObj +end diff --git a/mods/mquake/_mquake_a_constants_32.luac b/mods/mquake/_mquake_a_constants_32.luac deleted file mode 100644 index 10666bc2558f11a24ff3eaeb1ceb5ba8b12241ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15251 zcmdU0dvF`adEdKRfe@)TB)=n3i6>24H<>1xWZLPB?r;RaH(&r1CD+XbBtQ}tNHBOv zqC2e*fJ`+~+`OB2W2d&8G^z8llQzjD2f`t3$&cpgxb0-xj+=3&nrSkfX_GV=_xJ7Y z;XzT2?dFgAIEQcd`@Y@%Uc0yZ-SPVIY9__5efQ4(>-st8!QknmtaH8Ul&N)U+TNe( zj0Kp<4w)u9=xVM3V$?O+s%NrGC}&MqdnI$(o4n`l2r!F9O^dC%7F+i$7SO^hYK2*> zwx+K(!)#r%Ss-k)Xx(P3Yc^ZghuDSs!+)aSTO}Mir|Jq0omX|hDEQakCZN7?*Lpa{ zo~gU+Uvvi9`rY+@R}mMciZe0^%OM?;zXe22B(FZP5Jz+#ke!A9z26`@<;H{SlPWZw&oz z;Evr5h&y%^q>bieagLH6BG2Ho#|D#)Jt>!AD813~t^PY2!g&p?;YuGf#TZ?5U+yZ+hr zwP_ZxkFh89#x{)gxuE%t&jsC~&tF_)Yye~Q8ygSy8?lD~AA&p&Zh`y4<+#Qd(6{L0 zg1+(K1wDqg8xNuXFH*m~xcU}2{cnQo5!|uAg{^SMz66Ln_T?b^{+HM5Z(>^OAYz7T z80RaZZXZ&0{j2M14%3W5zy7uLy2IXVKDq6n%Me=*=76{DAY(3k|Fw&Cg9RFIW*64p z90(X032nf7CJ<;TXw1mEtzbjJ7N9;G2-vd{HWX|rXk-;#!G?s8*=vs*9+l$~q;aV~ z8kZoAEBaTE#uapeIW;bz7#C2C3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1v%k?pjiSVH_$STyuroX;w($SJNXj~ev4}IZfE54;Ttz7t{uc3|)D^>t*$M+Q& zbF1s?z+b@4S%BoB)oHhd&}5q1*F+gB49c}WtVX+=qFf(n;#{Datlz4+(VBp@sAf^U z{z^^C6F^@|p64aTV-VpRxOL=g(GRmFw4+4F8M2p-9JwQ|BrHXTKy>0@y{qCzHHQKG%OeLT#7?r*2O50R zs%nSbnn8($!^pqU9QpxlwA;O z6MfUumqEhnwRF(h>iRd}{}Z>)wv!rXna4IvlWn-3_NN}xHat&0pfyW>0x7Zp)QCZi z)uzQfh=q3Ay){=O6>o$Zhw*jsK}?myW>}|mn^i+r2cnZ2R#TQ~dQw(M%KZY>2r*Bd zoH>9&aLUSbHH!Zn^bO4G#qv{eh|UYr#D$F+=MynsAJ_(^@+6_ zKWyrp%n9qlu&$1?ljdnI+yIDm_@Mb8cia!Hd^2N`L20_^(=ru0SOrDtxcJbF!s!;i zb0J@uDV|PdviWK`L=%oKA1&X(^gI`}J}s!pmkN?s{{9Ar8^Nuyo%Ao37H;3x0gJ+k z>Cce8Yp}Nmd%OE!Z)k$QEOeNG9}apu$OoG6!6w^pSZm~qGamS|HCGcp@V2|O@B2Ce zvTtoodj|cS75hX}>=SF?-OyU_4gUY3-qLo4ZN9UP59f7^LH>ZP;e+})-E3@x(f^u$ z<|6QYhJ}9#GwK(B?=!+wK9eOsc{SmuSRF}B_!U0Ezsup_tm=2^`nJO^eAneC=!4Ou zj)y!CaihBeGTj~YT1dxh?gV>SoQ2n6rwz+B?u8yE*4~5c7k7BfMVm`)-_quw?T*dw p5Mh40eu>Aoc)iwH6rWc(_}*_%!T?6q`f&FnHUe8jhmcGD{0~Fv*&qM_ diff --git a/mods/mquake/_mquake_a_constants_64.luac b/mods/mquake/_mquake_a_constants_64.luac deleted file mode 100644 index ce167cd21be09c4521f49143722deb242a80caaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15251 zcmdU0dvF`adEdKRfe@)TB)=n3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+;Km&^39A%2BqnuPs>#3U=yu&5KTC`e6)NA)AL-^`m~@XUn)pm`TH9fZUnc+cGACCTDW~%2P_IF zrawdWuEE|O?CtJ@y`c&Ive01$emLmuARlPL2b*laVXcub&UoO<)?7{az}xQ9zVGV@ z$iB5T?HTlQR_qf^u}`dlcSCEzH~9aDdQ00Gw)xIFKAhJv2KfWFh7aoJbhEJ$M*nO2 znTx>p85aH}%&1=gzRw6#`AnAl)Q^y@LiXmpbtiq zIv(;o#EtF>$aHtmYat!4xfASRaTZ>Ooi;4jxEFeuSbGn$U)%-lT*a&P99YQYo^FJ~W*(3k} diff --git a/mods/mquake/_mquake_b_physics.lua b/mods/mquake/_mquake_b_physics.lua new file mode 100644 index 00000000..af243f5f --- /dev/null +++ b/mods/mquake/_mquake_b_physics.lua @@ -0,0 +1,370 @@ +if SM64COOPDX_VERSION == nil then return end +local collision_find_surface_on_ray,vec3f_dist,vec3f_sub,vec3f_dot,vec3f_project,vec3f_add,vec3f_copy,level_trigger_warp,vec3f_length,clampf,is_game_paused,vec3f_normalize,vec3f_mul = collision_find_surface_on_ray,vec3f_dist,vec3f_sub,vec3f_dot,vec3f_project,vec3f_add,vec3f_copy,level_trigger_warp,vec3f_length,clampf,is_game_paused,vec3f_normalize,vec3f_mul + + + +-- Helper functions + +-- Replaced with simplified quake code +function PHYS_CollideWithNormal(vel,norm,bounceFactor) + local backoff = vec3f_dot(vel,norm) * (1.0+bounceFactor) + return {x=vel.x-(norm.x*backoff),y=vel.y-(norm.y*backoff),z=vel.z-(norm.z*backoff)} +end + +SV_PlayerMovement_Scale = function(m,prescaled) + -- if (m.playerIndex ~= 0) then return end + if (sv_stopmovement) then return end + + if (prescaled) then + m.vel.x = cl_speedbuffer.x + m.vel.y = cl_speedbuffer.y + m.vel.z = cl_speedbuffer.z + else + cl_speedbuffer.x = m.vel.x + cl_speedbuffer.y = m.vel.y + cl_speedbuffer.z = m.vel.z + m.vel.x = m.vel.x * sv_scalerate + m.vel.y = m.vel.y * sv_scalerate + m.vel.z = m.vel.z * sv_scalerate + end +end + +function SV_PlayerMovement_Store(m,store) + if (m.playerIndex == 0) then + if (store) then + vec3f_copy(cl_upwarpfix_vel,m.vel) + vec3f_copy(cl_upwarpfix_pos,m.pos) + else + vec3f_copy(m.vel,cl_upwarpfix_vel) + vec3f_copy(m.pos,cl_upwarpfix_pos) + end + end +end + +function SV_PlayerMovement_Relative(m) + -- if (m.playerIndex ~= 0) then return end + local obj = m.marioObj.platform + if (obj ~= nil) then + m.vel.y = m.vel.y + (obj.oVelY*4) + end +end + +function SV_HandleSpecialFloors(m,bypassFloorCheck) + if (m.floor ~= nil) then + local type = m.floor.type + if (type == SURFACE_VERTICAL_WIND) then + m.vel.y = m.vel.y + 18 + if (m.vel.y < -24) then + m.vel.y = -24 + end + if (m.vel.y > 200) then + m.vel.y = 200 + end + return true + end + if (type == SURFACE_HORIZONTAL_WIND and DM_ACTION_QPHYS[m.action] == 1) then + local pushAngle = m.floor.force << 8; + + local amt = ifelse((m.action & ACT_FLAG_AIR) == 0,48,8) + + m.vel.x = m.vel.x + (amt * sins(pushAngle)) + m.vel.z = m.vel.z + (amt * coss(pushAngle)) + return true + end + if (type == SURFACE_DEATH_PLANE or type == SURFACE_VERTICAL_WIND) and (m.pos.y < m.floorHeight + 2048) then + if (level_trigger_warp(m, WARP_OP_WARP_FLOOR) == 20 and (m.flags & MARIO_UNKNOWN_18) ~= 0) then + return true + end + end + if (type == SURFACE_BURNING) and (m.invincTimer == 0) and ((m.flags & MARIO_METAL_CAP == 0) and (((m.action & ACT_FLAG_AIR) == 0 and (m.input & INPUT_OFF_FLOOR) == 0) or bypassFloorCheck)) then + m.hurtCounter = 8 + m.invincTimer = 15 + cl_red = 128 + end + if (type == SURFACE_INSTANT_QUICKSAND or type == SURFACE_INSTANT_MOVING_QUICKSAND) and (m.invincTimer == 0) and ((m.flags & MARIO_METAL_CAP == 0) and (((m.action & ACT_FLAG_AIR) == 0 and (m.input & INPUT_OFF_FLOOR) == 0) or bypassFloorCheck)) then + m.hurtCounter = 4 + m.invincTimer = 10 + cl_red = 128 + end + end + return false +end + +-- Player angle system + +frameCalculatedAngles = false +local frameAngles = {} + +function GetAngleVectors(m) + local s = gPlayerSyncTable[m.playerIndex] + + local yaw = gFirstPersonCamera.yaw+0x8000 + local pitch = -gFirstPersonCamera.pitch + + if (m.playerIndex == 0) then + s.playerYaw = yaw + s.playerPitch = pitch + if (frameCalculatedAngles) then return frameAngles end + frameCalculatedAngles = true + else + yaw = s.playerYaw + pitch = s.playerPitch + end + + local sinYaw = sins(yaw) + local cosYaw = coss(yaw) + + local yawRight = yaw-0x4000 + local cosYawRight = coss(yawRight) + local sinYawRight = sins(yawRight) + + local cosPitch = coss(pitch) + local sinPitch = sins(pitch) + + local _rawForward = {x=sinYaw*cosPitch,y=sinPitch,z=cosYaw*cosPitch} -- variable used this name, prevent old code from breaking; todo, rewrite? + local _forward = {x=sinYaw,y=0,z=cosYaw} + local _right = {x=sinYawRight,y=0,z=cosYawRight} + + local returnValue = { + rawForward=_rawForward, + forward=_forward, + right=_right + } + + if (m.playerIndex == 0) then + frameAngles = returnValue + end + + return returnValue +end + +-- Important Functions + +-- Acceleration / Friction +function SV_UserFriction(m) + -- if (m.playerIndex ~= 0) then return end + local speed = vec3f_length(m.vel) + if (speed <= 0.00001) then return end + local friction = ((sv_friction*phys_friction_scale)+ifelse(gPlayerSyncTable[m.playerIndex].playerCrouching,sv_crouchfriction_scale,0))*SV_GetSurfaceStandableFrictionMultiplier(m.floor.type,m.area.terrainType) + local control = nil + + if (speed <= sv_stopspeed) then + control = sv_stopspeed + else + control = speed + end + + local newspeed = speed - sv_tickrate*control*friction + + if (newspeed < 0) then newspeed = 0 end + if (newspeed > 0) then + newspeed = newspeed / speed + end + m.vel.x = m.vel.x * newspeed + m.vel.y = m.vel.y * newspeed + m.vel.z = m.vel.z * newspeed +end + +-- Acceleration / Friction +function SV_UserGravity(m,scale) + m.vel.y = m.vel.y - (sv_gravity * sv_tickrate * scale * sv_gravity_scale) + if (m.vel.y < -sv_gravity) then m.vel.y = -sv_gravity end +end +function SV_UserGravityEx(m,scale,minovr) + m.vel.y = m.vel.y - (sv_gravity * sv_tickrate * scale * sv_gravity_scale) + if (m.vel.y < -sv_gravity*minovr) then m.vel.y = -sv_gravity*minovr end +end + +function SV_Accelerate(m,wishDir,wishspeed) + -- if (m.playerIndex ~= 0) then return end + local addspeed,accelspeed,currentspeed = 0,0,0 + currentspeed = vec3f_dot(m.vel,wishDir) + addspeed = wishspeed - currentspeed + if (addspeed <= 0) then return end + accelspeed = sv_accelerate * wishspeed * sv_tickrate + if (accelspeed > addspeed) then accelspeed = addspeed end + m.vel.x = m.vel.x + (accelspeed * wishDir.x) + m.vel.y = m.vel.y + (accelspeed * wishDir.y) + m.vel.z = m.vel.z + (accelspeed * wishDir.z) +end + +function SV_AirAccelerate(m,wishDir,wishspeed) + -- Limiter code for wallkicks + local airLimiter_Frac = (1.0-clampf(cl_airstrafelimiter,0.0,1.0)) + local addspeed,wishspd,accelspeed,currentspeed = 0,0,0,0 + + wishspd = wishspeed*airLimiter_Frac + + -- Checks for a lack of acceleration + if (wishspeed == 0) then return end + if (wishspd > sv_playerclamp_air) then wishspd = sv_playerclamp_air end -- This is 30 in source, quake and other games + + currentspeed = vec3f_dot(m.vel,wishDir) + addspeed = wishspd - currentspeed + + if (addspeed <= 0) then return end + accelspeed = (sv_airaccelerate_value * phys_airaccel_scale) * (wishspd * airLimiter_Frac) * sv_tickrate + + if (accelspeed > addspeed) then accelspeed = addspeed end + m.vel.x = m.vel.x + ((accelspeed * wishDir.x)*airLimiter_Frac) + m.vel.y = m.vel.y + ((accelspeed * wishDir.y)*airLimiter_Frac) + m.vel.z = m.vel.z + ((accelspeed * wishDir.z)*airLimiter_Frac) +end + +-- Main movement functions + +function SV_PlayerMovement(m) + -- if (m.playerIndex ~= 0) then return end + if (sv_stopmovement) then return end + + local isPrediction = m.playerIndex ~= 0 + + -- if (isPrediction) then return end + + local crouch = gPlayerSyncTable[m.playerIndex].playerCrouching + local playerSpeed = ifelse(crouch,sv_playerspeed_crouch,sv_playerspeed) + local maxSpeed = ifelse(crouch,sv_maxspeed_crouch,sv_maxspeed) + + local vecInput = {x=0,y=0,z=0} + if ((not is_game_paused()) and m.health > 0xFF and not cl_bowserthrow and not cl_bowserthrow and not (not no_dialog_open() and not isPrediction)) then + vecInput.x = m.controller.rawStickX + vecInput.y = m.controller.rawStickY + end + + if (not isPrediction) then + vec3f_normalize(vecInput) + vec3f_mul(vecInput,m.controller.stickMag) + end + + local fmove = (vecInput.y/32)*playerSpeed -- what are the maximums of these again? + local smove = (vecInput.x/32)*playerSpeed + -- local fmove = (vecInput.y/64)*playerSpeed -- what are the maximums of these again? + -- local smove = (vecInput.x/64)*playerSpeed + + local wishVel = {x=0,y=0,z=0} + local wishDir = {x=0,y=0,z=0} + + local AngledVectors = GetAngleVectors(m) + + wishVel.x = (AngledVectors.forward.x * fmove) + (AngledVectors.right.x * smove) + wishVel.y = (AngledVectors.forward.y * fmove) + (AngledVectors.right.y * smove) + wishVel.z = (AngledVectors.forward.z * fmove) + (AngledVectors.right.z * smove) + + + if (not isPrediction) then + if (m.action == ACT_DM_GROUNDED_MOVEMENT or m.action == ACT_DM_GROUNDED_MOVEMENT_METAL or m.action == ACT_DM_GROUNDED_IDLE) then + wishVel.y = 0 + if (m.floor ~= nil) then + local tempNormal = vec3_invert(m.floor.normal) + tempNormal.y = 0 ; vec3f_normalize(tempNormal) + local amount = (cl_grounddefacto * clampf(vec3f_dot(wishVel,tempNormal),0,1)) * m.floor.normal.y + vec3f_sub(wishVel,vec3_scale(vec3f_project(wishVel, m.floor.normal), amount)) + vec3f_add(wishVel,vec3_scale(m.floor.normal, amount*0.125)) + end + end + end + + local wishspeed = vec3f_length(wishVel) + vec3f_copy(wishDir, wishVel) + vec3f_normalize(wishDir) + if wishspeed > maxSpeed then + wishVel.x = wishVel.x * (maxSpeed / wishspeed) + wishVel.y = wishVel.y * (maxSpeed / wishspeed) + wishVel.z = wishVel.z * (maxSpeed / wishspeed) + wishspeed = maxSpeed + end + if (m.action == ACT_DM_GROUNDED_MOVEMENT or m.action == ACT_DM_GROUNDED_MOVEMENT_METAL or m.action == ACT_DM_GROUNDED_IDLE) then + SV_UserFriction(m,wishDir,wishspeed) + SV_Accelerate(m,wishDir,wishspeed) + elseif (m.action == ACT_DM_AIR_MOVEMENT or m.action == ACT_DM_AIR_MOVEMENT_METAL) then + SV_AirAccelerate(m,wishDir,wishspeed) + end + + local finalVelLen = vec3f_length(m.vel) + if finalVelLen > sv_maxvelocity then + m.vel.x = m.vel.x * (sv_maxvelocity / finalVelLen) + m.vel.y = m.vel.y * (sv_maxvelocity / finalVelLen) + m.vel.z = m.vel.z * (sv_maxvelocity / finalVelLen) + end +end + +function SV_WaterMovement(m) + -- if (m.playerIndex ~= 0) then return end + if (sv_stopmovement) then return end + + local isPrediction = m.playerIndex ~= 0 + + local shellSpeed = mario_holding_underwater_shell(m) + + local playerSpeed = ifelse(shellSpeed,sv_playerspeed_water_shell,sv_playerspeed_water) + + local vecInput = {x=0,y=0,z=0} + if ((not is_game_paused()) and m.health > 0xFF) then + vecInput.x = m.controller.rawStickX + vecInput.y = m.controller.rawStickY + end + + if (not isPrediction) then + vec3f_normalize(vecInput) + vec3f_mul(vecInput,m.controller.stickMag) + end + + local fmove = (vecInput.y/32)*playerSpeed + local smove = (vecInput.x/32)*playerSpeed + local umove = 0 + if (m.controller.buttonDown & A_BUTTON ~= 0) then umove = umove+1 end + if (m.controller.buttonDown & Z_TRIG ~= 0) then umove = umove-1 end + + local wishVel = {x=0,y=0,z=0} + + local AngledVectors = GetAngleVectors(m) + + wishVel.x = (AngledVectors.rawForward.x * fmove) + (AngledVectors.right.x * smove) + wishVel.y = (AngledVectors.rawForward.y * fmove) + (AngledVectors.right.y * smove) + wishVel.z = (AngledVectors.rawForward.z * fmove) + (AngledVectors.right.z * smove) + + if (fmove < 0.1 and smove < 0.1 and umove == 0) then + wishVel.y = wishVel.y - 30 + else + wishVel.y = wishVel.y + sv_upspeed_water * umove + end + + local wishspeed = vec3f_length(wishVel) + + local maxspeed = ifelse(shellSpeed,sv_playerspeed_water_shell,sv_maxspeed_water) + + if (wishspeed > maxspeed) then + vec3f_mul(wishVel,maxspeed/wishspeed) + wishspeed = maxspeed + end + wishspeed = wishspeed * 0.85 + -- + -- water friction + -- + local speed = vec3f_length(m.vel) + local newspeed = 0 + + if (speed > 0.00001) then + newspeed = speed - sv_tickrate * speed * sv_waterfriction + if (newspeed < 0) then newspeed = 0 end + vec3f_mul(m.vel,newspeed/speed) + end + + -- + -- water acceleration + -- + if (wishspeed < 0.00001) then return end + + local addspeed = wishspeed - newspeed + + if (addspeed <= 0) then return end + + vec3f_normalize(wishVel) + local accelspeed = (sv_accelerate * wishspeed) * sv_tickrate + if (accelspeed > addspeed) then accelspeed = addspeed end + + m.vel.x = m.vel.x + (accelspeed * wishVel.x) + m.vel.y = m.vel.y + (accelspeed * wishVel.y) + m.vel.z = m.vel.z + (accelspeed * wishVel.z) + +end diff --git a/mods/mquake/_mquake_b_physics_32.luac b/mods/mquake/_mquake_b_physics_32.luac deleted file mode 100644 index 3bd6ae7020a6e94cc1d1ccf0acefe12513a74f50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7631 zcmcIpTWlN4dH!d2NJ^A!*`{-@g)9fcK~oe(+XO|?hj^FEizHj3BFT16`mmtLmBfT1 z1(LF@Jk636Y5T-haPrbNZ-Eh@fD04_3bYSJcS)NJT=*Cb3KV^=P!#A(`qqa6={K{y zN%m=jqFrD(^IvA>pMPfl%kbk{huKZ~@JAP-A4NImQ&SJ_(D?iH`vx0BZ0@%Jgvp?5 zhC%a0;u8`S76zp}gIZ)#&oC+Mnw0WQYOy%=%s7SXaY}XK)Y2^K#VraqEGp_mQ%0j* zv}CP6EH)JUu-H}bqoU3v{n3<>e0&qU&n>`0|Ll1~){W1ecNP4D=ej20A3V2Ytv`9* zQ1Fx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@D1wOziC zchA~hrF@^ymCATX&KAqNcKN_5@tIt?RIA|e7GYKtq4cJVMZP_5e#)n-61AG$jV%lZ zed}%YT;M%SbNPodi$xBc-pJfuOC%FElCh?SpOx>? zHZo5vi${WIY4sSki-@z7&pUWNua(DHwt7JiEdRi?dpF*G5I*8 z*k9G>c;I~|WXb}EA^i<}Ov?@YjeJ^;x?Usd8co#AB>Y0&6|@ajnaZZ!I3f!7c-~+l zjdV0^cIDG^L$#64L`~M*HUdA9#MlCnLLPnsHpp|GR;8RYC~P_~YJv9K?& zp{I4y7DOHXh6&g;*lXgSH|p>&0$x~zPPB9gc3hJ_WD)kxgl}0O{bb(LM5~*o6J3w= z^d*vZZmpq*7la2}NJ8?#FR?!QUEz)JGmN(&(wHX*q@P-P=(;de+AnR~OUOj@p;HNqz_8V^1`2LzcBepvl&@!Hm9PAW@AL-ovAjDPtbUC zL`#5{n4~qEa{jLpqQPI$#$Hp;&Gufom`Ac{6L<=>SpDnj`?nh^NIskSpUFEF_b^xIXVaUInr~pV L-jziUBqI7RzX;6{ diff --git a/mods/mquake/_mquake_c_moveset_functions.lua b/mods/mquake/_mquake_c_moveset_functions.lua new file mode 100644 index 00000000..38f865f8 --- /dev/null +++ b/mods/mquake/_mquake_c_moveset_functions.lua @@ -0,0 +1,313 @@ +if SM64COOPDX_VERSION == nil then return end +local get_dialog_box_state,get_dialog_id,disable_time_stop,save_file_get_flags,get_id_from_behavior,save_file_get_total_star_count,get_current_save_file_num,max,level_trigger_warp,obj_is_attackable,obj_is_breakable_object,obj_is_bully,obj_is_exclamation_box,bhv_spawn_star_no_level_exit,mario_drop_held_object,absf_2,clampf,set_mario_action,vec3f_add,mario_grab_used_object,mario_throw_held_object,play_character_sound,obj_is_grabbable,play_sound = get_dialog_box_state,get_dialog_id,disable_time_stop,save_file_get_flags,get_id_from_behavior,save_file_get_total_star_count,get_current_save_file_num,max,level_trigger_warp,obj_is_attackable,obj_is_breakable_object,obj_is_bully,obj_is_exclamation_box,bhv_spawn_star_no_level_exit,mario_drop_held_object,absf_2,clampf,set_mario_action,vec3f_add,mario_grab_used_object,mario_throw_held_object,play_character_sound,obj_is_grabbable,play_sound + +cutsceneActns = { + [ACT_WAITING_FOR_DIALOG] = 1, + [ACT_READING_AUTOMATIC_DIALOG] = 1, + [ACT_READING_NPC_DIALOG] = 1, + [ACT_READING_SIGN] = 1, + [ACT_INTRO_CUTSCENE] = 1, + [ACT_JUMBO_STAR_CUTSCENE] = 1, + [ACT_CREDITS_CUTSCENE] = 1, + [ACT_END_WAVING_CUTSCENE] = 1, + [ACT_IN_CANNON] = 1, + [ACT_SPAWN_NO_SPIN_AIRBORNE] = 1, + [ACT_SPAWN_SPIN_AIRBORNE] = 1, + [ACT_SHOT_FROM_CANNON] = 1, + [ACT_END_PEACH_CUTSCENE] = 1 +} + +function obj_activate_door(m,door,bhv) + if (m.action == ACT_DM_WATER_MOVEMENT) then return false end + + if door ~= nil then + local flags = save_file_get_flags() + -- local bhv = get_id_from_behavior(door) + if bhv == id_bhvDoor then + local doorStars = door.oBehParams >> 24 + if (doorStars <= save_file_get_total_star_count(get_current_save_file_num()-1,0,255)) then + door.oAction = 1 + door.header.gfx.animInfo.animFrame = max(door.header.gfx.animInfo.animFrame, 25) + end + return true + elseif bhv == id_bhvDoorWarp then + local wDoorID = door.oBehParams >> 24 + if (wDoorID == 1 and (flags & SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR) == 0) then + return true + end + if (wDoorID == 2 and (flags & SAVE_FLAG_UNLOCKED_BASEMENT_DOOR) == 0) then + return true + end + door.oAction = 2 + door.header.gfx.animInfo.animFrame = max(door.header.gfx.animInfo.animFrame, 10) + m.interactObj = door + m.usedObj = door + m.actionArg = should_push_or_pull_door(m, door) + level_trigger_warp(m, WARP_OP_WARP_DOOR) + return true + elseif (not obj_is_attackable(door)) and (not obj_is_breakable_object(door)) and (not obj_is_bully(door)) and (not obj_is_exclamation_box(door)) and (not obj_is_attackable(door)) and door.oAction == 0 then + local doorStars = door.oBehParams >> 24 + if (doorStars <= save_file_get_total_star_count(get_current_save_file_num()-1,0,255)) then + door.oInteractStatus = 0x00010000 + end + end + end + return false +end + +function obj_is_toad(m,toad,bhv) + if (m.action == ACT_DM_WATER_MOVEMENT) then return false end + + if toad ~= nil and bhv == id_bhvToadMessage then + local stars = save_file_get_total_star_count(get_current_save_file_num()-1,0,255) + + if (toad.oToadMessageDialogId == gBehaviorValues.dialogs.ToadStar1Dialog and stars >= gBehaviorValues.ToadStar1Requirement) then + toad.oToadMessageDialogId = gBehaviorValues.dialogs.ToadStar1AfterDialog; + bhv_spawn_star_no_level_exit(m.marioObj, 0, true); + return true + end + + if (toad.oToadMessageDialogId == gBehaviorValues.dialogs.ToadStar2Dialog and stars >= gBehaviorValues.ToadStar2Requirement) then + toad.oToadMessageDialogId = gBehaviorValues.dialogs.ToadStar2AfterDialog; + bhv_spawn_star_no_level_exit(m.marioObj, 1, true); + return true + end + + if (toad.oToadMessageDialogId == gBehaviorValues.dialogs.ToadStar3Dialog and stars >= gBehaviorValues.ToadStar3Requirement) then + toad.oToadMessageDialogId = gBehaviorValues.dialogs.ToadStar3AfterDialog; + bhv_spawn_star_no_level_exit(m.marioObj, 2, true); + return true + end + + return true + end + return false +end + +function held_obj_update(m) + local obj = m.heldObj + local bhv = get_id_from_behavior(obj.behavior) + + if (bhv == id_bhvBobomb) then + if (obj.oBobombFuseTimer >= 151) then + mario_drop_held_object(m) + end + end + + if (bhv == id_bhvKoopaShellUnderwater) then + if (obj.oTimer >= 601 or m.action ~= ACT_DM_WATER_MOVEMENT) then + mario_drop_held_object(m) + end + obj.oTimer = obj.oTimer + 1 + end +end + +function mario_throw_object_ext(m,ang) + local obj = m.heldObj + local bhv = get_id_from_behavior(obj.behavior) + + if (bhv == id_bhvBowser and cl_bowserthrow) then + local curFaceAngle = m.faceAngle.y + m.faceAngle.y = m.area.camera.yaw + 0x8000 + mario_drop_held_object(m) + obj.oPosX = m.marioBodyState.heldObjLastPosition.x + obj.oPosY = m.marioBodyState.heldObjLastPosition.y + obj.oPosZ = m.marioBodyState.heldObjLastPosition.z + + -- Todo ; How do we fix this shit maintaining the velocity? + + m.marioObj.oAngleVelYaw = 0 + m.marioObj.oMoveAnglePitch = 0 + obj.oForwardVel = 0 + obj.oVelY = 0 + obj.oBowserHeldAngleVelYaw = clampf(absf_2(s16(cl_bowserthrow_previousYaw-curFaceAngle)),0x10,0x1000) + obj.oBowserHeldAnglePitch = clampf(-absf_2(s16(cl_bowserthrow_previousYaw-curFaceAngle)),-0x1000,-0x400) + + network_send_object(obj,true) + return true + end + + if (bhv == id_bhvJumpingBox) then + mario_drop_held_object(m) + + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + + vec3f_add(m.vel,vec3_scale(ang.forward,300)) + vec3f_add(m.vel,{x=0,y=500,z=0}) + + obj.oPosX = m.pos.x + obj.oPosY = m.pos.y + obj.oPosZ = m.pos.z + return true + end + + return false +end + +function mario_drop_object_ext(m,ang) + local obj = m.heldObj + local bhv = get_id_from_behavior(obj.behavior) + + if (bhv == id_bhvJumpingBox) then + return mario_throw_object_ext(m,ang) + end + + return false +end + +function mario_grab_used_object_ext(m,ang) + local o = m.usedObj + local bhv = get_id_from_behavior(o.behavior) + + if (bhv == id_bhvBowser) then + if (not mario_is_within_object_angles(m, o, 0x2000, true)) then return false end + cl_bowserthrow = true + o.oForwardVel = 0 + o.oVelY = 0 + + o.oBowserHeldAngleVelYaw = 0 + o.oBowserHeldAnglePitch = 0 + o.oMoveAnglePitch = 0 + o.oMoveAngleYaw = 0 + o.oForwardVelS32 = 0 + o.oForwardVel = 0 + + m.marioObj.oAngleVelYaw = 0 + m.marioObj.oMoveAnglePitch = 0 + m.marioObj.oMoveAngleYaw = 0 + m.marioObj.oForwardVelS32 = 0 + m.marioObj.oForwardVel = 0 + end + + if (bhv == id_bhvKingBobomb) then + if (not mario_is_within_object_angles(m, o, 0x2000, true)) then return false end + + mario_grab_used_object(m) + + return false + end + + if (bhv == id_bhvChuckya) then + if (not mario_is_within_object_angles(m, o, 0x2000, true)) then return false end + + mario_grab_used_object(m) + + return false + end + + if (bhv == id_bhvKoopaShellUnderwater) then + if (m.action ~= ACT_DM_WATER_MOVEMENT) then return false end + o.oTimer = 0 -- ten seconds + end + + mario_grab_used_object(m) + return o == m.heldObj +end + +function mario_handle_grab_and_punch_custom(m) + if m.heldByObj ~= nil then return end + if m == nil then return end + + local pressedB = (m.controller.buttonPressed & B_BUTTON) ~= 0 + local pressedZ = (m.controller.buttonPressed & Z_TRIG) ~= 0 + + local ang = nil + + if m.heldObj ~= nil and cutsceneActns[m.action] ~= 1 then + if (ang == nil) then ang = GetAngleVectors(m) end + local obj = m.heldObj + if (cl_bowserthrow) then + m.marioBodyState.heldObjLastPosition.x = m.area.camera.pos.x + (ang.forward.x * (160+(obj.hitboxRadius*0.5))) + m.marioBodyState.heldObjLastPosition.y = m.area.camera.pos.y + (ang.forward.y * (160+(obj.hitboxRadius*0.5))) - (obj.hitboxHeight*0.5) + 64 + m.marioBodyState.heldObjLastPosition.z = m.area.camera.pos.z + (ang.forward.z * (160+(obj.hitboxRadius*0.5))) + else + m.marioBodyState.heldObjLastPosition.x = m.area.camera.pos.x + (ang.rawForward.x * (160+(obj.hitboxRadius*0.5))) + (m.vel.x*0.25) + m.marioBodyState.heldObjLastPosition.y = m.area.camera.pos.y + ((ang.rawForward.y * (160+(obj.hitboxRadius*0.5))) + (m.vel.y*0.25)) - (obj.hitboxHeight*0.5) + m.marioBodyState.heldObjLastPosition.z = m.area.camera.pos.z + (ang.rawForward.z * (160+(obj.hitboxRadius*0.5))) + (m.vel.z*0.25) + end + end + + m.controller.buttonPressed = m.controller.buttonPressed & ~(B_BUTTON|Z_TRIG) + if (pressedB) then + if (ang == nil) then ang = GetAngleVectors(m) end + if m.heldObj ~= nil then + local bhv = get_id_from_behavior(m.heldObj.behavior) + if (throwOverrides[bhv] ~= nil) then + if (throwOverrides[bhv](m,m.heldObj)) then return end + end + if not mario_throw_object_ext(m,ang) then + local curFaceAngle = m.faceAngle.y + local obj = m.heldObj + m.faceAngle.y = m.area.camera.yaw + 0x8000 + mario_throw_held_object(m) + obj.oPosX = m.marioBodyState.heldObjLastPosition.x + obj.oPosY = m.marioBodyState.heldObjLastPosition.y + obj.oPosZ = m.marioBodyState.heldObjLastPosition.z + obj.oVelX = (ang.rawForward.x * 160) + (m.vel.x*sv_scalerate) + obj.oVelY = (ang.rawForward.y * 160) + (m.vel.x*sv_scalerate) + obj.oVelZ = (ang.rawForward.z * 160) + (m.vel.x*sv_scalerate) + obj.oMoveAnglePitch = gLakituState.oldPitch + obj.oMoveAngleYaw = m.faceAngle.y + obj.oMoveAngleRoll = 0 + obj.oFaceAnglePitch = 0 + obj.oFaceAngleYaw = m.faceAngle.y + obj.oFaceAngleRoll = 0 + m.faceAngle.y = curFaceAngle + end + elseif (cl_interacttimer == 0) then + -- play_character_sound(m,CHAR_SOUND_PUNCH_HOO) + -- cl_interacttimer = 5 + m.marioBodyState.heldObjLastPosition.x = m.area.camera.pos.x + (ang.rawForward.x * 160) + m.marioBodyState.heldObjLastPosition.y = m.area.camera.pos.y + (ang.rawForward.y * 160) + m.marioBodyState.heldObjLastPosition.z = m.area.camera.pos.z + (ang.rawForward.z * 160) + local target = get_any_object_closest_to_point(m.marioBodyState.heldObjLastPosition) + if (target ~= nil) then + local bhv = get_id_from_behavior(target.behavior) + if (interactOverrides[bhv] ~= nil) then + if (interactOverrides[bhv](m,target)) then return end + end + if (not obj_activate_door(m,target,bhv) and not obj_is_toad(m,target,bhv)) then + if (obj_is_grabbable(target)) then + m.interactObj = target + m.usedObj = target + if (not mario_grab_used_object_ext(m,ang)) then + m.interactObj = nil + m.usedObj = nil + end + elseif (obj_is_attackable(target) or obj_is_exclamation_box(target) or obj_is_bully(target) or obj_is_breakable_object(target)) then + m.interactObj = target + m.usedObj = target + target.oInteractStatus = INT_STATUS_INTERACTED | INT_STATUS_WAS_ATTACKED | ATTACK_PUNCH + play_character_sound(m,CHAR_SOUND_PUNCH_HOO) + end + end + else + play_sound(CAM_SOUND_UNUSED_SELECT_FIXED, m.pos) + end + end + end + if (pressedZ) then + if m.heldObj ~= nil then + local bhv = get_id_from_behavior(m.heldObj.behavior) + if (dropOverrides[bhv] ~= nil) then + if (dropOverrides[bhv](m,m.heldObj)) then return end + end + if (not mario_drop_object_ext(m,ang)) then + local curFaceAngle = m.faceAngle.y + local obj = m.heldObj + m.faceAngle.y = m.area.camera.yaw + 0x8000 + mario_drop_held_object(m) + obj.oPosX = m.marioBodyState.heldObjLastPosition.x + obj.oPosY = m.marioBodyState.heldObjLastPosition.y + obj.oPosZ = m.marioBodyState.heldObjLastPosition.z + obj.oMoveAnglePitch = gLakituState.oldPitch + obj.oMoveAngleYaw = m.faceAngle.y + obj.oMoveAngleRoll = 0 + obj.oFaceAnglePitch = 0 + obj.oFaceAngleYaw = m.faceAngle.y + obj.oFaceAngleRoll = 0 + m.faceAngle.y = curFaceAngle + end + end + end +end \ No newline at end of file diff --git a/mods/mquake/_mquake_c_moveset_functions_32.luac b/mods/mquake/_mquake_c_moveset_functions_32.luac deleted file mode 100644 index 789ac34cfe3520619209938c09a1079ffb1d948d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7854 zcmb_hTW=dlc0ScClM-b~wrP1h;|#Sk>kRh6K(cnQxx8!_ucF2x1(LF71_2r^vL$g% zu@zn{d!M@HF}0E736dG_>@J)j82D%8fvpQUyNiMI6Y^l>IS+XZu=%RHd67iPgGC4w z>vB$=I#qS9)i>_8^a8#6<#hPHFz0+?;?X@C{(iKrvSE+CmqsT@D$T1ZMTxAB$fBU7 zQmUg;n*?=LK|xzk$`RCNG3tsK1$SbU+K*9NiBmTgr{I$~r4HiM4kV}>Pf+ml1f>oW z)aFU*CXy6*nDixqqH$~xK?_w&I_Ug7@cl|oJ;KTj8?bltu4rY9~ zU$_0b>({|W7d}D3=eL4H6V(3dR!Y{v7q{AO|HZAY+yCXQAd~Q4-b%?j`1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!oC6Qbq#*VfIWOMtN@lHDH>*`-A2X}1X49-K*YT`jl=);#i>(xkx$MA;^3Z2m zF`r2f94$ZbnZSQ79OSb6Qrc+xi9o4o)*B~-mG7OfoXC9;iw|OTKD|+C;@eAJFIQR( z>HG2f&!0yA&23=6NS%C?1*5XQ(Tu1A$j|vyUElT-88;p9=l{n~N8STw-E1uP(5Tld zWxUp$5pIvBYh$xBH%S|0U2Z(~37>A@gON-=>M~*TgEY7L>~!!oy?$4JP-(Wj>~7Mm zmc3-`R8TfZ*7CSp&`I?Z$v*yIzz^d3a2NkFQnmgQsQg%0=Rc5N*Yw)seh^x!nhm4T z)S9NYWdfC7>EjQN>1|&>#=o+j_f6yEODeyHPet;hP;sRozZxa;$nug2etl&4z9?v- zSQPSUm`{5xZFwadU*L1`1$<5_{{UD`ST_Iw diff --git a/mods/mquake/_mquake_c_moveset_functions_64.luac b/mods/mquake/_mquake_c_moveset_functions_64.luac deleted file mode 100644 index 28741a91e9f25e559f4d10ac7ff13bff60d590e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7854 zcmb_hTW=dlc0ScClM-b~wrP1h;|#Sk>kRh6K(cnQxx8!_ucF2x1(LF71_2r^vL$g% zu@zn{d!M@HF}0E736dG_>@J)j82D%8fvpQUyNiMI6Y^l>IS+XZu=%RHd67iPgGC4w z>vB$=I#qS9)i>_8^a8#6<#hPHFrVNP6OZoE@b{x_l?{9By)-&OQfXdQDN1C0L>2`t zl~Ns*+9ar}3JThSQjVZDi&0m^D7X`&)P9WGN}Rf}I0c`?DRmI1b|69Bc!GkTCn$B8 zpf*oZH<6^^(g%@x+w|=dlyrwv{$$Ny6e}$1t0F$ZNKjNbui<@ z{krYfUB3=4y6_1KKED+tnxOVqw^FhWzPQzP`!8;F-Tp6c1(}5Z@>WXL!LM(%-Tv3| zEdCtl!y|>IpZrBUms?JJqTNg83z=M&_}seD)XEjTYOZUm<|D1q)SCvM85ymV`IT~| zp|4gAty$SLfMRa(s}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emz}*FWx1+MICFrXTv3XUvxBUe0Cx9PfsgNT;UquxC zz8giS1tM#~6wQi3dj7`qB-xp|}u`ic5z=piB=OG)iB8$^e+6*tnwxAa{zu&-M7HwMz3)^0WJVfa) z&%JY3RyuPCUo6lPpxINTOr)GN!ZKTdtRk<+JBQ!5ARj&8m2Hc;vf|5eiY>?xiGa#n zn2^@`&u|wDpnIh3Vone3kdmNKEWtxN3w(Nif&Y%}JUc?j0?$Bi1hF3Er)T3m26wUN zuzw!*kI=V=eVhm2U-lgDPG8&dKIHkwc?$X6Y)ohU%7PT8J|gqz38%! zv4`JFK3>SZNErYRU+)PAMf_?wX8#KPU(5dQg#9eqi9+A*LZ9(Q0__T6k0Cp*q@i1B zWS40h#euG2FH*<;(M|@IygS?-k1Nkp;wDFNpN++}yB;odXGoVl53(h!?dht#Z&wb~ zh=nj3A$wXWW2`Nfp!+NUSU}1^zu&<<xHNtR?NLr(-jxbxbTD*D=3uf%aG(vzJN2IykSg4gC{XL!JD-I(FfY)v-TT z?xlZ=;~aQcCIzv_$a(R8S2AnOx>>Cv`;Ar`Y&jkK!;UJggm(oVlPXtO$v)(uvtbFf;iV{y$hhf%KmR{|I`SSc>tvH3Giw%gG#gIWp|Ti zwd^Hhr-HIUvX;l)f=;TRNcQmu1AY+Khr9Tfk*f8dK;_4}I{$(Ex~A72_k++<)od7z zrq(pIEfc8xN*{lCOmF-8G5(eHyl)yOUsCxsd@7P3g^DW$`PC?yN0ygN@arSP_eDVy z#iEc;!+hFnY0E3w_yV7cFW_@hA-5vG+{h7aA(!LPxLEQBSF$SwJSZ2EcawPjPGvp; pi5dCzZn(+uUuNXX5`s+5uCi-*)xC&U-7uSD?~HlW@num~{|D01SUUg! diff --git a/mods/mquake/_mquake_d_actions.lua b/mods/mquake/_mquake_d_actions.lua new file mode 100644 index 00000000..11ee6a83 --- /dev/null +++ b/mods/mquake/_mquake_d_actions.lua @@ -0,0 +1,517 @@ +if SM64COOPDX_VERSION == nil then return end +local play_step_sound,set_mario_action,play_character_sound,vec3f_length,perform_ground_step,vec3f_copy,perform_air_step,clampf,vec3f_add,set_mario_particle_flags,play_mario_heavy_landing_sound = play_step_sound,set_mario_action,play_character_sound,vec3f_length,perform_ground_step,vec3f_copy,perform_air_step,clampf,vec3f_add,set_mario_particle_flags,play_mario_heavy_landing_sound + + + +local function play_local_footstep_sounds(m,rate,max) + cl_footstepTimer = cl_footstepTimer + rate + if (cl_footstepTimer >= max) then + m.marioObj.header.gfx.animInfo.animFrame = 0 + play_step_sound(m, 0, 1) + cl_footstepTimer = 0 + end +end + +------------------------------- +-- Code for our local player -- +------------------------------- + +--- @param m MarioState +local function local_act_dm_grounded_movement(m) + local valid_update = local_update(m) + + local metal_underwater = (m.flags & MARIO_METAL_CAP) ~= 0 and m.pos.y <= m.waterLevel-sv_playersubmergelevel + local crouch = gPlayerSyncTable[m.playerIndex].playerCrouching + + if (metal_underwater and m.action ~= ACT_DM_GROUNDED_MOVEMENT_METAL) then + SV_PlayerMovement_Store(m,true) + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT_METAL, 0) + m.action = ACT_DM_GROUNDED_MOVEMENT_METAL + SV_PlayerMovement_Store(m,false) + -- return + elseif (m.action == ACT_DM_GROUNDED_MOVEMENT_METAL and not metal_underwater) then + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT, 0) + m.action = ACT_DM_GROUNDED_MOVEMENT + -- return + end + + if (m.floor ~= nil) then + if (m.floor.normal.y <= SV_GetSurfaceStandableMinimum(m.floor.type,m.area.terrainType)) then + SV_PlayerMovement_Relative(m) + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + act_dm_air_movement(m) + return + end + end + + if (m.controller.buttonDown & A_BUTTON) ~= 0 and no_dialog_open() and m.floor ~= nil then + set_character_animation(m, CHAR_ANIM_IDLE_HEAD_CENTER) + + -- m.controller.buttonPressed = m.controller.buttonPressed & ~A_BUTTON + + if (m.vel.y < 0) then m.vel.y = m.vel.y * 0.33 end + + m.vel.y = m.vel.y + ifelse(metal_underwater,135*sv_jumpheight,140*sv_jumpheight) + + if (m.vel.y > 320*sv_jumpheight) then m.vel.y = 320*sv_jumpheight end + + play_mario_jump_sound(m) + + SV_PlayerMovement_Relative(m) + + -- SV_PlayerMovement_Store(m,true) + + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + act_dm_air_movement(m) + return + end + + SV_PlayerMovement(m) + + set_character_animation(m, CHAR_ANIM_A_POSE) + if (not cl_bowserthrow) then + local len = vec3f_length(vec3_qscale(m.vel,1,0,1)) + if (len < 1) then + m.faceAngle.y = m.area.camera.yaw + 0x8000 + if (m.action == ACT_DM_GROUNDED_MOVEMENT) then m.action = ACT_DM_GROUNDED_IDLE end + else + play_local_footstep_sounds(m,len * 0.08,60) + m.faceAngle.y = atan2s(m.vel.z, m.vel.x) + if (m.action == ACT_DM_GROUNDED_IDLE) then m.action = ACT_DM_GROUNDED_MOVEMENT end + end + end + + if (valid_update) then + m.forwardVel = vec3f_length(vec3_qscale(m.vel,sv_scalerate,0,sv_scalerate)) + else m.forwardVel = 0 end + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_ground_step(m) + SV_PlayerMovement_Scale(m,true) + + if (stepResult == GROUND_STEP_LEFT_GROUND) then + SV_PlayerMovement_Relative(m) + if (m.action == ACT_DM_GROUNDED_MOVEMENT_METAL) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT_METAL, 0) + else + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + end + end + + if m.wall ~= nil and (stepResult == GROUND_STEP_HIT_WALL) then --or (stepResult == GROUND_STEP_HIT_WALL_CONTINUE_QSTEPS) or (stepResult == GROUND_STEP_HIT_WALL_STOP_QSTEPS)) then + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.wall.normal,0.0)) + end + + if (m.pos.y <= m.waterLevel-sv_playersubmergelevel and m.waterLevel > m.floorHeight + sv_playersubmergelevel) and (m.flags & MARIO_METAL_CAP) == 0 then + if (m.action == ACT_DM_GROUNDED_MOVEMENT_METAL) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT_METAL, 0) + else + set_mario_action(m, ACT_DM_WATER_MOVEMENT, 0) + end + end +end +--- @param m MarioState +local function local_act_dm_air_movement(m) + local valid_update = local_update(m) + -- AngleVectors(m) + local metal_underwater = (m.flags & MARIO_METAL_CAP) ~= 0 and m.pos.y <= m.waterLevel-sv_playersubmergelevel + local act = m.action + local crouch = gPlayerSyncTable[m.playerIndex].playerCrouching + + if (metal_underwater and act ~= ACT_DM_AIR_MOVEMENT_METAL) then + SV_PlayerMovement_Store(m,true) + set_mario_action(m, ACT_DM_AIR_MOVEMENT_METAL, 0) + m.action = ACT_DM_AIR_MOVEMENT_METAL + SV_PlayerMovement_Store(m,false) + -- return + elseif (act == ACT_DM_AIR_MOVEMENT_METAL and not metal_underwater) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + m.action = ACT_DM_AIR_MOVEMENT + -- return + end + + if (m.controller.buttonPressed & Z_TRIG) ~= 0 and (m.controller.buttonDown & A_BUTTON) == 0 and sv_groundpound and m.heldObj == nil and no_dialog_open() then --and m.prevAction ~= ACT_DM_WATER_MOVEMENT then + m.vel.y = 0 + m.controller.buttonPressed = m.controller.buttonPressed & ~Z_TRIG + set_mario_action(m, ifelse(metal_underwater,ACT_DM_GROUND_POUND_METAL,ACT_GROUND_POUND), 1) + play_sound(SOUND_ACTION_TWIRL,m.marioObj.header.gfx.cameraToObject) + return + end + + SV_PlayerMovement(m) + + local len_spd = vec3f_length(vec3_qscale(m.vel,1,0,1)) + + if (len_spd < 1) then + m.faceAngle.y = m.area.camera.yaw + 0x8000 + else + m.faceAngle.y = atan2s(m.vel.z, m.vel.x) + end + set_character_animation(m, CHAR_ANIM_A_POSE) + + if (metal_underwater) then + SV_UserGravity(m,0.66) + else + SV_UserGravity(m,1.0) + end + + if ((m.flags & MARIO_WING_CAP) ~= 0 and (m.controller.buttonPressed & A_BUTTON) ~= 0) and no_dialog_open() then + if (m.vel.y < 0) then m.vel.y = 0 end + m.vel.y = m.vel.y + ifelse(metal_underwater,100,200) + if (m.vel.y > 320) then m.vel.y = 320 end + set_mario_particle_flags(m, (PARTICLE_DUST | PARTICLE_MIST_CIRCLE), false) + end + + local preStepYVel = m.vel.y + + if (valid_update) then + m.forwardVel = len_spd*sv_scalerate + else m.forwardVel = 0 end + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) + + if (stepResult == AIR_STEP_LANDED) then + if (m.floor ~= nil) then + if (m.floor.normal.y > SV_GetSurfaceStandableMinimum(m.floor.type,m.area.terrainType) and ifelse(sv_sticky,m.vel.y < (sv_gravity*sv_tickrate)*2,true)) then + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.floor.normal,0.0)) + -- SV_PlayerMovement_Store(m,true) + + cl_airstrafelimiter = 0 + m.marioObj.header.gfx.animInfo.animFrame = 0 + play_step_sound(m, 0, 1) + gLakituState.roll = gLakituState.roll + clampf(-1.75*(preStepYVel+200),0,1000) + + if (m.action == ACT_DM_AIR_MOVEMENT_METAL) then + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT_METAL, 0) + else + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT, 0) + end + return + else + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.floor.normal,0)) + vec3f_add(m.pos,vec3_scale(m.floor.normal,6)) + -- vec3f_add(m.vel,vec3_scale(m.floor.normal,clampf(preStepYVel*0.75,-1,1))) + return + end + end + end + if (stepResult == AIR_STEP_HIT_WALL) and m.wall ~= nil then + if (m.controller.buttonDown & ifelse(cl_altWalljumpKey,B_BUTTON,A_BUTTON)) ~= 0 and sv_walljump and no_dialog_open() and m.heldObj == nil and len_spd > 100 then + cl_airstrafelimiter = 0.66 + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.wall.normal,0.965)) + set_mario_particle_flags(m, (PARTICLE_VERTICAL_STAR | PARTICLE_DUST), false) + m.vel.y = 250*sv_jumpheight + play_sound(SOUND_ACTION_BONK,m.marioObj.header.gfx.cameraToObject) + play_character_sound(m,CHAR_SOUND_YAH_WAH_HOO) + else + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.wall.normal,0.05)) + end + end + + if (m.pos.y <= m.waterLevel-sv_playersubmergelevel and m.waterLevel > m.floorHeight + sv_playersubmergelevel) and (m.flags & MARIO_METAL_CAP) == 0 then + if (m.action ~= ACT_DM_AIR_MOVEMENT_METAL) then + set_mario_action(m, ACT_DM_WATER_MOVEMENT, 0) + end + end +end +--- @param m MarioState +local function local_act_dm_water_movement(m) + local valid_update = local_update(m) + -- AngleVectors(m) + SV_WaterMovement(m) + + SV_PlayerMovement_Store(m,true) + + if (m.playerIndex == 0) then + if (vec3f_length(vec3_qscale(m.vel,1,0,1)) < 1) then + m.faceAngle.y = m.area.camera.yaw + 0x8000 + else + m.faceAngle.y = atan2s(m.vel.z, m.vel.x) + end + set_character_animation(m, CHAR_ANIM_A_POSE) + else + local scale = m.forwardVel + if (scale < 10) then + set_character_animation(m, CHAR_ANIM_WATER_IDLE) + else + set_character_anim_with_accel(m, CHAR_ANIM_FLUTTERKICK, scale*0x800) + end + end + + if (valid_update) then + m.forwardVel = vec3f_length(vec3_qscale(m.vel,sv_scalerate,0,sv_scalerate)) + else m.forwardVel = 0 end + + if (m.pos.y+(m.vel.y*sv_scalerate) < m.floorHeight + 2) then + m.pos.y = m.floorHeight + 2 + m.vel.y = 0 + end + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) + + if (stepResult == AIR_STEP_HIT_WALL) and m.wall ~= nil then + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.wall.normal,0.05)) + end + + local isSnowy = ((m.area.terrainType & TERRAIN_MASK) == TERRAIN_SNOW) + + if (m.area.camera.pos.y >= m.waterLevel - 15 and not isSnowy) or mario_holding_underwater_shell(m) then + m.healCounter = 1 + if (m.controller.buttonDown & A_BUTTON) ~= 0 and m.vel.y > 0 then + m.vel.y = 180 + end + elseif (not mario_holding_underwater_shell(m)) then + m.health = m.health - ifelse(isSnowy,3,1) + end + + if (m.pos.y > m.waterLevel-sv_playersubmergelevel) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + return + end +end +--- @param m MarioState +local function local_act_dm_ground_pound(m) + local valid_update = local_update(m) + + local metal_underwater = (m.flags & MARIO_METAL_CAP) ~= 0 and m.pos.y <= m.waterLevel-sv_playersubmergelevel + + if (metal_underwater and act ~= ACT_DM_GROUND_POUND_METAL) then + SV_PlayerMovement_Store(m,true) + set_mario_action(m, ACT_DM_GROUND_POUND_METAL, 0) + SV_PlayerMovement_Store(m,false) + elseif (act == ACT_DM_AIR_MOVEMENT_METAL and not metal_underwater) then + set_mario_action(m, ACT_DM_GROUND_POUND, 0) + end + + if (m.controller.buttonPressed & Z_TRIG) ~= 0 then + m.vel.x = 0 + m.vel.z = 0 + end + + m.faceAngle.y = m.area.camera.yaw + 0x8000 + set_character_animation(m, CHAR_ANIM_A_POSE) + + SV_UserGravityEx(m,1.0,0.75) + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) + + if (stepResult == AIR_STEP_LANDED) then + if (m.floor ~= nil) then + play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_HEAVY_LANDING) + set_mario_particle_flags(m, (PARTICLE_MIST_CIRCLE | PARTICLE_HORIZONTAL_STAR), false) + gLakituState.roll = gLakituState.roll + 500 + if (m.controller.buttonDown & A_BUTTON) ~= 0 and m.health > 0xFF then + SV_HandleSpecialFloors(m,true) + + local direction = GetAngleVectors(m).forward + local yV = m.vel.y * 0.32 * sv_scalerate + local len = vec3f_length(vec3_qscale(m.vel,1,0,1)) + + vec3f_copy(m.vel,vec3_scale(direction,len*0.895)) + + vec3f_add(m.vel,vec3_qscale(m.floor.normal,-0.3,85 * clampf((len+math.abs(yV)) / 320, 0.5, 1.0),-0.3)) + + m.vel.y = (m.vel.y + (250 * clampf((len+math.abs(yV)) / 320, 0.65, 1.0)))*sv_jumpheight + -- PHYS_CollideWithNormal(m.vel,m.floor.normal,0.0,1.0) + + set_mario_action(m, ifelse(metal_underwater,ACT_DM_AIR_MOVEMENT_METAL,ACT_DM_AIR_MOVEMENT), 0) + play_character_sound(m,CHAR_SOUND_YAHOO) + else + m.forwardVel = 0 + m.vel.x = 0 + m.vel.y = 0 + m.vel.z = 0 + set_mario_action(m, ifelse(metal_underwater,ACT_DM_GROUNDED_MOVEMENT_METAL,ACT_GROUND_POUND_LAND), 0) + end + return; + end + end +end +--- @param m MarioState +local function local_act_dm_pole_movement(m) + local_update(m) + + m.vel.x = 0 + m.vel.z = 0 + + if (m.health <= 0xFF or m.usedObj == nil or (m.controller.buttonPressed & Z_TRIG) ~= 0) then + m.vel.y = 0 + m.forwardVel = 3 + m.controller.buttonPressed = m.controller.buttonPressed & ~(Z_TRIG|A_BUTTON) + return set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + end + + m.faceAngle.y = m.area.camera.yaw + 0x8000 + + if (m.controller.buttonPressed & A_BUTTON) ~= 0 then + m.vel.y = 12 + m.forwardVel = 36 + return set_mario_action(m, ACT_WALL_KICK_AIR, 0) + end + + set_character_animation(m, CHAR_ANIM_A_POSE) + + local o = m.usedObj + local i = ifelse(gFirstPersonCamera.pitch < 0,1.0,-1.0) + m.pos.y = m.pos.y + (m.usedObj.oPosY-cl_poleY) + cl_poleY = m.usedObj.oPosY + + m.pos.x = o.oPosX + sins(m.faceAngle.y) + m.pos.z = o.oPosZ + coss(m.faceAngle.y) + + m.vel.y = m.controller.rawStickY*0.66*i + local intendedPos = m.pos.y + (m.vel.y*sv_scalerate) + + if (intendedPos < o.oPosY) then + m.vel.y = 0 + m.pos.y = o.oPosY + end + + if (intendedPos > o.oPosY+o.hitboxHeight) then + m.vel.y = 0 + m.pos.y = o.oPosY+o.hitboxHeight + end + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) +end + + +---------------------------------- +-- Prediction for other players -- +---------------------------------- + +--- @param m MarioState +local function prediction_act_dm_grounded_movement(m) + local crouch = gPlayerSyncTable[m.playerIndex].playerCrouching + + if ((m.controller.buttonDown & A_BUTTON) ~= 0 or (m.controller.buttonPressed & A_BUTTON) ~= 0) and m.floor ~= nil then + play_character_sound(m,CHAR_SOUND_YAH_WAH_HOO) + -- return + end + + if (not cl_disableAccelPred) then SV_PlayerMovement(m) end + + local scale = m.forwardVel + if (scale < 5) then + set_character_animation(m, ifelse(crouch,CHAR_ANIM_CROUCHING,CHAR_ANIM_FIRST_PERSON)) + else + play_step_sound(m, ifelse(crouch,26,9), ifelse(crouch,79,45)) + set_character_anim_with_accel(m, ifelse(crouch,CHAR_ANIM_CRAWLING,CHAR_ANIM_RUNNING), scale*ifelse(crouch,0x4000,0x2600)) + end + + m.forwardVel = vec3f_length(vec3_qscale(m.vel,sv_scalerate,0,sv_scalerate)) + + SV_PlayerMovement_Scale(m,false) + + local stepResult = perform_ground_step(m) + + SV_PlayerMovement_Scale(m,true) +end +--- @param m MarioState +local function prediction_act_dm_air_movement(m) + local crouch = gPlayerSyncTable[m.playerIndex].playerCrouching + + if (not cl_disableAccelPred) then SV_PlayerMovement(m) end + + set_character_animation(m, ifelse(crouch,CHAR_ANIM_FAST_LONGJUMP,ifelse(m.vel.y < 0,CHAR_ANIM_DOUBLE_JUMP_FALL,CHAR_ANIM_DOUBLE_JUMP_RISE))) + + if (metal_underwater) then + SV_UserGravity(m,0.66) + else + SV_UserGravity(m,1.0) + end + + if ((m.flags & MARIO_WING_CAP) ~= 0 and (m.controller.buttonDown & A_BUTTON) ~= 0 and m.vel.y < 0) then m.vel.y = 0 end + + m.forwardVel = vec3f_length(vec3_qscale(m.vel,sv_scalerate,0,sv_scalerate)) + + SV_PlayerMovement_Scale(m,false) + + local stepResult = perform_air_step(m,0) + + SV_PlayerMovement_Scale(m,true) +end +--- @param m MarioState +local function prediction_act_dm_water_movement(m) + + if (not cl_disableAccelPred) then SV_WaterMovement(m) end + + local scale = m.forwardVel + if (scale < 10) then + set_character_animation(m, CHAR_ANIM_WATER_IDLE) + else + set_character_anim_with_accel(m, CHAR_ANIM_FLUTTERKICK, scale*0x800) + end + + if (vec3f_length(m.vel) <= 10) then + m.forwardVel = 0 + return + end + + m.forwardVel = vec3f_length(vec3_qscale(m.vel,sv_scalerate,0,sv_scalerate)) + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) +end +--- @param m MarioState +local function prediction_act_dm_ground_pound(m) + set_character_animation(m, CHAR_ANIM_TRIPLE_JUMP_GROUND_POUND) + + SV_UserGravityEx(m,1.0,0.75) + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) + + if (stepResult == AIR_STEP_LANDED) then + if (m.floor ~= nil) then + play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_HEAVY_LANDING) + set_mario_particle_flags(m, (PARTICLE_MIST_CIRCLE | PARTICLE_HORIZONTAL_STAR), false) + if (m.controller.buttonDown & A_BUTTON) ~= 0 then + play_character_sound(m,CHAR_SOUND_YAHOO) + end + end + end +end +--- @param m MarioState +local function prediction_act_dm_pole_movement(m) + set_character_animation(m, CHAR_ANIM_IDLE_ON_POLE) + + SV_PlayerMovement_Scale(m,false) + local stepResult = perform_air_step(m,0) + SV_PlayerMovement_Scale(m,true) +end + + +--- @param m MarioState +function act_dm_grounded_movement(m) + if (m.playerIndex == 0) then return local_act_dm_grounded_movement(m) else return prediction_act_dm_grounded_movement(m) end +end +--- @param m MarioState +function act_dm_air_movement(m) + if (m.playerIndex == 0) then return local_act_dm_air_movement(m) else return prediction_act_dm_air_movement(m) end +end +--- @param m MarioState +function act_dm_water_movement(m) + if (m.playerIndex == 0) then return local_act_dm_water_movement(m) else return prediction_act_dm_water_movement(m) end +end +--- @param m MarioState +function act_dm_ground_pound(m) + if (m.playerIndex == 0) then return local_act_dm_ground_pound(m) else return prediction_act_dm_ground_pound(m) end +end +--- @param m MarioState +function act_dm_pole_movement(m) + if (m.playerIndex == 0) then return local_act_dm_pole_movement(m) else return prediction_act_dm_pole_movement(m) end +end + + + diff --git a/mods/mquake/_mquake_d_actions_32.luac b/mods/mquake/_mquake_d_actions_32.luac deleted file mode 100644 index 935b98e0d40a2599bd247d4d55627548cbca65fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13577 zcmcgzU2GfKbw2mbB`MREWt;Z?B!H~lxIrJbK-&a;YT+4D97@&?6-l<^yv))fZ7ZQg zm6Gjs`f`U}k-OV&gKV;B{#vwNwLk&44@DkY^dU3Un)EtxoTf<&1bt`SOXsNn`^6i! z=$FLPzkouVY&vP%G)kmDN}A%@CO5FDP7bwfhvL3NZs<^5q^aekDPBvH+e}kkX6Ri> z^g@QHe2eJL7SX$wpclpkm0uQg=WRjnDoHP7C6zZM-MK4iNN?2d#4OxnjXPPsZ#3>~ znDQ%k?wax|%)>G8rBVwszxMG=K0i19N$*^Ceqk~{OX|pKxp324TQ9A8Yn5v&MRjzo zwC-IkRF^AWVQGE2vZ79yE=yMmRaBI!oqogDOG_WSatW>y{V3NI~0~d0mG@pQn_$-^^!_Py$Z#mdbU6IYN5Kmyi_iEm&%39YwD!o zA!6%Fsc`+KS1zm+msc)#xOo<=dByJVrJ{GWa=mo5w6d;_cUpMdUgcAr${PiqP_Me% zw=;=VBajoFzN-~*)9uQuF6aoaeH_;?E{hT@<`&uXz}8|YAkELu1tdnb)NR|Qwhlx) zz(t|Bufy71EDgwz;|uabLEARTA?+Bo83HYJbgArJs#MllV2jIFOI3Bi$RL05(<%Wu z6j7rtUwTO$D6A}Bom{z8QAvJstA(qj6eyTqs;i^WF8sPBQ;7Z?$8FU#9sCHIUGS|@ zENT)B@ZHijeG&8U0vmG?x&c*g*p6sxs54ag+vJM^+F9jq*+jSS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nh94PU$JYa?YFlgQ3wf@w1kR?4g7rzi~m=+1RcaN^AiM6o%Ub%{ungZP4JH zR9#2=O@x-&i{@~+TL-o`p|=fq=N7y(?{g2{o%3j%FJw>Mva|hqFvRP?H@j2qKiC&F9dCkM3>IbQ@2|0> z-!a-g^vh^rZ*tL&wA;0zCa5dgz@yrxu^@;vlRBF2IFV)=ZSB-S>+_3NXx~Faybmp1qnK= zvUFj?xNZv<_sOEf7@9qZ!=is=oI4DenTM_{$1au}`l z2_WALSYs_=EYSd#U>p(IG2oJbu?R^+1NeZ)`Y1R#3Yz;nu#fcjJdTIwx;uF=K2!gf zFurdy{$Jzy_r(#NFa8FC*cjx5C5YlrX$pgX{sp3c*JwtJCAyzxJfZ~ww1Tw&nuAB| z%Sa1&WfaQ$ugm~?;MBc`L`NMK$94{h(tlyZA3xDi4~yR1 ld!zpZBmVaj9d$(T|6}a>VO1n9q= 0 and get_dialog_box_state() < 3) +end +-- function remove_cutscenes(m) + -- todo: this shit breaks + -- if m.area ~= nil and m.area.camera ~= nil then + -- local lvl = gNetworkPlayers[m.playerIndex].currLevelNum + -- if (cutsceneActns[m.action] ~= 1 or not no_dialog_open()) and (lvl ~= LEVEL_BOWSER_1 and lvl ~= LEVEL_BOWSER_2 and lvl ~= LEVEL_BOWSER_3) then + -- disable_time_stop() + -- m.area.camera.cutscene = 0 + -- m.statusForCamera.cameraEvent = 0 + -- m.freeze = 0 + -- end + -- end +-- end + +local intFix = 0 + +--- @param m MarioState +function active_player(m) + local np = gNetworkPlayers[m.playerIndex] + if m.playerIndex == 0 then + return 1 + end + if not np.connected then + return 0 + end + if np.currCourseNum ~= gNetworkPlayers[0].currCourseNum then + return 0 + end + if np.currActNum ~= gNetworkPlayers[0].currActNum then + return 0 + end + if np.currLevelNum ~= gNetworkPlayers[0].currLevelNum then + return 0 + end + if np.currAreaIndex ~= gNetworkPlayers[0].currAreaIndex then + return 0 + end + return is_player_active(m) +end + +function on_set_mario_action(m) + if (m.playerIndex == 0) then + if (DM_ACTION_TRANSFERS[m.action] == 1) then + local yVel = m.vel.y * sv_scalerate_inverse + local fVel = m.forwardVel * sv_scalerate_inverse + local s = gPlayerSyncTable[m.playerIndex] + local direction = GetAngleVectors(m).forward + vec3f_copy(m.vel,vec3_scale(direction,m.forwardVel*sv_scalerate_inverse)) + m.vel.y = yVel + local is_underwater = m.pos.y <= m.waterLevel-sv_playersubmergelevel + local metal_underwater = (m.flags & MARIO_METAL_CAP) ~= 0 + if ((m.action & ACT_FLAG_AIR) ~= 0) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + return 1 + elseif ((m.action & ACT_GROUP_SUBMERGED) ~= 0) then + if (not metal_underwater) and (is_underwater) then + set_mario_action(m, ACT_DM_WATER_MOVEMENT, 0) + return 1 + end + if (metal_underwater) and (is_underwater) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT_METAL, 0) + return 1 + end + end + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT, 0) + return 1 + end + if (DM_ACTION_FUNCTIONS[m.action] ~= nil) then + local val = DM_ACTION_FUNCTIONS[m.action](m) + if (val == 1) then return 1 end + end + end +end + +function allow_voice(m,s) + if (s == CHAR_SOUND_ON_FIRE or s == CHAR_SOUND_ATTACKED or s == CHAR_SOUND_EEUH) then + return 0 + end +end + +function override_defacto(m) + -- if m.action == ACT_DM_AIR_MOVEMENT or m.action == ACT_DM_GROUNDED_MOVEMENT or + -- m.action == ACT_DM_AIR_MOVEMENT_METAL or m.action == ACT_DM_GROUNDED_MOVEMENT_METAL or m.action == ACT_DM_GROUNDED_IDLE then + return 1 + -- end +end + +function on_player_connected(m) + gPlayerSyncTable[m.playerIndex].playerCrouching = false + gPlayerSyncTable[m.playerIndex].playerPitch = 1 + gPlayerSyncTable[m.playerIndex].playerYaw = 1 +end + +function before_set_mario_action(m,incoming) + if (DM_ACTION_PREFUNCS_ALL[incoming] ~= nil) then + local val = DM_ACTION_PREFUNCS_ALL[incoming](m) + if (val == 1) then return 1 end + end + + if (m.playerIndex == 0) then + if (DM_ACTION_PREFUNCS[incoming] ~= nil) then + return DM_ACTION_PREFUNCS[incoming](m) + elseif (DM_ACTIONS[incoming] ~= 1) then + m.controller.buttonPressed = 0 + local is_underwater = m.pos.y <= m.waterLevel-sv_playersubmergelevel + local metal_underwater = (m.flags & MARIO_METAL_CAP) ~= 0 + if ((incoming & ACT_FLAG_AIR) ~= 0) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT, 0) + return 1 + elseif ((incoming & ACT_FLAG_SWIMMING) ~= 0) or ((incoming & ACT_GROUP_SUBMERGED) ~= 0) then + if (not metal_underwater) and (is_underwater) then + set_mario_action(m, ACT_DM_WATER_MOVEMENT, 0) + return 1 + end + if (metal_underwater) and (is_underwater) then + set_mario_action(m, ACT_DM_AIR_MOVEMENT_METAL, 0) + return 1 + end + end + set_mario_action(m, ACT_DM_GROUNDED_MOVEMENT, 0) + return 1 + end + end +end + +function before_phys_step(m) + local act = m.action + if (DM_ACTIONS[act] ~= 1) then return 0 end + if ((act == ACT_DM_AIR_MOVEMENT or act == ACT_DM_AIR_MOVEMENT_METAL or act == ACT_DM_WATER_MOVEMENT or act == ACT_GROUND_POUND) and m.playerIndex == 0 and m.ceil ~= nil) then + local h = m.marioObj.hitboxHeight + if (m.ceilHeight <= m.pos.y + h) then + m.pos.y = m.ceilHeight - h - 4 + return 0 + end + + if (m.pos.y + h + 4 + sv_camerayoffset > m.ceilHeight) then + SV_PlayerMovement_Scale(m,true) + vec3f_copy(m.vel, PHYS_CollideWithNormal(m.vel,m.ceil.normal,0.25)) + SV_PlayerMovement_Scale(m,false) + m.pos.y = m.pos.y - 4 + return perform_air_step(m,0) + end + end +end + + +function on_interact(m,o,i,b) + if (intFix > 0) then return end + if DM_ACTION_QPHYS[m.action] == 1 then + if (i == INTERACT_BOUNCE_TOP or i == INTERACT_BOUNCE_TOP2) and not (m.action == ACT_GROUND_POUND or m.action == ACT_DM_GROUND_POUND_METAL) then + if (o.oInteractStatus & INT_STATUS_WAS_ATTACKED) ~= 0 then + m.vel.y = 160 + return + end + end + if (o.oInteractStatus & INT_STATUS_ATTACKED_MARIO) ~= 0 and m.health > 0xFF then + m.invincTimer = 30 + gLakituState.roll = 2730*(m.hurtCounter*0.25) + gLakituState.oldRoll = gLakituState.roll + cl_red = 128 + return + end + if i == INTERACT_STAR_OR_KEY then + local lvl = gNetworkPlayers[m.playerIndex].currLevelNum + if (lvl == LEVEL_BOWSER_1) then + if ((save_file_get_flags() & (SAVE_FLAG_UNLOCKED_BASEMENT_DOOR)) == 0) then + save_file_set_flags(SAVE_FLAG_UNLOCKED_BASEMENT_DOOR) + save_file_do_save(get_current_save_file_num()-1,true) + end + end + if (lvl == LEVEL_BOWSER_2) then + if ((save_file_get_flags() & (SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR)) == 0) then + save_file_set_flags(SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR) + save_file_do_save(get_current_save_file_num()-1,true) + end + end + return + end + end +end + +function allow_interact(m,o,i) + if (intFix > 0) then return end + if DM_ACTION_QPHYS[m.action] == 1 then + if (i == INTERACT_POLE and no_dialog_open()) then + if (vec3f_dot({x=o.oPosX-m.pos.x,y=0,z=o.oPosZ-m.pos.z},{x=m.vel.x,y=0,z=m.vel.z}) > 0) and (m.controller.buttonDown & B_BUTTON) ~= 0 then + m.usedObj = o + cl_poleY = o.oPosY + set_mario_action(m,ACT_DM_POLE_MOVEMENT,0) + end + return false + end + if (i == INTERACT_IGLOO_BARRIER) then + if (m.controller.buttonDown & Z_TRIG ~= 0) then + return false + end + end + if (m.action == ACT_DM_GROUND_POUND_METAL) then + o.oInteractStatus = (o.oInteractStatus | INT_GROUND_POUND) + end + end + if (get_id_from_behavior(o.behavior) == id_bhvToadMessage) then + return false + end +end + +function on_pvp(m,v) + if (intFix > 0) then return end + if DM_ACTION_QPHYS[v.action] == 1 then + v.invincTimer = 30 + if (v.playerIndex == 0) then + gLakituState.roll = 2730*(v.hurtCounter*0.25) + gLakituState.oldRoll = gLakituState.roll + cl_red = 128 + end + end +end + +local function render_speed(w2,h2,textWidth,h_offset,hspeed_text,scale,height) + local scale1 = scale*0.5 + djui_hud_set_color(0,0,0,100) + djui_hud_render_rect((w2*0.5) - (textWidth*scale1) - 1,(h2*h_offset),textWidth*scale + 2,height) + djui_hud_set_color(255,255,255,255) + djui_hud_print_text(hspeed_text, (w2*0.5) - (textWidth*scale1),(h2*h_offset),scale) +end + +function render_hud_effects() + local m = gMarioStates[0] + if (m ~= nil) then + + djui_hud_set_resolution(RESOLUTION_DJUI) + local w = djui_hud_get_screen_width() + local h = djui_hud_get_screen_height() + if (cl_red > 0) then + djui_hud_set_color(255,0,0,cl_red*0.5) + djui_hud_render_rect(0,0,w,h) + end + local c = m.area.camera + if (c ~= nil) then + if (c.pos.y < m.waterLevel) then + djui_hud_set_color(38,139,255,100) + djui_hud_render_rect(0,0,w,h) + end + end + + if (m.health <= 0xFF or m.action == ACT_UNINITIALIZED or m.action == ACT_DISAPPEARED) then return end + + djui_hud_set_resolution(RESOLUTION_N64) + djui_hud_set_font(FONT_NORMAL) + + local w2 = djui_hud_get_screen_width() + local h2 = djui_hud_get_screen_height() + + local hspeed = m.forwardVel*sv_scalerate_inverse ; if (DM_ACTION_QPHYS[m.action] == 1) then hspeed = vec3f_length({x=m.vel.x,y=0,z=m.vel.z}) end + local hspeed_text = tostring(math.floor(hspeed)) + local textWidth = djui_hud_measure_text(hspeed_text) + render_speed(w2,h2,textWidth,0.8,hspeed_text,0.5,15) + + local vspeed = m.vel.y ; if (DM_ACTION_QPHYS[m.action] ~= 1) then vspeed = vspeed * sv_scalerate_inverse end + local vspeed_text = tostring(math.floor(vspeed)) + local vtextWidth = djui_hud_measure_text(vspeed_text) + render_speed(w2,h2,vtextWidth,0.75,vspeed_text,0.25,7.5) + + -- local vspeed_text = tostring(m.area.camera.cutscene) + -- local vTextWidth = djui_hud_measure_text(vspeed_text) + -- render_speed(w2,h2,vTextWidth,0.75,vspeed_text,0.25,7.5) + + -- local usedObjT = tostring(m.usedObj ~= nil) + -- local usedObj = djui_hud_measure_text(usedObjT) + -- render_speed(w2,h2,usedObj,0.6,usedObjT,0.25,7.5) + + -- local usedObjT2 = tostring(get_cutscene_from_mario_status(m.area.camera)) + -- local usedObj2 = djui_hud_measure_text(usedObjT2) + -- render_speed(w2,h2,usedObj2,0.55,usedObjT2,0.25,7.5) + + if (m.capTimer > 0) then + local capTimer_Seconds = math.floor(m.capTimer * 0.03333333333333333) + local capText = "Cap Timer: " .. tostring(capTimer_Seconds) + local capWidth = djui_hud_measure_text(capText) + render_speed(w2,h2,capWidth,0.875,capText,0.5,15) + end + -- m.area.camera.cutscene = 0 + -- m.statusForCamera.cameraEvent = 0 + -- if (m.area.camera.cutscene > 0) then + -- local at = "Area Cutscene: " .. tostring(m.area.camera.cutscene) + -- local aw = djui_hud_measure_text(at) + -- render_speed(w2,h2,aw,0.1,at,0.5,15) + -- end + -- if (m.statusForCamera.cameraEvent > 0) then + -- local at2 = "Mario Cutscene: " .. tostring(m.statusForCamera.cameraEvent) + -- local aw2 = djui_hud_measure_text(at2) + -- render_speed(w2,h2,aw2,0.2,at2,0.5,15) + -- end + + if (not sv_gunmod_loaded) then -- crosshair + -- djui_hud_set_color(0,0,0,255) + -- djui_hud_render_rect((w2*0.5) - 6,(h2*0.5) - 1,11,3) + -- djui_hud_render_rect((w2*0.5) - 2,(h2*0.5) - 5,3,11) + + djui_hud_set_color(255,255,255,255) + djui_hud_render_rect((w2*0.5) - 5,(h2*0.5),9,1) + djui_hud_render_rect((w2*0.5) - 1,(h2*0.5) - 4,1,9) + end + end +end + +function allow_pvp(m,v) + if (intFix > 0) then return end + if (m.action == ACT_DM_AIR_MOVEMENT or m.action == ACT_DM_AIR_MOVEMENT_METAL or m.action == ACT_DM_WATER_MOVEMENT) then + return false + end +end + +function on_object_render(o) + if (get_id_from_behavior(o.behavior) == id_bhvMario) then + local m = gMarioStates[0] + if (o == m.marioObj) then + o.header.gfx.shadowInvisible = true + o.header.gfx.disableAutomaticShadowPos = true + local flag = cutsceneActns[m.action] ~= 1 + if (m.heldObj ~= nil and flag) then + local cYaw = m.area.camera.yaw + 0x8000 + local fA = m.faceAngle.y + 0x4000 + + local offsetX_FaceAngle = 40 * sins(fA) + local offsetZ_FaceAngle = 40 * coss(fA) + + local factorY_CameraAngle = sins(gLakituState.oldPitch) + + local offsetX_CameraAngle_Fixup = (sins(cYaw)) * factorY_CameraAngle + local offsetZ_CameraAngle_Fixup = (coss(cYaw)) * factorY_CameraAngle + + local finalOffsetX = offsetX_FaceAngle + offsetX_CameraAngle_Fixup + local finalOffsetY = -60 + local finalOffsetZ = offsetZ_FaceAngle + offsetZ_CameraAngle_Fixup + + + m.marioObj.header.gfx.pos.x = m.marioBodyState.heldObjLastPosition.x + finalOffsetX + m.marioObj.header.gfx.pos.y = m.marioBodyState.heldObjLastPosition.y + finalOffsetY + m.marioObj.header.gfx.pos.z = m.marioBodyState.heldObjLastPosition.z + finalOffsetZ + elseif (m.heldObj == nil and m.heldByObj ~= nil and flag) then + vec3f_copy(m.pos,m.marioObj.header.gfx.pos) + end + end + end +end +local modLoad = false +function on_level_init() + gFirstPersonCamera.offset.y = sv_camerayoffset + gLakituState.roll = 0 + cl_red = 0 + intFix = 10 + local lastList = 0 + local obj = obj_get_first(ObjectLists[lastList]) + while obj ~= nil do + obj.header.gfx.skipInViewCheck = true + local nextObj = obj_get_next(obj) + if (nextObj == nil) then + while nextObj == nil and lastList < 9 do + lastList = lastList + 1 + nextObj = obj_get_first(ObjectLists[lastList]) + end + end + obj = nextObj + end + + + if (not modLoad) then + djui_chat_message_create("\\#FFE0A0\\Welcome to \\#FFAA00\\mQuake\\#FFE0A0\\!\nPlease check the list of commands with '/mq list'.") + end + + if (not modLoad and network_is_server()) then + djui_chat_message_create("\\#A0FFE0\\Please check the server settings with '/mq_server list'.") + end + + modLoad = true +end +function local_update(m) + if (m == nil) then return true end + + if (m.health <= 0xFF) then + gFirstPersonCamera.offset.y = -110 + gLakituState.roll = 0 + m.invincTimer = 0 + cl_red = 192 + return false + end + + if (cl_airstrafelimiter > 0) then + cl_airstrafelimiter = cl_airstrafelimiter * 0.95 + if (cl_airstrafelimiter <= 0.1) then cl_airstrafelimiter = 0 end + end + + local btnDown = m.controller.buttonDown + local btnPressed = m.controller.buttonPressed + -- if (cl_interacttimer > 0) then cl_interacttimer = cl_interacttimer - 1 end + if (cl_red > 0) then cl_red = cl_red - 32 end + + m.marioObj.hookRender = 1 + + if (m.heldObj ~= nil) then + held_obj_update(m) + end + + if (m.usedObj ~= nil and cl_toadTalkedTo and no_dialog_open()) then + m.usedObj.oToadMessageState = 4 + m.usedObj = nil + cl_toadTalkedTo = false + end + + if (DM_ACTION_QPHYS[m.action] == 1) then + if (m.controller.buttonDown & B_BUTTON) ~= 0 and (m.flags & MARIO_UNKNOWN_31) == 0 then + m.flags = m.flags | MARIO_UNKNOWN_31 + elseif (m.flags & MARIO_UNKNOWN_31) ~= 0 then + m.flags = m.flags & ~MARIO_UNKNOWN_31 + end + end + + if (cl_bowserthrow) then + cl_bowserthrow_previousYaw = m.faceAngle.y + cl_bowserthrow = m.heldObj ~= nil + m.faceAngle.y = m.area.camera.yaw + 0x8000 + end + + SV_HandleSpecialFloors(m,false) + + local shouldCrouch = ((((m.controller.buttonDown & Z_TRIG) ~= 0 and m.health > 0xFF) or m.action == ACT_GROUND_POUND or m.action == ACT_DM_GROUND_POUND_METAL) and m.action ~= ACT_DM_WATER_MOVEMENT) or (gPlayerSyncTable[m.playerIndex].playerCrouching and m.ceilHeight < m.pos.y + m.marioObj.hitboxHeight) + if (DM_ACTION_FORCEANGLE[m.action] ~= nil and not cl_bowserthrow) then + m.faceAngle.y = m.area.camera.yaw + (0x8000*DM_ACTION_FORCEANGLE[m.action]) + end + + if (DM_ACTIONS_CROUCHAIR[m.action] == 1) then + if (shouldCrouch ~= gPlayerSyncTable[m.playerIndex].playerCrouching) then + if (shouldCrouch) then + m.pos.y = m.pos.y + sv_crouchoffset + else + if (m.pos.y - sv_crouchoffset < m.floorHeight) then + m.pos.y = m.floorHeight + else + m.pos.y = m.pos.y - sv_crouchoffset + end + end + end + end + + gPlayerSyncTable[m.playerIndex].playerCrouching = shouldCrouch + + if (m.action ~= ACT_SQUISHED) then gFirstPersonCamera.offset.y = ifelse(shouldCrouch, sv_camerayoffset-sv_crouchoffset, sv_camerayoffset) end + + -- if (m.health <= 0xFF) then + gLakituState.roll = gLakituState.roll * 0.75 + if (DM_ACTIONS_ALLOWGRAB[m.action] == 1 and no_dialog_open() and sv_interact) then + mario_handle_grab_and_punch_custom(m) + end + -- end + + m.marioObj.hitboxHeight = ifelse(shouldCrouch, sv_playerheight-sv_crouchoffset, sv_playerheight) + + local warp = obj_get_nearest_object_with_behavior_id(m.marioObj, id_bhvFadingWarp) + if warp ~= nil and m.heldObj == nil and m.action ~= ACT_TELEPORT_FADE_OUT and m.action ~= ACT_TELEPORT_FADE_IN and obj_check_hitbox_overlap(m.marioObj, warp) and vec3f_length(m.vel) < sv_stopspeed and gPlayerSyncTable[m.playerIndex].playerCrouching then + m.interactObj = warp + m.usedObj = warp + m.forwardVel = 0 + set_mario_action(m, ACT_TELEPORT_FADE_OUT, 0) + m.controller.buttonDown = btnDown + m.controller.buttonPressed = btnPressed + frameCalculatedAngles = false + return false + end + + m.controller.buttonDown = btnDown + m.controller.buttonPressed = btnPressed + + frameCalculatedAngles = false + return true +end +function on_game_update(m) + local m = gMarioStates[0] + + if (m == nil) then return end + m.peakHeight = m.pos.y + + local a = m.action + + if (DM_ACTION_DONT_OVERRIDE_FP[a] ~= 1) then set_first_person_enabled(true) end + -- remove_cutscenes(m) + + gFirstPersonCamera.forceRoll = false + gFirstPersonCamera.fov = cl_fov + + if (a == ACT_SQUISHED and m.ceil ~= nil) then + gFirstPersonCamera.offset.y = m.ceilHeight - m.pos.y - 120 + end + + if (intFix > 0) then intFix = intFix -1 end +end + + +--- commands +function mquake(msg) + if msg == 'list' then + djui_chat_message_create("\\#FFE0A0\\'/mq alt_walljump [on/off]'\\#FFFFFF\\ - Set alternate walljump key (Holding B)") + djui_chat_message_create("\\#FFE0A0\\'/mq predict [on/off]'\\#FFFFFF\\ - Set prediction for acceleration") + djui_chat_message_create("\\#FFE0A0\\'/mq moveset'\\#FFFFFF\\ - A short tutorial on the moveset") + djui_chat_message_create("\\#FFE0A0\\'/mq fov [45-120]'\\#FFFFFF\\ - Set the FOV") + return true + elseif msg == 'alt_walljump off' then + djui_chat_message_create("\\#FFE0A0\\Alternative Walljump Key:\\#FF1414\\ Off") + mod_storage_save_bool("mq_altwallj",false) + cl_altWalljumpKey = false + return true + elseif msg == 'predict off' then + djui_chat_message_create("\\#FFE0A0\\Acceleration Prediction:\\#FF1414\\ Off") + mod_storage_save_bool("mq_accelpred",true) + cl_disableAccelPred = true + return true + elseif msg == 'alt_walljump on' then + djui_chat_message_create("\\#FFE0A0\\Alternative Walljump Key:\\#14FF14\\ On") + mod_storage_save_bool("mq_altwallj",true) + cl_altWalljumpKey = true + return true + elseif msg == 'predict on' then + djui_chat_message_create("\\#FFE0A0\\Acceleration Prediction:\\#14FF14\\ On") + mod_storage_save_bool("mq_accelpred",true) + cl_disableAccelPred = true + return true + elseif msg == 'moveset' then + djui_chat_message_create("\\#FFE0A0\\Ground Pound - \\#FFFFFF\\Let go of (A) and press [Z] to start a ground pound.\nPressing [Z] again will cancell all horizontal velocity, sending you straight down!") + djui_chat_message_create("\\#FFE0A0\\Ground Pound Jump - \\#FFFFFF\\Hold (A) after starting a ground pound to ground pound jump when you land. \nThis converts some velocity to upwards momentum while carrying the rest!") + djui_chat_message_create("\\#FFE0A0\\Crouch Jump - \\#FFFFFF\\Continue to hold (A) after jumping then press and hold [Z] to stay in the air longer and land on higher up platforms!") + djui_chat_message_create("\\#FFE0A0\\Interacting - \\#FFFFFF\\Pressing (B) will interact with objects.\nLook at the object you wish to either punch, grab or talk to and press (B).\nHolding (B) will let you push metal boxes around and grab trees or poles!") + djui_chat_message_create("\\#FFE0A0\\Throwing Bowser - \\#FFFFFF\\To throw bowser, flick your view to the left or right and press (B)!") + return true + end + + local space = string.find(msg,' ') + if (space == nil or space < 1) then return end + local args = {[1]=string.sub(msg,1,space-1),[2]=string.sub(msg,-(string.len(msg)-space))} + + if (args[2] == nil or args[2] == "") then return false end + if (args[1] == nil or args[1] == "") then return false end + + if args[1] == "fov" and args[2] ~= nil then + cl_fov = clampf(tonumber(args[2]),45,120) + mod_storage_save_number("mq_fov",cl_fov) + return true + end + return false +end + +if (network_is_server()) then + function mquake_server(msg) + if msg == 'list' then + djui_chat_message_create("\\#A0FFE0\\'/mq_server StickySlope [on/off]'\\#FFFFFF\\ - Default is off") + djui_chat_message_create("\\#A0FFE0\\'/mq_server Accelerate [value]'\\#FFFFFF\\ - Default is 10") + djui_chat_message_create("\\#A0FFE0\\'/mq_server AirAccelerate [value]'\\#FFFFFF\\ - Default is 10") + djui_chat_message_create("\\#A0FFE0\\'/mq_server AirClamp [value]'\\#FFFFFF\\ - Default is 30") + djui_chat_message_create("\\#A0FFE0\\'/mq_server Gravity [value]'\\#FFFFFF\\ - Default is 800") + djui_chat_message_create("\\#A0FFE0\\'/mq_server PlayerSpeed [value]'\\#FFFFFF\\ - Default is 1.0") + djui_chat_message_create("\\#A0FFE0\\'/mq_server PlayerFriction [value]'\\#FFFFFF\\ - Default is 1.0") + djui_chat_message_create("\\#A0FFE0\\'/mq_server PlayerJumpHeight [value]'\\#FFFFFF\\ - Default is 1.0") + djui_chat_message_create("\\#A0FFE0\\'/mq_server GroundPound [on/off]'\\#FFFFFF\\ - Default is on") + djui_chat_message_create("\\#A0FFE0\\'/mq_server WallJump [on/off]'\\#FFFFFF\\ - Default is on") + djui_chat_message_create("\\#A0FFE0\\'/mq_server Interact [on/off]'\\#FFFFFF\\ - Default is on") + djui_chat_message_create("\\#A0FFE0\\'/mq_server SaveConfig [name]'\\#FFFFFF\\ - Save the current server settings to mod storage ") + djui_chat_message_create("\\#A0FFE0\\'/mq_server LoadConfig [name]'\\#FFFFFF\\ - Load settings from mod storage") + return true + end + + local space = string.find(msg,' ') + if (space == nil or space < 1) then return end + local args = {[1]=string.sub(msg,1,space-1),[2]=string.sub(msg,-(string.len(msg)-space))} + + if (args[2] == nil or args[2] == "") then return false end + if (args[1] == nil or args[1] == "") then return false end + + if args[1] == "StickySlope" and args[2] ~= nil then + gGlobalSyncTable.Convar_StickySlope = args[2]=="on" + return true + end + if args[1] == "Accelerate" and args[2] ~= nil then + gGlobalSyncTable.Convar_Accelerate = tonumber(args[2]) + return true + end + if args[1] == "AirAccelerate" and args[2] ~= nil then + gGlobalSyncTable.Convar_AirAccelerate = tonumber(args[2]) + return true + end + if args[1] == "AirClamp" and args[2] ~= nil then + gGlobalSyncTable.Convar_AirClamp = tonumber(args[2]) + return true + end + if args[1] == "Gravity" and args[2] ~= nil then + gGlobalSyncTable.Convar_Gravity = tonumber(args[2]) + return true + end + if args[1] == "PlayerSpeed" and args[2] ~= nil then + gGlobalSyncTable.Convar_PlayerSpeed = tonumber(args[2]) + return true + end + if args[1] == "PlayerFriction" and args[2] ~= nil then + gGlobalSyncTable.Convar_PlayerFriction = tonumber(args[2]) + return true + end + if args[1] == "PlayerJumpHeight" and args[2] ~= nil then + gGlobalSyncTable.Convar_PlayerJumpHeight = tonumber(args[2]) + return true + end + if args[1] == "GroundPound" and args[2] ~= nil then + gGlobalSyncTable.Convar_PlayerAllow_GroundPound = args[2]=="on" + return true + end + if args[1] == "WallJump" and args[2] ~= nil then + gGlobalSyncTable.Convar_PlayerAllow_WallJump = args[2]=="on" + return true + end + if args[1] == "Interact" and args[2] ~= nil then + gGlobalSyncTable.Convar_PlayerAllow_Interact = args[2]=="on" + return true + end + + if args[1] == "SaveConfig" and args[2] ~= nil then + mod_storage_save_bool(args[2] .. ".ss",gGlobalSyncTable.Convar_StickySlope) + mod_storage_save_bool(args[2] .. ".gp",gGlobalSyncTable.Convar_PlayerAllow_GroundPound) + mod_storage_save_bool(args[2] .. ".wj",gGlobalSyncTable.Convar_PlayerAllow_WallJump) + mod_storage_save_bool(args[2] .. ".i",gGlobalSyncTable.Convar_PlayerAllow_Interact) + mod_storage_save_number(args[2] .. ".j",gGlobalSyncTable.Convar_PlayerJumpHeight) + mod_storage_save_number(args[2] .. ".f",gGlobalSyncTable.Convar_PlayerFriction) + mod_storage_save_number(args[2] .. ".s",gGlobalSyncTable.Convar_PlayerSpeed) + mod_storage_save_number(args[2] .. ".aa",gGlobalSyncTable.Convar_AirAccelerate) + mod_storage_save_number(args[2] .. ".a",gGlobalSyncTable.Convar_Accelerate) + mod_storage_save_number(args[2] .. ".ac",gGlobalSyncTable.Convar_AirClamp) + mod_storage_save_number(args[2] .. ".g",gGlobalSyncTable.Convar_Gravity) + djui_chat_message_create("\\#A0FFE0\\Saved settings to '" .. args[2] .. "'") + return true + end + + if args[1] == "LoadConfig" and args[2] ~= nil then + if (mod_storage_load_number(args[2] .. ".s") ~= nil) then + + gGlobalSyncTable.Convar_Gravity = mod_storage_load_number(args[2] .. ".g") + gGlobalSyncTable.Convar_Accelerate = mod_storage_load_number(args[2] .. ".a") + gGlobalSyncTable.Convar_AirAccelerate = mod_storage_load_number(args[2] .. ".aa") + gGlobalSyncTable.Convar_AirClamp = mod_storage_load_number(args[2] .. ".ac") + gGlobalSyncTable.Convar_PlayerSpeed = mod_storage_load_number(args[2] .. ".s") + gGlobalSyncTable.Convar_PlayerFriction = mod_storage_load_number(args[2] .. ".f") + gGlobalSyncTable.Convar_PlayerJumpHeight = mod_storage_load_number(args[2] .. ".j") + gGlobalSyncTable.Convar_PlayerAllow_GroundPound = mod_storage_load_bool(args[2] .. ".gp") + gGlobalSyncTable.Convar_PlayerAllow_WallJump = mod_storage_load_bool(args[2] .. ".wj") + gGlobalSyncTable.Convar_PlayerAllow_Interact = mod_storage_load_bool(args[2] .. ".i") + gGlobalSyncTable.Convar_StickySlope = mod_storage_load_bool(args[2] .. ".ss") + djui_chat_message_create("\\#A0FFE0\\Loaded settings from '" .. args[2] .. "'") + return true + end + end + end +else + function mquake_server(msg) + return false + end +end \ No newline at end of file diff --git a/mods/mquake/_mquake_e_hook_functions_32.luac b/mods/mquake/_mquake_e_hook_functions_32.luac deleted file mode 100644 index 88052211570e8687c05ddfcf77996903056d0b2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17951 zcmcJ1Z*UvOmFMe06QHR7CMEgLMT8uc?QF@4ocL0yt-8_-Kma5~5j06j>%^`J1Pn=7 zAiw~iXywDDK}uv|$CCfY+1d|xKJ9+k(tW?J{W2gaz|qEW>MHm3ZqLO_<*HKm?LOR9 zUG4o|&j1*ZkZfJuPStQ``gOm4-TnIY@4asDnTh4h3_bP1!GWg-q?G;rZ(gR(^}>oN zI$z=&X?%pqq+!#flSJw{QWRDuC0&!&$)bj7QMhJNvTo73h*86eQFt{*$;}w88*ysH z;uKzsQ*tX#>!A^9#78K6bA*!HBeX6Pv@w#{*SMLW@cjfO`;xStNK)fglERH76~aXQ zX85+1jL^L#-c|U{y>))B-?`V&-|yZF3;urhUXq{T_wKFh@AvLC^!NMs!UogdznA1^ z_=9`v`ul@>4TJs^4pF}w{_sypey)G`r*-}P(H81G)5JS%d~_xv@r-{e1@}ix| zm+eZ`S&~DQ%yq|}%NHDb9=YcVnfXdEky&_&PjqtTN;ZGUr@2UWxmAY938|x=r9}E7`K+6z!FKuDT$f=|x&_^79K-`9zzh zTU;tuGJ>mgM1L$1FK4bf@`<8TT`85X*_b^Qr;L`$LmtWhWa}m97wIG|rmI;|9) zBBf4}P;AEdI|@_ArY&R=g)n8G0|TDA5@qBeRttYz^105a=!xN{^DwfOID;V+;fsan zah*Wg8Qg;8ckoD(NgJj~DG0&OVPy)oA2pZgZ;)$)>h!4z`@(6;Pc!S(K)I%JMboSc z+a<3|i>?B6)r0N^=xz@>ZFcz6<{tjH&@nC%{Wau+jOZ*y`|y-U<|n<8nbJ0`A`f^P zHwI(yX1m`8TRkHOI+}Qh%}~6wT&_5iFhBeG)5=!){UE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msvxc88RhcuNJ3#vio%YSMd%%s0X>TFe#`!X&1{FNnkvI`u zC>C;;xxz~H3PO7RxiFf5Jx__%aD0lC4Qn~!KstZm9cYO8bkPKUyg@rYng9aQ zXky1l6L|KZ2^`y@yFQwbKodJ{H1TuB(QR4^JKyR0-G`xxw_0WrXko`k6G@;2j^qW= zM50S~6MgB}?e_Oad|re|BBF&63*T-Ekqc~6Ti753_PtEdG8$QZWtsPT%9ub_UtP}!J!Ral zRp!HB% z0yIQowJhy&^#HB@>t0$TKog(!(!_yoeU`VU*lhE(0yKCFz4ZlX!mkguM>G!TIaL=2 z=^J%{GK}6m6tCx^`8(KwqusuCkD#w-yteyoxUYD#4EBP@LC@0}k7xY=y^g4)H($m3 zJv6kVORL}Pp`raGfCwJYG6A+FuZ>fS*?S4%OG; zV)ktgxWpMLe3cmAJvG{&LAruplGm<%Rr&9qIyIW;D}i^SAAwOP|5Z$0I(cd|{Rk$h zisw3g9X=C};KNAT3tD|0PW_wZ`97ZO)7R$?j4|9{tFJihKWbS2|IDEc!oONqOQZR| zGR)zB48WCGD8Tb7A*$J{sZ7;S*8c|t@V5A;+}#~tAYH&r_)OYgj*iautz-(Z{)bn> z)GkNlr46DEII-~u4F5AFjolw(_n9Ry2&T}Jb|PR(w6&s zrlvgH&KsPta!-5a;YX2PeVv3se@@8*KBfJ=FECeRTg+hE0q>(d59AS_!2`*Myzj1> z%O`s>1_=8CdMw9#a#{L66$I&f+WIR0MW37<;-0or_RZEI?(J&c!(uM-B#y<%lZz|( zbM*}wI$3zQQxiJL85VGJk!%((S$@gkWl?^kqn2E2K--|d&r9QZxwosLy>%3!oVM>c v^@N5rL5GGA`S1@&Fq0s6t;^3p#L@btLG&x!*lrAA!HVNvz!xuIU+4P2K2Os9 diff --git a/mods/mquake/_mquake_f_hooks.lua b/mods/mquake/_mquake_f_hooks.lua new file mode 100644 index 00000000..27dbeb79 --- /dev/null +++ b/mods/mquake/_mquake_f_hooks.lua @@ -0,0 +1,95 @@ +if SM64COOPDX_VERSION == nil then return end + +hook_mario_action(ACT_DM_GROUNDED_MOVEMENT, act_dm_grounded_movement) +hook_mario_action(ACT_DM_GROUNDED_IDLE, act_dm_grounded_movement) +hook_mario_action(ACT_DM_AIR_MOVEMENT, act_dm_air_movement) +hook_mario_action(ACT_GROUND_POUND, act_dm_ground_pound) +hook_mario_action(ACT_DM_GROUND_POUND_METAL, act_dm_ground_pound) +hook_mario_action(ACT_DM_GROUNDED_MOVEMENT_METAL, act_dm_grounded_movement) +hook_mario_action(ACT_DM_AIR_MOVEMENT_METAL, act_dm_air_movement) +hook_mario_action(ACT_DM_POLE_MOVEMENT, act_dm_pole_movement) +hook_mario_action(ACT_DM_WATER_MOVEMENT, act_dm_water_movement) +hook_event(HOOK_ON_PLAYER_CONNECTED, on_player_connected) +hook_event(HOOK_OVERRIDE_PHYS_STEP_DEFACTO_SPEED, override_defacto) +hook_event(HOOK_CHARACTER_SOUND, allow_voice) +hook_event(HOOK_BEFORE_SET_MARIO_ACTION, before_set_mario_action) +hook_event(HOOK_ON_SET_MARIO_ACTION, on_set_mario_action) +hook_event(HOOK_ON_LEVEL_INIT, on_level_init) +hook_event(HOOK_BEFORE_PHYS_STEP, before_phys_step) +hook_event(HOOK_ALLOW_HAZARD_SURFACE, function(m) return false end) +hook_event(HOOK_ON_INTERACT, on_interact) +hook_event(HOOK_ALLOW_INTERACT, allow_interact) +hook_event(HOOK_ON_PVP_ATTACK, on_pvp) +hook_event(HOOK_ALLOW_PVP_ATTACK, allow_pvp) +hook_event(HOOK_ON_OBJECT_RENDER, on_object_render) +hook_event(HOOK_ON_HUD_RENDER_BEHIND, render_hud_effects) +hook_event(HOOK_UPDATE, on_game_update) + +hook_chat_command('mq', "[list] - \\#FFE0A0\\List all commands", mquake) + + + + + + +--- Server --- + + +if (network_is_server()) then + hook_chat_command('mq_server', "[list] - \\#A0FFE0\\List all convars/settings", mquake_server) +end + + + +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_StickySlope', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'StickySlope'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal==true).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal==true).."'\\#A0FFE0\\.") end + sv_sticky = newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_AirAccelerate', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'AirAccelerate'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_airaccelerate_value = newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_Accelerate', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'Accelerate'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_accelerate = newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_AirClamp', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'AirClamp'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_playerclamp_air = newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_PlayerSpeed', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'PlayerSpeed'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_maxspeed = 180*newVal + sv_maxspeed_crouch = 80*newVal + sv_maxspeed_water = 180*newVal + sv_playerspeed = 90*newVal + sv_playerspeed_water = 90*newVal + sv_playerspeed_water_shell = 300*newVal + sv_upspeed_water = 180*newVal + sv_playerspeed_crouch = 40*newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_Gravity', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'Gravity'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_gravity = newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_PlayerFriction', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'PlayerFriction'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_friction = 4*newVal + sv_waterfriction = 2.5*newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_PlayerJumpHeight', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'PlayerJumpHeight'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal).."'\\#A0FFE0\\.") end + sv_jumpheight =newVal +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_PlayerAllow_GroundPound', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'PlayerAllow_GroundPound'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal==true).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal==true).."'\\#A0FFE0\\.") end + sv_groundpound = newVal==true +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_PlayerAllow_WallJump', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'PlayerAllow_WallJump'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal==true).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal==true).."'\\#A0FFE0\\.") end + sv_walljump = newVal==true +end) +hook_on_sync_table_change(gGlobalSyncTable, 'Convar_PlayerAllow_Interact', 'server', function(tag, oldVal, newVal) + if (oldVal ~= newVal) and (oldVal ~= nil) then djui_chat_message_create("\\#A0FFE0\\Cvar \\#14FF14\\'PlayerAllow_Interact'\\#A0FFE0\\ changed from \\#14FF14\\'"..tostring(oldVal==true).."'\\#A0FFE0\\ to \\#14FF14\\'"..tostring(newVal==true).."'\\#A0FFE0\\.") end + sv_interact = newVal==true +end) \ No newline at end of file diff --git a/mods/mquake/_mquake_f_hooks_32.luac b/mods/mquake/_mquake_f_hooks_32.luac deleted file mode 100644 index 5bb05d1b8ad99236d339aeb6ad1498e6968240e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5808 zcmdT|T~pge6kVAu5JDitKm+-rO(w}h+9cCV+nM%3!j`eYSRUIUUvzeaEkKEFIkF7l zO_VfApZhoZ*uIO&OkVpZ@T$-?%BH^=0dim7s=c&XU68o zD5ayLFV;xsxw$J#9ZUM;cNoJ&CRb#cTqeZ5PFynV$|U8<WoJ=i4EvE>Z#i0#29%MpATc*OQ#la&a*0$kYM z3X~cr`|>z>=Vrknv0)Ei*Cn4Lr^`fghkec&aL$0UDmbecbq>A>a_CNwTZ*4Q+6uoX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lpLepGU*UKGKe#df9UV`83*>uc@P7mU-v)i8dT$-?%BH^=0dim7s=c&XU68o z=qMc>eX&M5&&^#~>R8ezzrz?NGPxqlfm?S0*V>Ca;J>uF0lv%*wrMfF?3h-a&MAo!ORln|f_6Wb zRFiB~TT@rnT#3$s!74SjWm~O!#i+2FwPVzbxSsc zL}x`e50sJ`8Pu#G@9K^b8P;iEU1Nt!G?&)26{h7_KC3)J+k}?Osfm(`p;~p;sOo!Y zS+?qRqwE+JdOe_Hq6(R$%JS()MOG}Sd6raD$U$Spyo$C{m;u{1D+a3=n@GZq=rAy|+Tt>1loeDgn*ye$&a926m`-LJST4301&HbUNx@=^YC3~* zj|UXC-KsESa}$l4blgwqmziXrPmDBYE)2UV&Rszbq7ULtLa!BL$&Ah+LNl; zbbeU)VqyJiDy800?yP6wSU|Q5g4d)YwdXDU8Di88XVRXs%+racpr`E5Ef=OUrQHgi&rBZkAt>1{u@QpTSAt;Q> z!lrH2B4m2Xv6_yJ@{%Mv7vVcrlr`Q#zNBN#9c&o9jJTplJa^#x3NMs8hmWt6JQOJ9 z#k!PoLv^G;9TFpwugGFl5#lQ{!n-;~k#u{sJ&JVIb!Q}ht;tCh`4o!asMXsmh3)9o zmeEI^dl<$yct5f{YF~NUX%9l139e1Mhdz>g3pu{~_>v_0N+LG6K?o9uAi+(f%=b`U zIDJ(49*U#_RX)S#pRS`nu(OPM}Lpzi^b7HMfmwHGWIXDV+kT)$rqqX0tubL}E8ZXMKuc3Gg!BkGyLv_FE$2 zcpt=Mo`yhM!R?`s7%LD$3&fbg=igo#ywb-I_qa;W^b@B0o-+u2c(HGadsLkAJn{I2 z=GSEi@tX|?ZZp? za1(qh6Y`ed_`H+d{0hel_`!|&@922)TOi*ngZ~@&|2F6& diff --git a/mods/mquake/_mquake_g_api.lua b/mods/mquake/_mquake_g_api.lua new file mode 100644 index 00000000..d30ce282 --- /dev/null +++ b/mods/mquake/_mquake_g_api.lua @@ -0,0 +1,143 @@ +local function sv_get_gravity() return gGlobalSyncTable.Convar_Gravity end +local function sv_get_air_accel() return gGlobalSyncTable.Convar_AirAccelerate end +local function sv_get_air_clamp() return gGlobalSyncTable.Convar_AirClamp end +local function sv_get_ground_accel() return gGlobalSyncTable.Convar_Accelerate end +local function sv_get_speed() return gGlobalSyncTable.Convar_PlayerSpeed end +local function sv_get_friction() return gGlobalSyncTable.Convar_PlayerFriction end +local function sv_get_jump_height() return gGlobalSyncTable.Convar_PlayerJumpHeight end +local function sv_get_allow_groundpound() return gGlobalSyncTable.Convar_PlayerAllow_GroundPound end +local function sv_get_allow_walljump() return gGlobalSyncTable.Convar_PlayerAllow_WallJump end +local function sv_get_allow_interact() return gGlobalSyncTable.Convar_PlayerAllow_Interact end + +local function sv_set_gravity(v) gGlobalSyncTable.Convar_Gravity = v end +local function sv_set_air_accel(v) gGlobalSyncTable.Convar_AirAccelerate = v end +local function sv_set_air_clamp(v) gGlobalSyncTable.Convar_AirClamp = v end +local function sv_set_ground_accel(v) gGlobalSyncTable.Convar_Accelerate = v end +local function sv_set_speed(v) gGlobalSyncTable.Convar_PlayerSpeed = v end +local function sv_set_friction(v) gGlobalSyncTable.Convar_PlayerFriction = v end +local function sv_set_jump_height(v) gGlobalSyncTable.Convar_PlayerJumpHeight = v end +local function sv_set_allow_groundpound(v) gGlobalSyncTable.Convar_PlayerAllow_GroundPound = v end +local function sv_set_allow_walljump(v) gGlobalSyncTable.Convar_PlayerAllow_WallJump = v end +local function sv_set_allow_interact(v) gGlobalSyncTable.Convar_PlayerAllow_Interact = v end + +local function cl_set_allow_action(a,o) + DM_ACTIONS[tonumber(a)] = o +end + +local function cl_set_action_crouchair(a,o) + DM_ACTIONS_CROUCHAIR[tonumber(a)] = o +end + +local function cl_set_action_allowgrab(a,o) + DM_ACTIONS_ALLOWGRAB[tonumber(a)] = o +end + +local function cl_set_action_uses_qphys(a,o) + DM_ACTION_QPHYS[tonumber(a)] = o +end + +local function cl_set_action_forceangle(a,o) + DM_ACTION_FORCEANGLE[tonumber(a)] = o +end + +local function cl_set_action_transfer_to_qphys(a,o) + DM_ACTION_TRANSFERS[tonumber(a)] = o +end + +local function cl_set_action_prerun_func(a,o) + DM_ACTION_PREFUNCS[tonumber(a)] = o +end + +local function cl_set_action_postrun_func(a,o) + DM_ACTION_FUNCTIONS[tonumber(a)] = o +end + +local function cl_set_action_ignore_fp(a,o) + DM_ACTION_DONT_OVERRIDE_FP[tonumber(a)] = o +end + +local function cl_set_interaction_func(a,o) + interactOverrides[tonumber(a)] = o +end + +local function cl_set_throw_func(a,o) + throwOverrides[tonumber(a)]=o +end + +local function cl_set_drop_func(a,o) + dropOverrides[tonumber(a)]=o +end + +local api = { + version = 1, + hotfix = 0, + server = { + get = { -- Allows modders to get server convars + stickyslope = sv_get_stickyslope, + gravity = sv_get_gravity, + airaccelerate = sv_get_air_accel, + airclamp = sv_get_air_clamp, + accelerate = sv_get_ground_accel, + speed = sv_get_speed, + friction = sv_get_friction, + jumpheight = sv_get_jump_height, + groundpound = sv_get_allow_groundpound, + walljump = sv_get_allow_walljump, + interact = sv_get_allow_interact + }, + set = { -- Allows modders to override server convars + stickyslope = sv_set_stickyslope, + gravity = sv_set_gravity, + airaccelerate = sv_set_air_accel, + airclamp = sv_set_air_clamp, + accelerate = sv_set_ground_accel, + speed = sv_set_speed, + friction = sv_set_friction, + jumpheight = sv_set_jump_height, + groundpound = sv_set_allow_groundpound, + walljump = sv_set_allow_walljump, + interact = sv_set_allow_interact + } + }, + physics = { -- Allows modders to access mQuakes physics functions + update = local_update, + airaccelerate = SV_AirAccelerate, + accelerate = SV_Accelerate, + playermovement = SV_PlayerMovement, + watermovement = SV_WaterMovement, + gravity = SV_UserGravityEx, + friction = SV_UserFriction, + getplayerangles = GetAngleVectors, + handlefloors = SV_HandleSpecialFloors, + addrelativevelocity = SV_PlayerMovement_Relative, + storeplayerposvel = SV_PlayerMovement_Store, + velcollide = PHYS_CollideWithNormal + }, + actions = { -- Allows modders to access mQuakes action override tables + set_allow_action = cl_set_allow_action, + set_action_crouchair = cl_set_action_crouchair, + set_action_allowgrab = cl_set_action_allowgrab, + set_action_uses_qphys = cl_set_action_uses_qphys, + set_action_forceangle = cl_set_action_forceangle, + set_action_transfer_to_qphys = cl_set_action_transfer_to_qphys, + set_action_prerun_func = cl_set_action_prerun_func, + set_action_postrun_func = cl_set_action_postrun_func, + set_action_ignore_fp = cl_set_action_ignore_fp, + get_allowed_action_list = function() return DM_ACTIONS end, + get_crouchair_action_list = function() return DM_ACTIONS_CROUCHAIR end, + get_allowgrab_action_list = function() return DM_ACTIONS_ALLOWGRAB end, + get_qphys_action_list = function() return DM_ACTION_QPHYS end, + get_nofp_action_list = function() return DM_ACTION_DONT_OVERRIDE_FP end, + get_forceangle_action_list = function() return DM_ACTION_FORCEANGLE end, + get_transfer_action_list = function() return DM_ACTION_TRANSFERS end, + get_prefunc_action_list = function() return DM_ACTION_PREFUNCS end, + get_postfunc_action_list = function() return DM_ACTION_FUNCTIONS end + }, + interactions = { -- Allows modders to override interactions + set_interaction_override = cl_set_interaction_func, + set_throw_override = cl_set_throw_func, + set_drop_override = cl_set_drop_func + } +} + +_G.mQuake_API = api \ No newline at end of file diff --git a/mods/mquake/_mquake_g_api_32.luac b/mods/mquake/_mquake_g_api_32.luac deleted file mode 100644 index 36f4a712ff3bd1834ad9cc93d0872e6b912e7462..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5474 zcmbuC`)}J+6vuCpo5XF`_qw(#(}aKlq6i^`5JHG#X%aW<+Air@@ss5yPGjcA!FJm9 z7f9R0H3r0EZ0tS$0RIs@hyM_M%pbuy&YRA}*&>}d=bU>#-}~@Ab{1C3e1^>58XZ1A zOetlUo13Kbd1F7~>v+CbE8r}GNfAOUaO%H;@ADBU>Lb>nkJNwjkww3sNSFP@I`WhH z?|!lv2oNb2Al7k!)c**OMM{aZM2S_Ur2Z!*i@_j~;z457f~5XekSvBmL`sB+rH4rU zX^1R_!$eAkiFFbt^}oYp#PE?}Hc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