From 41169d46fe3afe0f3462d4431f51fdb8d7a58102 Mon Sep 17 00:00:00 2001 From: milesthenerd Date: Tue, 12 Jan 2021 19:59:29 -0600 Subject: [PATCH] Hopefully fixed the Queen's phase sync when fighting a second time --- objects/oClient.object.gmx | 8 +++- objects/oMAlpha.object.gmx | 24 +---------- objects/oMGamma.object.gmx | 25 +----------- objects/oMOmega.object.gmx | 18 +------- objects/oMZeta.object.gmx | 20 +-------- scripts/update_variables.gml | 79 ++++++++---------------------------- 6 files changed, 26 insertions(+), 148 deletions(-) diff --git a/objects/oClient.object.gmx b/objects/oClient.object.gmx index f49eb85..ab81aa6 100644 --- a/objects/oClient.object.gmx +++ b/objects/oClient.object.gmx @@ -267,7 +267,7 @@ if(global.playerhealth <= 0){ } if(instance_exists(oQueenHead) && !is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){ - if(global.queenhealthPrev != oQueenHead.myhealth){ + if(global.queenhealthPrev != oQueenHead.myhealth || oQueen.phase != phase){ show_debug_message("queen health sent " + string(oQueenHead.myhealth)); var size, type, alignment; size = 1024; @@ -328,11 +328,15 @@ if(instance_exists(oQueenHead) && !is_undefined(oQueenHead.myhealth) &am if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){ if(oQueen.phase < phase){ oQueen.phase = phase; - } else if(oQueen.phase > phase){ + } else if(oQueen.phase > phase && global.event[303] == 0){ phase = oQueen.phase; } } +if(global.event[303] > 0){ + phase = 0; +} + if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){ if(phase >= 1 && instance_exists(inst_146524)){ event_perform_object(oQueenFireball, ev_other, ev_user1); diff --git a/objects/oMAlpha.object.gmx b/objects/oMAlpha.object.gmx index 64773d2..62fb376 100644 --- a/objects/oMAlpha.object.gmx +++ b/objects/oMAlpha.object.gmx @@ -271,29 +271,7 @@ if (state == 5 || dodging) alarm[2] = 3; 1 - if(global.metdead[myid] == 1 && !dead){ - dead = true; - myhealth = 0; - if (myhealth <= 0) { - state = 100; - statetime = 0; - alarm[10] = 1; - alarm[11] = 160; - flashtime = 180; - turndelay = 180; - PlaySoundMono(deathsound); - check_areaclear(); - global.monstersalive -= 1; - if (global.monstersalive == 0) { - mus_fadeout(musAlphaFight); - oMusicV2.bossbgm = sndJump; - } - with (oMAlpha) event_user(2); - global.dmap[mapposx, mapposy] = 11; - with (oControl) event_user(2); - } -} -if (active == 1) { + if (active == 1) { if (state == 1) { xVel = 0; yVel = 0; diff --git a/objects/oMGamma.object.gmx b/objects/oMGamma.object.gmx index 8ef5db2..48e6788 100644 --- a/objects/oMGamma.object.gmx +++ b/objects/oMGamma.object.gmx @@ -332,30 +332,7 @@ if (state == 5 || dodging) alarm[2] = 3; 1 - if(global.metdead[myid] == 1 && !dead){ - dead = true; - myhealth = 0; - if (myhealth <= 0) { - state = 100; - statetime = 0; - alarm[10] = 1; - alarm[11] = 160; - flashtime = 180; - turndelay = 180; - PlaySoundMono(deathsound); - check_areaclear(); - global.monstersalive -= 1; - if (global.monstersalive == 0) { - mus_fadeout(musGammaFight); - oMusicV2.bossbgm = sndJump; - } - if (instance_exists(grabber)) with (grabber) instance_destroy(); - if (instance_exists(arms)) with (arms) instance_destroy(); - global.dmap[mapposx, mapposy] = 11; - with (oControl) event_user(2); - } -} -if (active == 1) { + if (active == 1) { if (state == 1) { xVel = 0; yVel = 0; diff --git a/objects/oMOmega.object.gmx b/objects/oMOmega.object.gmx index 766b8fd..be41869 100644 --- a/objects/oMOmega.object.gmx +++ b/objects/oMOmega.object.gmx @@ -380,23 +380,7 @@ if (instance_exists(grab_obj)) { 1 - if(global.metdead[myid] == 1 && !dead){ - dead = true; - myhealth = 0; - if (myhealth <= 0) { - state = 100; - statetime = 0; - alarm[10] = 1; - alarm[11] = 160; - event_user(2); - mus_fadeout(musOmegaFight); - oMusicV2.bossbgm = sndJump; - check_areaclear(); - global.dmap[mapposx, mapposy] = 11; - with (oControl) event_user(2); - } -} -var slash_dist, msl, tl; + var slash_dist, msl, tl; slash_dist = 130; // Target set if (target_mode == 0) { diff --git a/objects/oMZeta.object.gmx b/objects/oMZeta.object.gmx index 5ca2f55..90215f5 100644 --- a/objects/oMZeta.object.gmx +++ b/objects/oMZeta.object.gmx @@ -413,25 +413,7 @@ if (instance_exists(mask_obj)) { 1 - if(global.metdead[myid] == 1 && !dead){ - dead = true; - myhealth = 0; - if (myhealth <= 0) { - state = 100; - statetime = 0; - alarm[10] = 1; - alarm[11] = 160; - with (body_obj) instance_destroy(); - with (head_obj) instance_destroy(); - with (mask_obj) instance_destroy(); - mus_fadeout(musZetaFight); - oMusicV2.bossbgm = sndJump; - check_areaclear(); - global.dmap[mapposx, mapposy] = 11; - with (oControl) event_user(2); - } -} -var msl, fr_speed; + var msl, fr_speed; if (target_mode == 0) { targetx = oCharacter.x; targety = oCharacter.y; diff --git a/scripts/update_variables.gml b/scripts/update_variables.gml index 8cc0ded..bd93508 100644 --- a/scripts/update_variables.gml +++ b/scripts/update_variables.gml @@ -116,8 +116,6 @@ switch(argument0){ if(global.morphballPrev != global.morphball){ global.morphballPrev = global.morphball; } - } else if(global.onlineReceived[# 2, i] == 10 && global.receivedClientID == global.clientID){ - global.morphballPrev = global.morphball; } if(global.onlineReceived[# 2, i] == 11 && global.receivedClientID != global.clientID){ @@ -125,117 +123,91 @@ switch(argument0){ if(global.jumpballPrev != global.jumpball){ global.jumpballPrev = global.jumpball; } - } else if(global.onlineReceived[# 2, i] == 11 && global.receivedClientID == global.clientID){ - global.jumpballPrev = global.jumpball; - } + } if(global.onlineReceived[# 2, i] == 12 && global.receivedClientID != global.clientID){ global.powergrip = global.onlineReceived[# 1, i]; if(global.powergripPrev != global.powergrip){ global.powergripPrev = global.powergrip; } - } else if(global.onlineReceived[# 2, i] == 12 && global.receivedClientID == global.clientID){ - global.powergripPrev = global.powergrip; - } + } if(global.onlineReceived[# 2, i] == 13 && global.receivedClientID != global.clientID){ global.spacejump = global.onlineReceived[# 1, i]; if(global.spacejumpPrev != global.spacejump){ global.spacejumpPrev = global.spacejump; } - } else if(global.onlineReceived[# 2, i] == 13 && global.receivedClientID == global.clientID){ - global.spacejumpPrev = global.spacejump; - } + } if(global.onlineReceived[# 2, i] == 14 && global.receivedClientID != global.clientID){ global.screwattack = global.onlineReceived[# 1, i]; if(global.screwattackPrev != global.screwattack){ global.screwattackPrev = global.screwattack; } - } else if(global.onlineReceived[# 2, i] == 14 && global.receivedClientID == global.clientID){ - global.screwattackPrev = global.screwattack; - } + } if(global.onlineReceived[# 2, i] == 15 && global.receivedClientID != global.clientID){ global.hijump = global.onlineReceived[# 1, i]; if(global.hijumpPrev != global.hijump){ global.hijumpPrev = global.hijump; } - } else if(global.onlineReceived[# 2, i] == 15 && global.receivedClientID == global.clientID){ - global.hijumpPrev = global.hijump; - } + } if(global.onlineReceived[# 2, i] == 16 && global.receivedClientID != global.clientID){ global.spiderball = global.onlineReceived[# 1, i]; if(global.spiderballPrev != global.spiderball){ global.spiderballPrev = global.spiderball; } - } else if(global.onlineReceived[# 2, i] == 16 && global.receivedClientID == global.clientID){ - global.spiderballPrev = global.spiderball; - } + } if(global.onlineReceived[# 2, i] == 17 && global.receivedClientID != global.clientID){ global.speedbooster = global.onlineReceived[# 1, i]; if(global.speedboosterPrev != global.speedbooster){ global.speedboosterPrev = global.speedbooster; } - } else if(global.onlineReceived[# 2, i] == 17 && global.receivedClientID == global.clientID){ - global.speedboosterPrev = global.speedbooster; - } + } if(global.onlineReceived[# 2, i] == 18 && global.receivedClientID != global.clientID){ global.bomb = global.onlineReceived[# 1, i]; if(global.bombPrev != global.bomb){ global.bombPrev = global.bomb; } - } else if(global.onlineReceived[# 2, i] == 18 && global.receivedClientID == global.clientID){ - global.bombPrev = global.bomb; - } + } if(global.onlineReceived[# 2, i] == 19 && global.receivedClientID != global.clientID){ global.ibeam = global.onlineReceived[# 1, i]; if(global.ibeamPrev != global.ibeam){ global.ibeamPrev = global.ibeam; } - } else if(global.onlineReceived[# 2, i] == 19 && global.receivedClientID == global.clientID){ - global.ibeamPrev = global.ibeam; - } + } if(global.onlineReceived[# 2, i] == 20 && global.receivedClientID != global.clientID){ global.wbeam = global.onlineReceived[# 1, i]; if(global.wbeamPrev != global.wbeam){ global.wbeamPrev = global.wbeam; } - } else if(global.onlineReceived[# 2, i] == 20 && global.receivedClientID == global.clientID){ - global.wbeamPrev = global.wbeam; - } + } if(global.onlineReceived[# 2, i] == 21 && global.receivedClientID != global.clientID){ global.pbeam = global.onlineReceived[# 1, i]; if(global.pbeamPrev != global.pbeam){ global.pbeamPrev = global.pbeam; } - } else if(global.onlineReceived[# 2, i] == 21 && global.receivedClientID == global.clientID){ - global.pbeamPrev = global.pbeam; - } + } if(global.onlineReceived[# 2, i] == 22 && global.receivedClientID != global.clientID){ global.sbeam = global.onlineReceived[# 1, i]; if(global.sbeamPrev != global.sbeam){ global.sbeamPrev = global.sbeam; } - } else if(global.onlineReceived[# 2, i] == 22 && global.receivedClientID == global.clientID){ - global.sbeamPrev = global.sbeam; - } + } if(global.onlineReceived[# 2, i] == 23 && global.receivedClientID != global.clientID){ global.cbeam = global.onlineReceived[# 1, i]; if(global.cbeamPrev != global.cbeam){ global.cbeamPrev = global.cbeam; } - } else if(global.onlineReceived[# 2, i] == 23 && global.receivedClientID == global.clientID){ - global.cbeamPrev = global.cbeam; - } + } if(global.onlineReceived[# 2, i] == 26 && global.receivedClientID != global.clientID){ global.pbombs = global.onlineReceived[# 1, i]; @@ -437,19 +409,6 @@ switch(argument0){ } } } - /* - switch(i){ - case 0: - global.onlineList[# 0, 0] = global.itemPrev; - break; - case 1: - global.onlineList[# 0, 1] = global.metdeadPrev; - break; - case 3: - global.onlineList[# 0, 3] = global.eventPrev; - break; - } - */ } if(i == 4){ if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID != global.clientID){ @@ -457,9 +416,7 @@ switch(argument0){ if(global.monstersleftPrev != global.monstersleft){ global.monstersleftPrev = global.monstersleft; } - } else if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID == global.clientID){ - global.monstersleftPrev = global.monstersleft; - } + } } if(i == 32){ if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID != global.clientID){ @@ -467,9 +424,7 @@ switch(argument0){ if(global.monstersareaPrev != global.monstersarea){ global.monstersareaPrev = global.monstersarea; } - } else if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID == global.clientID){ - global.monstersareaPrev = global.monstersarea; - } + } } if(i == 33){ if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID != global.clientID){ @@ -477,9 +432,7 @@ switch(argument0){ if(global.lavastatePrev != global.lavastate){ global.lavastatePrev = global.lavastate; } - } else if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID == global.clientID){ - global.lavastatePrev = global.lavastate; - } + } } } break;