Added Kill Looting

pull/6/head
DodoBirb 4 years ago
parent 07a95b1487
commit 1777ffe0e3

@ -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)

@ -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++)

@ -482,5 +482,6 @@ global.MetCount = 41
global.freeForAll = 0
global.killedBy = 0
global.killMessages = 0
global.looting = 0
reset_map()
load_character_vars()

@ -0,0 +1,2 @@
global.looting = 0
image_speed = 0

@ -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)

@ -0,0 +1 @@
global.looting = (!global.looting)

@ -0,0 +1,4 @@
if global.looting
image_index = 0
else
image_index = 1

@ -87,3 +87,4 @@ global.doomstarted = 0
global.juggActive = 0
global.totalItemCount = 0
global.killMessages = 0
global.looting = 0

@ -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

@ -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
}
]
}
],
[],
[],
[],
[],
[],
[]
]
}
Loading…
Cancel
Save