Fixed metroid deaths and (hopefully) corrected queen fight sync

pull/3/head
milesthenerd 6 years ago
parent 0a11efb327
commit d153f6a10c

@ -31,6 +31,7 @@ canSend = false;
connected = false;
queenHealthWait = false;
queenDead = false;
phase = 0;
seed = undefined;
var type;
type = network_socket_tcp;
@ -265,7 +266,7 @@ if(global.playerhealth <= 0){
}
}
if(!is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(instance_exists(oQueenHead) && !is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(global.queenhealthPrev != oQueenHead.myhealth){
show_debug_message("queen health sent " + string(oQueenHead.myhealth));
var size, type, alignment;
@ -324,21 +325,25 @@ if(!is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
}
}
if(oQueen.phase != phase){
oQueen.phase = phase;
if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){
if(oQueen.phase < phase){
oQueen.phase = phase;
} else if(oQueen.phase > phase){
phase = oQueen.phase;
}
}
if(!is_undefined(oQueen.phase)){
if(oQueen.phase >= 1 && instance_exists(inst_146524)){
if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){
if(phase >= 1 && instance_exists(inst_146524)){
event_perform_object(oQueenFireball, ev_other, ev_user1);
}
if(oQueen.phase >= 2 && instance_exists(inst_146525) && instance_exists(inst_146520)){
if(phase >= 2 && instance_exists(inst_146525) && instance_exists(inst_146520)){
event_perform_object(oQueenFireball, ev_other, ev_user2);
}
if(oQueen.phase >= 3 && instance_exists(inst_146526) && instance_exists(inst_146514)){
if(phase >= 3 && instance_exists(inst_146526) && instance_exists(inst_146514)){
event_perform_object(oQueenFireball, ev_other, ev_user3);
}
if((oQueen.phase >= 4 || oQueen.phase == 5) && instance_exists(inst_146527)){
if(phase >= 4 && instance_exists(inst_146527)){
event_perform_object(oQueenFireball, ev_other, ev_user4);
}
if(global.event[303] > 0 && !queenDead){

@ -282,17 +282,13 @@ if (state == 5 || dodging) alarm[2] = 3;
flashtime = 180;
turndelay = 180;
PlaySoundMono(deathsound);
global.metdead[myid] = 1;
global.monstersleft -= 1;
global.monstersarea -= 1;
check_areaclear();
global.monstersalive -= 1;
if (global.monstersalive == 0) {
mus_fadeout(musGammaFight);
mus_fadeout(musAlphaFight);
oMusicV2.bossbgm = sndJump;
}
if (instance_exists(grabber)) with (grabber) instance_destroy();
if (instance_exists(arms)) with (arms) instance_destroy();
with (oMAlpha) event_user(2);
global.dmap[mapposx, mapposy] = 11;
with (oControl) event_user(2);
}

@ -343,9 +343,6 @@ if (state == 5 || dodging) alarm[2] = 3;
flashtime = 180;
turndelay = 180;
PlaySoundMono(deathsound);
global.metdead[myid] = 1;
global.monstersleft -= 1;
global.monstersarea -= 1;
check_areaclear();
global.monstersalive -= 1;
if (global.monstersalive == 0) {

@ -388,20 +388,10 @@ if (instance_exists(grab_obj)) {
statetime = 0;
alarm[10] = 1;
alarm[11] = 160;
flashtime = 180;
turndelay = 180;
PlaySoundMono(deathsound);
global.metdead[myid] = 1;
global.monstersleft -= 1;
global.monstersarea -= 1;
event_user(2);
mus_fadeout(musOmegaFight);
oMusicV2.bossbgm = sndJump;
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);
}

@ -421,20 +421,12 @@ if (instance_exists(mask_obj)) {
statetime = 0;
alarm[10] = 1;
alarm[11] = 160;
flashtime = 180;
turndelay = 180;
PlaySoundMono(deathsound);
global.metdead[myid] = 1;
global.monstersleft -= 1;
global.monstersarea -= 1;
with (body_obj) instance_destroy();
with (head_obj) instance_destroy();
with (mask_obj) instance_destroy();
mus_fadeout(musZetaFight);
oMusicV2.bossbgm = sndJump;
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);
}

@ -226,9 +226,53 @@ if (instance_exists(spark3)) {
<argument>
<kind>1</kind>
<string>if(global.metdead[myid] == 1 &amp;&amp; !dead){
dead = true;
hp = 0;
event_user(0);
var pickup;
if (hp &lt;= 0) {
repeat (10) {
expl = instance_create(x - 16 + random(32), y - 16 + random(32), oFXAnimSpark);
expl.image_speed = 0.5 + random(0.5);
expl.additive = 0;
expl.sprite_index = sExpl1;
expl.direction = random(360);
expl.speed = 2 + random(1);
}
repeat (20) deb = instance_create(x, y - 8, oIceShard);
make_explosion4(x, y);
instance_create(x, y, oScreenFlash);
sfx_play(sndMissileExpl);
PlaySoundMono(sndIceShatter);
sfx_play(sndMonsterDeath);
if (global.monstersarea &lt; 1) global.monstersarea = 1;
if (global.monstersleft &lt; 1) global.monstersleft = 1;
pickup = choose(0, 1);
if (pickup == 0) {
if (global.missiles &lt; global.maxmissiles &amp;&amp; global.maxmissiles &gt; 0) {
repeat (3) instance_create(x + random_range(-15, 15), y + random_range(-15, 15), oMPickup);
} else pickup = 1;
}
if (pickup == 1) {
if (global.smissiles &lt; global.maxsmissiles &amp;&amp; global.maxsmissiles &gt; 0) instance_create(x, y, oSMPickup);
}
if (global.playerhealth &lt; global.maxhealth &amp;&amp; (oControl.mod_insanitymode == 0 || (global.difficulty &lt; 2 &amp;&amp; oControl.mod_insanitymode == 1))) {
repeat (3) instance_create(x + random_range(-15, 15), y + random_range(-15, 15), oHPickupBig);
}
//if (room == rm_a7b08A &amp;&amp; global.metdead[52] &gt; 0 &amp;&amp; global.metdead[53] &gt; 0 &amp;&amp; global.metdead[54] &gt; 0 &amp;&amp; global.metdead[55] &gt; 0 &amp;&amp; global.metdead[56] &gt; 0 &amp;&amp; global.metdead[57] &gt; 0 &amp;&amp; global.metdead[58] &gt; 0 &amp;&amp; global.metdead[74] &gt; 0)
if (room == rm_a7b08A &amp;&amp; instance_number(oMonster) == 1) //oMonster must == 1 here, since oMonster is checking for oMonsters!!!
{
if (global.monstersleft != 1) { global.monstersleft = 1; }
if (global.monstersarea != 1) { global.monstersarea = 1; }
instance_create(0,0,oBigQuakeQueen);
}
instance_destroy();
}
}
var tgty;
if (state == 0) {
scale = 0.5;

Loading…
Cancel
Save