Various bugfixes

pull/28/head
milesthenerd 6 years ago
parent 45f7690f7b
commit 4033dfb032

@ -1,5 +1,5 @@
[ModSettings]
ipaddress = 127.0.0.1
ipaddress = 206.123.128.236
displayname = name
port = 64198

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

@ -25,10 +25,7 @@
<arguments>
<argument>
<kind>1</kind>
<string>global.ipaddress = undefined;
global.canSet = false;
global.monsterStr = "Monster";
<string>global.monsterStr = "Monster";
randomize();
@ -396,6 +393,7 @@ ds_map_read(room_width_map, "920100007501000000000000000000000090704000000000000
global.canConnect = true;
reset_map();
load_character_vars();
</string>
</argument>
@ -1678,6 +1676,12 @@ if (room == titleroom &amp;&amp; instance_exists(oPressStart)) {
global.gamestarted = 0;
if (os_type == os_android) os_powersave_enable(true);
}
if(room == titleroom){
global.mapmarker = 0;
global.mapmarkerx = 0;
global.mapmarkery = 0;
}
</string>
</argument>
</arguments>

@ -26,7 +26,6 @@
<argument>
<kind>1</kind>
<string>alarm[0] = 30;
alarm[1] = 20;
image_speed = 0.2;
active = 0;
btn1_name = "";
@ -35,6 +34,7 @@ itemtype = 0;
itemid = 0;
text1 = "";
text2 = "";
collected = false;
</string>
</argument>
</arguments>
@ -57,15 +57,7 @@ text2 = "";
<arguments>
<argument>
<kind>1</kind>
<string>/*
if(instance_exists(oClient)){
itemIndex = findIndex(global.itemlist, self.itemid);
if(itemIndex == -1){
instance_destroy();
}
}
alarm[1] = 20;
*/
<string>instance_destroy();
</string>
</argument>
</arguments>
@ -111,8 +103,9 @@ alarm[1] = 20;
<arguments>
<argument>
<kind>1</kind>
<string>if(global.item[itemid] == 1){
instance_destroy();
<string>if(global.item[itemid] == 1 &amp;&amp; !collected){
collected = true;
alarm[1] = 1;
}
</string>
</argument>

@ -73,6 +73,29 @@ if (room != rm_a0h14) global.dmap[mapposx, mapposy] = 10;
else global.dmap[43, 24] = 10;
with (oControl) event_user(2);
dead = false;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="1" enumb="0">
<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>global.dmap[mapposx, mapposy] = 11;
</string>
</argument>
</arguments>

@ -91,6 +91,29 @@ speedmulti = 1;
targetx = x;
targety = y;
dead = false;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="1" enumb="0">
<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>global.dmap[mapposx, mapposy] = 11;
</string>
</argument>
</arguments>

@ -165,6 +165,7 @@ dead = false;
<kind>1</kind>
<string>event_user(2);
with (tail) instance_destroy();
global.dmap[mapposx, mapposy] = 11;
</string>
</argument>
</arguments>

@ -117,6 +117,29 @@ alarm[3] = 1;
alarm[9] = 1;
scan_log(14, get_text("ScanEvents", "ScanBioform"), 180, 0);
dead = false;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="1" enumb="0">
<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>global.dmap[mapposx, mapposy] = 11;
</string>
</argument>
</arguments>

@ -92,11 +92,13 @@
draw_set_font(font_displayname);
draw_set_halign(fa_center);
draw_cool_text(arrX, arrY - 52, text, c_black, c_white, c_white, 1);
draw_set_halign(fa_left);
}
} else {
draw_set_font(font_displayname);
draw_set_halign(fa_center);
draw_cool_text(arrX, arrY - 52, text, c_black, c_white, c_white, 1);
draw_set_halign(fa_left);
}
}
}

@ -118,6 +118,9 @@
<kind>1</kind>
<string>global.monstersleft = 0;
global.monstersarea = 0;
mus_stop(musQueen);
mus_stop(musQueen2);
mus_stop(musQueen3);
</string>
</argument>
</arguments>

@ -11,11 +11,13 @@ if(!instance_exists(oClient)){
}
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
repeat (350) {
global.event[j] = readline();
j += 1;
}
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
}
ds_list_clear(list);

