mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into item-color
Conflicts: code/game/machinery/washing_machine.dm code/modules/mob/living/carbon/human/update_icons.dm
This commit is contained in:
@@ -523,7 +523,7 @@ var/list/admin_verbs_mentor = list(
|
||||
if(C)
|
||||
message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [AUTOBANTIME] minute ban.")
|
||||
C << "<font color='red'><BIG><B>You have been autobanned due to a warning by [ckey].</B></BIG><br>This is a temporary ban, it will be removed in [AUTOBANTIME] minutes."
|
||||
del(C)
|
||||
qdel(C)
|
||||
else
|
||||
message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban.")
|
||||
AddBan(warned_ckey, D.last_id, "Autobanning due to too many formal warnings", ckey, 1, AUTOBANTIME)
|
||||
|
||||
@@ -16,7 +16,7 @@ var/list/admin_datums = list()
|
||||
/datum/admins/New(initial_rank = "Temporary Admin", initial_rights = 0, ckey)
|
||||
if(!ckey)
|
||||
error("Admin datum created without a ckey argument. Datum has been deleted")
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
|
||||
rank = initial_rank
|
||||
@@ -91,5 +91,5 @@ NOTE: It checks usr by default. Supply the "user" argument if you wish to check
|
||||
/client/proc/deadmin()
|
||||
if(holder)
|
||||
holder.disassociate()
|
||||
//del(holder)
|
||||
//qdel(holder)
|
||||
return 1
|
||||
|
||||
+167
-167
@@ -1,167 +1,167 @@
|
||||
//This stuff was originally intended to be integrated into the ban-system I was working on
|
||||
//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
|
||||
//enjoy ~Carn
|
||||
/*
|
||||
#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
|
||||
|
||||
datum/admins/proc/notes_show(var/ckey)
|
||||
usr << browse("<head><title>Player Notes</title></head><body>[notes_gethtml(ckey)]</body>","window=player_notes;size=700x400")
|
||||
|
||||
|
||||
datum/admins/proc/notes_gethtml(var/ckey)
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return "<font color='red'>Error: Cannot access [NOTESFILE]</font>"
|
||||
if(ckey)
|
||||
. = "<b>Notes for <a href='?src=\ref[src];notes=show'>[ckey]</a>:</b> <a href='?src=\ref[src];notes=add;ckey=[ckey]'>\[+\]</a> <a href='?src=\ref[src];notes=remove;ckey=[ckey]'>\[-\]</a><br>"
|
||||
notesfile.cd = "/[ckey]"
|
||||
var/index = 1
|
||||
while( !notesfile.eof )
|
||||
var/note
|
||||
notesfile >> note
|
||||
. += "[note] <a href='?src=\ref[src];notes=remove;ckey=[ckey];from=[index]'>\[-\]</a><br>"
|
||||
index++
|
||||
else
|
||||
. = "<b>All Notes:</b> <a href='?src=\ref[src];notes=add'>\[+\]</a> <a href='?src=\ref[src];notes=remove'>\[-\]</a><br>"
|
||||
notesfile.cd = "/"
|
||||
for(var/dir in notesfile.dir)
|
||||
. += "<a href='?src=\ref[src];notes=show;ckey=[dir]'>[dir]</a><br>"
|
||||
return
|
||||
|
||||
|
||||
//handles adding notes to the end of a ckey's buffer
|
||||
//originally had seperate entries such as var/by to record who left the note and when
|
||||
//but the current bansystem is a heap of dung.
|
||||
/proc/notes_add(var/ckey, var/note)
|
||||
if(!ckey)
|
||||
ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
|
||||
if(!ckey) return
|
||||
|
||||
if(!note)
|
||||
note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null)
|
||||
if(!note) return
|
||||
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return
|
||||
notesfile.cd = "/[ckey]"
|
||||
notesfile.eof = 1 //move to the end of the buffer
|
||||
notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
|
||||
return
|
||||
|
||||
//handles removing entries from the buffer, or removing the entire directory if no start_index is given
|
||||
/proc/notes_remove(var/ckey, var/start_index, var/end_index)
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return
|
||||
|
||||
if(!ckey)
|
||||
notesfile.cd = "/"
|
||||
ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
|
||||
if(!ckey) return
|
||||
|
||||
if(start_index)
|
||||
notesfile.cd = "/[ckey]"
|
||||
var/list/noteslist = list()
|
||||
if(!end_index) end_index = start_index
|
||||
var/index = 0
|
||||
while( !notesfile.eof )
|
||||
index++
|
||||
var/temp
|
||||
notesfile >> temp
|
||||
if( (start_index <= index) && (index <= end_index) )
|
||||
continue
|
||||
noteslist += temp
|
||||
|
||||
notesfile.eof = -2 //Move to the start of the buffer and then erase.
|
||||
|
||||
for( var/note in noteslist )
|
||||
notesfile << note
|
||||
else
|
||||
notesfile.cd = "/"
|
||||
if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
|
||||
notesfile.dir.Remove(ckey)
|
||||
return
|
||||
|
||||
#undef NOTESFILE
|
||||
*/
|
||||
|
||||
//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
|
||||
|
||||
/proc/notes_add(var/key, var/note, var/mob/usr)
|
||||
if (!key || !note)
|
||||
return
|
||||
|
||||
//Loading list of notes for this key
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos) infos = list()
|
||||
|
||||
//Overly complex timestamp creation
|
||||
var/modifyer = "th"
|
||||
switch(time2text(world.timeofday, "DD"))
|
||||
if("01","21","31")
|
||||
modifyer = "st"
|
||||
if("02","22",)
|
||||
modifyer = "nd"
|
||||
if("03","23")
|
||||
modifyer = "rd"
|
||||
var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
|
||||
if(copytext(day_string,1,2) == "0")
|
||||
day_string = copytext(day_string,2)
|
||||
var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
|
||||
var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
|
||||
|
||||
var/datum/player_info/P = new
|
||||
if (usr)
|
||||
P.author = usr.key
|
||||
P.rank = usr.client.holder.rank
|
||||
else
|
||||
P.author = "Adminbot"
|
||||
P.rank = "Friendly Robot"
|
||||
P.content = note
|
||||
P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
|
||||
|
||||
infos += P
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
|
||||
log_admin("[key_name(usr)] has edited [key]'s notes.")
|
||||
|
||||
del info
|
||||
|
||||
//Updating list of keys with notes on them
|
||||
var/savefile/note_list = new("data/player_notes.sav")
|
||||
var/list/note_keys
|
||||
note_list >> note_keys
|
||||
if(!note_keys) note_keys = list()
|
||||
if(!note_keys.Find(key)) note_keys += key
|
||||
note_list << note_keys
|
||||
del note_list
|
||||
|
||||
|
||||
/proc/notes_del(var/key, var/index)
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos || infos.len < index) return
|
||||
|
||||
var/datum/player_info/item = infos[index]
|
||||
infos.Remove(item)
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
|
||||
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
|
||||
|
||||
del info
|
||||
|
||||
/proc/show_player_info_irc(var/key as text)
|
||||
var/dat = " Info on [key]%0D%0A"
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos)
|
||||
dat = "No information found on the given key."
|
||||
else
|
||||
for(var/datum/player_info/I in infos)
|
||||
dat += "[I.content]%0D%0Aby [I.author] ([I.rank]) on [I.timestamp]%0D%0A%0D%0A"
|
||||
|
||||
return dat
|
||||
//This stuff was originally intended to be integrated into the ban-system I was working on
|
||||
//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
|
||||
//enjoy ~Carn
|
||||
/*
|
||||
#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
|
||||
|
||||
datum/admins/proc/notes_show(var/ckey)
|
||||
usr << browse("<head><title>Player Notes</title></head><body>[notes_gethtml(ckey)]</body>","window=player_notes;size=700x400")
|
||||
|
||||
|
||||
datum/admins/proc/notes_gethtml(var/ckey)
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return "<font color='red'>Error: Cannot access [NOTESFILE]</font>"
|
||||
if(ckey)
|
||||
. = "<b>Notes for <a href='?src=\ref[src];notes=show'>[ckey]</a>:</b> <a href='?src=\ref[src];notes=add;ckey=[ckey]'>\[+\]</a> <a href='?src=\ref[src];notes=remove;ckey=[ckey]'>\[-\]</a><br>"
|
||||
notesfile.cd = "/[ckey]"
|
||||
var/index = 1
|
||||
while( !notesfile.eof )
|
||||
var/note
|
||||
notesfile >> note
|
||||
. += "[note] <a href='?src=\ref[src];notes=remove;ckey=[ckey];from=[index]'>\[-\]</a><br>"
|
||||
index++
|
||||
else
|
||||
. = "<b>All Notes:</b> <a href='?src=\ref[src];notes=add'>\[+\]</a> <a href='?src=\ref[src];notes=remove'>\[-\]</a><br>"
|
||||
notesfile.cd = "/"
|
||||
for(var/dir in notesfile.dir)
|
||||
. += "<a href='?src=\ref[src];notes=show;ckey=[dir]'>[dir]</a><br>"
|
||||
return
|
||||
|
||||
|
||||
//handles adding notes to the end of a ckey's buffer
|
||||
//originally had seperate entries such as var/by to record who left the note and when
|
||||
//but the current bansystem is a heap of dung.
|
||||
/proc/notes_add(var/ckey, var/note)
|
||||
if(!ckey)
|
||||
ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
|
||||
if(!ckey) return
|
||||
|
||||
if(!note)
|
||||
note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null)
|
||||
if(!note) return
|
||||
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return
|
||||
notesfile.cd = "/[ckey]"
|
||||
notesfile.eof = 1 //move to the end of the buffer
|
||||
notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
|
||||
return
|
||||
|
||||
//handles removing entries from the buffer, or removing the entire directory if no start_index is given
|
||||
/proc/notes_remove(var/ckey, var/start_index, var/end_index)
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return
|
||||
|
||||
if(!ckey)
|
||||
notesfile.cd = "/"
|
||||
ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
|
||||
if(!ckey) return
|
||||
|
||||
if(start_index)
|
||||
notesfile.cd = "/[ckey]"
|
||||
var/list/noteslist = list()
|
||||
if(!end_index) end_index = start_index
|
||||
var/index = 0
|
||||
while( !notesfile.eof )
|
||||
index++
|
||||
var/temp
|
||||
notesfile >> temp
|
||||
if( (start_index <= index) && (index <= end_index) )
|
||||
continue
|
||||
noteslist += temp
|
||||
|
||||
notesfile.eof = -2 //Move to the start of the buffer and then erase.
|
||||
|
||||
for( var/note in noteslist )
|
||||
notesfile << note
|
||||
else
|
||||
notesfile.cd = "/"
|
||||
if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
|
||||
notesfile.dir.Remove(ckey)
|
||||
return
|
||||
|
||||
#undef NOTESFILE
|
||||
*/
|
||||
|
||||
//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
|
||||
|
||||
/proc/notes_add(var/key, var/note, var/mob/usr)
|
||||
if (!key || !note)
|
||||
return
|
||||
|
||||
//Loading list of notes for this key
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos) infos = list()
|
||||
|
||||
//Overly complex timestamp creation
|
||||
var/modifyer = "th"
|
||||
switch(time2text(world.timeofday, "DD"))
|
||||
if("01","21","31")
|
||||
modifyer = "st"
|
||||
if("02","22",)
|
||||
modifyer = "nd"
|
||||
if("03","23")
|
||||
modifyer = "rd"
|
||||
var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
|
||||
if(copytext(day_string,1,2) == "0")
|
||||
day_string = copytext(day_string,2)
|
||||
var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
|
||||
var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
|
||||
|
||||
var/datum/player_info/P = new
|
||||
if (usr)
|
||||
P.author = usr.key
|
||||
P.rank = usr.client.holder.rank
|
||||
else
|
||||
P.author = "Adminbot"
|
||||
P.rank = "Friendly Robot"
|
||||
P.content = note
|
||||
P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
|
||||
|
||||
infos += P
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
|
||||
log_admin("[key_name(usr)] has edited [key]'s notes.")
|
||||
|
||||
qdel(info)
|
||||
|
||||
//Updating list of keys with notes on them
|
||||
var/savefile/note_list = new("data/player_notes.sav")
|
||||
var/list/note_keys
|
||||
note_list >> note_keys
|
||||
if(!note_keys) note_keys = list()
|
||||
if(!note_keys.Find(key)) note_keys += key
|
||||
note_list << note_keys
|
||||
qdel(note_list)
|
||||
|
||||
|
||||
/proc/notes_del(var/key, var/index)
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos || infos.len < index) return
|
||||
|
||||
var/datum/player_info/item = infos[index]
|
||||
infos.Remove(item)
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
|
||||
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
|
||||
|
||||
qdel(info)
|
||||
|
||||
/proc/show_player_info_irc(var/key as text)
|
||||
var/dat = " Info on [key]%0D%0A"
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos)
|
||||
dat = "No information found on the given key."
|
||||
else
|
||||
for(var/datum/player_info/I in infos)
|
||||
dat += "[I.content]%0D%0Aby [I.author] ([I.rank]) on [I.timestamp]%0D%0A%0D%0A"
|
||||
|
||||
return dat
|
||||
|
||||
+14
-14
@@ -745,7 +745,7 @@
|
||||
log_admin("[key_name(usr)] booted [key_name(M)].")
|
||||
message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1)
|
||||
//M.client = null
|
||||
del(M.client)
|
||||
qdel(M.client)
|
||||
/*
|
||||
//Player Notes
|
||||
else if(href_list["notes"])
|
||||
@@ -811,8 +811,8 @@
|
||||
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
|
||||
del(M.client)
|
||||
//del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
|
||||
qdel(M.client)
|
||||
//qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
|
||||
if("No")
|
||||
if(!check_rights(R_BAN)) return
|
||||
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
|
||||
@@ -836,8 +836,8 @@
|
||||
feedback_inc("ban_perma",1)
|
||||
DB_ban_record(BANTYPE_PERMA, M, -1, reason)
|
||||
|
||||
del(M.client)
|
||||
//del(M)
|
||||
qdel(M.client)
|
||||
//qdel(M)
|
||||
if("Cancel")
|
||||
return
|
||||
|
||||
@@ -1301,7 +1301,7 @@
|
||||
S.victim = M
|
||||
S.loc = M.loc
|
||||
spawn(20)
|
||||
del(S)
|
||||
qdel(S)
|
||||
|
||||
var/turf/simulated/floor/T = get_turf(M)
|
||||
if(istype(T))
|
||||
@@ -1424,7 +1424,7 @@
|
||||
src.owner << "\red Message reply failed."
|
||||
|
||||
spawn(100)
|
||||
del(P)
|
||||
qdel(P)
|
||||
return
|
||||
|
||||
else if(href_list["SolGovFaxReply"])
|
||||
@@ -1669,28 +1669,28 @@
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","SC")
|
||||
for(var/obj/item/clothing/under/O in world)
|
||||
del(O)
|
||||
qdel(O)
|
||||
ok = 1
|
||||
if("sec_all_clothes")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","SAC")
|
||||
for(var/obj/item/clothing/O in world)
|
||||
del(O)
|
||||
qdel(O)
|
||||
ok = 1
|
||||
if("sec_classic1")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","SC1")
|
||||
for(var/obj/item/clothing/suit/fire/O in world)
|
||||
del(O)
|
||||
qdel(O)
|
||||
for(var/obj/structure/grille/O in world)
|
||||
del(O)
|
||||
qdel(O)
|
||||
/* for(var/obj/machinery/vehicle/pod/O in world)
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = M
|
||||
del(O)
|
||||
qdel(O)
|
||||
ok = 1*/
|
||||
if("monkey")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
@@ -2044,7 +2044,7 @@
|
||||
var/turf/T = pick(blobstart)
|
||||
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
|
||||
spawn(rand(100, 600))
|
||||
del(bh)
|
||||
qdel(bh)
|
||||
|
||||
if("timeanomalies") //dear god this code was awful :P Still needs further optimisation
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
@@ -2272,7 +2272,7 @@
|
||||
feedback_add_details("admin_secrets_fun_used","NS")
|
||||
var/choice = input("You sure you want to end the round and summon narsie at your location? Misuse of this could result in removal of flags or halarity.") in list("PRAISE SATAN", "Cancel")
|
||||
if(choice == "PRAISE SATAN")
|
||||
new /obj/machinery/singularity/narsie/large(get_turf(usr))
|
||||
new /obj/singularity/narsie/large(get_turf(usr))
|
||||
message_admins("[key_name_admin(usr)] has summoned narsie and brought about a new realm of suffering.")
|
||||
if("supermattercascade")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
// if(!istates.Find(O.item_state))
|
||||
// text += "[O.type] MISSING NORMAL ICON CALLED\n\"[O.item_state]\" IN \"[O.icon]\"\n"
|
||||
//text+="\n"
|
||||
del(O)
|
||||
qdel(O)
|
||||
if(text)
|
||||
var/F = file("broken_icons.txt")
|
||||
fdel(F)
|
||||
|
||||
+497
-497
@@ -1,497 +1,497 @@
|
||||
|
||||
//Structured Datum Query Language. Basically SQL meets BYOND objects.
|
||||
|
||||
//Note: For use in BS12, need text_starts_with proc, and to modify the action on select to use BS12's object edit command(s).
|
||||
|
||||
/client/proc/SDQL_query(query_text as message)
|
||||
set category = "Admin"
|
||||
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
|
||||
message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
|
||||
var/list/query_list = SDQL_tokenize(query_text)
|
||||
|
||||
if(query_list.len < 2)
|
||||
if(query_list.len > 0)
|
||||
usr << "\red SDQL: Too few discrete tokens in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
if(!(lowertext(query_list[1]) in list("select", "delete", "update")))
|
||||
usr << "\red SDQL: Unknown query type: \"[query_list[1]]\" in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
var/list/types = list()
|
||||
|
||||
var/i
|
||||
for(i = 2; i <= query_list.len; i += 2)
|
||||
types += query_list[i]
|
||||
|
||||
if(i + 1 >= query_list.len || query_list[i + 1] != ",")
|
||||
break
|
||||
|
||||
i++
|
||||
|
||||
var/list/from = list()
|
||||
|
||||
if(i <= query_list.len)
|
||||
if(lowertext(query_list[i]) in list("from", "in"))
|
||||
for(i++; i <= query_list.len; i += 2)
|
||||
from += query_list[i]
|
||||
|
||||
if(i + 1 >= query_list.len || query_list[i + 1] != ",")
|
||||
break
|
||||
|
||||
i++
|
||||
|
||||
if(from.len < 1)
|
||||
from += "world"
|
||||
|
||||
var/list/set_vars = list()
|
||||
|
||||
if(lowertext(query_list[1]) == "update")
|
||||
if(i <= query_list.len && lowertext(query_list[i]) == "set")
|
||||
for(i++; i <= query_list.len; i++)
|
||||
if(i + 2 <= query_list.len && query_list[i + 1] == "=")
|
||||
set_vars += query_list[i]
|
||||
set_vars[query_list[i]] = query_list[i + 2]
|
||||
|
||||
else
|
||||
usr << "\red SDQL: Invalid set parameter in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
i += 3
|
||||
|
||||
if(i >= query_list.len || query_list[i] != ",")
|
||||
break
|
||||
|
||||
if(set_vars.len < 1)
|
||||
usr << "\red SDQL: Invalid or missing set in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
var/list/where = list()
|
||||
|
||||
if(i <= query_list.len && lowertext(query_list[i]) == "where")
|
||||
where = query_list.Copy(i + 1)
|
||||
|
||||
var/list/from_objs = list()
|
||||
if("world" in from)
|
||||
from_objs += world
|
||||
else
|
||||
for(var/f in from)
|
||||
if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
|
||||
from_objs += locate(copytext(f, 2, length(f)))
|
||||
else if(copytext(f, 1, 2) != "/")
|
||||
from_objs += locate(f)
|
||||
else
|
||||
var/f2 = text2path(f)
|
||||
if(text_starts_with(f, "/mob"))
|
||||
for(var/mob/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/space"))
|
||||
for(var/turf/space/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/simulated"))
|
||||
for(var/turf/simulated/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/unsimulated"))
|
||||
for(var/turf/unsimulated/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf"))
|
||||
for(var/turf/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/area"))
|
||||
for(var/area/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/item"))
|
||||
for(var/obj/item/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/machinery"))
|
||||
for(var/obj/machinery/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj"))
|
||||
for(var/obj/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/atom"))
|
||||
for(var/atom/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
/*
|
||||
else
|
||||
for(var/datum/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
*/
|
||||
|
||||
var/list/objs = list()
|
||||
|
||||
for(var/from_obj in from_objs)
|
||||
if("*" in types)
|
||||
objs += from_obj:contents
|
||||
else
|
||||
for(var/f in types)
|
||||
if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
|
||||
objs += locate(copytext(f, 2, length(f))) in from_obj
|
||||
else if(copytext(f, 1, 2) != "/")
|
||||
objs += locate(f) in from_obj
|
||||
else
|
||||
var/f2 = text2path(f)
|
||||
if(text_starts_with(f, "/mob"))
|
||||
for(var/mob/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/space"))
|
||||
for(var/turf/space/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/simulated"))
|
||||
for(var/turf/simulated/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/unsimulated"))
|
||||
for(var/turf/unsimulated/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf"))
|
||||
for(var/turf/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/area"))
|
||||
for(var/area/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/item"))
|
||||
for(var/obj/item/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/machinery"))
|
||||
for(var/obj/machinery/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj"))
|
||||
for(var/obj/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/atom"))
|
||||
for(var/atom/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else
|
||||
for(var/datum/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
|
||||
for(var/datum/t in objs)
|
||||
var/currently_false = 0
|
||||
for(i = 1, i - 1 < where.len, i++)
|
||||
var/v = where[i++]
|
||||
var/compare_op = where[i++]
|
||||
if(!(compare_op in list("==", "=", "<>", "<", ">", "<=", ">=", "!=")))
|
||||
usr << "\red SDQL: Unknown comparison operator [compare_op] in where clause following [v] in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
var/j
|
||||
for(j = i, j <= where.len, j++)
|
||||
if(lowertext(where[j]) in list("and", "or", ";"))
|
||||
break
|
||||
|
||||
if(!currently_false)
|
||||
var/value = SDQL_text2value(t, v)
|
||||
var/result = SDQL_evaluate(t, where.Copy(i, j))
|
||||
|
||||
switch(compare_op)
|
||||
if("=", "==")
|
||||
currently_false = !(value == result)
|
||||
|
||||
if("!=", "<>")
|
||||
currently_false = !(value != result)
|
||||
|
||||
if("<")
|
||||
currently_false = !(value < result)
|
||||
|
||||
if(">")
|
||||
currently_false = !(value > result)
|
||||
|
||||
if("<=")
|
||||
currently_false = !(value <= result)
|
||||
|
||||
if(">=")
|
||||
currently_false = !(value >= result)
|
||||
|
||||
|
||||
if(j > where.len || lowertext(where[j]) == ";")
|
||||
break
|
||||
else if(lowertext(where[j]) == "or")
|
||||
if(currently_false)
|
||||
currently_false = 0
|
||||
else
|
||||
break
|
||||
|
||||
i = j
|
||||
|
||||
if(currently_false)
|
||||
objs -= t
|
||||
|
||||
|
||||
|
||||
usr << "\blue SQDL Query: [query_text]"
|
||||
message_admins("[usr] executed SDQL query: \"[query_text]\".")
|
||||
/*
|
||||
for(var/t in types)
|
||||
usr << "Type: [t]"
|
||||
|
||||
for(var/t in from)
|
||||
usr << "From: [t]"
|
||||
|
||||
for(var/t in set_vars)
|
||||
usr << "Set: [t] = [set_vars[t]]"
|
||||
|
||||
if(where.len)
|
||||
var/where_str = ""
|
||||
for(var/t in where)
|
||||
where_str += "[t] "
|
||||
|
||||
usr << "Where: [where_str]"
|
||||
|
||||
usr << "From objects:"
|
||||
for(var/datum/t in from_objs)
|
||||
usr << t
|
||||
|
||||
usr << "Objects:"
|
||||
for(var/datum/t in objs)
|
||||
usr << t
|
||||
*/
|
||||
switch(lowertext(query_list[1]))
|
||||
if("delete")
|
||||
for(var/datum/t in objs)
|
||||
del t
|
||||
|
||||
if("update")
|
||||
for(var/datum/t in objs)
|
||||
objs[t] = list()
|
||||
for(var/v in set_vars)
|
||||
if(v in t.vars)
|
||||
objs[t][v] = SDQL_text2value(t, set_vars[v])
|
||||
|
||||
for(var/datum/t in objs)
|
||||
for(var/v in objs[t])
|
||||
t.vars[v] = objs[t][v]
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
for(var/datum/t in objs)
|
||||
if(istype(t, /atom))
|
||||
var/atom/a = t
|
||||
|
||||
if(a.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] at ([a.x], [a.y], [a.z])<br>"
|
||||
|
||||
else if(a.loc && a.loc.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
//text += "[t]<br>"
|
||||
usr << browse(text, "window=sdql_result")
|
||||
|
||||
|
||||
/client/Topic(href,href_list[],hsrc)
|
||||
if(href_list["SDQL_select"])
|
||||
debug_variables(locate(href_list["SDQL_select"]))
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/proc/SDQL_evaluate(datum/object, list/equation)
|
||||
if(equation.len == 0)
|
||||
return null
|
||||
|
||||
else if(equation.len == 1)
|
||||
return SDQL_text2value(object, equation[1])
|
||||
|
||||
else if(equation[1] == "!")
|
||||
return !SDQL_evaluate(object, equation.Copy(2))
|
||||
|
||||
else if(equation[1] == "-")
|
||||
return -SDQL_evaluate(object, equation.Copy(2))
|
||||
|
||||
|
||||
else
|
||||
usr << "\red SDQL: Sorry, equations not yet supported :("
|
||||
return null
|
||||
|
||||
|
||||
/proc/SDQL_text2value(datum/object, text)
|
||||
if(text2num(text) != null)
|
||||
return text2num(text)
|
||||
else if(text == "null")
|
||||
return null
|
||||
else if(copytext(text, 1, 2) == "'" || copytext(text, 1, 2) == "\"" )
|
||||
return copytext(text, 2, length(text))
|
||||
else if(copytext(text, 1, 2) == "/")
|
||||
return text2path(text)
|
||||
else
|
||||
if(findtext(text, "."))
|
||||
var/split = findtext(text, ".")
|
||||
var/v = copytext(text, 1, split)
|
||||
|
||||
if((v in object.vars) && istype(object.vars[v], /datum))
|
||||
return SDQL_text2value(object.vars[v], copytext(text, split + 1))
|
||||
else
|
||||
return null
|
||||
|
||||
else
|
||||
if(text in object.vars)
|
||||
return object.vars[text]
|
||||
else
|
||||
return null
|
||||
|
||||
|
||||
/proc/text_starts_with(text, start)
|
||||
if(copytext(text, 1, length(start) + 1) == start)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_tokenize(query_text)
|
||||
|
||||
var/list/whitespace = list(" ", "\n", "\t")
|
||||
var/list/single = list("(", ")", ",", "+", "-")
|
||||
var/list/multi = list(
|
||||
"=" = list("", "="),
|
||||
"<" = list("", "=", ">"),
|
||||
">" = list("", "="),
|
||||
"!" = list("", "="))
|
||||
|
||||
var/word = ""
|
||||
var/list/query_list = list()
|
||||
var/len = length(query_text)
|
||||
|
||||
for(var/i = 1, i <= len, i++)
|
||||
var/char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char in whitespace)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
else if(char in single)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
query_list += char
|
||||
|
||||
else if(char in multi)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
var/char2 = copytext(query_text, i + 1, i + 2)
|
||||
|
||||
if(char2 in multi[char])
|
||||
query_list += "[char][char2]"
|
||||
i++
|
||||
|
||||
else
|
||||
query_list += char
|
||||
|
||||
else if(char == "'")
|
||||
if(word != "")
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unexpected ' in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "'"
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "'"
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unmatched ' in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]'"
|
||||
word = ""
|
||||
|
||||
else if(char == "\"")
|
||||
if(word != "")
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unexpected \" in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "\""
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "\"")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "\""
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unmatched \" in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]\""
|
||||
word = ""
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(word != "")
|
||||
query_list += word
|
||||
|
||||
return query_list
|
||||
|
||||
//Structured Datum Query Language. Basically SQL meets BYOND objects.
|
||||
|
||||
//Note: For use in BS12, need text_starts_with proc, and to modify the action on select to use BS12's object edit command(s).
|
||||
|
||||
/client/proc/SDQL_query(query_text as message)
|
||||
set category = "Admin"
|
||||
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
|
||||
message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
|
||||
var/list/query_list = SDQL_tokenize(query_text)
|
||||
|
||||
if(query_list.len < 2)
|
||||
if(query_list.len > 0)
|
||||
usr << "\red SDQL: Too few discrete tokens in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
if(!(lowertext(query_list[1]) in list("select", "delete", "update")))
|
||||
usr << "\red SDQL: Unknown query type: \"[query_list[1]]\" in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
var/list/types = list()
|
||||
|
||||
var/i
|
||||
for(i = 2; i <= query_list.len; i += 2)
|
||||
types += query_list[i]
|
||||
|
||||
if(i + 1 >= query_list.len || query_list[i + 1] != ",")
|
||||
break
|
||||
|
||||
i++
|
||||
|
||||
var/list/from = list()
|
||||
|
||||
if(i <= query_list.len)
|
||||
if(lowertext(query_list[i]) in list("from", "in"))
|
||||
for(i++; i <= query_list.len; i += 2)
|
||||
from += query_list[i]
|
||||
|
||||
if(i + 1 >= query_list.len || query_list[i + 1] != ",")
|
||||
break
|
||||
|
||||
i++
|
||||
|
||||
if(from.len < 1)
|
||||
from += "world"
|
||||
|
||||
var/list/set_vars = list()
|
||||
|
||||
if(lowertext(query_list[1]) == "update")
|
||||
if(i <= query_list.len && lowertext(query_list[i]) == "set")
|
||||
for(i++; i <= query_list.len; i++)
|
||||
if(i + 2 <= query_list.len && query_list[i + 1] == "=")
|
||||
set_vars += query_list[i]
|
||||
set_vars[query_list[i]] = query_list[i + 2]
|
||||
|
||||
else
|
||||
usr << "\red SDQL: Invalid set parameter in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
i += 3
|
||||
|
||||
if(i >= query_list.len || query_list[i] != ",")
|
||||
break
|
||||
|
||||
if(set_vars.len < 1)
|
||||
usr << "\red SDQL: Invalid or missing set in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
var/list/where = list()
|
||||
|
||||
if(i <= query_list.len && lowertext(query_list[i]) == "where")
|
||||
where = query_list.Copy(i + 1)
|
||||
|
||||
var/list/from_objs = list()
|
||||
if("world" in from)
|
||||
from_objs += world
|
||||
else
|
||||
for(var/f in from)
|
||||
if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
|
||||
from_objs += locate(copytext(f, 2, length(f)))
|
||||
else if(copytext(f, 1, 2) != "/")
|
||||
from_objs += locate(f)
|
||||
else
|
||||
var/f2 = text2path(f)
|
||||
if(text_starts_with(f, "/mob"))
|
||||
for(var/mob/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/space"))
|
||||
for(var/turf/space/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/simulated"))
|
||||
for(var/turf/simulated/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/unsimulated"))
|
||||
for(var/turf/unsimulated/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf"))
|
||||
for(var/turf/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/area"))
|
||||
for(var/area/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/item"))
|
||||
for(var/obj/item/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/machinery"))
|
||||
for(var/obj/machinery/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj"))
|
||||
for(var/obj/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
|
||||
else if(text_starts_with(f, "/atom"))
|
||||
for(var/atom/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
/*
|
||||
else
|
||||
for(var/datum/m in world)
|
||||
if(istype(m, f2))
|
||||
from_objs += m
|
||||
*/
|
||||
|
||||
var/list/objs = list()
|
||||
|
||||
for(var/from_obj in from_objs)
|
||||
if("*" in types)
|
||||
objs += from_obj:contents
|
||||
else
|
||||
for(var/f in types)
|
||||
if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
|
||||
objs += locate(copytext(f, 2, length(f))) in from_obj
|
||||
else if(copytext(f, 1, 2) != "/")
|
||||
objs += locate(f) in from_obj
|
||||
else
|
||||
var/f2 = text2path(f)
|
||||
if(text_starts_with(f, "/mob"))
|
||||
for(var/mob/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/space"))
|
||||
for(var/turf/space/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/simulated"))
|
||||
for(var/turf/simulated/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf/unsimulated"))
|
||||
for(var/turf/unsimulated/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/turf"))
|
||||
for(var/turf/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/area"))
|
||||
for(var/area/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/item"))
|
||||
for(var/obj/item/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj/machinery"))
|
||||
for(var/obj/machinery/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/obj"))
|
||||
for(var/obj/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else if(text_starts_with(f, "/atom"))
|
||||
for(var/atom/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
else
|
||||
for(var/datum/m in from_obj)
|
||||
if(istype(m, f2))
|
||||
objs += m
|
||||
|
||||
|
||||
for(var/datum/t in objs)
|
||||
var/currently_false = 0
|
||||
for(i = 1, i - 1 < where.len, i++)
|
||||
var/v = where[i++]
|
||||
var/compare_op = where[i++]
|
||||
if(!(compare_op in list("==", "=", "<>", "<", ">", "<=", ">=", "!=")))
|
||||
usr << "\red SDQL: Unknown comparison operator [compare_op] in where clause following [v] in query \"[query_text]\". Please check your syntax and try again."
|
||||
return
|
||||
|
||||
var/j
|
||||
for(j = i, j <= where.len, j++)
|
||||
if(lowertext(where[j]) in list("and", "or", ";"))
|
||||
break
|
||||
|
||||
if(!currently_false)
|
||||
var/value = SDQL_text2value(t, v)
|
||||
var/result = SDQL_evaluate(t, where.Copy(i, j))
|
||||
|
||||
switch(compare_op)
|
||||
if("=", "==")
|
||||
currently_false = !(value == result)
|
||||
|
||||
if("!=", "<>")
|
||||
currently_false = !(value != result)
|
||||
|
||||
if("<")
|
||||
currently_false = !(value < result)
|
||||
|
||||
if(">")
|
||||
currently_false = !(value > result)
|
||||
|
||||
if("<=")
|
||||
currently_false = !(value <= result)
|
||||
|
||||
if(">=")
|
||||
currently_false = !(value >= result)
|
||||
|
||||
|
||||
if(j > where.len || lowertext(where[j]) == ";")
|
||||
break
|
||||
else if(lowertext(where[j]) == "or")
|
||||
if(currently_false)
|
||||
currently_false = 0
|
||||
else
|
||||
break
|
||||
|
||||
i = j
|
||||
|
||||
if(currently_false)
|
||||
objs -= t
|
||||
|
||||
|
||||
|
||||
usr << "\blue SQDL Query: [query_text]"
|
||||
message_admins("[usr] executed SDQL query: \"[query_text]\".")
|
||||
/*
|
||||
for(var/t in types)
|
||||
usr << "Type: [t]"
|
||||
|
||||
for(var/t in from)
|
||||
usr << "From: [t]"
|
||||
|
||||
for(var/t in set_vars)
|
||||
usr << "Set: [t] = [set_vars[t]]"
|
||||
|
||||
if(where.len)
|
||||
var/where_str = ""
|
||||
for(var/t in where)
|
||||
where_str += "[t] "
|
||||
|
||||
usr << "Where: [where_str]"
|
||||
|
||||
usr << "From objects:"
|
||||
for(var/datum/t in from_objs)
|
||||
usr << t
|
||||
|
||||
usr << "Objects:"
|
||||
for(var/datum/t in objs)
|
||||
usr << t
|
||||
*/
|
||||
switch(lowertext(query_list[1]))
|
||||
if("delete")
|
||||
for(var/datum/t in objs)
|
||||
qdel(t)
|
||||
|
||||
if("update")
|
||||
for(var/datum/t in objs)
|
||||
objs[t] = list()
|
||||
for(var/v in set_vars)
|
||||
if(v in t.vars)
|
||||
objs[t][v] = SDQL_text2value(t, set_vars[v])
|
||||
|
||||
for(var/datum/t in objs)
|
||||
for(var/v in objs[t])
|
||||
t.vars[v] = objs[t][v]
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
for(var/datum/t in objs)
|
||||
if(istype(t, /atom))
|
||||
var/atom/a = t
|
||||
|
||||
if(a.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] at ([a.x], [a.y], [a.z])<br>"
|
||||
|
||||
else if(a.loc && a.loc.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
//text += "[t]<br>"
|
||||
usr << browse(text, "window=sdql_result")
|
||||
|
||||
|
||||
/client/Topic(href,href_list[],hsrc)
|
||||
if(href_list["SDQL_select"])
|
||||
debug_variables(locate(href_list["SDQL_select"]))
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/proc/SDQL_evaluate(datum/object, list/equation)
|
||||
if(equation.len == 0)
|
||||
return null
|
||||
|
||||
else if(equation.len == 1)
|
||||
return SDQL_text2value(object, equation[1])
|
||||
|
||||
else if(equation[1] == "!")
|
||||
return !SDQL_evaluate(object, equation.Copy(2))
|
||||
|
||||
else if(equation[1] == "-")
|
||||
return -SDQL_evaluate(object, equation.Copy(2))
|
||||
|
||||
|
||||
else
|
||||
usr << "\red SDQL: Sorry, equations not yet supported :("
|
||||
return null
|
||||
|
||||
|
||||
/proc/SDQL_text2value(datum/object, text)
|
||||
if(text2num(text) != null)
|
||||
return text2num(text)
|
||||
else if(text == "null")
|
||||
return null
|
||||
else if(copytext(text, 1, 2) == "'" || copytext(text, 1, 2) == "\"" )
|
||||
return copytext(text, 2, length(text))
|
||||
else if(copytext(text, 1, 2) == "/")
|
||||
return text2path(text)
|
||||
else
|
||||
if(findtext(text, "."))
|
||||
var/split = findtext(text, ".")
|
||||
var/v = copytext(text, 1, split)
|
||||
|
||||
if((v in object.vars) && istype(object.vars[v], /datum))
|
||||
return SDQL_text2value(object.vars[v], copytext(text, split + 1))
|
||||
else
|
||||
return null
|
||||
|
||||
else
|
||||
if(text in object.vars)
|
||||
return object.vars[text]
|
||||
else
|
||||
return null
|
||||
|
||||
|
||||
/proc/text_starts_with(text, start)
|
||||
if(copytext(text, 1, length(start) + 1) == start)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_tokenize(query_text)
|
||||
|
||||
var/list/whitespace = list(" ", "\n", "\t")
|
||||
var/list/single = list("(", ")", ",", "+", "-")
|
||||
var/list/multi = list(
|
||||
"=" = list("", "="),
|
||||
"<" = list("", "=", ">"),
|
||||
">" = list("", "="),
|
||||
"!" = list("", "="))
|
||||
|
||||
var/word = ""
|
||||
var/list/query_list = list()
|
||||
var/len = length(query_text)
|
||||
|
||||
for(var/i = 1, i <= len, i++)
|
||||
var/char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char in whitespace)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
else if(char in single)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
query_list += char
|
||||
|
||||
else if(char in multi)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
var/char2 = copytext(query_text, i + 1, i + 2)
|
||||
|
||||
if(char2 in multi[char])
|
||||
query_list += "[char][char2]"
|
||||
i++
|
||||
|
||||
else
|
||||
query_list += char
|
||||
|
||||
else if(char == "'")
|
||||
if(word != "")
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unexpected ' in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "'"
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "'"
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unmatched ' in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]'"
|
||||
word = ""
|
||||
|
||||
else if(char == "\"")
|
||||
if(word != "")
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unexpected \" in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "\""
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "\"")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "\""
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL: You have an error in your SDQL syntax, unmatched \" in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]\""
|
||||
word = ""
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(word != "")
|
||||
query_list += word
|
||||
|
||||
return query_list
|
||||
|
||||
+426
-426
@@ -1,426 +1,426 @@
|
||||
|
||||
|
||||
/client/proc/SDQL2_query(query_text as message)
|
||||
set category = "Admin"
|
||||
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
|
||||
message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
|
||||
if(!query_text || length(query_text) < 1)
|
||||
return
|
||||
|
||||
//world << query_text
|
||||
|
||||
var/list/query_list = SDQL2_tokenize(query_text)
|
||||
|
||||
if(!query_list || query_list.len < 1)
|
||||
return
|
||||
|
||||
var/list/query_tree = SDQL_parse(query_list)
|
||||
|
||||
if(query_tree.len < 1)
|
||||
return
|
||||
|
||||
var/list/from_objs = list()
|
||||
var/list/select_types = list()
|
||||
|
||||
switch(query_tree[1])
|
||||
if("explain")
|
||||
SDQL_testout(query_tree["explain"])
|
||||
return
|
||||
|
||||
if("call")
|
||||
if("on" in query_tree)
|
||||
select_types = query_tree["on"]
|
||||
else
|
||||
return
|
||||
|
||||
if("select", "delete", "update")
|
||||
select_types = query_tree[query_tree[1]]
|
||||
|
||||
from_objs = SDQL_from_objs(query_tree["from"])
|
||||
|
||||
var/list/objs = list()
|
||||
|
||||
for(var/type in select_types)
|
||||
var/char = copytext(type, 1, 2)
|
||||
|
||||
if(char == "/" || char == "*")
|
||||
for(var/from in from_objs)
|
||||
objs += SDQL_get_all(type, from)
|
||||
|
||||
else if(char == "'" || char == "\"")
|
||||
objs += locate(copytext(type, 2, length(type)))
|
||||
|
||||
if("where" in query_tree)
|
||||
var/objs_temp = objs
|
||||
objs = list()
|
||||
for(var/datum/d in objs_temp)
|
||||
if(SDQL_expression(d, query_tree["where"]))
|
||||
objs += d
|
||||
|
||||
//usr << "Query: [query_text]"
|
||||
message_admins("[usr] executed SDQL query: \"[query_text]\".")
|
||||
|
||||
switch(query_tree[1])
|
||||
if("delete")
|
||||
for(var/datum/d in objs)
|
||||
del d
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
for(var/datum/t in objs)
|
||||
if(istype(t, /atom))
|
||||
var/atom/a = t
|
||||
|
||||
if(a.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] at ([a.x], [a.y], [a.z])<br>"
|
||||
|
||||
else if(a.loc && a.loc.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
usr << browse(text, "window=SDQL-result")
|
||||
|
||||
if("update")
|
||||
if("set" in query_tree)
|
||||
var/list/set_list = query_tree["set"]
|
||||
for(var/datum/d in objs)
|
||||
var/list/vals = list()
|
||||
for(var/v in set_list)
|
||||
if(v in d.vars)
|
||||
vals += v
|
||||
vals[v] = SDQL_expression(d, set_list[v])
|
||||
|
||||
if(istype(d, /turf))
|
||||
for(var/v in vals)
|
||||
if(v == "x" || v == "y" || v == "z")
|
||||
continue
|
||||
|
||||
d.vars[v] = vals[v]
|
||||
|
||||
else
|
||||
for(var/v in vals)
|
||||
d.vars[v] = vals[v]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_parse(list/query_list)
|
||||
var/datum/SDQL_parser/parser = new(query_list)
|
||||
var/list/query_tree = parser.parse()
|
||||
|
||||
del(parser)
|
||||
|
||||
return query_tree
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_testout(list/query_tree, indent = 0)
|
||||
var/spaces = ""
|
||||
for(var/s = 0, s < indent, s++)
|
||||
spaces += " "
|
||||
|
||||
for(var/item in query_tree)
|
||||
if(istype(item, /list))
|
||||
world << "[spaces]("
|
||||
SDQL_testout(item, indent + 1)
|
||||
world << "[spaces])"
|
||||
|
||||
else
|
||||
world << "[spaces][item]"
|
||||
|
||||
if(!isnum(item) && query_tree[item])
|
||||
|
||||
if(istype(query_tree[item], /list))
|
||||
world << "[spaces] ("
|
||||
SDQL_testout(query_tree[item], indent + 2)
|
||||
world << "[spaces] )"
|
||||
|
||||
else
|
||||
world << "[spaces] [query_tree[item]]"
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_from_objs(list/tree)
|
||||
if("world" in tree)
|
||||
return list(world)
|
||||
|
||||
var/list/out = list()
|
||||
|
||||
for(var/type in tree)
|
||||
var/char = copytext(type, 1, 2)
|
||||
|
||||
if(char == "/")
|
||||
out += SDQL_get_all(type, world)
|
||||
|
||||
else if(char == "'" || char == "\"")
|
||||
out += locate(copytext(type, 2, length(type)))
|
||||
|
||||
return out
|
||||
|
||||
|
||||
/proc/SDQL_get_all(type, location)
|
||||
var/list/out = list()
|
||||
|
||||
if(type == "*")
|
||||
for(var/datum/d in location)
|
||||
out += d
|
||||
|
||||
return out
|
||||
|
||||
type = text2path(type)
|
||||
|
||||
if(ispath(type, /mob))
|
||||
for(var/mob/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /turf))
|
||||
for(var/turf/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /obj))
|
||||
for(var/obj/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /area))
|
||||
for(var/area/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /atom))
|
||||
for(var/atom/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else
|
||||
for(var/datum/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
return out
|
||||
|
||||
|
||||
/proc/SDQL_expression(datum/object, list/expression, start = 1)
|
||||
var/result = 0
|
||||
var/val
|
||||
|
||||
for(var/i = start, i <= expression.len, i++)
|
||||
var/op = ""
|
||||
|
||||
if(i > start)
|
||||
op = expression[i]
|
||||
i++
|
||||
|
||||
var/list/ret = SDQL_value(object, expression, i)
|
||||
val = ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
if(op != "")
|
||||
switch(op)
|
||||
if("+")
|
||||
result += val
|
||||
if("-")
|
||||
result -= val
|
||||
if("*")
|
||||
result *= val
|
||||
if("/")
|
||||
result /= val
|
||||
if("&")
|
||||
result &= val
|
||||
if("|")
|
||||
result |= val
|
||||
if("^")
|
||||
result ^= val
|
||||
if("=", "==")
|
||||
result = (result == val)
|
||||
if("!=", "<>")
|
||||
result = (result != val)
|
||||
if("<")
|
||||
result = (result < val)
|
||||
if("<=")
|
||||
result = (result <= val)
|
||||
if(">")
|
||||
result = (result > val)
|
||||
if(">=")
|
||||
result = (result >= val)
|
||||
if("and", "&&")
|
||||
result = (result && val)
|
||||
if("or", "||")
|
||||
result = (result || val)
|
||||
else
|
||||
usr << "\red SDQL2: Unknown op [op]"
|
||||
result = null
|
||||
else
|
||||
result = val
|
||||
|
||||
return result
|
||||
|
||||
/proc/SDQL_value(datum/object, list/expression, start = 1)
|
||||
var/i = start
|
||||
var/val = null
|
||||
|
||||
if(i > expression.len)
|
||||
return list("val" = null, "i" = i)
|
||||
|
||||
if(istype(expression[i], /list))
|
||||
val = SDQL_expression(object, expression[i])
|
||||
|
||||
else if(expression[i] == "!")
|
||||
var/list/ret = SDQL_value(object, expression, i + 1)
|
||||
val = !ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
else if(expression[i] == "~")
|
||||
var/list/ret = SDQL_value(object, expression, i + 1)
|
||||
val = ~ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
else if(expression[i] == "-")
|
||||
var/list/ret = SDQL_value(object, expression, i + 1)
|
||||
val = -ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
else if(expression[i] == "null")
|
||||
val = null
|
||||
|
||||
else if(isnum(expression[i]))
|
||||
val = expression[i]
|
||||
|
||||
else if(copytext(expression[i], 1, 2) in list("'", "\""))
|
||||
val = copytext(expression[i], 2, length(expression[i]))
|
||||
|
||||
else
|
||||
val = SDQL_var(object, expression, i)
|
||||
i = expression.len
|
||||
|
||||
return list("val" = val, "i" = i)
|
||||
|
||||
/proc/SDQL_var(datum/object, list/expression, start = 1)
|
||||
|
||||
if(expression[start] in object.vars)
|
||||
|
||||
if(start < expression.len && expression[start + 1] == ".")
|
||||
return SDQL_var(object.vars[expression[start]], expression[start + 2])
|
||||
|
||||
else
|
||||
return object.vars[expression[start]]
|
||||
|
||||
else
|
||||
return null
|
||||
|
||||
/proc/SDQL2_tokenize(query_text)
|
||||
|
||||
var/list/whitespace = list(" ", "\n", "\t")
|
||||
var/list/single = list("(", ")", ",", "+", "-", ".")
|
||||
var/list/multi = list(
|
||||
"=" = list("", "="),
|
||||
"<" = list("", "=", ">"),
|
||||
">" = list("", "="),
|
||||
"!" = list("", "="))
|
||||
|
||||
var/word = ""
|
||||
var/list/query_list = list()
|
||||
var/len = length(query_text)
|
||||
|
||||
for(var/i = 1, i <= len, i++)
|
||||
var/char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char in whitespace)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
else if(char in single)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
query_list += char
|
||||
|
||||
else if(char in multi)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
var/char2 = copytext(query_text, i + 1, i + 2)
|
||||
|
||||
if(char2 in multi[char])
|
||||
query_list += "[char][char2]"
|
||||
i++
|
||||
|
||||
else
|
||||
query_list += char
|
||||
|
||||
else if(char == "'")
|
||||
if(word != "")
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected ' in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "'"
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "'"
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched ' in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]'"
|
||||
word = ""
|
||||
|
||||
else if(char == "\"")
|
||||
if(word != "")
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected \" in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "\""
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "\"")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "\""
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched \" in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]\""
|
||||
word = ""
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(word != "")
|
||||
query_list += word
|
||||
|
||||
return query_list
|
||||
|
||||
|
||||
/client/proc/SDQL2_query(query_text as message)
|
||||
set category = "Admin"
|
||||
if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
|
||||
message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
|
||||
|
||||
if(!query_text || length(query_text) < 1)
|
||||
return
|
||||
|
||||
//world << query_text
|
||||
|
||||
var/list/query_list = SDQL2_tokenize(query_text)
|
||||
|
||||
if(!query_list || query_list.len < 1)
|
||||
return
|
||||
|
||||
var/list/query_tree = SDQL_parse(query_list)
|
||||
|
||||
if(query_tree.len < 1)
|
||||
return
|
||||
|
||||
var/list/from_objs = list()
|
||||
var/list/select_types = list()
|
||||
|
||||
switch(query_tree[1])
|
||||
if("explain")
|
||||
SDQL_testout(query_tree["explain"])
|
||||
return
|
||||
|
||||
if("call")
|
||||
if("on" in query_tree)
|
||||
select_types = query_tree["on"]
|
||||
else
|
||||
return
|
||||
|
||||
if("select", "delete", "update")
|
||||
select_types = query_tree[query_tree[1]]
|
||||
|
||||
from_objs = SDQL_from_objs(query_tree["from"])
|
||||
|
||||
var/list/objs = list()
|
||||
|
||||
for(var/type in select_types)
|
||||
var/char = copytext(type, 1, 2)
|
||||
|
||||
if(char == "/" || char == "*")
|
||||
for(var/from in from_objs)
|
||||
objs += SDQL_get_all(type, from)
|
||||
|
||||
else if(char == "'" || char == "\"")
|
||||
objs += locate(copytext(type, 2, length(type)))
|
||||
|
||||
if("where" in query_tree)
|
||||
var/objs_temp = objs
|
||||
objs = list()
|
||||
for(var/datum/d in objs_temp)
|
||||
if(SDQL_expression(d, query_tree["where"]))
|
||||
objs += d
|
||||
|
||||
//usr << "Query: [query_text]"
|
||||
message_admins("[usr] executed SDQL query: \"[query_text]\".")
|
||||
|
||||
switch(query_tree[1])
|
||||
if("delete")
|
||||
for(var/datum/d in objs)
|
||||
qdel(d)
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
for(var/datum/t in objs)
|
||||
if(istype(t, /atom))
|
||||
var/atom/a = t
|
||||
|
||||
if(a.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] at ([a.x], [a.y], [a.z])<br>"
|
||||
|
||||
else if(a.loc && a.loc.x)
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
else
|
||||
text += "<a href='?src=\ref[t];SDQL_select=\ref[t]'>\ref[t]</a>: [t]<br>"
|
||||
|
||||
usr << browse(text, "window=SDQL-result")
|
||||
|
||||
if("update")
|
||||
if("set" in query_tree)
|
||||
var/list/set_list = query_tree["set"]
|
||||
for(var/datum/d in objs)
|
||||
var/list/vals = list()
|
||||
for(var/v in set_list)
|
||||
if(v in d.vars)
|
||||
vals += v
|
||||
vals[v] = SDQL_expression(d, set_list[v])
|
||||
|
||||
if(istype(d, /turf))
|
||||
for(var/v in vals)
|
||||
if(v == "x" || v == "y" || v == "z")
|
||||
continue
|
||||
|
||||
d.vars[v] = vals[v]
|
||||
|
||||
else
|
||||
for(var/v in vals)
|
||||
d.vars[v] = vals[v]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_parse(list/query_list)
|
||||
var/datum/SDQL_parser/parser = new(query_list)
|
||||
var/list/query_tree = parser.parse()
|
||||
|
||||
qdel(parser)
|
||||
|
||||
return query_tree
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_testout(list/query_tree, indent = 0)
|
||||
var/spaces = ""
|
||||
for(var/s = 0, s < indent, s++)
|
||||
spaces += " "
|
||||
|
||||
for(var/item in query_tree)
|
||||
if(istype(item, /list))
|
||||
world << "[spaces]("
|
||||
SDQL_testout(item, indent + 1)
|
||||
world << "[spaces])"
|
||||
|
||||
else
|
||||
world << "[spaces][item]"
|
||||
|
||||
if(!isnum(item) && query_tree[item])
|
||||
|
||||
if(istype(query_tree[item], /list))
|
||||
world << "[spaces] ("
|
||||
SDQL_testout(query_tree[item], indent + 2)
|
||||
world << "[spaces] )"
|
||||
|
||||
else
|
||||
world << "[spaces] [query_tree[item]]"
|
||||
|
||||
|
||||
|
||||
/proc/SDQL_from_objs(list/tree)
|
||||
if("world" in tree)
|
||||
return list(world)
|
||||
|
||||
var/list/out = list()
|
||||
|
||||
for(var/type in tree)
|
||||
var/char = copytext(type, 1, 2)
|
||||
|
||||
if(char == "/")
|
||||
out += SDQL_get_all(type, world)
|
||||
|
||||
else if(char == "'" || char == "\"")
|
||||
out += locate(copytext(type, 2, length(type)))
|
||||
|
||||
return out
|
||||
|
||||
|
||||
/proc/SDQL_get_all(type, location)
|
||||
var/list/out = list()
|
||||
|
||||
if(type == "*")
|
||||
for(var/datum/d in location)
|
||||
out += d
|
||||
|
||||
return out
|
||||
|
||||
type = text2path(type)
|
||||
|
||||
if(ispath(type, /mob))
|
||||
for(var/mob/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /turf))
|
||||
for(var/turf/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /obj))
|
||||
for(var/obj/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /area))
|
||||
for(var/area/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else if(ispath(type, /atom))
|
||||
for(var/atom/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
else
|
||||
for(var/datum/d in location)
|
||||
if(istype(d, type))
|
||||
out += d
|
||||
|
||||
return out
|
||||
|
||||
|
||||
/proc/SDQL_expression(datum/object, list/expression, start = 1)
|
||||
var/result = 0
|
||||
var/val
|
||||
|
||||
for(var/i = start, i <= expression.len, i++)
|
||||
var/op = ""
|
||||
|
||||
if(i > start)
|
||||
op = expression[i]
|
||||
i++
|
||||
|
||||
var/list/ret = SDQL_value(object, expression, i)
|
||||
val = ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
if(op != "")
|
||||
switch(op)
|
||||
if("+")
|
||||
result += val
|
||||
if("-")
|
||||
result -= val
|
||||
if("*")
|
||||
result *= val
|
||||
if("/")
|
||||
result /= val
|
||||
if("&")
|
||||
result &= val
|
||||
if("|")
|
||||
result |= val
|
||||
if("^")
|
||||
result ^= val
|
||||
if("=", "==")
|
||||
result = (result == val)
|
||||
if("!=", "<>")
|
||||
result = (result != val)
|
||||
if("<")
|
||||
result = (result < val)
|
||||
if("<=")
|
||||
result = (result <= val)
|
||||
if(">")
|
||||
result = (result > val)
|
||||
if(">=")
|
||||
result = (result >= val)
|
||||
if("and", "&&")
|
||||
result = (result && val)
|
||||
if("or", "||")
|
||||
result = (result || val)
|
||||
else
|
||||
usr << "\red SDQL2: Unknown op [op]"
|
||||
result = null
|
||||
else
|
||||
result = val
|
||||
|
||||
return result
|
||||
|
||||
/proc/SDQL_value(datum/object, list/expression, start = 1)
|
||||
var/i = start
|
||||
var/val = null
|
||||
|
||||
if(i > expression.len)
|
||||
return list("val" = null, "i" = i)
|
||||
|
||||
if(istype(expression[i], /list))
|
||||
val = SDQL_expression(object, expression[i])
|
||||
|
||||
else if(expression[i] == "!")
|
||||
var/list/ret = SDQL_value(object, expression, i + 1)
|
||||
val = !ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
else if(expression[i] == "~")
|
||||
var/list/ret = SDQL_value(object, expression, i + 1)
|
||||
val = ~ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
else if(expression[i] == "-")
|
||||
var/list/ret = SDQL_value(object, expression, i + 1)
|
||||
val = -ret["val"]
|
||||
i = ret["i"]
|
||||
|
||||
else if(expression[i] == "null")
|
||||
val = null
|
||||
|
||||
else if(isnum(expression[i]))
|
||||
val = expression[i]
|
||||
|
||||
else if(copytext(expression[i], 1, 2) in list("'", "\""))
|
||||
val = copytext(expression[i], 2, length(expression[i]))
|
||||
|
||||
else
|
||||
val = SDQL_var(object, expression, i)
|
||||
i = expression.len
|
||||
|
||||
return list("val" = val, "i" = i)
|
||||
|
||||
/proc/SDQL_var(datum/object, list/expression, start = 1)
|
||||
|
||||
if(expression[start] in object.vars)
|
||||
|
||||
if(start < expression.len && expression[start + 1] == ".")
|
||||
return SDQL_var(object.vars[expression[start]], expression[start + 2])
|
||||
|
||||
else
|
||||
return object.vars[expression[start]]
|
||||
|
||||
else
|
||||
return null
|
||||
|
||||
/proc/SDQL2_tokenize(query_text)
|
||||
|
||||
var/list/whitespace = list(" ", "\n", "\t")
|
||||
var/list/single = list("(", ")", ",", "+", "-", ".")
|
||||
var/list/multi = list(
|
||||
"=" = list("", "="),
|
||||
"<" = list("", "=", ">"),
|
||||
">" = list("", "="),
|
||||
"!" = list("", "="))
|
||||
|
||||
var/word = ""
|
||||
var/list/query_list = list()
|
||||
var/len = length(query_text)
|
||||
|
||||
for(var/i = 1, i <= len, i++)
|
||||
var/char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char in whitespace)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
else if(char in single)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
query_list += char
|
||||
|
||||
else if(char in multi)
|
||||
if(word != "")
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
var/char2 = copytext(query_text, i + 1, i + 2)
|
||||
|
||||
if(char2 in multi[char])
|
||||
query_list += "[char][char2]"
|
||||
i++
|
||||
|
||||
else
|
||||
query_list += char
|
||||
|
||||
else if(char == "'")
|
||||
if(word != "")
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected ' in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "'"
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "'"
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched ' in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]'"
|
||||
word = ""
|
||||
|
||||
else if(char == "\"")
|
||||
if(word != "")
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected \" in query: \"<font color=gray>[query_text]</font>\" following \"<font color=gray>[word]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
word = "\""
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "\"")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "\""
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(i > len)
|
||||
usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched \" in query: \"<font color=gray>[query_text]</font>\". Please check your syntax, and try again."
|
||||
return null
|
||||
|
||||
query_list += "[word]\""
|
||||
word = ""
|
||||
|
||||
else
|
||||
word += char
|
||||
|
||||
if(word != "")
|
||||
query_list += word
|
||||
|
||||
return query_list
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
M.client.show_popup_menus = 1
|
||||
for(var/obj/effect/bmode/buildholder/H)
|
||||
if(H.cl == M.client)
|
||||
del(H)
|
||||
qdel(H)
|
||||
else
|
||||
log_admin("[key_name(usr)] has entered build mode.")
|
||||
M.client.buildmode = 1
|
||||
@@ -220,7 +220,7 @@
|
||||
T.ChangeTurf(/turf/simulated/wall)
|
||||
return
|
||||
else if(istype(object,/obj))
|
||||
del(object)
|
||||
qdel(object)
|
||||
return
|
||||
else if(istype(object,/turf) && pa.Find("alt") && pa.Find("left"))
|
||||
new/obj/machinery/door/airlock(get_turf(object))
|
||||
@@ -250,7 +250,7 @@
|
||||
var/obj/A = new holder.buildmode.objholder (get_turf(object))
|
||||
A.set_dir(holder.builddir.dir)
|
||||
else if(pa.Find("right"))
|
||||
if(isobj(object)) del(object)
|
||||
if(isobj(object)) qdel(object)
|
||||
if(pa.Find("middle"))
|
||||
holder.buildmode.objholder = text2path("[object.type]")
|
||||
if(holder.buildmode.objsay) usr << "[object.type]"
|
||||
|
||||
@@ -350,7 +350,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(hsbitem)
|
||||
for(var/atom/O in world)
|
||||
if(istype(O, hsbitem))
|
||||
del(O)
|
||||
qdel(O)
|
||||
log_admin("[key_name(src)] has deleted all instances of [hsbitem].")
|
||||
message_admins("[key_name_admin(src)] has deleted all instances of [hsbitem].", 0)
|
||||
feedback_add_details("admin_verb","DELA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -420,7 +420,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
var/mob/adminmob = src.mob
|
||||
M.ckey = src.ckey
|
||||
if( isobserver(adminmob) )
|
||||
del(adminmob)
|
||||
qdel(adminmob)
|
||||
feedback_add_details("admin_verb","ADC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -555,7 +555,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
for (var/obj/item/I in M)
|
||||
if (istype(I, /obj/item/weapon/implant))
|
||||
continue
|
||||
del(I)
|
||||
qdel(I)
|
||||
switch(dresscode)
|
||||
if ("strip")
|
||||
//do nothing
|
||||
@@ -614,7 +614,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
|
||||
var/obj/item/weapon/storage/backpack/backpack = new(M)
|
||||
for(var/obj/item/I in backpack)
|
||||
del(I)
|
||||
qdel(I)
|
||||
M.equip_to_slot_or_del(backpack, slot_back)
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/mop(M), slot_r_hand)
|
||||
@@ -705,7 +705,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
var/obj/item/weapon/storage/secure/briefcase/sec_briefcase = new(M)
|
||||
for(var/obj/item/briefcase_item in sec_briefcase)
|
||||
del(briefcase_item)
|
||||
qdel(briefcase_item)
|
||||
for(var/i=3, i>0, i--)
|
||||
sec_briefcase.contents += new /obj/item/weapon/spacecash/c1000
|
||||
sec_briefcase.contents += new /obj/item/weapon/gun/energy/crossbow
|
||||
@@ -927,9 +927,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
spawn(30)
|
||||
for(var/obj/machinery/the_singularitygen/G in world)
|
||||
if(G.anchored)
|
||||
var/obj/machinery/singularity/S = new /obj/machinery/singularity(get_turf(G), 50)
|
||||
var/obj/singularity/S = new /obj/singularity(get_turf(G), 50)
|
||||
spawn(0)
|
||||
del(G)
|
||||
qdel(G)
|
||||
S.energy = 1750
|
||||
S.current_size = 7
|
||||
S.icon = 'icons/effects/224x224.dmi'
|
||||
|
||||
@@ -55,7 +55,7 @@ var/intercom_range_display_status = 0
|
||||
|
||||
|
||||
for(var/obj/effect/debugging/camera_range/C in world)
|
||||
del(C)
|
||||
qdel(C)
|
||||
|
||||
if(camera_range_display_status)
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
@@ -114,14 +114,14 @@ var/intercom_range_display_status = 0
|
||||
intercom_range_display_status = 1
|
||||
|
||||
for(var/obj/effect/debugging/marker/M in world)
|
||||
del(M)
|
||||
qdel(M)
|
||||
|
||||
if(intercom_range_display_status)
|
||||
for(var/obj/item/device/radio/intercom/I in world)
|
||||
for(var/turf/T in orange(7,I))
|
||||
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
|
||||
if (!(F in view(7,I.loc)))
|
||||
del(F)
|
||||
qdel(F)
|
||||
feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
var/list/debug_verbs = list (
|
||||
@@ -276,7 +276,7 @@ var/list/debug_verbs = list (
|
||||
var/datum/controller/air_system/old_air = air_master
|
||||
for(var/zone/zone in old_air.zones)
|
||||
zone.c_invalidate()
|
||||
del old_air
|
||||
qdel(old_air)
|
||||
air_master = new
|
||||
air_master.Setup()
|
||||
spawn air_master.Start()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set name = "Possess Obj"
|
||||
set category = "Object"
|
||||
|
||||
if(istype(O,/obj/machinery/singularity))
|
||||
if(istype(O,/obj/singularity))
|
||||
if(config.forbid_singulo_possession)
|
||||
usr << "It is forbidden to possess singularities."
|
||||
return
|
||||
|
||||
@@ -686,7 +686,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=[mins]&server=[replacetext(config.server_name, "#", "")]")
|
||||
del(M.client)
|
||||
del(M)
|
||||
qdel(M)
|
||||
else
|
||||
|
||||
if("No")
|
||||
@@ -701,7 +701,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
|
||||
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=perma&server=[replacetext(config.server_name, "#", "")]")
|
||||
del(M.client)
|
||||
del(M)
|
||||
qdel(M)
|
||||
*/
|
||||
|
||||
/client/proc/update_world()
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
bombtank.master = null
|
||||
bombtank = null
|
||||
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if((istype(W, /obj/item/weapon/weldingtool) && W:welding))
|
||||
if(!status)
|
||||
@@ -144,8 +144,8 @@
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
if(master)
|
||||
del(master)
|
||||
del(src)
|
||||
qdel(master)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
|
||||
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles)
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
a_right:holder = null
|
||||
a_right.loc = T
|
||||
spawn(0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
on = 0
|
||||
if(first) del(first)
|
||||
if(first) qdel(first)
|
||||
processing_objects.Remove(src)
|
||||
update_icon()
|
||||
return secured
|
||||
@@ -53,7 +53,7 @@
|
||||
process()//Old code
|
||||
if(!on)
|
||||
if(first)
|
||||
del(first)
|
||||
qdel(first)
|
||||
return
|
||||
|
||||
if((!(first) && (secured && (istype(loc, /turf) || (holder && istype(holder.loc, /turf))))))
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
|
||||
attack_hand()
|
||||
del(first)
|
||||
qdel(first)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -86,14 +86,14 @@
|
||||
var/t = dir
|
||||
..()
|
||||
set_dir(t)
|
||||
del(first)
|
||||
qdel(first)
|
||||
return
|
||||
|
||||
|
||||
holder_movement()
|
||||
if(!holder) return 0
|
||||
// set_dir(holder.dir)
|
||||
del(first)
|
||||
qdel(first)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
if(master)
|
||||
//world << "beam hit \ref[src]: calling master \ref[master].hit"
|
||||
master.trigger_beam()
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/effect/beam/i_beam/proc/vis_spread(v)
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
if((loc.density || !(master)))
|
||||
// world << "beam hit loc [loc] or no master [master], deleting"
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
//world << "proccess: [src.left] left"
|
||||
|
||||
@@ -233,17 +233,17 @@
|
||||
return
|
||||
else
|
||||
//world << "is a next: \ref[next], deleting beam \ref[I]"
|
||||
del(I)
|
||||
qdel(I)
|
||||
else
|
||||
//world << "step failed, deleting \ref[next]"
|
||||
del(next)
|
||||
qdel(next)
|
||||
spawn(10)
|
||||
process()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/effect/beam/i_beam/Bump()
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/effect/beam/i_beam/Bumped()
|
||||
@@ -258,7 +258,10 @@
|
||||
return
|
||||
return
|
||||
|
||||
/obj/effect/beam/i_beam/Del()
|
||||
del(next)
|
||||
/obj/effect/beam/i_beam/Destroy()
|
||||
if(master.first == src)
|
||||
master.first = null
|
||||
if(next)
|
||||
qdel(next)
|
||||
next = null
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
w_class = 5.0
|
||||
flags = CONDUCT
|
||||
|
||||
/obj/item/assembly/shock_kit/Del()
|
||||
del(part1)
|
||||
del(part2)
|
||||
/obj/item/assembly/shock_kit/Destroy()
|
||||
qdel(part1)
|
||||
qdel(part2)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
part2.master = null
|
||||
part1 = null
|
||||
part2 = null
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
status = !status
|
||||
|
||||
@@ -141,6 +141,8 @@
|
||||
|
||||
|
||||
proc/set_frequency(new_frequency)
|
||||
if(!frequency)
|
||||
return
|
||||
if(!radio_controller)
|
||||
sleep(20)
|
||||
if(!radio_controller)
|
||||
@@ -171,3 +173,9 @@
|
||||
processing_objects.Add(src)
|
||||
log_and_message_admins("is threatening to trigger a signaler deadman's switch")
|
||||
usr.visible_message("\red [usr] moves their finger over [src]'s signal button...")
|
||||
|
||||
/obj/item/device/assembly/signaler/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
frequency = 0
|
||||
..()
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
W.assignment = corpseidjob
|
||||
W.registered_name = M.real_name
|
||||
M.equip_to_slot_or_del(W, slot_wear_id)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
continue
|
||||
|
||||
new loot_path(get_turf(src))
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
if(M.client)
|
||||
M << "<span class='info'>[message]</span>"
|
||||
if(once)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/step_trigger/teleport_fancy
|
||||
var/locationx
|
||||
@@ -41,4 +41,4 @@
|
||||
|
||||
uses--
|
||||
if(uses == 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
@@ -33,7 +33,7 @@
|
||||
if( findtext(href,"<script",1,0) )
|
||||
world.log << "Attempted use of scripts within a topic call, by [src]"
|
||||
message_admins("Attempted use of scripts within a topic call, by [src]")
|
||||
//del(usr)
|
||||
//qdel(usr)
|
||||
return
|
||||
|
||||
//Admin PM
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
if(!config.guests_allowed && IsGuestKey(key))
|
||||
alert(src,"This server doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// Change the way they should download resources.
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
O = (H.l_ear == src ? H.r_ear : H.l_ear)
|
||||
user.u_equip(O)
|
||||
if(!istype(src,/obj/item/clothing/ears/offear))
|
||||
del(O)
|
||||
qdel(O)
|
||||
O = src
|
||||
else
|
||||
O = src
|
||||
@@ -129,7 +129,7 @@
|
||||
O.add_fingerprint(user)
|
||||
|
||||
if(istype(src,/obj/item/clothing/ears/offear))
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/clothing/ears/update_clothing_icon()
|
||||
if (ismob(src.loc))
|
||||
@@ -486,17 +486,18 @@ BLIND // can't see anything
|
||||
if (!(src.loc == usr))
|
||||
return
|
||||
|
||||
if (!( usr.restrained() ) && !( usr.stat ))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
usr.u_equip(src)
|
||||
usr.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
usr.u_equip(src)
|
||||
usr.put_in_l_hand(src)
|
||||
src.add_fingerprint(usr)
|
||||
if (( usr.restrained() ) || ( usr.stat ))
|
||||
return
|
||||
return
|
||||
|
||||
if (!usr.unEquip(src))
|
||||
return
|
||||
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
usr.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
usr.put_in_l_hand(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
/obj/item/clothing/under/examine(mob/user)
|
||||
..(user)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
item_state = "balaclava"
|
||||
flags = BLOCKHAIR
|
||||
flags_inv = HIDEFACE
|
||||
body_parts_covered = FACE
|
||||
body_parts_covered = FACE|HEAD
|
||||
w_class = 2
|
||||
sprite_sheets = list(
|
||||
"Tajara" = 'icons/mob/species/tajaran/helmet.dmi',
|
||||
|
||||
@@ -15,26 +15,34 @@
|
||||
|
||||
var/hanging = 0
|
||||
|
||||
verb/toggle()
|
||||
/obj/item/clothing/mask/breath/proc/adjust_mask(mob/user)
|
||||
if(user.canmove && !user.stat)
|
||||
if(!src.hanging)
|
||||
src.hanging = !src.hanging
|
||||
gas_transfer_coefficient = 1 //gas is now escaping to the turf and vice versa
|
||||
flags &= ~(MASKCOVERSMOUTH | AIRTIGHT)
|
||||
body_parts_covered = 0
|
||||
icon_state = "breathdown"
|
||||
user << "Your mask is now hanging on your neck."
|
||||
|
||||
else
|
||||
src.hanging = !src.hanging
|
||||
gas_transfer_coefficient = initial(gas_transfer_coefficient)
|
||||
flags |= MASKCOVERSMOUTH | AIRTIGHT
|
||||
body_parts_covered = initial(body_parts_covered)
|
||||
icon_state = "breath"
|
||||
user << "You pull the mask up to cover your face."
|
||||
update_clothing_icon()
|
||||
|
||||
/obj/item/clothing/mask/breath/attack_self(mob/user)
|
||||
adjust_mask(user)
|
||||
|
||||
/obj/item/clothing/mask/breath/verb/toggle()
|
||||
set category = "Object"
|
||||
set name = "Adjust mask"
|
||||
set src in usr
|
||||
|
||||
if(usr.canmove && !usr.stat && !usr.restrained())
|
||||
if(!src.hanging)
|
||||
src.hanging = !src.hanging
|
||||
gas_transfer_coefficient = 1 //gas is now escaping to the turf and vice versa
|
||||
flags &= ~(MASKCOVERSMOUTH | AIRTIGHT)
|
||||
icon_state = "breathdown"
|
||||
usr << "Your mask is now hanging on your neck."
|
||||
|
||||
else
|
||||
src.hanging = !src.hanging
|
||||
gas_transfer_coefficient = 0.10
|
||||
flags |= MASKCOVERSMOUTH | AIRTIGHT
|
||||
icon_state = "breath"
|
||||
usr << "You pull the mask up to cover your face."
|
||||
update_clothing_icon()
|
||||
adjust_mask(usr)
|
||||
|
||||
/obj/item/clothing/mask/breath/medical
|
||||
desc = "A close-fitting sterile mask that can be connected to an air supply."
|
||||
|
||||
@@ -155,7 +155,7 @@ var/global/list/breach_burn_descriptors = list(
|
||||
for(var/datum/breach/B in breaches)
|
||||
if(!B.class)
|
||||
src.breaches -= B
|
||||
del(B)
|
||||
qdel(B)
|
||||
else
|
||||
damage += B.class
|
||||
if(B.damtype == BRUTE)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
user << "<font color='blue'><b>You slot \the [input_device] into the suit module.</b></font>"
|
||||
user.drop_from_inventory(input_device)
|
||||
del(input_device)
|
||||
qdel(input_device)
|
||||
accepted_item.charges++
|
||||
return 1
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
|
||||
for(var/obj/item/weapon/melee/energy/blade/blade in M.contents)
|
||||
M.drop_from_inventory(blade)
|
||||
del(blade)
|
||||
qdel(blade)
|
||||
|
||||
/obj/item/rig_module/fabricator
|
||||
|
||||
|
||||
@@ -157,8 +157,8 @@
|
||||
user << "<span class='danger'>You purge the remaining scraps of data from your previous AI, freeing it for use.</span>"
|
||||
if(integrated_ai)
|
||||
integrated_ai.ghostize()
|
||||
del(integrated_ai)
|
||||
if(ai_card) del(ai_card)
|
||||
qdel(integrated_ai)
|
||||
if(ai_card) qdel(ai_card)
|
||||
else if(user)
|
||||
user.put_in_hands(ai_card)
|
||||
else
|
||||
|
||||
@@ -179,12 +179,12 @@
|
||||
explosion(get_turf(src), 1, 2, 4, 5)
|
||||
if(holder && holder.wearer)
|
||||
holder.wearer.drop_from_inventory(src)
|
||||
del(holder)
|
||||
del(src)
|
||||
qdel(holder)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/rig_module/self_destruct/small/engage()
|
||||
explosion(get_turf(src), 0, 0, 3, 4)
|
||||
if(holder && holder.wearer)
|
||||
holder.wearer.drop_from_inventory(src)
|
||||
del(holder)
|
||||
del(src)
|
||||
qdel(holder)
|
||||
qdel(src)
|
||||
@@ -149,12 +149,12 @@
|
||||
|
||||
update_icon(1)
|
||||
|
||||
/obj/item/weapon/rig/Del()
|
||||
/obj/item/weapon/rig/Destroy()
|
||||
for(var/obj/item/piece in list(gloves,boots,helmet,chest))
|
||||
var/mob/living/M = piece.loc
|
||||
if(istype(M))
|
||||
M.drop_from_inventory(piece)
|
||||
del(piece)
|
||||
qdel(piece)
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
@@ -659,25 +659,25 @@
|
||||
var/obj/item/garbage = H.head
|
||||
H.drop_from_inventory(garbage)
|
||||
H.head = null
|
||||
del(garbage)
|
||||
qdel(garbage)
|
||||
|
||||
if(H.gloves)
|
||||
var/obj/item/garbage = H.gloves
|
||||
H.drop_from_inventory(garbage)
|
||||
H.gloves = null
|
||||
del(garbage)
|
||||
qdel(garbage)
|
||||
|
||||
if(H.shoes)
|
||||
var/obj/item/garbage = H.shoes
|
||||
H.drop_from_inventory(garbage)
|
||||
H.shoes = null
|
||||
del(garbage)
|
||||
qdel(garbage)
|
||||
|
||||
if(H.wear_suit)
|
||||
var/obj/item/garbage = H.wear_suit
|
||||
H.drop_from_inventory(garbage)
|
||||
H.wear_suit = null
|
||||
del(garbage)
|
||||
qdel(garbage)
|
||||
|
||||
for(var/piece in list("helmet","gauntlets","chest","boots"))
|
||||
toggle_piece(piece, H, ONLY_DEPLOY)
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
pockets.max_w_class = 2 //fit only pocket sized items
|
||||
pockets.max_storage_space = 4
|
||||
|
||||
/obj/item/clothing/suit/storage/Destroy()
|
||||
qdel(pockets)
|
||||
pockets = null
|
||||
..()
|
||||
|
||||
/obj/item/clothing/suit/storage/attack_hand(mob/user as mob)
|
||||
if (pockets.handle_attack_hand(user))
|
||||
..(user)
|
||||
@@ -59,7 +64,6 @@
|
||||
pockets.max_w_class = 2
|
||||
pockets.max_storage_space = 8
|
||||
|
||||
|
||||
/obj/item/clothing/suit/storage/vest
|
||||
var/icon_badge
|
||||
var/icon_nobadge
|
||||
|
||||
@@ -552,7 +552,7 @@
|
||||
kit.uses--
|
||||
if(kit.uses<1)
|
||||
user.drop_item()
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
/obj/item/clothing/suit/space/void/attackby(var/obj/item/O as obj, mob/user as mob)
|
||||
..()
|
||||
@@ -571,7 +571,7 @@
|
||||
kit.uses--
|
||||
if(kit.uses<1)
|
||||
user.drop_item()
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
///////// Salvage crew hardsuit - Cybele Petit - solaruin ///////////////
|
||||
/obj/item/device/kit/suit/fluff/salvage
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
if(M.ckey == "nerezza" && M.real_name == "Asher Spock" && M.mind.role_alt_title && M.mind.role_alt_title != "Emergency Physician")
|
||||
//only spawn ID if asher is joining as an emergency physician
|
||||
ok = 1
|
||||
del(Item)
|
||||
qdel(Item)
|
||||
goto skip
|
||||
var/obj/item/weapon/card/id/I = Item
|
||||
for(var/obj/item/weapon/card/id/C in M)
|
||||
@@ -59,18 +59,18 @@
|
||||
I.name = "[M.real_name]'s Technician ID ([M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role])"
|
||||
|
||||
//replace old ID
|
||||
del(C)
|
||||
qdel(C)
|
||||
ok = M.equip_to_slot_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail
|
||||
break
|
||||
else if(istype(Item,/obj/item/weapon/storage/belt))
|
||||
if(M.ckey == "jakksergal" && M.real_name == "Nashi Ra'hal" && M.mind.role_alt_title && M.mind.role_alt_title != "Nurse" && M.mind.role_alt_title != "Chemist")
|
||||
ok = 1
|
||||
del(Item)
|
||||
qdel(Item)
|
||||
goto skip
|
||||
var/obj/item/weapon/storage/belt/medical/fluff/nashi_belt/I = Item
|
||||
if(istype(M.belt,/obj/item/weapon/storage/belt))
|
||||
for(var/obj/item/weapon/storage/belt/B in M)
|
||||
del(B)
|
||||
qdel(B)
|
||||
M.belt=null
|
||||
ok = M.equip_to_slot_if_possible(I, slot_belt, 0)
|
||||
break
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
if(istype(I, /obj/item/weapon/f_card))
|
||||
if(process_card(I))
|
||||
M.drop_item()
|
||||
del(I)
|
||||
qdel(I)
|
||||
else
|
||||
usr << "<spawn class='warning'>Invalid fingerprint card, rejected.</span>"
|
||||
if("print")
|
||||
|
||||
@@ -109,7 +109,7 @@ log transactions
|
||||
|
||||
user << "<span class='info'>You insert [I] into [src].</span>"
|
||||
src.attack_hand(user)
|
||||
del I
|
||||
qdel(I)
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
user.drop_from_inventory(cash)
|
||||
bundle = new (src.loc)
|
||||
bundle.worth += cash.worth
|
||||
del(cash)
|
||||
qdel(cash)
|
||||
else //is bundle
|
||||
bundle = W
|
||||
bundle.worth += src.worth
|
||||
@@ -37,7 +37,7 @@
|
||||
h_user.drop_from_inventory(bundle)
|
||||
h_user.put_in_hands(bundle)
|
||||
user << "<span class='notice'>You add [src.worth] Thalers worth of money to the bundles.<br>It holds [bundle.worth] Thalers now.</span>"
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/spacecash/bundle
|
||||
name = "pile of thalers"
|
||||
@@ -87,7 +87,7 @@
|
||||
bundle.update_icon()
|
||||
usr.put_in_hands(bundle)
|
||||
if(!worth)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/spacecash/c1
|
||||
name = "1 Thaler"
|
||||
|
||||
@@ -45,4 +45,4 @@
|
||||
if(!C.stat)
|
||||
var/turf/T = get_turf(C)
|
||||
if(istype(T, /turf/space))
|
||||
del(C)
|
||||
qdel(C)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
D.z = config.admin_levels[1]
|
||||
D.has_loot = 0
|
||||
|
||||
del(D)
|
||||
qdel(D)
|
||||
num_recovered++
|
||||
|
||||
if(num_recovered > drones_list.len * 0.75)
|
||||
|
||||
@@ -264,26 +264,26 @@ proc/check_panel(mob/M)
|
||||
spawn(300)
|
||||
if(my_target)
|
||||
my_target.hallucinations -= src
|
||||
del(src)
|
||||
qdel(src)
|
||||
step_away(src,my_target,2)
|
||||
spawn attack_loop()
|
||||
|
||||
|
||||
proc/updateimage()
|
||||
// del src.currentimage
|
||||
// qdel(src.currentimage)
|
||||
|
||||
|
||||
if(src.dir == NORTH)
|
||||
del src.currentimage
|
||||
qdel(src.currentimage)
|
||||
src.currentimage = new /image(up,src)
|
||||
else if(src.dir == SOUTH)
|
||||
del src.currentimage
|
||||
qdel(src.currentimage)
|
||||
src.currentimage = new /image(down,src)
|
||||
else if(src.dir == EAST)
|
||||
del src.currentimage
|
||||
qdel(src.currentimage)
|
||||
src.currentimage = new /image(right,src)
|
||||
else if(src.dir == WEST)
|
||||
del src.currentimage
|
||||
qdel(src.currentimage)
|
||||
src.currentimage = new /image(left,src)
|
||||
my_target << currentimage
|
||||
|
||||
@@ -329,7 +329,7 @@ proc/check_panel(mob/M)
|
||||
var/image/I = image('icons/effects/blood.dmi',O,"floor[rand(1,7)]",O.dir,1)
|
||||
target << I
|
||||
spawn(300)
|
||||
del(O)
|
||||
qdel(O)
|
||||
return
|
||||
|
||||
var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/item/ammo_magazine/a357,\
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
var/obj/item/weapon/hand/H = O
|
||||
for(var/datum/playingcard/P in H.cards)
|
||||
cards += P
|
||||
del(O)
|
||||
qdel(O)
|
||||
user << "You place your cards on the bottom of the deck."
|
||||
return
|
||||
..()
|
||||
@@ -131,7 +131,7 @@
|
||||
for(var/datum/playingcard/P in H.cards)
|
||||
cards += P
|
||||
src.concealed = H.concealed
|
||||
del(O)
|
||||
qdel(O)
|
||||
user.put_in_hands(src)
|
||||
update_icon()
|
||||
return
|
||||
@@ -183,7 +183,7 @@
|
||||
if(!discarding || !to_discard[discarding] || !usr || !src) return
|
||||
|
||||
var/datum/playingcard/card = to_discard[discarding]
|
||||
del(to_discard)
|
||||
qdel(to_discard)
|
||||
|
||||
var/obj/item/weapon/hand/H = new(src.loc)
|
||||
H.cards += card
|
||||
@@ -195,7 +195,7 @@
|
||||
H.loc = get_step(usr,usr.dir)
|
||||
|
||||
if(!cards.len)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/hand/attack_self(var/mob/user as mob)
|
||||
concealed = !concealed
|
||||
@@ -212,7 +212,7 @@
|
||||
/obj/item/weapon/hand/update_icon(var/direction = 0)
|
||||
|
||||
if(!cards.len)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(cards.len > 1)
|
||||
name = "hand of cards"
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
var/global/list/holodeck_programs = list(
|
||||
"emptycourt" = /area/holodeck/source_emptycourt, \
|
||||
"boxingcourt" = /area/holodeck/source_boxingcourt, \
|
||||
"basketball" = /area/holodeck/source_basketball, \
|
||||
"thunderdomecourt" = /area/holodeck/source_thunderdomecourt, \
|
||||
"beach" = /area/holodeck/source_beach, \
|
||||
"desert" = /area/holodeck/source_desert, \
|
||||
"space" = /area/holodeck/source_space, \
|
||||
"picnicarea" = /area/holodeck/source_picnicarea, \
|
||||
"snowfield" = /area/holodeck/source_snowfield, \
|
||||
"theatre" = /area/holodeck/source_theatre, \
|
||||
"meetinghall" = /area/holodeck/source_meetinghall, \
|
||||
"courtroom" = /area/holodeck/source_courtroom, \
|
||||
"burntest" = /area/holodeck/source_burntest, \
|
||||
"wildlifecarp" = /area/holodeck/source_wildlife, \
|
||||
"turnoff" = /area/holodeck/source_plating \
|
||||
)
|
||||
|
||||
/obj/machinery/computer/HolodeckControl
|
||||
name = "holodeck control console"
|
||||
desc = "A computer used to control a nearby holodeck."
|
||||
@@ -113,9 +95,7 @@ var/global/list/holodeck_programs = list(
|
||||
if(href_list["program"])
|
||||
var/prog = href_list["program"]
|
||||
if(prog in holodeck_programs)
|
||||
target = locate(holodeck_programs[prog])
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
loadProgram(holodeck_programs[prog])
|
||||
|
||||
else if(href_list["AIoverride"])
|
||||
if(!issilicon(usr))
|
||||
@@ -172,13 +152,9 @@ var/global/list/holodeck_programs = list(
|
||||
/obj/machinery/computer/HolodeckControl/New()
|
||||
..()
|
||||
linkedholodeck = locate(/area/holodeck/alphadeck)
|
||||
//if(linkedholodeck)
|
||||
// target = locate(/area/holodeck/source_emptycourt)
|
||||
// if(target)
|
||||
// loadProgram(target)
|
||||
|
||||
//This could all be done better, but it works for now.
|
||||
/obj/machinery/computer/HolodeckControl/Del()
|
||||
/obj/machinery/computer/HolodeckControl/Destroy()
|
||||
emergencyShutdown()
|
||||
..()
|
||||
|
||||
@@ -225,9 +201,7 @@ var/global/list/holodeck_programs = list(
|
||||
|
||||
if(!checkInteg(linkedholodeck))
|
||||
damaged = 1
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
loadProgram(holodeck_programs["turnoff"], 0)
|
||||
active = 0
|
||||
use_power = 1
|
||||
for(var/mob/M in range(10,src))
|
||||
@@ -257,7 +231,7 @@ var/global/list/holodeck_programs = list(
|
||||
if(!silent)
|
||||
var/obj/oldobj = obj
|
||||
visible_message("The [oldobj.name] fades away!")
|
||||
del(obj)
|
||||
qdel(obj)
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/proc/checkInteg(var/area/A)
|
||||
for(var/turf/T in A)
|
||||
@@ -268,46 +242,33 @@ var/global/list/holodeck_programs = list(
|
||||
|
||||
//Why is it called toggle if it doesn't toggle?
|
||||
/obj/machinery/computer/HolodeckControl/proc/togglePower(var/toggleOn = 0)
|
||||
|
||||
if(toggleOn)
|
||||
var/area/targetsource = locate(/area/holodeck/source_emptycourt)
|
||||
holographic_objs = targetsource.copy_contents_to(linkedholodeck)
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
if(L.name=="Atmospheric Test Start")
|
||||
spawn(20)
|
||||
var/turf/T = get_turf(L)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
if(T)
|
||||
T.temperature = 5000
|
||||
T.hotspot_expose(50000,50000,1)
|
||||
|
||||
active = 1
|
||||
use_power = 2
|
||||
loadProgram(holodeck_programs["emptycourt"], 0)
|
||||
else
|
||||
for(var/item in holographic_objs)
|
||||
derez(item)
|
||||
loadProgram(holodeck_programs["turnoff"], 0)
|
||||
|
||||
if(!linkedholodeck.has_gravity)
|
||||
linkedholodeck.gravitychange(1,linkedholodeck)
|
||||
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
use_power = 1
|
||||
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/proc/loadProgram(var/area/A)
|
||||
/obj/machinery/computer/HolodeckControl/proc/loadProgram(var/datum/holodeck_program/HP, var/check_delay = 1)
|
||||
if(!HP)
|
||||
return
|
||||
var/area/A = locate(HP.target)
|
||||
if(!A)
|
||||
return
|
||||
|
||||
if(world.time < (last_change + 25))
|
||||
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve
|
||||
return
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("\b ERROR. Recalibrating projection apparatus.")
|
||||
last_change = world.time
|
||||
return
|
||||
if(check_delay)
|
||||
if(world.time < (last_change + 25))
|
||||
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve
|
||||
return
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("\b ERROR. Recalibrating projection apparatus.")
|
||||
last_change = world.time
|
||||
return
|
||||
|
||||
last_change = world.time
|
||||
active = 1
|
||||
@@ -321,12 +282,21 @@ var/global/list/holodeck_programs = list(
|
||||
C.derez()
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck)
|
||||
del(B)
|
||||
qdel(B)
|
||||
|
||||
holographic_objs = A.copy_contents_to(linkedholodeck , 1)
|
||||
for(var/obj/holo_obj in holographic_objs)
|
||||
holo_obj.alpha *= 0.8 //give holodeck objs a slight transparency
|
||||
|
||||
if(HP.ambience)
|
||||
linkedholodeck.forced_ambience = HP.ambience
|
||||
else
|
||||
linkedholodeck.forced_ambience = initial(linkedholodeck.ambience)
|
||||
|
||||
for(var/mob/living/M in mobs_in_area(linkedholodeck))
|
||||
if(M.mind)
|
||||
linkedholodeck.play_ambience(M)
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
if(L.name=="Atmospheric Test Start")
|
||||
@@ -367,21 +337,11 @@ var/global/list/holodeck_programs = list(
|
||||
A.gravitychange(1,A)
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/proc/emergencyShutdown()
|
||||
//Get rid of any items
|
||||
for(var/item in holographic_objs)
|
||||
derez(item)
|
||||
for(var/mob/living/simple_animal/hostile/carp/holodeck/C in holographic_mobs)
|
||||
holographic_mobs -= C
|
||||
C.derez()
|
||||
//Turn it back to the regular non-holographic room
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
loadProgram(holodeck_programs["turnoff"], 0)
|
||||
|
||||
if(!linkedholodeck.has_gravity)
|
||||
linkedholodeck.gravitychange(1,linkedholodeck)
|
||||
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
use_power = 1
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
icon_state = "boxing"
|
||||
item_state = "boxing"
|
||||
|
||||
/obj/structure/window/reinforced/holowindow/Del()
|
||||
/obj/structure/window/reinforced/holowindow/Destroy()
|
||||
..()
|
||||
|
||||
/obj/structure/window/reinforced/holowindow/attackby(obj/item/W as obj, mob/user as mob)
|
||||
@@ -95,7 +95,7 @@
|
||||
if(istype(G.affecting,/mob/living))
|
||||
var/mob/living/M = G.affecting
|
||||
var/state = G.state
|
||||
del(W) //gotta delete it here because if window breaks, it won't get deleted
|
||||
qdel(W) //gotta delete it here because if window breaks, it won't get deleted
|
||||
switch (state)
|
||||
if(1)
|
||||
M.visible_message("<span class='warning'>[user] slams [M] against \the [src]!</span>")
|
||||
@@ -138,13 +138,13 @@
|
||||
playsound(src, "shatter", 70, 1)
|
||||
if(display_message)
|
||||
visible_message("[src] fades away as it shatters!")
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/structure/window/reinforced/holowindow/disappearing/Del()
|
||||
/obj/structure/window/reinforced/holowindow/disappearing/Destroy()
|
||||
..()
|
||||
|
||||
/obj/machinery/door/window/holowindoor/Del()
|
||||
/obj/machinery/door/window/holowindoor/Destroy()
|
||||
..()
|
||||
|
||||
/obj/machinery/door/window/holowindoor/attackby(obj/item/weapon/I as obj, mob/user as mob)
|
||||
@@ -180,9 +180,9 @@
|
||||
playsound(src, "shatter", 70, 1)
|
||||
if(display_message)
|
||||
visible_message("[src] fades away as it shatters!")
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/bed/chair/holochair/Del()
|
||||
/obj/structure/bed/chair/holochair/Destroy()
|
||||
..()
|
||||
|
||||
/obj/structure/bed/chair/holochair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
@@ -275,7 +275,7 @@
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
visible_message("<span class='warning'>[G.assailant] dunks [G.affecting] into the [src]!</span>", 3)
|
||||
del(W)
|
||||
qdel(W)
|
||||
return
|
||||
else if (istype(W, /obj/item) && get_dist(src,user)<2)
|
||||
user.drop_item(src.loc)
|
||||
@@ -334,7 +334,7 @@
|
||||
|
||||
currentarea = get_area(src.loc)
|
||||
if(!currentarea)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
if(eventstarted)
|
||||
usr << "The event has already begun!"
|
||||
@@ -365,7 +365,7 @@
|
||||
eventstarted = 1
|
||||
|
||||
for(var/obj/structure/window/reinforced/holowindow/disappearing/W in currentarea)
|
||||
del(W)
|
||||
qdel(W)
|
||||
|
||||
for(var/mob/M in currentarea)
|
||||
M << "FIGHT!"
|
||||
@@ -425,4 +425,4 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/holodeck/proc/derez()
|
||||
visible_message("<span class='notice'>\The [src] fades away!</span>")
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
var/global/list/holodeck_programs = list(
|
||||
"emptycourt" = new/datum/holodeck_program(/area/holodeck/source_emptycourt, list('sound/music/THUNDERDOME.ogg')),
|
||||
"boxingcourt" = new/datum/holodeck_program(/area/holodeck/source_boxingcourt, list('sound/music/THUNDERDOME.ogg')),
|
||||
"basketball" = new/datum/holodeck_program(/area/holodeck/source_basketball, list('sound/music/THUNDERDOME.ogg')),
|
||||
"thunderdomecourt" = new/datum/holodeck_program(/area/holodeck/source_thunderdomecourt, list('sound/music/THUNDERDOME.ogg')),
|
||||
"beach" = new/datum/holodeck_program(/area/holodeck/source_beach),
|
||||
"desert" = new/datum/holodeck_program(/area/holodeck/source_desert,
|
||||
list(
|
||||
'sound/effects/wind/wind_2_1.ogg',
|
||||
'sound/effects/wind/wind_2_2.ogg',
|
||||
'sound/effects/wind/wind_3_1.ogg',
|
||||
'sound/effects/wind/wind_4_1.ogg',
|
||||
'sound/effects/wind/wind_4_2.ogg',
|
||||
'sound/effects/wind/wind_5_1.ogg'
|
||||
)
|
||||
),
|
||||
"snowfield" = new/datum/holodeck_program(/area/holodeck/source_snowfield,
|
||||
list(
|
||||
'sound/effects/wind/wind_2_1.ogg',
|
||||
'sound/effects/wind/wind_2_2.ogg',
|
||||
'sound/effects/wind/wind_3_1.ogg',
|
||||
'sound/effects/wind/wind_4_1.ogg',
|
||||
'sound/effects/wind/wind_4_2.ogg',
|
||||
'sound/effects/wind/wind_5_1.ogg'
|
||||
)
|
||||
),
|
||||
"space" = new/datum/holodeck_program(/area/holodeck/source_space,
|
||||
list(
|
||||
'sound/ambience/ambispace.ogg',
|
||||
'sound/music/main.ogg',
|
||||
'sound/music/space.ogg',
|
||||
'sound/music/traitor.ogg',
|
||||
)
|
||||
),
|
||||
"picnicarea" = new/datum/holodeck_program(/area/holodeck/source_picnicarea, list('sound/music/title2.ogg')),
|
||||
"theatre" = new/datum/holodeck_program(/area/holodeck/source_theatre),
|
||||
"meetinghall" = new/datum/holodeck_program(/area/holodeck/source_meetinghall),
|
||||
"courtroom" = new/datum/holodeck_program(/area/holodeck/source_courtroom, list('sound/music/traitor.ogg')),
|
||||
"burntest" = new/datum/holodeck_program(/area/holodeck/source_burntest, list()),
|
||||
"wildlifecarp" = new/datum/holodeck_program(/area/holodeck/source_wildlife, list()),
|
||||
"turnoff" = new/datum/holodeck_program(/area/holodeck/source_plating, list())
|
||||
)
|
||||
|
||||
/datum/holodeck_program
|
||||
var/target
|
||||
var/list/ambience = null
|
||||
|
||||
/datum/holodeck_program/New(var/target, var/list/ambience = null)
|
||||
src.target = target
|
||||
src.ambience = ambience
|
||||
@@ -29,7 +29,7 @@
|
||||
sleep(250) // ugly hack, should mean roundstart plants are fine.
|
||||
if(!plant_controller)
|
||||
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
seed = plant_controller.seeds[plantname]
|
||||
@@ -65,7 +65,7 @@
|
||||
sleep(250) // ugly hack, should mean roundstart plants are fine.
|
||||
if(!plant_controller)
|
||||
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(plant_controller.product_descs["[seed.uid]"])
|
||||
@@ -163,7 +163,7 @@
|
||||
M.Weaken(5)
|
||||
seed.thrown_at(src,M)
|
||||
sleep(-1)
|
||||
if(src) del(src)
|
||||
if(src) qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom)
|
||||
@@ -183,13 +183,13 @@
|
||||
user.put_in_hands(pocell)
|
||||
pocell.maxcharge = src.potency * 10
|
||||
pocell.charge = pocell.maxcharge
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(W.sharp)
|
||||
if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful.
|
||||
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
|
||||
new /obj/item/clothing/head/pumpkinhead (user.loc)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(seed.chems)
|
||||
if(istype(W,/obj/item/weapon/hatchet) && !isnull(seed.chems["woodpulp"]))
|
||||
@@ -204,22 +204,22 @@
|
||||
continue
|
||||
G.attackby(NG, user)
|
||||
user << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks."
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(!isnull(seed.chems["potato"]))
|
||||
user << "You slice \the [src] into sticks."
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(get_turf(src))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(!isnull(seed.chems["carrotjuice"]))
|
||||
user << "You slice \the [src] into sticks."
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/carrotfries(get_turf(src))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(!isnull(seed.chems["soymilk"]))
|
||||
user << "You roughly chop up \the [src]."
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
if(user)
|
||||
user << "<span class='danger'>\The [src] has fallen to bits.</span>"
|
||||
user.drop_from_inventory(src)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
@@ -296,7 +296,7 @@
|
||||
user.visible_message("<span class='danger'>\The [user] squashes \the [src]!</span>")
|
||||
seed.thrown_at(src,user)
|
||||
sleep(-1)
|
||||
if(src) del(src)
|
||||
if(src) qdel(src)
|
||||
return
|
||||
|
||||
if(seed.kitchen_tag == "grass")
|
||||
@@ -311,13 +311,13 @@
|
||||
continue
|
||||
NG.attackby(G, user)
|
||||
user << "You add the newly-formed grass to the stack. It now contains [G.amount] tiles."
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(seed.get_trait(TRAIT_SPREAD) > 0)
|
||||
user << "<span class='notice'>You plant the [src.name].</span>"
|
||||
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/*
|
||||
@@ -327,13 +327,13 @@
|
||||
var/obj/item/stack/medical/bruise_pack/tajaran/poultice = new /obj/item/stack/medical/bruise_pack/tajaran(user.loc)
|
||||
poultice.heal_brute = potency
|
||||
user << "<span class='notice'>You mash the leaves into a poultice.</span>"
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if("mtear")
|
||||
var/obj/item/stack/medical/ointment/tajaran/poultice = new /obj/item/stack/medical/ointment/tajaran(user.loc)
|
||||
poultice.heal_burn = potency
|
||||
user << "<span class='notice'>You mash the petals into a poultice.</span>"
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
*/
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/kitchenknife/ritual))
|
||||
user << "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>"
|
||||
new /obj/item/clothing/mask/smokable/pipe/cobpipe (user.loc)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/bananapeel
|
||||
|
||||
@@ -102,10 +102,10 @@
|
||||
if(!istype(target))
|
||||
if(istype(target, /mob/living/simple_animal/mouse))
|
||||
new /obj/effect/decal/remains/mouse(get_turf(target))
|
||||
del(target)
|
||||
qdel(target)
|
||||
else if(istype(target, /mob/living/simple_animal/lizard))
|
||||
new /obj/effect/decal/remains/lizard(get_turf(target))
|
||||
del(target)
|
||||
qdel(target)
|
||||
return
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
apply_special_effect(M)
|
||||
splatter(T,thrown)
|
||||
origin_turf.visible_message("<span class='danger'>The [thrown.name] explodes!</span>")
|
||||
del(thrown)
|
||||
qdel(thrown)
|
||||
return
|
||||
|
||||
if(istype(target,/mob/living))
|
||||
@@ -242,7 +242,7 @@
|
||||
if(get_trait(TRAIT_JUICY) && splatted)
|
||||
splatter(origin_turf,thrown)
|
||||
origin_turf.visible_message("<span class='danger'>The [thrown.name] splatters against [target]!</span>")
|
||||
del(thrown)
|
||||
qdel(thrown)
|
||||
|
||||
/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/check_only)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
|
||||
/datum/controller/plants/New()
|
||||
if(plant_controller && plant_controller != src)
|
||||
log_debug("Rebuilding plant controller.")
|
||||
del(plant_controller)
|
||||
qdel(plant_controller)
|
||||
plant_controller = src
|
||||
setup()
|
||||
process()
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
genetics = seed.seed
|
||||
degradation = 0
|
||||
|
||||
del(seed)
|
||||
qdel(seed)
|
||||
seed = null
|
||||
|
||||
if(href_list["get_gene"])
|
||||
|
||||
@@ -188,16 +188,16 @@
|
||||
N.seeds -= O
|
||||
if (N.amount <= 0 || N.seeds.len <= 0)
|
||||
piles -= N
|
||||
del(N)
|
||||
qdel(N)
|
||||
O.loc = src.loc
|
||||
else
|
||||
piles -= N
|
||||
del(N)
|
||||
qdel(N)
|
||||
else if (task == "purge")
|
||||
for (var/obj/O in N.seeds)
|
||||
del(O)
|
||||
qdel(O)
|
||||
piles -= N
|
||||
del(N)
|
||||
qdel(N)
|
||||
break
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
color = DEAD_PLANT_COLOUR
|
||||
|
||||
/obj/effect/dead_plant/attack_hand()
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/dead_plant/attackby()
|
||||
..()
|
||||
for(var/obj/effect/plant/neighbor in range(1))
|
||||
neighbor.update_neighbors()
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/plant
|
||||
name = "plant"
|
||||
@@ -60,7 +60,7 @@
|
||||
var/last_tick = 0
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/plant
|
||||
|
||||
/obj/effect/plant/Del()
|
||||
/obj/effect/plant/Destroy()
|
||||
if(plant_controller)
|
||||
plant_controller.remove_plant(src)
|
||||
for(var/obj/effect/plant/neighbor in range(1,src))
|
||||
@@ -81,14 +81,14 @@
|
||||
sleep(250) // ugly hack, should mean roundstart plants are fine.
|
||||
if(!plant_controller)
|
||||
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(!istype(newseed))
|
||||
newseed = plant_controller.seeds[DEFAULT_SEED]
|
||||
seed = newseed
|
||||
if(!seed)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
name = seed.display_name
|
||||
|
||||
@@ -99,6 +99,6 @@
|
||||
for(var/obj/effect/plant/neighbor in check_turf.contents)
|
||||
neighbor.neighbors |= check_turf
|
||||
plant_controller.add_plant(neighbor)
|
||||
spawn(1) if(src) del(src)
|
||||
spawn(1) if(src) qdel(src)
|
||||
|
||||
#undef NEIGHBOR_REFRESH_TIME
|
||||
@@ -457,7 +457,7 @@
|
||||
|
||||
if(!S.seed)
|
||||
user << "The packet seems to be empty. You throw it away."
|
||||
del(O)
|
||||
qdel(O)
|
||||
return
|
||||
|
||||
user << "You plant the [S.seed.seed_name] [S.seed.seed_noun]."
|
||||
@@ -468,7 +468,7 @@
|
||||
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
|
||||
lastcycle = world.time
|
||||
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
check_health()
|
||||
|
||||
@@ -503,7 +503,7 @@
|
||||
weedlevel -= spray.weed_kill_str
|
||||
user << "You spray [src] with [O]."
|
||||
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
|
||||
del(O)
|
||||
qdel(O)
|
||||
check_health()
|
||||
|
||||
else if(mechanical && istype(O, /obj/item/weapon/wrench))
|
||||
@@ -522,13 +522,13 @@
|
||||
user << "<span class='danger'>[src] is already occupied!</span>"
|
||||
else
|
||||
user.drop_item()
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
var/obj/machinery/apiary/A = new(src.loc)
|
||||
A.icon = src.icon
|
||||
A.icon_state = src.icon_state
|
||||
A.hydrotray_type = src.type
|
||||
del(src)
|
||||
qdel(src)
|
||||
else if(O.force && seed)
|
||||
user.visible_message("<span class='danger'>\The [seed.display_name] has been attacked by [user] with \the [O]!</span>")
|
||||
if(!dead)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
health = 10
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
del(O)
|
||||
qdel(O)
|
||||
user << "\blue You carefully insert the queen into [src], she gets busy making a hive."
|
||||
bees_in_hive = 0
|
||||
else if(istype(O, /obj/item/beezeez))
|
||||
@@ -62,7 +62,7 @@
|
||||
user << "\blue You insert [O] into [src]. A relaxed humming appears to pick up."
|
||||
else
|
||||
user << "\blue You insert [O] into [src]. Now it just needs some bees."
|
||||
del(O)
|
||||
qdel(O)
|
||||
else if(istype(O, /obj/item/weapon/minihoe))
|
||||
if(health > 0)
|
||||
user << "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>"
|
||||
@@ -73,7 +73,7 @@
|
||||
new hydrotray_type(src.loc)
|
||||
new /obj/item/apiary(src.loc)
|
||||
user << "\red You dislodge the apiary from the tray."
|
||||
del(src)
|
||||
qdel(src)
|
||||
else if(istype(O, /obj/item/weapon/bee_net))
|
||||
var/obj/item/weapon/bee_net/N = O
|
||||
if(N.caught_bees > 0)
|
||||
@@ -115,11 +115,11 @@
|
||||
if(swarming <= 0)
|
||||
for(var/mob/living/simple_animal/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
del(B)
|
||||
qdel(B)
|
||||
else if(bees_in_hive < 10)
|
||||
for(var/mob/living/simple_animal/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
del(B)
|
||||
qdel(B)
|
||||
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
lastcycle = world.time
|
||||
@@ -199,7 +199,7 @@
|
||||
B.target_turf = get_turf(src)
|
||||
B.strength -= 1
|
||||
if(B.strength <= 0)
|
||||
del(B)
|
||||
qdel(B)
|
||||
else if(B.strength <= 5)
|
||||
B.icon_state = "bees[B.strength]"
|
||||
bees_in_hive = 0
|
||||
|
||||
@@ -41,25 +41,25 @@
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/remove_dead()
|
||||
..()
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
|
||||
..()
|
||||
if(!seed) // Repeat harvests are a thing.
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die()
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process()
|
||||
if(!seed)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(name=="plant")
|
||||
name = seed.display_name
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Del()
|
||||
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Destroy()
|
||||
// Check if we're masking a decal that needs to be visible again.
|
||||
for(var/obj/effect/plant/plant in get_turf(src))
|
||||
if(plant.invisibility == INVISIBILITY_MAXIMUM)
|
||||
|
||||
@@ -277,4 +277,4 @@
|
||||
for(var/obj/effect/plant/B in orange(A,1))
|
||||
if(prob(80))
|
||||
B.die_off(1)
|
||||
del A
|
||||
qdel(A)
|
||||
@@ -56,20 +56,20 @@
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/obj/item/weapon/book/b in contents)
|
||||
del(b)
|
||||
del(src)
|
||||
qdel(b)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
for(var/obj/item/weapon/book/b in contents)
|
||||
if (prob(50)) b.loc = (get_turf(src))
|
||||
else del(b)
|
||||
del(src)
|
||||
else qdel(b)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(50))
|
||||
for(var/obj/item/weapon/book/b in contents)
|
||||
b.loc = (get_turf(src))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
@@ -463,6 +463,6 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
|
||||
b.dat = O:info
|
||||
b.name = "Print Job #" + "[rand(100, 999)]"
|
||||
b.icon_state = "book[rand(1,7)]"
|
||||
del(O)
|
||||
qdel(O)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -16,16 +16,16 @@ datum/puddle/proc/process()
|
||||
L.apply_calculated_effect()
|
||||
|
||||
if(liquid_objects.len == 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
datum/puddle/New()
|
||||
..()
|
||||
puddles += src
|
||||
|
||||
datum/puddle/Del()
|
||||
datum/puddle/Destroy()
|
||||
puddles -= src
|
||||
for(var/obj/O in liquid_objects)
|
||||
del(O)
|
||||
qdel(O)
|
||||
..()
|
||||
|
||||
client/proc/splash()
|
||||
@@ -63,11 +63,11 @@ obj/effect/liquid
|
||||
obj/effect/liquid/New()
|
||||
..()
|
||||
if( !isturf(loc) )
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
for( var/obj/effect/liquid/L in loc )
|
||||
if(L != src)
|
||||
del(L)
|
||||
qdel(L)
|
||||
|
||||
obj/effect/liquid/proc/spread()
|
||||
|
||||
@@ -124,14 +124,14 @@ obj/effect/liquid/proc/apply_calculated_effect()
|
||||
volume += new_volume
|
||||
|
||||
if(volume < LIQUID_TRANSFER_THRESHOLD)
|
||||
del(src)
|
||||
qdel(src)
|
||||
new_volume = 0
|
||||
update_icon2()
|
||||
|
||||
obj/effect/liquid/Move()
|
||||
return 0
|
||||
|
||||
obj/effect/liquid/Del()
|
||||
obj/effect/liquid/Destroy()
|
||||
src.controller.liquid_objects.Remove(src)
|
||||
..()
|
||||
|
||||
@@ -140,7 +140,7 @@ obj/effect/liquid/proc/update_icon2()
|
||||
|
||||
switch(volume)
|
||||
if(0 to 0.1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
if(0.1 to 5)
|
||||
icon_state = "1"
|
||||
if(5 to 10)
|
||||
|
||||
+678
-678
File diff suppressed because it is too large
Load Diff
@@ -164,7 +164,7 @@
|
||||
user << "<span class='danger'>The crate's anti-tamper system activates!</span>"
|
||||
var/turf/T = get_turf(src.loc)
|
||||
explosion(T, 0, 0, 0, 1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
user << "<span class='notice'>You attempt to interact with the device using a hand gesture, but it appears this crate is from before the DECANECT came out.</span>"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if (machine)
|
||||
machine.console = src
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if (machine)
|
||||
machine.console = src
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
@@ -85,7 +85,7 @@
|
||||
var/obj/item/stack/S = new stacktype(src)
|
||||
stack_storage[S.name] = 0
|
||||
stack_paths[S.name] = stacktype
|
||||
del(S)
|
||||
qdel(S)
|
||||
|
||||
stack_storage["glass"] = 0
|
||||
stack_paths["glass"] = /obj/item/stack/sheet/glass
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
if(!S || S.field_type != get_responsive_reagent(F.find_type))
|
||||
if(X)
|
||||
visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</b>")
|
||||
del(X)
|
||||
qdel(X)
|
||||
|
||||
finds.Remove(F)
|
||||
|
||||
@@ -507,7 +507,7 @@
|
||||
..()
|
||||
if(istype(M,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if(istype(R.module, /obj/item/weapon/robot_module/miner))
|
||||
if(R.module)
|
||||
if(istype(R.module_state_1,/obj/item/weapon/storage/bag/ore))
|
||||
attackby(R.module_state_1,R)
|
||||
else if(istype(R.module_state_2,/obj/item/weapon/storage/bag/ore))
|
||||
|
||||
@@ -42,22 +42,22 @@
|
||||
if(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/gold))
|
||||
amt_gold += 100 * O.get_amount()
|
||||
del(O)
|
||||
qdel(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/silver))
|
||||
amt_silver += 100 * O.get_amount()
|
||||
del(O)
|
||||
qdel(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
|
||||
amt_diamond += 100 * O.get_amount()
|
||||
del(O)
|
||||
qdel(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/phoron))
|
||||
amt_phoron += 100 * O.get_amount()
|
||||
del(O)
|
||||
qdel(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
|
||||
amt_uranium += 100 * O.get_amount()
|
||||
del(O)
|
||||
qdel(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.get_amount()
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob)
|
||||
|
||||
|
||||
@@ -97,5 +97,5 @@
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
O.loc = src.loc
|
||||
O.ex_act(severity++)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -2,4 +2,4 @@
|
||||
..()
|
||||
spawn(0)
|
||||
if(src && !key) //we've transferred to another mob. This ghost should be deleted.
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -81,10 +81,10 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
|
||||
real_name = name
|
||||
..()
|
||||
|
||||
/mob/dead/observer/Del()
|
||||
/mob/dead/observer/Destroy()
|
||||
if (ghostimage)
|
||||
ghost_darkness_images -= ghostimage
|
||||
del(ghostimage)
|
||||
qdel(ghostimage)
|
||||
ghostimage = null
|
||||
updateallghostimages()
|
||||
..()
|
||||
@@ -598,7 +598,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
for(var/image/I in client.images)
|
||||
if(I.icon_state == icon)
|
||||
iconRemoved = 1
|
||||
del(I)
|
||||
qdel(I)
|
||||
|
||||
if(!iconRemoved)
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = src, icon_state = icon)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
if(do_gibs) gibs(loc, viruses, dna)
|
||||
|
||||
spawn(15)
|
||||
if(animation) del(animation)
|
||||
if(src) del(src)
|
||||
if(animation) qdel(animation)
|
||||
if(src) qdel(src)
|
||||
|
||||
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
|
||||
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
|
||||
@@ -43,8 +43,8 @@
|
||||
|
||||
dead_mob_list -= src
|
||||
spawn(15)
|
||||
if(animation) del(animation)
|
||||
if(src) del(src)
|
||||
if(animation) qdel(animation)
|
||||
if(src) qdel(src)
|
||||
|
||||
|
||||
/mob/proc/death(gibbed,deathmessage="seizes up and falls limp...")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// The datum containing all the chunks.
|
||||
|
||||
/datum/visualnet/camera
|
||||
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
|
||||
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Destroy().
|
||||
var/list/cameras = list()
|
||||
var/cameras_unsorted = 1
|
||||
chunk_type = /datum/chunk/camera
|
||||
|
||||
@@ -39,10 +39,11 @@
|
||||
if(eyeobj)
|
||||
eyeobj.loc = src.loc
|
||||
|
||||
/mob/living/silicon/ai/Del()
|
||||
/mob/living/silicon/ai/Destroy()
|
||||
if(eyeobj)
|
||||
eyeobj.owner = null
|
||||
del(eyeobj) // No AI, no Eye
|
||||
qdel(eyeobj) // No AI, no Eye
|
||||
eyeobj = null
|
||||
..()
|
||||
|
||||
/atom/proc/move_camera_by_click()
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
dd_insertObjectList(cameranet.cameras, src)
|
||||
update_coverage(1)
|
||||
|
||||
/obj/machinery/camera/Del()
|
||||
/obj/machinery/camera/Destroy()
|
||||
cameranet.cameras -= src
|
||||
clear_all_networks()
|
||||
..()
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
updateallghostimages()
|
||||
..()
|
||||
|
||||
mob/eye/Del()
|
||||
mob/eye/Destroy()
|
||||
if (ghostimage)
|
||||
ghost_darkness_images -= ghostimage
|
||||
ghost_sightless_images -= ghostimage
|
||||
del(ghostimage)
|
||||
qdel(ghostimage)
|
||||
ghostimage = null
|
||||
updateallghostimages()
|
||||
..()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
..()
|
||||
cultnet.updateVisibility(src, 0)
|
||||
|
||||
/mob/living/Del()
|
||||
/mob/living/Destroy()
|
||||
cultnet.updateVisibility(src, 0)
|
||||
..()
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
HOW IT WORKS
|
||||
|
||||
It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be
|
||||
explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Del().
|
||||
explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Destroy().
|
||||
|
||||
Next the camera network has chunks. These chunks are a 16x16 tile block of turfs and cameras contained inside the chunk.
|
||||
These turfs are then sorted out based on what the cameras can and cannot see. If none of the cameras can see the turf, inside
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/turf/drain_power()
|
||||
return -1
|
||||
|
||||
/turf/simulated/Del()
|
||||
/turf/simulated/Destroy()
|
||||
updateVisibility(src)
|
||||
..()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
// STRUCTURES
|
||||
|
||||
/obj/structure/Del()
|
||||
/obj/structure/Destroy()
|
||||
updateVisibility(src)
|
||||
..()
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
// EFFECTS
|
||||
|
||||
/obj/effect/Del()
|
||||
/obj/effect/Destroy()
|
||||
updateVisibility(src)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/effect/New()
|
||||
..()
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
..()
|
||||
visual_nets += src
|
||||
|
||||
/datum/visualnet/Del()
|
||||
/datum/visualnet/Destroy()
|
||||
visual_nets -= src
|
||||
..()
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/item/weapon/holder/Del()
|
||||
/obj/item/weapon/holder/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
mob_container.forceMove(get_turf(src))
|
||||
M.reset_view()
|
||||
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/holder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
for(var/mob/M in src.contents)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
if(!W.mob_can_equip(src, slot))
|
||||
if(del_on_fail)
|
||||
del(W)
|
||||
qdel(W)
|
||||
else
|
||||
if(!disable_warning)
|
||||
src << "\red You are unable to equip that." //Only print if del_on_fail is false
|
||||
@@ -58,6 +58,10 @@ var/list/slot_equipment_priority = list( \
|
||||
slot_r_store\
|
||||
)
|
||||
|
||||
//Checks if a given slot can be accessed at this time, either to equip or unequip I
|
||||
/mob/proc/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null)
|
||||
return 1
|
||||
|
||||
//puts the item "W" into an appropriate slot in a human's inventory
|
||||
//returns 0 if it cannot, 1 if successful
|
||||
/mob/proc/equip_to_appropriate_slot(obj/item/W)
|
||||
@@ -143,7 +147,8 @@ var/list/slot_equipment_priority = list( \
|
||||
W.dropped()
|
||||
return 0
|
||||
|
||||
// Removes an item from inventory and places it in the target atom
|
||||
// Removes an item from inventory and places it in the target atom.
|
||||
// If canremove or other conditions need to be checked then use unEquip instead.
|
||||
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
|
||||
if(W)
|
||||
if(!Target)
|
||||
@@ -196,15 +201,21 @@ var/list/slot_equipment_priority = list( \
|
||||
update_inv_wear_mask(0)
|
||||
return
|
||||
|
||||
//This differs from remove_from_mob() in that it checks canremove first.
|
||||
//This differs from remove_from_mob() in that it checks if the item can be unequipped first.
|
||||
/mob/proc/unEquip(obj/item/I, force = 0) //Force overrides NODROP for things like wizarditis and admin undress.
|
||||
if(!I) //If there's nothing to drop, the drop is automatically successful.
|
||||
return 1
|
||||
|
||||
if(!I.canremove && !force)
|
||||
var/slot
|
||||
for(var/s in slot_back to slot_tie) //kind of worries me
|
||||
if(get_equipped_item(s) == I)
|
||||
slot = s
|
||||
break
|
||||
|
||||
if(slot && !I.mob_can_unequip(src, slot))
|
||||
return 0
|
||||
|
||||
remove_from_mob(I)
|
||||
drop_from_inventory(I)
|
||||
return 1
|
||||
|
||||
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
|
||||
@@ -220,6 +231,15 @@ var/list/slot_equipment_priority = list( \
|
||||
return 1
|
||||
|
||||
|
||||
//Returns the item equipped to the specified slot, if any.
|
||||
/mob/proc/get_equipped_item(var/slot)
|
||||
switch(slot)
|
||||
if(slot_l_hand) return l_hand
|
||||
if(slot_r_hand) return r_hand
|
||||
if(slot_back) return back
|
||||
if(slot_wear_mask) return wear_mask
|
||||
return null
|
||||
|
||||
//Outdated but still in use apparently. This should at least be a human proc.
|
||||
/mob/proc/get_equipped_items()
|
||||
var/list/items = new/list()
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
B << "To create this node you will have to be on a normal blob tile and far enough away from any other node."
|
||||
B << "Check your Blob verbs and hit Create Node to build a node."
|
||||
spawn(10)
|
||||
del(G_found)
|
||||
qdel(G_found)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
if(istype(loc,/obj/item/weapon/holder/diona))
|
||||
var/obj/item/weapon/holder/diona/L = loc
|
||||
src.loc = L.loc
|
||||
del(L)
|
||||
qdel(L)
|
||||
|
||||
src.visible_message("\red [src] begins to shift and quiver, and erupts in a shower of shed bark as it splits into a tangle of nearly a dozen new dionaea.","\red You begin to shift and quiver, feeling your awareness splinter. All at once, we consume our stored nutrients to surge with growth, splitting into a tangle of at least a dozen new dionaea. We have attained our gestalt form.")
|
||||
return "Diona"
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
for(var/datum/language/L in languages)
|
||||
adult.add_language(L.name)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/mob/living/carbon/alien/proc/update_progression()
|
||||
if(amount_grown < max_grown)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
living_mob_list += brainmob
|
||||
|
||||
user.drop_item()
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
name = "Man-Machine Interface: [brainmob.real_name]"
|
||||
icon_state = "mmi_full"
|
||||
@@ -114,6 +114,15 @@
|
||||
locked = 1
|
||||
return
|
||||
|
||||
/obj/item/device/mmi/Destroy()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/borg = loc
|
||||
borg.mmi = null
|
||||
if(brainmob)
|
||||
qdel(brainmob)
|
||||
brainmob = null
|
||||
..()
|
||||
|
||||
/obj/item/device/mmi/radio_enabled
|
||||
name = "radio-enabled man-machine interface"
|
||||
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity. This one comes with a built-in radio."
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
R.my_atom = src
|
||||
..()
|
||||
|
||||
Del()
|
||||
Destroy()
|
||||
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
|
||||
if(stat!=DEAD) //If not dead.
|
||||
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
if(brainmob && brainmob.client)
|
||||
brainmob.client.screen.len = null //clear the hud
|
||||
|
||||
/obj/item/organ/brain/Destroy()
|
||||
if(brainmob)
|
||||
qdel(brainmob)
|
||||
brainmob = null
|
||||
..()
|
||||
|
||||
/obj/item/organ/brain/proc/transfer_identity(var/mob/living/carbon/H)
|
||||
name = "\the [H]'s [initial(src.name)]"
|
||||
brainmob = new(src)
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
/mob/living/carbon/brain/gib()
|
||||
if(istype(container, /obj/item/device/mmi))
|
||||
del(container)//Gets rid of the MMI if there is one
|
||||
qdel(container)//Gets rid of the MMI if there is one
|
||||
if(loc)
|
||||
if(istype(loc,/obj/item/organ/brain))
|
||||
del(loc)//Gets rid of the brain item
|
||||
qdel(loc)//Gets rid of the brain item
|
||||
..(null,1)
|
||||
@@ -7,6 +7,13 @@
|
||||
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
|
||||
germ_level++
|
||||
|
||||
/mob/living/carbon/Destroy()
|
||||
for(var/guts in internal_organs)
|
||||
qdel(guts)
|
||||
for(var/food in stomach_contents)
|
||||
qdel(food)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/Move(NewLoc, direct)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
@@ -47,6 +47,11 @@
|
||||
dna.real_name = real_name
|
||||
make_blood()
|
||||
|
||||
/mob/living/carbon/human/Destroy()
|
||||
for(var/organ in organs)
|
||||
qdel(organ)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
@@ -65,7 +70,7 @@
|
||||
|
||||
if (internal)
|
||||
if (!internal.air_contents)
|
||||
del(internal)
|
||||
qdel(internal)
|
||||
else
|
||||
stat("Internal Atmosphere Info", internal.name)
|
||||
stat("Tank Pressure", internal.air_contents.return_pressure())
|
||||
@@ -818,7 +823,7 @@
|
||||
for(var/x in all_hairs)
|
||||
var/datum/sprite_accessory/hair/H = new x // create new hair datum based on type x
|
||||
hairs.Add(H.name) // add hair name to hairs
|
||||
del(H) // delete the hair after it's all done
|
||||
qdel(H) // delete the hair after it's all done
|
||||
|
||||
var/new_style = input("Please select hair style", "Character Generation",h_style) as null|anything in hairs
|
||||
|
||||
@@ -833,7 +838,7 @@
|
||||
for(var/x in all_fhairs)
|
||||
var/datum/sprite_accessory/facial_hair/H = new x
|
||||
fhairs.Add(H.name)
|
||||
del(H)
|
||||
qdel(H)
|
||||
|
||||
new_style = input("Please select facial style", "Character Generation",f_style) as null|anything in fhairs
|
||||
|
||||
@@ -944,7 +949,7 @@
|
||||
if(H.brainmob.real_name == src.real_name)
|
||||
if(H.brainmob.mind)
|
||||
H.brainmob.mind.transfer_to(src)
|
||||
del(H)
|
||||
qdel(H)
|
||||
|
||||
for (var/datum/disease/virus in viruses)
|
||||
virus.cure()
|
||||
@@ -1017,7 +1022,7 @@
|
||||
.=..()
|
||||
if(clean_feet && !shoes && istype(feet_blood_DNA, /list) && feet_blood_DNA.len)
|
||||
feet_blood_color = null
|
||||
del(feet_blood_DNA)
|
||||
qdel(feet_blood_DNA)
|
||||
update_inv_shoes(1)
|
||||
return 1
|
||||
|
||||
@@ -1143,7 +1148,7 @@
|
||||
if(client && client.screen)
|
||||
client.screen.len = null
|
||||
if(hud_used)
|
||||
del(hud_used)
|
||||
qdel(hud_used)
|
||||
hud_used = new /datum/hud(src)
|
||||
|
||||
if(species)
|
||||
@@ -1358,4 +1363,4 @@
|
||||
/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
|
||||
if(W in organs)
|
||||
return
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -337,12 +337,12 @@
|
||||
visible_message("<span class='danger'>[user] has broken [src]'s grip on [lgrab.affecting]!</span>")
|
||||
success = 1
|
||||
spawn(1)
|
||||
del(lgrab)
|
||||
qdel(lgrab)
|
||||
if(istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/rgrab = r_hand
|
||||
if(rgrab.affecting)
|
||||
visible_message("<span class='danger'>[user] has broken [src]'s grip on [rgrab.affecting]!</span>")
|
||||
success = 1
|
||||
spawn(1)
|
||||
del(rgrab)
|
||||
qdel(rgrab)
|
||||
return success
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
qdel(spark_system)
|
||||
|
||||
//Handles chem traces
|
||||
/mob/living/carbon/human/proc/handle_trace_chems()
|
||||
|
||||
@@ -34,7 +34,7 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
if (equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
|
||||
return slot
|
||||
if (del_on_fail)
|
||||
del(W)
|
||||
qdel(W)
|
||||
return null
|
||||
|
||||
|
||||
@@ -317,6 +317,48 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
|
||||
return 1
|
||||
|
||||
//Checks if a given slot can be accessed at this time, either to equip or unequip I
|
||||
/mob/living/carbon/human/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null)
|
||||
var/obj/item/covering = null
|
||||
var/check_flags = 0
|
||||
|
||||
switch(slot)
|
||||
if(slot_wear_mask)
|
||||
covering = src.head
|
||||
check_flags = HEADCOVERSMOUTH
|
||||
if(slot_glasses)
|
||||
covering = src.head
|
||||
check_flags = HEADCOVERSEYES
|
||||
if(slot_gloves, slot_w_uniform)
|
||||
covering = src.wear_suit
|
||||
|
||||
if(covering)
|
||||
if((covering.body_parts_covered & I.body_parts_covered) || (covering.flags & check_flags))
|
||||
user << "<span class='warning'>\The [covering] is in the way.</span>"
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/get_equipped_item(var/slot)
|
||||
switch(slot)
|
||||
if(slot_wear_suit) return wear_suit
|
||||
if(slot_gloves) return gloves
|
||||
if(slot_shoes) return shoes
|
||||
if(slot_belt) return belt
|
||||
if(slot_glasses) return glasses
|
||||
if(slot_head) return head
|
||||
if(slot_l_ear) return l_ear
|
||||
if(slot_r_ear) return r_ear
|
||||
if(slot_w_uniform) return w_uniform
|
||||
if(slot_wear_id) return wear_id
|
||||
if(slot_l_store) return l_store
|
||||
if(slot_r_store) return r_store
|
||||
if(slot_s_store) return s_store
|
||||
if(slot_handcuffed) return handcuffed
|
||||
if(slot_legcuffed) return legcuffed
|
||||
return ..()
|
||||
|
||||
///Bizarre equip effect system below
|
||||
|
||||
/*
|
||||
MouseDrop human inventory menu
|
||||
*/
|
||||
@@ -341,9 +383,9 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
|
||||
/obj/effect/equip_e/New()
|
||||
if (!ticker)
|
||||
del(src)
|
||||
qdel(src)
|
||||
spawn(100)
|
||||
del(src)
|
||||
qdel(src)
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -354,22 +396,22 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
switch(place)
|
||||
if("mask")
|
||||
if (!( target.wear_mask ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("l_hand")
|
||||
if (!( target.l_hand ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("r_hand")
|
||||
if (!( target.r_hand ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("suit")
|
||||
if (!( target.wear_suit ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("uniform")
|
||||
if (!( target.w_uniform ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("back")
|
||||
if (!( target.back ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("syringe")
|
||||
return
|
||||
if("pill")
|
||||
@@ -382,10 +424,10 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
return
|
||||
if("handcuff")
|
||||
if (!( target.handcuffed ))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("id")
|
||||
if ((!( target.wear_id ) || !( target.w_uniform )))
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("splints")
|
||||
var/count = 0
|
||||
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
|
||||
@@ -394,19 +436,19 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
count = 1
|
||||
break
|
||||
if(count == 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if("sensor")
|
||||
if (! target.w_uniform )
|
||||
del(src)
|
||||
qdel(src)
|
||||
if("internal")
|
||||
if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && (istype(target.back, /obj/item/weapon/tank) || istype(target.belt, /obj/item/weapon/tank) || istype(target.s_store, /obj/item/weapon/tank)) && !( target.internal )) ) && !( target.internal )))
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel", "sensor", "internal", "tie")
|
||||
if ((item && !( L.Find(place) )))
|
||||
if(isrobot(source) && place != "handcuff")
|
||||
del(src)
|
||||
qdel(src)
|
||||
for(var/mob/O in viewers(target, null))
|
||||
O.show_message("\red <B>[source] is trying to put \a [item] on [target]</B>", 1)
|
||||
else
|
||||
@@ -508,7 +550,7 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
message = "\red <B>[source] is trying to empty [target]'s pockets.</B>"
|
||||
if("CPR")
|
||||
if (!target.cpr_time)
|
||||
del(src)
|
||||
qdel(src)
|
||||
target.cpr_time = 0
|
||||
message = "\red <B>[source] is trying perform CPR on [target]!</B>"
|
||||
if("internal")
|
||||
@@ -566,7 +608,7 @@ It can still be worn/put on as normal.
|
||||
if ((source.restrained() || source.stat)) return //Source restrained or unconscious / dead
|
||||
|
||||
var/slot_to_process
|
||||
var/strip_item //this will tell us which item we will be stripping - if any.
|
||||
var/obj/item/strip_item //this will tell us which item we will be stripping - if any.
|
||||
|
||||
switch(place) //here we go again...
|
||||
if("mask")
|
||||
@@ -607,13 +649,13 @@ It can still be worn/put on as normal.
|
||||
strip_item = target.shoes
|
||||
if("l_hand")
|
||||
if (istype(target, /obj/item/clothing/suit/straight_jacket))
|
||||
del(src)
|
||||
qdel(src)
|
||||
slot_to_process = slot_l_hand
|
||||
if (target.l_hand)
|
||||
strip_item = target.l_hand
|
||||
if("r_hand")
|
||||
if (istype(target, /obj/item/clothing/suit/straight_jacket))
|
||||
del(src)
|
||||
qdel(src)
|
||||
slot_to_process = slot_r_hand
|
||||
if (target.r_hand)
|
||||
strip_item = target.r_hand
|
||||
@@ -700,11 +742,11 @@ It can still be worn/put on as normal.
|
||||
S.add_fingerprint(source)
|
||||
if (!( istype(S, /obj/item/weapon/dnainjector) ))
|
||||
S.inuse = 0
|
||||
del(src)
|
||||
qdel(src)
|
||||
S.inject(target, source)
|
||||
if (S.s_time >= world.time + 30)
|
||||
S.inuse = 0
|
||||
del(src)
|
||||
qdel(src)
|
||||
S.s_time = world.time
|
||||
for(var/mob/O in viewers(source, null))
|
||||
O.show_message("\red [source] injects [target] with the DNA Injector!", 1)
|
||||
@@ -748,19 +790,23 @@ It can still be worn/put on as normal.
|
||||
target.internals.icon_state = "internal1"
|
||||
if(slot_to_process)
|
||||
if(strip_item) //Stripping an item from the mob
|
||||
var/obj/item/W = strip_item
|
||||
target.remove_from_mob(W)
|
||||
W.add_fingerprint(source)
|
||||
if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;)
|
||||
if(target.r_store)
|
||||
target.remove_from_mob(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
|
||||
else
|
||||
if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob
|
||||
if(item.mob_can_equip(target, slot_to_process, 0))
|
||||
source.remove_from_mob(item)
|
||||
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
|
||||
if(strip_item.mob_can_unequip(target, slot_to_process, 0))
|
||||
target.drop_from_inventory(strip_item)
|
||||
source.put_in_hands(strip_item)
|
||||
strip_item.add_fingerprint(source)
|
||||
if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;)
|
||||
if(target.r_store)
|
||||
target.drop_from_inventory(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
|
||||
else
|
||||
source << "<span class='warning'>You fail to remove \the [strip_item] from [target]!</span>"
|
||||
else if(item)
|
||||
if(target.has_organ_for_slot(slot_to_process) && item.mob_can_equip(target, slot_to_process, 0)) //Placing an item on the mob
|
||||
source.drop_from_inventory(item)
|
||||
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
|
||||
else
|
||||
source << "<span class='warning'>You fail to place \the [item] on [target]!</span>"
|
||||
|
||||
if(source && target)
|
||||
if(source.machine == target)
|
||||
target.show_inv(source)
|
||||
del(src)
|
||||
qdel(src)
|
||||
@@ -974,7 +974,7 @@
|
||||
|
||||
else
|
||||
for(var/atom/a in hallucinations)
|
||||
del a
|
||||
qdel(a)
|
||||
|
||||
if(halloss > 100)
|
||||
src << "<span class='notice'>You're in too much pain to keep going...</span>"
|
||||
@@ -1404,7 +1404,7 @@
|
||||
if(M.stat == 2)
|
||||
M.death(1)
|
||||
stomach_contents.Remove(M)
|
||||
del(M)
|
||||
qdel(M)
|
||||
continue
|
||||
if(air_master.current_cycle%3==1)
|
||||
if(!(M.status_flags & GODMODE))
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
/datum/species/shadow/handle_death(var/mob/living/carbon/human/H)
|
||||
spawn(1)
|
||||
new /obj/effect/decal/cleanable/ash(H.loc)
|
||||
del(H)
|
||||
qdel(H)
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
for(var/obj/item/organ/organ in H.contents)
|
||||
if((organ in H.organs) || (organ in H.internal_organs))
|
||||
del(organ)
|
||||
qdel(organ)
|
||||
|
||||
if(H.organs) H.organs.Cut()
|
||||
if(H.internal_organs) H.internal_organs.Cut()
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
if(D.client)
|
||||
D.loc = H.loc
|
||||
else
|
||||
del(D)
|
||||
qdel(D)
|
||||
|
||||
H.visible_message("\red[H] splits apart with a wet slithering noise!")
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
spawn(0)
|
||||
AddInfectionImages(affected_mob)
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/alien_embryo/Del()
|
||||
/obj/item/alien_embryo/Destroy()
|
||||
if(affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
spawn(0)
|
||||
@@ -98,7 +98,7 @@
|
||||
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention
|
||||
if(gib_on_success)
|
||||
affected_mob.gib()
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/*----------------------------------------
|
||||
Proc: RefreshInfectionImage()
|
||||
@@ -114,7 +114,7 @@ Des: Removes all infection images from aliens and places an infection image on a
|
||||
if(alien.client)
|
||||
for(var/image/I in alien.client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected"))
|
||||
del(I)
|
||||
qdel(I)
|
||||
for(var/mob/living/L in mob_list)
|
||||
if(iscorgi(L) || iscarbon(L))
|
||||
if(L.status_flags & XENO_HOST)
|
||||
@@ -156,4 +156,4 @@ Des: Removes the alien infection image from all aliens in the world located in p
|
||||
for(var/image/I in alien.client.images)
|
||||
if(I.loc == C)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected"))
|
||||
del(I)
|
||||
qdel(I)
|
||||
@@ -41,7 +41,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
if(config.aliens_allowed)
|
||||
..()
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/examine(mob/user)
|
||||
..(user)
|
||||
|
||||
@@ -45,7 +45,7 @@ Des: Removes all infected images from the alien.
|
||||
if (client)
|
||||
for(var/image/I in client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected"))
|
||||
del(I)
|
||||
qdel(I)
|
||||
return
|
||||
|
||||
/* TODO: Convert this over.
|
||||
|
||||
@@ -239,7 +239,7 @@ var/global/list/damage_icon_parts = list()
|
||||
//0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic.
|
||||
//Create a new, blank icon for our mob to use.
|
||||
if(stand_icon)
|
||||
del(stand_icon)
|
||||
qdel(stand_icon)
|
||||
stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank")
|
||||
var/icon_key = "[species.race_key][g][s_tone][r_skin][g_skin][b_skin]"
|
||||
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
|
||||
@@ -412,7 +412,7 @@ var/global/list/damage_icon_parts = list()
|
||||
if (targeted_by && target_locked)
|
||||
overlays_standing[TARGETED_LAYER] = target_locked
|
||||
else if (!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
qdel(target_locked)
|
||||
if (!targeted_by)
|
||||
overlays_standing[TARGETED_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
@@ -497,14 +497,9 @@ var/global/list/damage_icon_parts = list()
|
||||
overlays_standing[UNIFORM_LAYER] = standing
|
||||
else
|
||||
overlays_standing[UNIFORM_LAYER] = null
|
||||
// This really, really seems like it should not be mixed in the middle of display code...
|
||||
// Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY
|
||||
for( var/obj/item/thing in list(r_store, l_store, wear_id, belt) )
|
||||
if(thing)
|
||||
drop_from_inventory(thing)
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
update_icons()
|
||||
|
||||
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
|
||||
if(wear_id)
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
//now mobs
|
||||
var/speech_bubble_test = say_test(message)
|
||||
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]")
|
||||
spawn(30) del(speech_bubble)
|
||||
spawn(30) qdel(speech_bubble)
|
||||
|
||||
for(var/mob/M in listening)
|
||||
M << speech_bubble
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
user <<"You apply the enhancer. It now has triple the amount of uses."
|
||||
Uses = 3
|
||||
enhanced = 1
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
/obj/item/slime_extract/New()
|
||||
..()
|
||||
@@ -145,14 +145,14 @@
|
||||
pet.icon_dead = "[M.colour] baby slime dead"
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del(M)
|
||||
qdel(M)
|
||||
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
pet.name = newname
|
||||
pet.real_name = newname
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/slimepotion2
|
||||
name = "advanced docility potion"
|
||||
@@ -176,14 +176,14 @@
|
||||
pet.icon_dead = "[M.colour] baby slime dead"
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del(M)
|
||||
qdel(M)
|
||||
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
pet.name = newname
|
||||
pet.real_name = newname
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/item/weapon/slimesteroid
|
||||
@@ -208,7 +208,7 @@
|
||||
|
||||
user <<"You feed the slime the steroid. It now has triple the amount of extract."
|
||||
M.cores = 3
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/slimesteroid2
|
||||
name = "extract enhancer"
|
||||
@@ -227,7 +227,7 @@
|
||||
user <<"You apply the enhancer. It now has triple the amount of uses."
|
||||
target.Uses = 3
|
||||
target.enahnced = 1
|
||||
del(src)*/
|
||||
qdel(src)*/
|
||||
|
||||
/obj/effect/golemrune
|
||||
anchored = 1
|
||||
@@ -268,7 +268,7 @@
|
||||
G.set_species("Golem")
|
||||
G.key = ghost.key
|
||||
G << "You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve [user], and assist them in completing their goals at any cost."
|
||||
del (src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
proc/announce_to_ghosts()
|
||||
@@ -350,7 +350,7 @@
|
||||
spawn(rand(50,100))
|
||||
src.visible_message("<span class='warning'> The [name] bursts open!</span>")
|
||||
new/mob/living/carbon/slime(T)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/egg/slime/process()
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
var/f_loss = null
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if (2.0)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user