From 07a95b14878ae6525fd385a181e83c4b39af9296 Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Wed, 8 Mar 2023 20:30:07 +1100 Subject: [PATCH 1/5] Added Kill Messages --- .../gml_Object_oBeam_Collision_904.gml | 2 + Export_Code/gml_Object_oClient_Other_12.gml | 1 + Export_Code/gml_Object_oClient_Other_13.gml | 2 + Export_Code/gml_Object_oClient_Other_19.gml | 4 + Export_Code/gml_Object_oClient_Other_68.gml | 15 ++- Export_Code/gml_Object_oControl_Create_0.gml | 4 +- .../gml_Object_oMissile_Collision_904.gml | 1 + .../gml_Script_load_character_vars.gml | 1 + Export_Code/gml_Script_sv6_load.gml | 1 + .../gml_Object_oKillMessages_Create_0.gml | 2 + .../gml_Object_oKillMessages_Draw_0.gml | 4 + .../gml_Object_oKillMessages_Mouse_4.gml | 1 + .../gml_Object_oKillMessages_Step_0.gml | 4 + .../gml_Object_oServer_Alarm_11.gml | 1 + .../gml_Object_oServer_Create_0.gml | 3 +- .../gml_Object_oServer_Other_68.gml | 29 ++++- Export_ObjectServer/oKillMessages.json | 123 ++++++++++++++++++ 17 files changed, 194 insertions(+), 4 deletions(-) create mode 100644 Export_CodeServer/gml_Object_oKillMessages_Create_0.gml create mode 100644 Export_CodeServer/gml_Object_oKillMessages_Draw_0.gml create mode 100644 Export_CodeServer/gml_Object_oKillMessages_Mouse_4.gml create mode 100644 Export_CodeServer/gml_Object_oKillMessages_Step_0.gml create mode 100644 Export_ObjectServer/oKillMessages.json diff --git a/Export_Code/gml_Object_oBeam_Collision_904.gml b/Export_Code/gml_Object_oBeam_Collision_904.gml index 26fb13c..80f3714 100644 --- a/Export_Code/gml_Object_oBeam_Collision_904.gml +++ b/Export_Code/gml_Object_oBeam_Collision_904.gml @@ -4,6 +4,7 @@ if (sax != other.sax && (!other.spectator)) if pbeam { event_user(0) + global.attackID = global.clientID global.checkID = other.myid global.checkX = other.x global.checkY = other.y @@ -23,6 +24,7 @@ if (sax != other.sax && (!other.spectator)) else { event_user(0) + global.attackID = global.clientID global.checkID = other.myid global.checkX = other.x global.checkY = other.y diff --git a/Export_Code/gml_Object_oClient_Other_12.gml b/Export_Code/gml_Object_oClient_Other_12.gml index eefe86c..7ad91b1 100644 --- a/Export_Code/gml_Object_oClient_Other_12.gml +++ b/Export_Code/gml_Object_oClient_Other_12.gml @@ -1,6 +1,7 @@ var size, type, alignment, bufferSize, result; if global.spectator exit +global.killedBy = global.otherID size = 1024 type = buffer_grow alignment = 1 diff --git a/Export_Code/gml_Object_oClient_Other_13.gml b/Export_Code/gml_Object_oClient_Other_13.gml index d6f80f9..a0847a7 100644 --- a/Export_Code/gml_Object_oClient_Other_13.gml +++ b/Export_Code/gml_Object_oClient_Other_13.gml @@ -6,6 +6,7 @@ alignment = 1 buffer5 = buffer_create(size, type, alignment) buffer_seek(buffer5, buffer_seek_start, 0) buffer_write(buffer5, buffer_u8, 106) +buffer_write(buffer5, buffer_u8, global.attackID) buffer_write(buffer5, buffer_u8, global.checkID) buffer_write(buffer5, buffer_s16, global.checkX) buffer_write(buffer5, buffer_s16, global.checkY) @@ -18,6 +19,7 @@ bufferSize = buffer_tell(buffer5) buffer_seek(buffer5, buffer_seek_start, 0) buffer_write(buffer5, buffer_s32, bufferSize) buffer_write(buffer5, buffer_u8, 106) +buffer_write(buffer5, buffer_u8, global.attackID) buffer_write(buffer5, buffer_u8, global.checkID) buffer_write(buffer5, buffer_s16, global.checkX) buffer_write(buffer5, buffer_s16, global.checkY) diff --git a/Export_Code/gml_Object_oClient_Other_19.gml b/Export_Code/gml_Object_oClient_Other_19.gml index 46c97d0..f13a9ef 100644 --- a/Export_Code/gml_Object_oClient_Other_19.gml +++ b/Export_Code/gml_Object_oClient_Other_19.gml @@ -10,6 +10,8 @@ buffer_write(buffer11, buffer_s16, room) buffer_write(buffer11, buffer_s16, global.currX) buffer_write(buffer11, buffer_s16, global.currY) buffer_write(buffer11, buffer_s8, global.sax) +buffer_write(buffer11, buffer_u8, global.killedBy) +buffer_write(buffer11, buffer_u8, global.clientID) bufferSize = buffer_tell(buffer11) buffer_seek(buffer11, buffer_seek_start, 0) buffer_write(buffer11, buffer_s32, bufferSize) @@ -19,5 +21,7 @@ buffer_write(buffer11, buffer_s16, room) buffer_write(buffer11, buffer_s16, global.currX) buffer_write(buffer11, buffer_s16, global.currY) buffer_write(buffer11, buffer_s8, global.sax) +buffer_write(buffer11, buffer_u8, global.killedBy) +buffer_write(buffer11, buffer_u8, global.clientID) result = network_send_packet(socket, buffer11, buffer_tell(buffer11)) buffer_delete(buffer11) diff --git a/Export_Code/gml_Object_oClient_Other_68.gml b/Export_Code/gml_Object_oClient_Other_68.gml index b23452d..a2f75d6 100644 --- a/Export_Code/gml_Object_oClient_Other_68.gml +++ b/Export_Code/gml_Object_oClient_Other_68.gml @@ -1,4 +1,4 @@ -var type_event, _buffer, bufferSize, bufferSizePacket, clientID, findsocket, i, arrList, f, v, ban, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, arr, indexValue, clientMapX, clientMapY, sax, spectator, arrPosData, find, event, playerHealth, missiles, smissiles, pbombs, playerhealth, ping, item, metdead, team, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, otherItemArr, IDCheck, tempArr, ID, checkBeam, checkMissile, checkDamage, checkFreeze, newTeam, saxmode, lobbyLocked, samCount, getGravity, receivedPasswordHash, size, type, alignment, result, _seed, monstersLeft, monstersArea, itemArr, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, time, dir, sprX, sprY, charge, arrDraw, arrID, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, syncDiff, str, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, mapposx, mapposy, mirror, sentRoom, playerX, playerY, resend, receivedItem, etankCount, stankCount, ptankCount, mtankCount, receivedEvent, receivedMetdead, countArea, countLeft, part, j, receiveddmap, damageMultStr, damageMult, experimental, playerState, combatState, freezeOff, checkDir, clientSBall, canFreeze, cantFreeze; +var type_event, _buffer, bufferSize, bufferSizePacket, clientID, findsocket, i, arrList, f, v, ban, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, arr, indexValue, clientMapX, clientMapY, sax, spectator, arrPosData, find, event, playerHealth, missiles, smissiles, pbombs, playerhealth, ping, item, metdead, team, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, otherItemArr, IDCheck, tempArr, ID, checkBeam, checkMissile, checkDamage, checkFreeze, newTeam, saxmode, lobbyLocked, samCount, getGravity, receivedPasswordHash, size, type, alignment, result, _seed, monstersLeft, monstersArea, itemArr, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, time, dir, sprX, sprY, charge, arrDraw, arrID, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, syncDiff, str, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, mapposx, mapposy, mirror, sentRoom, playerX, playerY, resend, receivedItem, etankCount, stankCount, ptankCount, mtankCount, receivedEvent, receivedMetdead, countArea, countLeft, part, j, receiveddmap, damageMultStr, damageMult, experimental, playerState, combatState, freezeOff, checkDir, clientSBall, canFreeze, cantFreeze, checkID, attackID, killedBy, deadPlayer, deadName, killerName; disconnectTimer = 900 if (!global.acceptPacket) exit @@ -369,11 +369,13 @@ switch type_event break case 110: global.showHealthIndicatorsTimer = 900 + attackID = buffer_read(_buffer, buffer_u8) checkBeam = buffer_read(_buffer, buffer_u8) checkMissile = buffer_read(_buffer, buffer_u8) checkDamage = buffer_read(_buffer, buffer_u8) checkFreeze = buffer_read(_buffer, buffer_u8) checkDir = buffer_read(_buffer, buffer_u8) + global.killedBy = attackID if (checkMissile && global.playerFreeze > 151) break else @@ -476,6 +478,7 @@ switch type_event experimental = buffer_read(_buffer, buffer_u8) global.MetCount = buffer_read(_buffer, buffer_u8) global.freeForAll = buffer_read(_buffer, buffer_u8) + global.killMessages = buffer_read(_buffer, buffer_u8) global.damageMult = damageMult global.saxmode = saxmode global.experimental = experimental @@ -1591,6 +1594,16 @@ switch type_event playerX = buffer_read(_buffer, buffer_s16) playerY = buffer_read(_buffer, buffer_s16) sax = buffer_read(_buffer, buffer_s8) + killedBy = buffer_read(_buffer, buffer_u8) + deadName = buffer_read(_buffer, buffer_string) + killerName = buffer_read(_buffer, buffer_string) + if global.killMessages + { + if (killedBy != 0) + popup_text(((killerName + " killed ") + deadName)) + else + popup_text((deadName + " died")) + } if (room == sentRoom) { seq = instance_create(playerX, playerY, oDeathSequenceMulti) diff --git a/Export_Code/gml_Object_oControl_Create_0.gml b/Export_Code/gml_Object_oControl_Create_0.gml index 021a143..d48745a 100644 --- a/Export_Code/gml_Object_oControl_Create_0.gml +++ b/Export_Code/gml_Object_oControl_Create_0.gml @@ -269,7 +269,7 @@ if file_exists("lang/fonts/Glasstown_NBP.ttf") ini_close() global.fontVersion = font_add_sprite_ext(sVersionFont, "V.0123456789", 1, 1) global.am2r_version = "V1.5.2" -global.multitroid_version = "FT1.6.2" +global.multitroid_version = "FT1.6.3" global.gamestarted = 0 global.wave_height = 1 global.sand_map = ds_map_create() @@ -480,5 +480,7 @@ global.saveStationCooldown = 0 global.hitBySuper = 0 global.MetCount = 41 global.freeForAll = 0 +global.killedBy = 0 +global.killMessages = 0 reset_map() load_character_vars() diff --git a/Export_Code/gml_Object_oMissile_Collision_904.gml b/Export_Code/gml_Object_oMissile_Collision_904.gml index f456325..24ccb6a 100644 --- a/Export_Code/gml_Object_oMissile_Collision_904.gml +++ b/Export_Code/gml_Object_oMissile_Collision_904.gml @@ -1,6 +1,7 @@ if (myid != other.myid && sax != other.sax && (!other.spectator)) { global.showHealthIndicatorsTimer = 900 + global.attackID = global.clientID global.checkID = other.myid global.checkX = other.x global.checkY = other.y diff --git a/Export_Code/gml_Script_load_character_vars.gml b/Export_Code/gml_Script_load_character_vars.gml index 4e3b8db..abda197 100644 --- a/Export_Code/gml_Script_load_character_vars.gml +++ b/Export_Code/gml_Script_load_character_vars.gml @@ -1,4 +1,5 @@ var i, f; +global.killedBy = 0 global.morphball = 1 global.jumpball = 0 global.powergrip = 1 diff --git a/Export_Code/gml_Script_sv6_load.gml b/Export_Code/gml_Script_sv6_load.gml index 2573872..11387e9 100644 --- a/Export_Code/gml_Script_sv6_load.gml +++ b/Export_Code/gml_Script_sv6_load.gml @@ -89,6 +89,7 @@ else global.roomsSinceLastSpawn = 0 global.ingame = 1 global.newgame = 0 + global.killedBy = 0 room_change(global.start_room, 1) } if instance_exists(oClient) diff --git a/Export_CodeServer/gml_Object_oKillMessages_Create_0.gml b/Export_CodeServer/gml_Object_oKillMessages_Create_0.gml new file mode 100644 index 0000000..70a09f7 --- /dev/null +++ b/Export_CodeServer/gml_Object_oKillMessages_Create_0.gml @@ -0,0 +1,2 @@ +global.killMessages = 0 +image_speed = 0 diff --git a/Export_CodeServer/gml_Object_oKillMessages_Draw_0.gml b/Export_CodeServer/gml_Object_oKillMessages_Draw_0.gml new file mode 100644 index 0000000..43f0eb3 --- /dev/null +++ b/Export_CodeServer/gml_Object_oKillMessages_Draw_0.gml @@ -0,0 +1,4 @@ +draw_self() +draw_set_halign(fa_right) +draw_text((x - sprite_width), (y - 12), "Toggle Kill Messages") +draw_set_halign(fa_left) diff --git a/Export_CodeServer/gml_Object_oKillMessages_Mouse_4.gml b/Export_CodeServer/gml_Object_oKillMessages_Mouse_4.gml new file mode 100644 index 0000000..681a0dc --- /dev/null +++ b/Export_CodeServer/gml_Object_oKillMessages_Mouse_4.gml @@ -0,0 +1 @@ +global.killMessages = (!global.killMessages) diff --git a/Export_CodeServer/gml_Object_oKillMessages_Step_0.gml b/Export_CodeServer/gml_Object_oKillMessages_Step_0.gml new file mode 100644 index 0000000..9e8fcf9 --- /dev/null +++ b/Export_CodeServer/gml_Object_oKillMessages_Step_0.gml @@ -0,0 +1,4 @@ +if global.killMessages + image_index = 0 +else + image_index = 1 diff --git a/Export_CodeServer/gml_Object_oServer_Alarm_11.gml b/Export_CodeServer/gml_Object_oServer_Alarm_11.gml index 380d4c3..415ebe0 100644 --- a/Export_CodeServer/gml_Object_oServer_Alarm_11.gml +++ b/Export_CodeServer/gml_Object_oServer_Alarm_11.gml @@ -30,6 +30,7 @@ buffer_write(buffer, buffer_string, string(global.damageMult)) buffer_write(buffer, buffer_u8, global.experimental) buffer_write(buffer, buffer_u8, global.MetCount) buffer_write(buffer, buffer_u8, global.freeForAll) +buffer_write(buffer, buffer_u8, global.killMessages) for (i = 0; i < sockets; i++) network_send_packet(ds_list_find_value(playerList, i), buffer, buffer_tell(buffer)) alarm[11] = 30 diff --git a/Export_CodeServer/gml_Object_oServer_Create_0.gml b/Export_CodeServer/gml_Object_oServer_Create_0.gml index 8d49c34..08bc493 100644 --- a/Export_CodeServer/gml_Object_oServer_Create_0.gml +++ b/Export_CodeServer/gml_Object_oServer_Create_0.gml @@ -77,7 +77,7 @@ syncedELM = 0 posMapModified = 0 global.lobbyLocked = 0 global.damageMult = 0 -global.clientVersion = "FT1.6.2" +global.clientVersion = "FT1.6.3" global.experimental = 0 global.prevMonstersLeft = 0 global.gametime = 0 @@ -86,3 +86,4 @@ global.doomenabled = 0 global.doomstarted = 0 global.juggActive = 0 global.totalItemCount = 0 +global.killMessages = 0 diff --git a/Export_CodeServer/gml_Object_oServer_Other_68.gml b/Export_CodeServer/gml_Object_oServer_Other_68.gml index f6f306c..4140264 100644 --- a/Export_CodeServer/gml_Object_oServer_Other_68.gml +++ b/Export_CodeServer/gml_Object_oServer_Other_68.gml @@ -1,4 +1,4 @@ -var type_event, ip, findIP, findKickIP, ban, size, type, alignment, bufferSize, findsocket, i, arrList, socket, socketID, ID, arr, seed, findID, _buffer, bufferSizePacket, clientID, sax, sockets, preferredID, f, arrID, arrSocket, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, list, clientMapX, clientMapY, spectator, findSamus, event, findDead, playerHealth, missiles, smissiles, pbombs, ping, realPing, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, tempSocket, checkID, checkX, checkY, checkBeam, checkMissile, checkDamage, checkFreeze, lag, lagPositions, timeToCheck, g, lagPosArr, lagPosTime, lagPosID, lagPosX, lagPosY, packetID, name, lobbyLocked, _queenHealth, phase, state, monstersLeft, monstersArea, item, itemArr, v, metdead, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, gametime, findTime, findReset, dir, sprX, sprY, charge, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, playerhealth, syncDiff, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, saxmode, findIDSamus, findIDSAX, mapposx, mapposy, mirror, sentRoom, playerX, playerY, receivedItem, receivedEvent, receivedMetdead, j, receiveddmap, msg, splitBy, slot, splits, str2, currStr, wrongVersion, playerState, combatState, checkDir, clientSBall, itempercent; +var type_event, ip, findIP, findKickIP, ban, size, type, alignment, bufferSize, findsocket, i, arrList, socket, socketID, ID, arr, seed, findID, _buffer, bufferSizePacket, clientID, sax, sockets, preferredID, f, arrID, arrSocket, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, list, clientMapX, clientMapY, spectator, findSamus, event, findDead, playerHealth, missiles, smissiles, pbombs, ping, realPing, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, tempSocket, checkID, checkX, checkY, checkBeam, checkMissile, checkDamage, checkFreeze, lag, lagPositions, timeToCheck, g, lagPosArr, lagPosTime, lagPosID, lagPosX, lagPosY, packetID, name, lobbyLocked, _queenHealth, phase, state, monstersLeft, monstersArea, item, itemArr, v, metdead, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, gametime, findTime, findReset, dir, sprX, sprY, charge, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, playerhealth, syncDiff, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, saxmode, findIDSamus, findIDSAX, mapposx, mapposy, mirror, sentRoom, playerX, playerY, receivedItem, receivedEvent, receivedMetdead, j, receiveddmap, msg, splitBy, slot, splits, str2, currStr, wrongVersion, playerState, combatState, checkDir, clientSBall, itempercent, attackID, killedBy, deadPlayer, killerName, deadName; type_event = ds_map_find_value(async_load, "type") ip = ds_map_find_value(async_load, "ip") findIP = ds_list_find_index(banList, ip) @@ -800,6 +800,7 @@ switch type_event network_send_packet(tempSocket, buffer, buffer_tell(buffer)) break case 106: + attackID = buffer_read(_buffer, buffer_u8) checkID = buffer_read(_buffer, buffer_u8) checkX = buffer_read(_buffer, buffer_s16) checkY = buffer_read(_buffer, buffer_s16) @@ -827,6 +828,7 @@ switch type_event buffer = buffer_create(size, type, alignment) buffer_seek(buffer, buffer_seek_start, 0) buffer_write(buffer, buffer_u8, 110) + buffer_write(buffer, buffer_u8, attackID) buffer_write(buffer, buffer_u8, checkBeam) buffer_write(buffer, buffer_u8, checkMissile) buffer_write(buffer, buffer_u8, checkDamage) @@ -836,6 +838,7 @@ switch type_event buffer_seek(buffer, buffer_seek_start, 0) buffer_write(buffer, buffer_s32, bufferSize) buffer_write(buffer, buffer_u8, 110) + buffer_write(buffer, buffer_u8, attackID) buffer_write(buffer, buffer_u8, checkBeam) buffer_write(buffer, buffer_u8, checkMissile) buffer_write(buffer, buffer_u8, checkDamage) @@ -2445,6 +2448,24 @@ switch type_event playerX = buffer_read(_buffer, buffer_s16) playerY = buffer_read(_buffer, buffer_s16) sax = buffer_read(_buffer, buffer_s8) + killedBy = buffer_read(_buffer, buffer_u8) + deadPlayer = buffer_read(_buffer, buffer_u8) + killerName = "" + deadName = "" + if global.killMessages + { + for (i = 0; i < ds_list_size(idList); i++) + { + arrList = ds_list_find_value(idList, i) + if (array_length_2d(arrList, 0) <= 2) + { + } + else if (arrList[0, 0] == killedBy) + killerName = arrList[0, 2] + else if (arrList[0, 0] == deadPlayer) + deadName = arrList[0, 2] + } + } buffer_delete(buffer) size = 1024 type = buffer_grow @@ -2457,6 +2478,9 @@ switch type_event buffer_write(buffer, buffer_s16, playerX) buffer_write(buffer, buffer_s16, playerY) buffer_write(buffer, buffer_s8, sax) + buffer_write(buffer, buffer_u8, killedBy) + buffer_write(buffer, buffer_string, deadName) + buffer_write(buffer, buffer_string, killerName) bufferSize = buffer_tell(buffer) buffer_seek(buffer, buffer_seek_start, 0) buffer_write(buffer, buffer_s32, bufferSize) @@ -2466,6 +2490,9 @@ switch type_event buffer_write(buffer, buffer_s16, playerX) buffer_write(buffer, buffer_s16, playerY) buffer_write(buffer, buffer_s8, sax) + buffer_write(buffer, buffer_u8, killedBy) + buffer_write(buffer, buffer_string, deadName) + buffer_write(buffer, buffer_string, killerName) sockets = ds_list_size(playerList) for (i = 0; i < sockets; i++) { diff --git a/Export_ObjectServer/oKillMessages.json b/Export_ObjectServer/oKillMessages.json new file mode 100644 index 0000000..51ffdd2 --- /dev/null +++ b/Export_ObjectServer/oKillMessages.json @@ -0,0 +1,123 @@ +{ + "name": "oKillMessages", + "sprite": "sOption", + "visible": true, + "solid": false, + "depth": 0, + "persistent": false, + "parent_id": null, + "texture_mask_id": null, + "uses_physics": false, + "is_sensor": false, + "collision_shape": 0, + "density": 0.5, + "restitution": 0.1, + "group": 0, + "linear_damping": 0.1, + "angular_damping": 0.1, + "friction": 0.2, + "awake": false, + "kinematic": false, + "physics_vertices": [], + "events": [ + [ + { + "event_subtype": 0, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oKillMessages_Create_0", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [], + [ + { + "event_subtype": 0, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oKillMessages_Step_0", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [], + [ + { + "event_subtype": 4, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oKillMessages_Mouse_4", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [ + { + "event_subtype": 0, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oKillMessages_Draw_0", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [], + [], + [], + [], + [] + ] +} \ No newline at end of file From 1777ffe0e3fb1b8619e28c5a293dbfc16eb823e5 Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Wed, 8 Mar 2023 21:08:04 +1100 Subject: [PATCH 2/5] Added Kill Looting --- Export_Code/gml_Object_oClient_Other_19.gml | 13 +- Export_Code/gml_Object_oClient_Other_68.gml | 211 +++++++++++++++++- Export_Code/gml_Object_oControl_Create_0.gml | 1 + .../gml_Object_oLooting_Create_0.gml | 2 + .../gml_Object_oLooting_Draw_0.gml | 4 + .../gml_Object_oLooting_Mouse_4.gml | 1 + .../gml_Object_oLooting_Step_0.gml | 4 + .../gml_Object_oServer_Create_0.gml | 1 + .../gml_Object_oServer_Other_68.gml | 28 ++- Export_ObjectServer/oLooting.json | 123 ++++++++++ 10 files changed, 385 insertions(+), 3 deletions(-) create mode 100644 Export_CodeServer/gml_Object_oLooting_Create_0.gml create mode 100644 Export_CodeServer/gml_Object_oLooting_Draw_0.gml create mode 100644 Export_CodeServer/gml_Object_oLooting_Mouse_4.gml create mode 100644 Export_CodeServer/gml_Object_oLooting_Step_0.gml create mode 100644 Export_ObjectServer/oLooting.json diff --git a/Export_Code/gml_Object_oClient_Other_19.gml b/Export_Code/gml_Object_oClient_Other_19.gml index f13a9ef..ba3af97 100644 --- a/Export_Code/gml_Object_oClient_Other_19.gml +++ b/Export_Code/gml_Object_oClient_Other_19.gml @@ -1,4 +1,12 @@ -var size, type, alignment, bufferSize, result; +var size, type, alignment, bufferSize, result, itemList, itemString; +itemString = "" +if global.looting +{ + itemList = ds_list_create() + ds_list_set(itemList, 0, global.item) + itemString = ds_list_write(itemList) + itemString = strict_compress(itemString) +} size = 1024 type = buffer_grow alignment = 1 @@ -12,6 +20,7 @@ buffer_write(buffer11, buffer_s16, global.currY) buffer_write(buffer11, buffer_s8, global.sax) buffer_write(buffer11, buffer_u8, global.killedBy) buffer_write(buffer11, buffer_u8, global.clientID) +buffer_write(buffer11, buffer_string, itemString) bufferSize = buffer_tell(buffer11) buffer_seek(buffer11, buffer_seek_start, 0) buffer_write(buffer11, buffer_s32, bufferSize) @@ -23,5 +32,7 @@ buffer_write(buffer11, buffer_s16, global.currY) buffer_write(buffer11, buffer_s8, global.sax) buffer_write(buffer11, buffer_u8, global.killedBy) buffer_write(buffer11, buffer_u8, global.clientID) +buffer_write(buffer11, buffer_string, itemString) result = network_send_packet(socket, buffer11, buffer_tell(buffer11)) buffer_delete(buffer11) +ds_list_destroy(itemList) diff --git a/Export_Code/gml_Object_oClient_Other_68.gml b/Export_Code/gml_Object_oClient_Other_68.gml index a2f75d6..da1ad80 100644 --- a/Export_Code/gml_Object_oClient_Other_68.gml +++ b/Export_Code/gml_Object_oClient_Other_68.gml @@ -1,4 +1,4 @@ -var type_event, _buffer, bufferSize, bufferSizePacket, clientID, findsocket, i, arrList, f, v, ban, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, arr, indexValue, clientMapX, clientMapY, sax, spectator, arrPosData, find, event, playerHealth, missiles, smissiles, pbombs, playerhealth, ping, item, metdead, team, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, otherItemArr, IDCheck, tempArr, ID, checkBeam, checkMissile, checkDamage, checkFreeze, newTeam, saxmode, lobbyLocked, samCount, getGravity, receivedPasswordHash, size, type, alignment, result, _seed, monstersLeft, monstersArea, itemArr, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, time, dir, sprX, sprY, charge, arrDraw, arrID, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, syncDiff, str, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, mapposx, mapposy, mirror, sentRoom, playerX, playerY, resend, receivedItem, etankCount, stankCount, ptankCount, mtankCount, receivedEvent, receivedMetdead, countArea, countLeft, part, j, receiveddmap, damageMultStr, damageMult, experimental, playerState, combatState, freezeOff, checkDir, clientSBall, canFreeze, cantFreeze, checkID, attackID, killedBy, deadPlayer, deadName, killerName; +var type_event, _buffer, bufferSize, bufferSizePacket, clientID, findsocket, i, arrList, f, v, ban, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, arr, indexValue, clientMapX, clientMapY, sax, spectator, arrPosData, find, event, playerHealth, missiles, smissiles, pbombs, playerhealth, ping, item, metdead, team, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, otherItemArr, IDCheck, tempArr, ID, checkBeam, checkMissile, checkDamage, checkFreeze, newTeam, saxmode, lobbyLocked, samCount, getGravity, receivedPasswordHash, size, type, alignment, result, _seed, monstersLeft, monstersArea, itemArr, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, time, dir, sprX, sprY, charge, arrDraw, arrID, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, syncDiff, str, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, mapposx, mapposy, mirror, sentRoom, playerX, playerY, resend, receivedItem, etankCount, stankCount, ptankCount, mtankCount, receivedEvent, receivedMetdead, countArea, countLeft, part, j, receiveddmap, damageMultStr, damageMult, experimental, playerState, combatState, freezeOff, checkDir, clientSBall, canFreeze, cantFreeze, checkID, attackID, killedBy, deadPlayer, deadName, killerName, itemString, itemList, itemArray; disconnectTimer = 900 if (!global.acceptPacket) exit @@ -1610,6 +1610,215 @@ switch type_event seq.facing = mirror } break + case 34: + itemString = buffer_read(_buffer, buffer_string) + if global.looting + { + itemString = strict_decompress(itemString) + itemList = ds_list_create() + ds_list_read(itemList, itemString) + itemArray = ds_list_find_value(itemList, 0) + ds_list_destroy(itemList) + for (i = 0; i < array_length_1d(itemArray); i++) + { + if (itemArray[i] == 1 && global.item[i] == 0) + { + global.item[i] = 1 + if (i == 0) + { + global.bomb = 1 + global.bombPrev = global.bomb + popup_text(((get_text("Items", "Bombs") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 1) + { + global.powergrip = 1 + global.powergripPrev = global.powergrip + popup_text(((get_text("Items", "PowerGrip") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 2) + { + global.spiderball = 1 + global.spiderballPrev = global.spiderball + popup_text(((get_text("Items", "SpiderBall") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 3) + { + global.jumpball = 1 + global.jumpballPrev = global.jumpball + popup_text(((get_text("Items", "JumpBall") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 4) + { + global.hijump = 1 + global.hijumpPrev = global.hijump + popup_text(((get_text("Items", "HiJump") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 5) + { + global.currentsuit = 1 + global.currentsuitPrev = global.currentsuit + popup_text(((get_text("Items", "VariaSuit") + " ") + get_text("GlobalOptions", "Enabled"))) + if sfx_isplaying(sndSpinJump) + sfx_stop(sndSpinJump) + if sfx_isplaying(sndSpaceJump) + sfx_stop(sndSpaceJump) + if sfx_isplaying(sndScrewAttack) + sfx_stop(sndScrewAttack) + if sfx_isplaying(sndSpaceScrewAttack) + sfx_stop(sndSpaceScrewAttack) + } + if (i == 6) + { + global.spacejump = 1 + global.spacejumpPrev = global.spacejump + popup_text(((get_text("Items", "SpaceJump") + " ") + get_text("GlobalOptions", "Enabled"))) + if sfx_isplaying(sndSpinJump) + sfx_stop(sndSpinJump) + if sfx_isplaying(sndSpaceJump) + sfx_stop(sndSpaceJump) + if sfx_isplaying(sndScrewAttack) + sfx_stop(sndScrewAttack) + if sfx_isplaying(sndSpaceScrewAttack) + sfx_stop(sndSpaceScrewAttack) + } + if (i == 7) + { + global.speedbooster = 1 + global.speedboosterPrev = global.speedbooster + popup_text(((get_text("Items", "SpeedBooster") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 8) + { + global.screwattack = 1 + global.screwattackPrev = global.screwattack + popup_text(((get_text("Items", "ScrewAttack") + " ") + get_text("GlobalOptions", "Enabled"))) + if sfx_isplaying(sndSpinJump) + sfx_stop(sndSpinJump) + if sfx_isplaying(sndSpaceJump) + sfx_stop(sndSpaceJump) + if sfx_isplaying(sndScrewAttack) + sfx_stop(sndScrewAttack) + if sfx_isplaying(sndSpaceScrewAttack) + sfx_stop(sndSpaceScrewAttack) + } + if (i == 9) + { + global.currentsuit = 2 + global.currentsuitPrev = global.currentsuit + popup_text(((get_text("Items", "GravitySuit") + " ") + get_text("GlobalOptions", "Enabled"))) + if sfx_isplaying(sndSpinJump) + sfx_stop(sndSpinJump) + if sfx_isplaying(sndSpaceJump) + sfx_stop(sndSpaceJump) + if sfx_isplaying(sndScrewAttack) + sfx_stop(sndScrewAttack) + if sfx_isplaying(sndSpaceScrewAttack) + sfx_stop(sndSpaceScrewAttack) + } + if (i == 10) + { + global.cbeam = 1 + global.cbeamPrev = global.cbeam + popup_text(((get_text("Items", "ChargeBeam") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 11) + { + global.ibeam = 1 + global.ibeamPrev = global.ibeam + popup_text(((get_text("Items", "IceBeam") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 12) + { + global.wbeam = 1 + global.wbeamPrev = global.wbeam + popup_text(((get_text("Items", "WaveBeam") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 13) + { + global.sbeam = 1 + global.sbeamPrev = global.sbeam + popup_text(((get_text("Items", "SpazerBeam") + " ") + get_text("GlobalOptions", "Enabled"))) + } + if (i == 14) + { + global.pbeam = 1 + global.pbeamPrev = global.pbeam + popup_text(((get_text("Items", "PlasmaBeam") + " ") + get_text("GlobalOptions", "Enabled"))) + } + } + } + etankCount = 0 + for (i = 0; i < array_length_1d(global.item); i++) + { + if (i == 50 || i == 103 || i == 108 || i == 157 || i == 158 || i == 200 || i == 201 || i == 251 || i == 254 || i == 306) + { + if (global.item[i] == 1) + etankCount++ + } + } + if (etankCount != global.etanks) + { + global.etanks = etankCount + global.maxhealth = ((99 + (100 * global.etanks)) * oControl.mod_etankhealthmult) + global.playerhealth = global.maxhealth + } + stankCount = 0 + for (i = 0; i < array_length_1d(global.item); i++) + { + if (i == 51 || i == 110 || i == 162 || i == 206 || i == 207 || i == 209 || i == 215 || i == 256 || i == 300 || i == 305) + { + if (global.item[i] == 1) + stankCount++ + } + } + if (stankCount != global.stanks) + { + global.stanks = stankCount + if (global.difficulty < 2) + global.maxsmissiles = (2 * global.stanks) + if (global.difficulty == 2) + global.maxsmissiles = (1 * global.stanks) + global.smissiles = global.maxsmissiles + } + ptankCount = 0 + for (i = 0; i < array_length_1d(global.item); i++) + { + if (i == 58 || i == 59 || i == 112 || i == 160 || i == 212 || i == 213 || i == 253 || i == 258 || i == 301 || i == 302) + { + if (global.item[i] == 1) + ptankCount++ + } + } + if (ptankCount != global.ptanks) + { + global.ptanks = ptankCount + if (global.difficulty < 2) + global.maxpbombs = (2 * global.ptanks) + if (global.difficulty == 2) + global.maxpbombs = (1 * global.ptanks) + global.pbombs = global.maxpbombs + } + mtankCount = 0 + for (i = 0; i < array_length_1d(global.item); i++) + { + if (i == 52 || i == 53 || i == 54 || i == 55 || i == 56 || i == 57 || i == 60 || i == 100 || i == 101 || i == 102 || i == 104 || i == 105 || i == 106 || i == 107 || i == 109 || i == 111 || i == 150 || i == 151 || i == 152 || i == 153 || i == 154 || i == 155 || i == 156 || i == 159 || i == 161 || i == 163 || i == 202 || i == 203 || i == 204 || i == 205 || i == 208 || i == 210 || i == 211 || i == 214 || i == 250 || i == 252 || i == 255 || i == 257 || i == 259 || i == 303 || i == 304 || i == 307 || i == 308 || i == 309) + { + if (global.item[i] == 1) + mtankCount++ + } + } + if (mtankCount != global.mtanks) + { + global.mtanks = mtankCount + if (global.difficulty < 2) + global.maxmissiles = (oControl.mod_Mstartingcount + (5 * global.mtanks)) + if (global.difficulty == 2) + global.maxmissiles = (oControl.mod_Mstartingcount + (2 * global.mtanks)) + global.missiles = global.maxmissiles + } + } + break case 50: resend = 0 for (i = 0; i < array_length_1d(global.item); i++) diff --git a/Export_Code/gml_Object_oControl_Create_0.gml b/Export_Code/gml_Object_oControl_Create_0.gml index d48745a..33d7be0 100644 --- a/Export_Code/gml_Object_oControl_Create_0.gml +++ b/Export_Code/gml_Object_oControl_Create_0.gml @@ -482,5 +482,6 @@ global.MetCount = 41 global.freeForAll = 0 global.killedBy = 0 global.killMessages = 0 +global.looting = 0 reset_map() load_character_vars() diff --git a/Export_CodeServer/gml_Object_oLooting_Create_0.gml b/Export_CodeServer/gml_Object_oLooting_Create_0.gml new file mode 100644 index 0000000..6f0dcbc --- /dev/null +++ b/Export_CodeServer/gml_Object_oLooting_Create_0.gml @@ -0,0 +1,2 @@ +global.looting = 0 +image_speed = 0 diff --git a/Export_CodeServer/gml_Object_oLooting_Draw_0.gml b/Export_CodeServer/gml_Object_oLooting_Draw_0.gml new file mode 100644 index 0000000..0b30ab1 --- /dev/null +++ b/Export_CodeServer/gml_Object_oLooting_Draw_0.gml @@ -0,0 +1,4 @@ +draw_self() +draw_set_halign(fa_right) +draw_text((x - sprite_width), (y - 12), "Toggle Kill Looting") +draw_set_halign(fa_left) diff --git a/Export_CodeServer/gml_Object_oLooting_Mouse_4.gml b/Export_CodeServer/gml_Object_oLooting_Mouse_4.gml new file mode 100644 index 0000000..21a2629 --- /dev/null +++ b/Export_CodeServer/gml_Object_oLooting_Mouse_4.gml @@ -0,0 +1 @@ +global.looting = (!global.looting) diff --git a/Export_CodeServer/gml_Object_oLooting_Step_0.gml b/Export_CodeServer/gml_Object_oLooting_Step_0.gml new file mode 100644 index 0000000..e5903a1 --- /dev/null +++ b/Export_CodeServer/gml_Object_oLooting_Step_0.gml @@ -0,0 +1,4 @@ +if global.looting + image_index = 0 +else + image_index = 1 diff --git a/Export_CodeServer/gml_Object_oServer_Create_0.gml b/Export_CodeServer/gml_Object_oServer_Create_0.gml index 08bc493..e252418 100644 --- a/Export_CodeServer/gml_Object_oServer_Create_0.gml +++ b/Export_CodeServer/gml_Object_oServer_Create_0.gml @@ -87,3 +87,4 @@ global.doomstarted = 0 global.juggActive = 0 global.totalItemCount = 0 global.killMessages = 0 +global.looting = 0 diff --git a/Export_CodeServer/gml_Object_oServer_Other_68.gml b/Export_CodeServer/gml_Object_oServer_Other_68.gml index 4140264..9356e7c 100644 --- a/Export_CodeServer/gml_Object_oServer_Other_68.gml +++ b/Export_CodeServer/gml_Object_oServer_Other_68.gml @@ -1,4 +1,4 @@ -var type_event, ip, findIP, findKickIP, ban, size, type, alignment, bufferSize, findsocket, i, arrList, socket, socketID, ID, arr, seed, findID, _buffer, bufferSizePacket, clientID, sax, sockets, preferredID, f, arrID, arrSocket, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, list, clientMapX, clientMapY, spectator, findSamus, event, findDead, playerHealth, missiles, smissiles, pbombs, ping, realPing, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, tempSocket, checkID, checkX, checkY, checkBeam, checkMissile, checkDamage, checkFreeze, lag, lagPositions, timeToCheck, g, lagPosArr, lagPosTime, lagPosID, lagPosX, lagPosY, packetID, name, lobbyLocked, _queenHealth, phase, state, monstersLeft, monstersArea, item, itemArr, v, metdead, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, gametime, findTime, findReset, dir, sprX, sprY, charge, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, playerhealth, syncDiff, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, saxmode, findIDSamus, findIDSAX, mapposx, mapposy, mirror, sentRoom, playerX, playerY, receivedItem, receivedEvent, receivedMetdead, j, receiveddmap, msg, splitBy, slot, splits, str2, currStr, wrongVersion, playerState, combatState, checkDir, clientSBall, itempercent, attackID, killedBy, deadPlayer, killerName, deadName; +var type_event, ip, findIP, findKickIP, ban, size, type, alignment, bufferSize, findsocket, i, arrList, socket, socketID, ID, arr, seed, findID, _buffer, bufferSizePacket, clientID, sax, sockets, preferredID, f, arrID, arrSocket, clientX, clientY, clientSprite, clientImage, clientA1, clientA1X, clientA1Y, clientA2, clientA2X, clientA2Y, clientA2A, clientMirror, clientArmmsl, clientRoom, clientName, clientBlend, clientFXTimer, clientRoomPrev, clientState, clientSAX, clientSpeedboost, clientSJBall, clientSJDir, clientSpeedCharge, clientPlayerHealth, clientSpectator, clientInvincible, clientMosaic, clientReform, clientVisible, list, clientMapX, clientMapY, spectator, findSamus, event, findDead, playerHealth, missiles, smissiles, pbombs, ping, realPing, spacejump, screwattack, spiderball, speedbooster, bomb, ibeam, wbeam, pbeam, sbeam, cbeam, tempSocket, checkID, checkX, checkY, checkBeam, checkMissile, checkDamage, checkFreeze, lag, lagPositions, timeToCheck, g, lagPosArr, lagPosTime, lagPosID, lagPosX, lagPosY, packetID, name, lobbyLocked, _queenHealth, phase, state, monstersLeft, monstersArea, item, itemArr, v, metdead, metdeadArr, eventArr, tileCount, tileX, tileY, tileData, itemstaken, maxmissiles, maxsmissiles, maxpbombs, maxhealth, etanks, mtanks, stanks, ptanks, gametime, findTime, findReset, dir, sprX, sprY, charge, bombX, bombY, currentWeapon, missileX, missileY, velX, velY, icemissiles, pbombX, pbombY, playerhealth, syncDiff, syncELM, otherAbsorbRelativeX, otherAbsorbRelativeY, otherAbsorbSpriteHeight, saxmode, findIDSamus, findIDSAX, mapposx, mapposy, mirror, sentRoom, playerX, playerY, receivedItem, receivedEvent, receivedMetdead, j, receiveddmap, msg, splitBy, slot, splits, str2, currStr, wrongVersion, playerState, combatState, checkDir, clientSBall, itempercent, attackID, killedBy, deadPlayer, killerName, deadName, itemString; type_event = ds_map_find_value(async_load, "type") ip = ds_map_find_value(async_load, "ip") findIP = ds_list_find_index(banList, ip) @@ -2450,6 +2450,32 @@ switch type_event sax = buffer_read(_buffer, buffer_s8) killedBy = buffer_read(_buffer, buffer_u8) deadPlayer = buffer_read(_buffer, buffer_u8) + itemString = buffer_read(_buffer, buffer_string) + if (itemString != "" && global.looting) + { + tempSocket = -100 + for (i = 0; i < ds_list_size(idList); i++) + { + arrList = ds_list_find_value(idList, i) + if (checkID == arrList[0, 0]) + tempSocket = arrList[0, 1] + } + buffer_delete(buffer) + 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, 34) + buffer_write(buffer, buffer_string, itemString) + bufferSize = buffer_tell(buffer) + buffer_seek(buffer, buffer_seek_start, 0) + buffer_write(buffer, buffer_s32, bufferSize) + buffer_write(buffer, buffer_u8, 34) + buffer_write(buffer, buffer_string, itemString) + if (tempSocket != -100) + network_send_packet(tempSocket, buffer, buffer_tell(buffer)) + } killerName = "" deadName = "" if global.killMessages diff --git a/Export_ObjectServer/oLooting.json b/Export_ObjectServer/oLooting.json new file mode 100644 index 0000000..d45bea2 --- /dev/null +++ b/Export_ObjectServer/oLooting.json @@ -0,0 +1,123 @@ +{ + "name": "oLooting", + "sprite": "sOption", + "visible": true, + "solid": false, + "depth": 0, + "persistent": false, + "parent_id": null, + "texture_mask_id": null, + "uses_physics": false, + "is_sensor": false, + "collision_shape": 0, + "density": 0.5, + "restitution": 0.1, + "group": 0, + "linear_damping": 0.1, + "angular_damping": 0.1, + "friction": 0.2, + "awake": false, + "kinematic": false, + "physics_vertices": [], + "events": [ + [ + { + "event_subtype": 0, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oLooting_Create_0", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [], + [ + { + "event_subtype": 0, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oLooting_Step_0", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [], + [ + { + "event_subtype": 4, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oLooting_Mouse_4", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [ + { + "event_subtype": 0, + "actions": [ + { + "lib_id": 0, + "id": 0, + "kind": 0, + "use_relative": false, + "is_question": false, + "use_apply_to": false, + "exe_type": 0, + "action_name": null, + "code_id": "gml_Object_oLooting_Draw_0", + "argument_count": 0, + "who": 0, + "relative": false, + "is_not": false + } + ] + } + ], + [], + [], + [], + [], + [], + [] + ] +} \ No newline at end of file From 0dd1c32a28c14094c39157ebf7d187c6dc8e94ad Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Wed, 8 Mar 2023 21:12:49 +1100 Subject: [PATCH 3/5] Made looting value synced --- Export_Code/gml_Object_oClient_Other_68.gml | 1 + Export_CodeServer/gml_Object_oServer_Alarm_11.gml | 1 + 2 files changed, 2 insertions(+) diff --git a/Export_Code/gml_Object_oClient_Other_68.gml b/Export_Code/gml_Object_oClient_Other_68.gml index da1ad80..caa8647 100644 --- a/Export_Code/gml_Object_oClient_Other_68.gml +++ b/Export_Code/gml_Object_oClient_Other_68.gml @@ -479,6 +479,7 @@ switch type_event global.MetCount = buffer_read(_buffer, buffer_u8) global.freeForAll = buffer_read(_buffer, buffer_u8) global.killMessages = buffer_read(_buffer, buffer_u8) + global.looting = buffer_read(_buffer, buffer_u8) global.damageMult = damageMult global.saxmode = saxmode global.experimental = experimental diff --git a/Export_CodeServer/gml_Object_oServer_Alarm_11.gml b/Export_CodeServer/gml_Object_oServer_Alarm_11.gml index 415ebe0..394ae27 100644 --- a/Export_CodeServer/gml_Object_oServer_Alarm_11.gml +++ b/Export_CodeServer/gml_Object_oServer_Alarm_11.gml @@ -31,6 +31,7 @@ buffer_write(buffer, buffer_u8, global.experimental) buffer_write(buffer, buffer_u8, global.MetCount) buffer_write(buffer, buffer_u8, global.freeForAll) buffer_write(buffer, buffer_u8, global.killMessages) +buffer_write(buffer, buffer_u8, global.looting) for (i = 0; i < sockets; i++) network_send_packet(ds_list_find_value(playerList, i), buffer, buffer_tell(buffer)) alarm[11] = 30 From 5e6d0ec44a55772fd6dcf8910456ab29b6cabe6c Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Wed, 8 Mar 2023 21:18:54 +1100 Subject: [PATCH 4/5] Fixed typo --- Export_CodeServer/gml_Object_oServer_Alarm_11.gml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Export_CodeServer/gml_Object_oServer_Alarm_11.gml b/Export_CodeServer/gml_Object_oServer_Alarm_11.gml index 394ae27..c1d7bda 100644 --- a/Export_CodeServer/gml_Object_oServer_Alarm_11.gml +++ b/Export_CodeServer/gml_Object_oServer_Alarm_11.gml @@ -18,6 +18,8 @@ buffer_write(buffer, buffer_string, string(global.damageMult)) buffer_write(buffer, buffer_u8, global.experimental) buffer_write(buffer, buffer_u8, global.MetCount) buffer_write(buffer, buffer_u8, global.freeForAll) +buffer_write(buffer, buffer_u8, global.killMessages) +buffer_write(buffer, buffer_u8, global.looting) bufferSize = buffer_tell(buffer) buffer_seek(buffer, buffer_seek_start, 0) buffer_write(buffer, buffer_s32, bufferSize) From d2877e6cb74f3012c7589d16fd585552f7ebecbe Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Wed, 8 Mar 2023 21:22:54 +1100 Subject: [PATCH 5/5] Fixed another typo --- Export_CodeServer/gml_Object_oServer_Other_68.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Export_CodeServer/gml_Object_oServer_Other_68.gml b/Export_CodeServer/gml_Object_oServer_Other_68.gml index 9356e7c..a90d638 100644 --- a/Export_CodeServer/gml_Object_oServer_Other_68.gml +++ b/Export_CodeServer/gml_Object_oServer_Other_68.gml @@ -2457,7 +2457,7 @@ switch type_event for (i = 0; i < ds_list_size(idList); i++) { arrList = ds_list_find_value(idList, i) - if (checkID == arrList[0, 0]) + if (killedBy == arrList[0, 0]) tempSocket = arrList[0, 1] } buffer_delete(buffer)