@ -21,7 +21,7 @@ if(!instance_exists(oClient)){
global.bomb = readline();
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
global.currentsuit = readline();
global.cbeam = readline();
global.ibeam = readline();
@ -37,6 +37,8 @@ if(!instance_exists(oClient)){
global.spiderball = readline();
global.speedbooster = readline();
global.bomb = readline();
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
}
ds_list_clear(list);

@ -11,11 +11,13 @@ if(!instance_exists(oClient)){
}
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
repeat (350) {
global.item[j] = readline();
j += 1;
}
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
}
ds_list_clear(list);

@ -19,7 +19,7 @@ if(!instance_exists(oClient)){
global.mapmarkery = readline();
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
global.gametime = readline();
global.itemstaken = readline();
global.etanks = readline();
@ -32,6 +32,8 @@ if(!instance_exists(oClient)){
global.mapmarker = readline();
global.mapmarkerx = readline();
global.mapmarkery = readline();
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
}
ds_list_clear(list);

@ -15,7 +15,7 @@ if(!instance_exists(oClient)){
}
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
repeat (80) {
j = 0;
repeat (80) {
@ -24,6 +24,8 @@ if(!instance_exists(oClient)){
}
k += 1;
}
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
}
ds_list_clear(list);

@ -11,11 +11,13 @@ if(!instance_exists(oClient)){
}
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
repeat (100) {
global.metdead[j] = readline();
j += 1;
}
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
}
ds_list_clear(list);

@ -3,17 +3,26 @@
scr_default_global_items();
var header;
show_debug_message(room_get_name(global.lastroom));
show_debug_message(room_get_name(room));
if(!instance_exists(oClient)){
load_character_vars();
reset_map();
init_map();
} else if(instance_exists(oClient) && global.lastroom == gameoverroom){
//don't reset values
} else if(instance_exists(oClient) && global.lastroom != gameoverroom){
oClient.phase = 0;
oClient.queenHealth = 600;
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) == 0){
load_character_vars();
reset_map();
init_map();
oClient.phase = 0;
oClient.queenHealth = 600;
} else if(instance_exists(oClient) && global.lastroom != gameoverroom && string_count("rm_a", room_get_name(global.lastroom)) > 0){
//don't reset values
oClient.phase = 0;
oClient.queenHealth = 600;
}
filename = argument0;

