From b3bd7f170c163ded4a7a0f4307550e1f8cc63d29 Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Sat, 21 May 2022 09:14:20 +1000 Subject: [PATCH] Added Spectator to Client --- Export_Code/gml_Object_oClient_Other_68.gml | 8 --- .../gml_Object_oPauseMenuOptions_Other_10.gml | 2 +- .../gml_Object_oPauseMenuOptions_Step_0.gml | 2 +- Export_Code/gml_Script_characterStepEvent.gml | 53 ++++++------------- 4 files changed, 17 insertions(+), 48 deletions(-) diff --git a/Export_Code/gml_Object_oClient_Other_68.gml b/Export_Code/gml_Object_oClient_Other_68.gml index 72b7667..992337c 100644 --- a/Export_Code/gml_Object_oClient_Other_68.gml +++ b/Export_Code/gml_Object_oClient_Other_68.gml @@ -453,14 +453,6 @@ switch type_event global.saxmode = saxmode global.experimental = experimental global.freeForAll = freeForAll - if (!lobbyLocked) - { - if global.spectator - { - global.spectator = 0 - global.spectatorIndex = -1 - } - } global.lobbyLocked = lobbyLocked global.samCount = samCount break diff --git a/Export_Code/gml_Object_oPauseMenuOptions_Other_10.gml b/Export_Code/gml_Object_oPauseMenuOptions_Other_10.gml index 3156d8c..1b27fbf 100644 --- a/Export_Code/gml_Object_oPauseMenuOptions_Other_10.gml +++ b/Export_Code/gml_Object_oPauseMenuOptions_Other_10.gml @@ -3,7 +3,7 @@ op1.optionid = 0 op1.label = get_text("PauseMenu", "Resume") op2 = instance_create(x, (y + 16), oPauseOption) op2.optionid = 1 -if (global.saxmode || global.lobbyLocked || global.currentroom == 55 || global.currentroom == 91 || global.currentroom == 128 || global.currentroom == 206 || global.currentroom == 282 || global.currentroom == 281 || global.currentroom == 276 || global.currentroom == 277 || global.currentroom == 205 || global.currentroom == 208 || global.currentroom == 207 || global.currentroom == 387) +if (global.saxmode || global.currentroom == 55 || global.currentroom == 91 || global.currentroom == 128 || global.currentroom == 206 || global.currentroom == 282 || global.currentroom == 281 || global.currentroom == 276 || global.currentroom == 277 || global.currentroom == 205 || global.currentroom == 208 || global.currentroom == 207 || global.currentroom == 387) op2.enabled = 0 op2.label = get_text("PauseMenu", "Restart") op3 = instance_create(x, (y + 32), oPauseOption) diff --git a/Export_Code/gml_Object_oPauseMenuOptions_Step_0.gml b/Export_Code/gml_Object_oPauseMenuOptions_Step_0.gml index c24b138..d1c9144 100644 --- a/Export_Code/gml_Object_oPauseMenuOptions_Step_0.gml +++ b/Export_Code/gml_Object_oPauseMenuOptions_Step_0.gml @@ -27,7 +27,7 @@ if active } if (global.curropt == 1) { - if ((!global.saxmode) && (!global.lobbyLocked) && global.currentroom != 55 && global.currentroom != 91 && global.currentroom != 128 && global.currentroom != 206 && global.currentroom != 282 && global.currentroom != 281 && global.currentroom != 276 && global.currentroom != 277 && global.currentroom != 205 && global.currentroom != 208 && global.currentroom != 207 && global.currentroom != 387) + if ((!global.saxmode) && global.currentroom != 55 && global.currentroom != 91 && global.currentroom != 128 && global.currentroom != 206 && global.currentroom != 282 && global.currentroom != 281 && global.currentroom != 276 && global.currentroom != 277 && global.currentroom != 205 && global.currentroom != 208 && global.currentroom != 207 && global.currentroom != 387) { instance_create(50, 92, oOptionsReload) instance_destroy() diff --git a/Export_Code/gml_Script_characterStepEvent.gml b/Export_Code/gml_Script_characterStepEvent.gml index 80afcc5..3648594 100644 --- a/Export_Code/gml_Script_characterStepEvent.gml +++ b/Export_Code/gml_Script_characterStepEvent.gml @@ -58,6 +58,8 @@ if (global.saxmode && global.sax && global.playerhealth == 1 && (!global.spectat } if global.spectator { + global.sax = 0 + global.reform = 0 if global.reform { invincible = 1 @@ -141,10 +143,10 @@ if global.spectator { sprite_index = sMonitoad image_speed = 0.25 - maxSpectatorLeftSpeed = -4 - maxSpectatorRightSpeed = 4 - maxSpectatorUpSpeed = -4 - maxSpectatorDownSpeed = 4 + maxSpectatorLeftSpeed = -5 + maxSpectatorRightSpeed = 5 + maxSpectatorUpSpeed = -5 + maxSpectatorDownSpeed = 5 } if global.sax { @@ -163,13 +165,13 @@ if global.spectator } } if (kLeft > 0) - xVel -= 0.1 + xVel = -5 if (kRight > 0) - xVel += 0.1 + xVel = 5 if (kUp > 0) - yVel -= 0.1 + yVel = -5 if (kDown > 0) - yVel += 0.1 + yVel = 5 if (xVel < maxSpectatorLeftSpeed) xVel = maxSpectatorLeftSpeed if (xVel > maxSpectatorRightSpeed) @@ -181,16 +183,16 @@ if global.spectator if (kLeft == 0 && kRight == 0) { if (xVel > 0) - xVel -= 0.1 + xVel = 0 if (xVel < 0) - xVel += 0.1 + xVel = 0 } if (kUp == 0 && kDown == 0) { if (yVel > 0) - yVel -= 0.1 + yVel = 0 if (yVel < 0) - yVel += 0.1 + yVel = 0 } if (!global.enablecontrol) { @@ -3339,31 +3341,6 @@ if (monster_drain > 0) else global.playerhealth -= (global.mod_monstersdrainGS * 4) } - if global.sax - { - if (global.currentsuit == 0 && oControl.mod_monstersextreme == 0) - global.playerhealth -= (global.mod_monstersdrainPS * 2) - else if (global.currentsuit == 0 && oControl.mod_monstersextreme != 0) - global.playerhealth -= (global.mod_monstersdrainPS * 4) - if (global.currentsuit == 1 && oControl.mod_monstersextreme == 0) - global.playerhealth -= (global.mod_monstersdrainVS * 2) - else if (global.currentsuit == 1 && oControl.mod_monstersextreme != 0) - global.playerhealth -= (global.mod_monstersdrainVS * 4) - if (global.currentsuit == 2 && oControl.mod_monstersextreme == 0) - { - if (global.item[5] == 0) - global.playerhealth -= (global.mod_monstersdrainVS * 2) - else - global.playerhealth -= (global.mod_monstersdrainGS * 2) - } - else if (global.currentsuit == 2 && oControl.mod_monstersextreme != 0) - { - if (global.item[5] == 0) - global.playerhealth -= (global.mod_monstersdrainVS * 4) - else - global.playerhealth -= (global.mod_monstersdrainGS * 4) - } - } if (global.playerhealth <= 0) { with (oControl) @@ -3721,5 +3698,5 @@ if (ballbounce > 0) statetime += 1 if (state != IDLE && state != SAVING && state != SAVINGFX && state != SAVINGSHIP && state != SAVINGSHIPFX) global.gametime += 1 -if global.freeForAll +if (global.freeForAll && (!global.spectator)) global.sax = global.clientID