@ -56,6 +56,8 @@ etanksTimer = 10;
mtanksTimer = 10;
mtanksTimer = 10;
stanksTimer = 10;
stanksTimer = 10;
ptanksTimer = 10;
ptanksTimer = 10;
teleportTimer = 180;
disconnectTimer = 600;
teleport = false;
teleport = false;
state = undefined;
state = undefined;
seed = undefined;
seed = undefined;
@ -110,12 +112,12 @@ buffer = buffer_create(size, type, alignment);
global.queenhealthPrev = 600;
global.queenhealthPrev = 600;
global.queenphasePrev = 0;
global.queenphasePrev = 0;
if(instance_exists(oCharacter)){
global.prevX = oCharacter.x ;
global.prevX = 0 ;
global.prevY = oCharacter.y ;
global.prevY = 0 ;
global.prevSprite = oCharacter.sprite_index ;
global.prevSprite = 0 ;
global.prevIndex = oCharacter.image_index ;
global.prevIndex = 0 ;
}
global.roomPrev = room;
global.roomPrev = room;
global.clientID = 0;
global.clientID = 0;
@ -183,7 +185,11 @@ trail = 0;
<argument>
<argument>
<kind>1</kind>
<kind>1</kind>
<string>if(connected){
<string>if(connected){
popup_text("Disconnected");
if(disconnectTimer > 0){
popup_text("Disconnected");
} else {
popup_text("Lost connection to server");
}
buffer_delete(buffer);
buffer_delete(buffer);
var size, type, alignment;
var size, type, alignment;
size = 1024;
size = 1024;
@ -777,32 +783,35 @@ if(metroidCountChanged){
<argument>
<argument>
<kind>1</kind>
<kind>1</kind>
<string>if(queenHealthResetQueued){
<string>if(queenHealthResetQueued){
if(!is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(instance_exists(oQueen) && !is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(global.queenhealthPrev != queenHealth){
if(global.queenhealthPrev != queenHealth){
if(queenHealth == 999999){
if(queenHealth == 999999){
queenHealth = 0;
queenHealth = 0;
oQueenHead.myhealth = queenHealth;
oQueenHead.myhealth = queenHealth;
with(oQueenHead){
if(queenHealth <= 0){
if (myhealth <= 0 && state != 100 && state != 50) {
with(oQueenHead){
if (oQueen.phase < 3) head_damage = 1;
if (myhealth <= 0 && state != 100 && state != 50) {
if (oQueen.phase == 3) head_damage = 2;
if (oQueen.phase < 3) head_damage = 1;
if (oQueen.phase < 5) {
if (oQueen.phase == 3) head_damage = 2;
state = 50;
if (oQueen.phase < 5) {
statetime = 0;
state = 50;
myhealth = 999999;
with (oQueen) {
state = 6;
statetime = 0;
statetime = 0;
myhealth = 999999;
with (oQueen) {
state = 6;
statetime = 0;
}
}
}
}
if (oQueen.phase == 5) {
if (oQueen.phase == 5) {
with (oQueen) {
with (oQueen) {
state = 100;
statetime = 0;
}
state = 100;
state = 100;
statetime = 0;
}
}
state = 100;
}
}
}
}
queenHealth = 999999;
}
}
}
}
}
}
@ -878,7 +887,7 @@ if(metroidCountChanged){
update_variables("onlinevars");
update_variables("onlinevars");
for(var i=0; i<ds_grid_height(global.onlineList); i++){
for(var i=0; i<ds_grid_height(global.onlineList); i++){
if(global.onlineList[# 0, i] != global.onlineList[# 1, i] && i != 0 && i != 1 && i != 3){
if(global.onlineList[# 0, i] != global.onlineList[# 1, i] && i != 0 && i != 1 && i != 3 && i != 2 && i != 4 && i != 5 && i != 6 && i != 7 && i != 8 && i != 27 && i != 28 && i != 29 && i != 30 && i != 32 ){
global.onlineSend[# 0, i] = global.onlineList[# 0, i];
global.onlineSend[# 0, i] = global.onlineList[# 0, i];
global.onlineSend[# 1, i] = global.onlineList[# 1, i];
global.onlineSend[# 1, i] = global.onlineList[# 1, i];
global.onlineSend[# 2, i] = global.onlineList[# 2, i];
global.onlineSend[# 2, i] = global.onlineList[# 2, i];
@ -1007,15 +1016,18 @@ if(instance_exists(oQueenHead) && !is_undefined(oQueenHead.myhealth) &am
}
}
}
}
/*
var itemCount = 0;
if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){
for(var h=0; h<array_length_1d(global.item); h++){
if(oQueen.phase < phase){
var val = global.item[h];
oQueen.phase = phase;
if(val == 1 && h != 1){
} else if(oQueen.phase > phase && global.event[303] == 0){
itemCount++;
phase = oQueen.phase;
}
}
}
}
*/
if(itemCount != global.itemstaken){
global.itemstaken = itemCount;
}
</string>
</string>
</argument>
</argument>
</arguments>
</arguments>
@ -1058,7 +1070,6 @@ if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){
}
}
}
}
if(instance_exists(oCharacter)){
if(instance_exists(oCharacter)){
if(global.event[203] < 9 && string_lower(reactorsequence) == "disabled"){
if(global.event[203] < 9 && string_lower(reactorsequence) == "disabled"){
global.event[203] = 9;
global.event[203] = 9;
@ -1084,7 +1095,7 @@ if(room == rm_a4b01 && global.event[203] == 9 && instance_exists
}
}
}
}
if(is_undefined(oQueenHead.myhealth) && is_undefined(oQueen.phase )){
if(!instance_exists(oQueen )){
if(!queenHealthResetQueued){
if(!queenHealthResetQueued){
queenHealthResetQueued = true;
queenHealthResetQueued = true;
alarm[1] = 5;
alarm[1] = 5;
@ -1104,6 +1115,15 @@ if(instance_exists(oQueen) && !is_undefined(oQueen.phase)){
}
}
queenDead = true;
queenDead = true;
}
}
with(oQueenHead){
if(oQueen.phase > 3 && instance_exists(inst_146527)){
oQueen.phase = 3;
if(head_damage == 2){
head_damage = 1;
}
}
}
}
}
if(keyboard_check_pressed(vk_f2)){
if(keyboard_check_pressed(vk_f2)){
@ -1131,6 +1151,13 @@ if(instance_exists(oCharacter)){
posY = posY;
posY = posY;
}
}
if((room == rm_a4b02 || room == rm_a4b03 || room == rm_a4b04 || room == rm_a4b05 || room == rm_a4b06 || room == rm_a4b07 || room == rm_a4b08 || room == rm_a4b09 || room == rm_a4b10 || room == rm_a4b11 || room == rm_a4b12 || room == rm_a4b13 || room == rm_a4b14 || room == rm_a4b15 || room == rm_a4b16 || room == rm_a4b17 || room == rm_a4b18 || room == rm_a4b19) && global.event[203] == 9 && !teleport){
teleport = true;
global.targetx = 624;
global.targety = 144;
room_change(rm_a4b01, 1);
}
if(time == 0 && connected){
if(time == 0 && connected){
if(ds_list_size(global.idList) > 0){
if(ds_list_size(global.idList) > 0){
checkListID = ds_list_create();
checkListID = ds_list_create();
@ -1320,6 +1347,18 @@ if(ptanksTimer == 0 && connected){
}
}
}
}
if(teleport){
teleportTimer--;
if(teleportTimer <= 0){
teleport = false;
teleportTimer = 60;
}
}
if(disconnectTimer <= 0){
instance_destroy();
}
time--;
time--;
maxpbombsTimer--;
maxpbombsTimer--;
maxhealthTimer--;
maxhealthTimer--;
@ -1327,6 +1366,7 @@ etanksTimer--;
mtanksTimer--;
mtanksTimer--;
stanksTimer--;
stanksTimer--;
ptanksTimer--;
ptanksTimer--;
disconnectTimer--;
if(instance_exists(self)){
if(instance_exists(self)){
if(ds_list_size(roomListData) > 0){
if(ds_list_size(roomListData) > 0){
@ -1523,6 +1563,7 @@ switch(type_event){
var clientMapX = buffer_read(_buffer, buffer_s16);
var clientMapX = buffer_read(_buffer, buffer_s16);
var clientMapY = buffer_read(_buffer, buffer_s16);
var clientMapY = buffer_read(_buffer, buffer_s16);
var findsocket = ds_list_find_index(roomList, clientID);
var findsocket = ds_list_find_index(roomList, clientID);
if(instance_exists(oCharacter)){
if(instance_exists(oCharacter)){
if(clientRoom == rm_death){
if(clientRoom == rm_death){
if(oCharacter.state != oCharacter.DEFEATED){
if(oCharacter.state != oCharacter.DEFEATED){
@ -1614,6 +1655,20 @@ switch(type_event){
case 102:
case 102:
ds_list_read(global.idList, strict_decompress(buffer_read(_buffer, buffer_string)));
ds_list_read(global.idList, strict_decompress(buffer_read(_buffer, buffer_string)));
break;
break;
case 103:
disconnectTimer = 600;
break;
case 104:
var playerHealth = buffer_read(_buffer, buffer_s16);
var missiles = buffer_read(_buffer, buffer_s16);
var smissiles = buffer_read(_buffer, buffer_u8);
var pbombs = buffer_read(_buffer, buffer_u8);
var clientID = buffer_read(_buffer, buffer_u8);
global.playerhealth = playerHealth;
global.missiles = missiles;
global.smissiles = smissiles;
global.pbombs = pbombs;
break;
case 0:
case 0:
global.clientID = buffer_read(_buffer, buffer_u8);
global.clientID = buffer_read(_buffer, buffer_u8);
alarm[0] = 5;
alarm[0] = 5;
@ -1671,33 +1726,36 @@ switch(type_event){
phase = buffer_read(_buffer, buffer_s8);
phase = buffer_read(_buffer, buffer_s8);
state = buffer_read(_buffer, buffer_s8);
state = buffer_read(_buffer, buffer_s8);
if(clientID != global.clientID){
if(clientID != global.clientID){
if(!is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(instance_exists(oQueen) && !is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(oQueen.phase == phase){
if(oQueen.phase == phase){
if(global.queenhealthPrev != queenHealth){
if(global.queenhealthPrev != queenHealth){
if(queenHealth == 999999){
if(queenHealth == 999999){
queenHealth = 0;
queenHealth = 0;
oQueenHead.myhealth = queenHealth;
oQueenHead.myhealth = queenHealth;
with(oQueenHead){
if(queenHealth <= 0){
if (myhealth <= 0 && state != 100 && state != 50) {
with(oQueenHead){
if (oQueen.phase < 3) head_damage = 1;
if (myhealth <= 0 && state != 100 && state != 50) {
if (oQueen.phase == 3) head_damage = 2;
if (oQueen.phase < 3) head_damage = 1;
if (oQueen.phase < 5) {
if (oQueen.phase == 3) head_damage = 2;
state = 50;
if (oQueen.phase < 5) {
statetime = 0;
state = 50;
myhealth = 999999;
with (oQueen) {
state = 6;
statetime = 0;
statetime = 0;
myhealth = 999999;
with (oQueen) {
state = 6;
statetime = 0;
}
}
}
}
if (oQueen.phase == 5) {
if (oQueen.phase == 5) {
with (oQueen) {
with (oQueen) {
state = 100;
statetime = 0;
}
state = 100;
state = 100;
statetime = 0;
}
}
state = 100;
}
}
}
}
queenHealth = 999999;
}
}
}
}
global.queenhealthPrev = queenHealth;
global.queenhealthPrev = queenHealth;
@ -1710,7 +1768,7 @@ switch(type_event){
}
}
}
}
} else {
} else {
if(!is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
if(instance_exists(oQueen) && !is_undefined(oQueenHead.myhealth) && !is_undefined(oQueen.phase)){
/*
/*
if(oQueen.phase == phase){
if(oQueen.phase == phase){
if(global.queenhealthPrev != queenHealth){
if(global.queenhealthPrev != queenHealth){
@ -1918,6 +1976,8 @@ switch(type_event){
} else if(clientID == global.clientID){
} else if(clientID == global.clientID){
global.maxmissilesPrev = global.maxmissiles;
global.maxmissilesPrev = global.maxmissiles;
}
}
global.missilesPrev = maxmissiles;
global.missiles = maxmissiles;
alarm[8] = 1;
alarm[8] = 1;
break;
break;
case 13:
case 13:
@ -1929,6 +1989,8 @@ switch(type_event){
} else if(clientID == global.clientID){
} else if(clientID == global.clientID){
global.maxsmissilesPrev = global.maxsmissiles;
global.maxsmissilesPrev = global.maxsmissiles;
}
}
global.smissilesPrev = maxsmissiles;
global.smissiles = maxsmissiles;
alarm[9] = 1;
alarm[9] = 1;
break;
break;
case 14:
case 14:
@ -1940,6 +2002,8 @@ switch(type_event){
} else if(clientID == global.clientID){
} else if(clientID == global.clientID){
global.maxpbombsPrev = global.maxpbombs;
global.maxpbombsPrev = global.maxpbombs;
}
}
global.pbombsPrev = maxpbombs;
global.pbombs = maxpbombs;
maxpbombsTimer = 1;
maxpbombsTimer = 1;
break;
break;
case 15:
case 15:
@ -1951,6 +2015,8 @@ switch(type_event){
} else if(clientID == global.clientID){
} else if(clientID == global.clientID){
global.maxhealthPrev = global.maxhealth;
global.maxhealthPrev = global.maxhealth;
}
}
global.playerhealthPrev = maxhealth;
global.playerhealth = maxhealth;
maxhealthTimer = 1;
maxhealthTimer = 1;
break;
break;
case 16:
case 16:
@ -1997,8 +2063,47 @@ switch(type_event){
}
}
ptanksTimer = 1;
ptanksTimer = 1;
break;
break;
case 20:
var time = buffer_read(_buffer, buffer_s32);
global.gametime = time;
break;
}
}
}
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="4">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>if(room == rm_credits){
buffer_delete(buffer);
var size, type, alignment;
size = 1024;
type = buffer_grow;
alignment = 1;
buffer = buffer_create(size, type, alignment);
buffer_seek(buffer, buffer_seek_start, 0);
buffer_write(buffer, buffer_u8, 19);
buffer_write(buffer, buffer_s32, global.gametime);
buffer_write(buffer, buffer_u8, global.clientID);
var result = network_send_packet(socket, buffer, buffer_tell(buffer));
}
</string>
</string>
</argument>
</argument>
</arguments>
</arguments>