@ -41,7 +41,13 @@ switch(argument0){
for(var i=0; i<ds_grid_height(global.onlineReceived); i++){
if(global.onlineReceived[# 2, i] != -1){
if(global.onlineReceived[# 2, i] == 24 && global.receivedClientID != global.clientID){
global.missiles = global.onlineReceived[# 1, i];
if(instance_exists(oCharacter)){
if(oCharacter.state != oCharacter.SAVINGFX && oCharacter.state != oCharacter.SAVINGSHIPFX && oCharacter.state != oCharacter.SAVINGSHIP && oCharacter.state != oCharacter.SAVING){
global.missiles = global.onlineReceived[# 1, i];
}
} else {
global.missiles = global.onlineReceived[# 1, i];
}
if(global.missilesPrev != global.missiles){
global.missilesPrev = global.missiles;
}
@ -50,7 +56,13 @@ switch(argument0){
}
if(global.onlineReceived[# 2, i] == 25 && global.receivedClientID != global.clientID){
global.smissiles = global.onlineReceived[# 1, i];
if(instance_exists(oCharacter)){
if(oCharacter.state != oCharacter.SAVINGFX && oCharacter.state != oCharacter.SAVINGSHIPFX && oCharacter.state != oCharacter.SAVINGSHIP && oCharacter.state != oCharacter.SAVING){
global.smissiles = global.onlineReceived[# 1, i];
}
} else {
global.smissiles = global.onlineReceived[# 1, i];
}
if(global.smissilesPrev != global.smissiles){
global.smissilesPrev = global.smissiles;
}
@ -104,7 +116,13 @@ switch(argument0){
}
*/
if(global.onlineReceived[# 2, i] == 9 && global.receivedClientID != global.clientID){
global.playerhealth = global.onlineReceived[# 1, i];
if(instance_exists(oCharacter)){
if(oCharacter.state != oCharacter.SAVINGFX && oCharacter.state != oCharacter.SAVINGSHIPFX && oCharacter.state != oCharacter.SAVINGSHIP && oCharacter.state != oCharacter.SAVING){
global.playerhealth = global.onlineReceived[# 1, i];
}
} else {
global.playerhealth = global.onlineReceived[# 1, i];
}
if(global.playerhealthPrev != global.playerhealth){
global.playerhealthPrev = global.playerhealth;
}
@ -341,7 +359,13 @@ switch(argument0){
}
if(global.onlineReceived[# 2, i] == 26 && global.receivedClientID != global.clientID){
global.pbombs = global.onlineReceived[# 1, i];
if(instance_exists(oCharacter)){
if(oCharacter.state != oCharacter.SAVINGFX && oCharacter.state != oCharacter.SAVINGSHIPFX && oCharacter.state != oCharacter.SAVINGSHIP && oCharacter.state != oCharacter.SAVING){
global.pbombs = global.onlineReceived[# 1, i];
}
} else {
global.pbombs = global.onlineReceived[# 1, i];
}
if(global.pbombsPrev != global.pbombs){
global.pbombsPrev = global.pbombs;
}
@ -511,68 +535,51 @@ switch(argument0){
break;
case "disablesame":
for(var i=0; i<ds_grid_height(global.onlineReceived); i++){
if(global.onlineReceived[# 2, i] != -1 && i != 0 && i != 1 && i != 3){
if(global.onlineReceived[# 2, i] != -1 && i != 0 && i != 1 && i != 3 && i != 9 && i != 24 && i != 25 && i != 26){
global.onlineList[# 1, i] = global.onlineReceived[# 1, i];
}
/*
if((i == 0 || i == 1 || i == 3) && (is_array(global.onlineReceived[# 1, i]))){
var arrList = global.onlineList[# 1, i];
var arrSend = global.onlineReceived[# 1, i];
show_debug_message(arrList);
show_debug_message(arrSend);
for(var f=0; f<array_length_1d(arrList); f++){
for(var v=0; v<array_height_2d(arrSend); v++){
if(f == arrSend[v, 1]){
if(i == 0){
global.itemPrev[f] = arrSend[v, 0];
if(global.item[f] != arrSend[v, 0]){
global.item[f] = arrSend[v, 0];
}
show_debug_message("item prev index " + string(f) + " changed");
}
if(i == 1){
global.metdeadPrev[f] = arrSend[v, 0];
if(global.metdead[f] != arrSend[v, 0]){
global.metdead[f] = arrSend[v, 0];
}
show_debug_message("metdead prev index " + string(f) + " changed");
}
if(i == 3){
global.eventPrev[f] = arrSend[v, 0];
if(global.event[f] != arrSend[v, 0]){
global.event[f] = arrSend[v, 0];
}
show_debug_message("event prev index " + string(f) + " changed");
}
if(global.onlineReceived[# 2, i] != -1 && (i == 9 || i == 24 || i == 25 || i == 26)){
if(instance_exists(oCharacter)){
if(oCharacter.state != oCharacter.SAVINGFX && oCharacter.state != oCharacter.SAVINGSHIPFX && oCharacter.state != oCharacter.SAVINGSHIP && oCharacter.state != oCharacter.SAVING){
global.onlineList[# 1, i] = global.onlineReceived[# 1, i];
} else if(oCharacter.state == oCharacter.SAVINGFX || oCharacter.state == oCharacter.SAVINGSHIPFX || oCharacter.state == oCharacter.SAVINGSHIP || oCharacter.state == oCharacter.SAVING){
if(global.playerhealth != global.maxhealth){
global.playerhealthPrev = global.maxhealth;
global.playerhealth = global.maxhealth;
}
}
if(global.missiles != global.maxmissiles){
global.missilesPrev = global.maxmissiles;
global.missiles = global.maxmissiles;
}
if(global.smissiles != global.maxsmissiles){
global.smissilesPrev = global.maxsmissiles;
global.smissiles = global.maxsmissiles;
}
if(global.pbombs != global.maxpbombs){
global.pbombsPrev = global.maxpbombs;
global.pbombs = global.maxpbombs;
}
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, 102);
buffer_write(buffer, buffer_s16, global.playerhealth);
buffer_write(buffer, buffer_s16, global.missiles);
buffer_write(buffer, buffer_u8, global.smissiles);
buffer_write(buffer, buffer_u8, global.pbombs);
buffer_write(buffer, buffer_u8, global.clientID);
var result = network_send_packet(socket, buffer, buffer_tell(buffer));
}
} else {
global.onlineList[# 1, i] = global.onlineReceived[# 1, i];
}
}
*/
/*
if(i == 4){
if(global.onlineReceived[# 2, i] != -1 && global.receivedClientID != global.clientID){
global.monstersleft = global.onlineReceived[# 1, 4];
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){
global.monstersarea = global.onlineReceived[# 1, 32];
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){
global.lavastate = global.onlineReceived[# 1, 33];

Loading…
Cancel
Save