mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 16:47:13 +01:00
Merge branch 'master' of https://github.com/tgstation/-tg-station into Msg1Fix
Conflicts: code/modules/admin/admin_verbs.dm
This commit is contained in:
@@ -444,6 +444,7 @@ var/global/floorIsLava = 0
|
||||
<A href='?src=\ref[src];secretsfun=traitor_all'>Everyone is the traitor</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=guns'>Summon Guns</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=magic'>Summon Magic</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=events'>Summon Events (Toggle)</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=onlyone'>There can only be one!</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=retardify'>Make all players retarded</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=eagles'>Egalitarian Station Mode</A><BR>
|
||||
|
||||
@@ -49,9 +49,9 @@
|
||||
else
|
||||
ckey = src.ckey
|
||||
if(ckey)
|
||||
message_admins("<span class='admin'>[src.ckey] removed [ckey]'s Memo.</span>")
|
||||
log_admin("[src.ckey] removed Memo created by [ckey].")
|
||||
for(var/memo in F.dir)
|
||||
message_admins("<span class='admin'>[src.ckey] removed [ckey]'s Memo.</span>")
|
||||
log_admin("[src.ckey] removed Memo created by [F[memo]].")
|
||||
F.dir.Remove(ckey)
|
||||
|
||||
#undef MEMOFILE
|
||||
|
||||
@@ -112,7 +112,8 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/cmd_debug_del_all,
|
||||
/client/proc/restart_controller,
|
||||
/client/proc/enable_debug_verbs,
|
||||
/client/proc/callproc
|
||||
/client/proc/callproc,
|
||||
/client/proc/SDQL2_query
|
||||
)
|
||||
var/list/admin_verbs_possess = list(
|
||||
/proc/possess,
|
||||
@@ -453,18 +454,16 @@ var/list/admin_verbs_hideable = list(
|
||||
set category = "Special Verbs"
|
||||
set name = "Object Say"
|
||||
set desc = "Makes an object say something."
|
||||
if(istype(O))
|
||||
var/message = input("What do you want the message to be?", "Object Say") as text | null
|
||||
if(!message)
|
||||
return
|
||||
var/templanguages = O.languages
|
||||
O.languages |= ALL
|
||||
O.say(message)
|
||||
O.languages = templanguages
|
||||
log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z] say [message]")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. say [message]</span>")
|
||||
feedback_add_details("admin_verb","MS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
var/message = input(usr, "What do you want the message to be?", "Make Sound") as text | null
|
||||
if(!message)
|
||||
return
|
||||
var/templanguages = O.languages
|
||||
O.languages |= ALL
|
||||
O.say(message)
|
||||
O.languages = templanguages
|
||||
log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z] say \"[message]\"")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. say \"[message]\"</span>")
|
||||
feedback_add_details("admin_verb","OS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/client/proc/togglebuildmodeself()
|
||||
set name = "Toggle Build Mode Self"
|
||||
set category = "Special Verbs"
|
||||
|
||||
@@ -1296,9 +1296,9 @@
|
||||
|
||||
//Job + antagonist
|
||||
if(M.mind)
|
||||
special_role_description = "Role: <b>[M.mind.assigned_role]</b>; Antagonist: <font color='red'><b>[M.mind.special_role]</b></font>; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]"
|
||||
special_role_description = "Role: <b>[M.mind.assigned_role]</b>; Antagonist: <font color='red'><b>[M.mind.special_role]</b></font>"
|
||||
else
|
||||
special_role_description = "Role: <i>Mind datum missing</i> Antagonist: <i>Mind datum missing</i>; Has been rev: <i>Mind datum missing</i>;"
|
||||
special_role_description = "Role: <i>Mind datum missing</i> Antagonist: <i>Mind datum missing</i>"
|
||||
|
||||
//Health
|
||||
if(isliving(M))
|
||||
@@ -1853,6 +1853,22 @@
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","SM")
|
||||
rightandwrong(1, usr)
|
||||
if("events")
|
||||
if(events && !events.wizardmode)
|
||||
if(alert("Do you want to toggle summon events on?",,"Yes","No") == "Yes")
|
||||
summonevents()
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","SE")
|
||||
|
||||
else if(events && events.wizardmode)
|
||||
switch(alert("What would you like to do?",,"Intensify Summon Events","Turn Off Summon Events","Nothing"))
|
||||
if("Intensify Summon Events")
|
||||
summonevents()
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","SE")
|
||||
if("Turn Off Summon Events")
|
||||
events.toggleWizardmode()
|
||||
events.resetFrequency()
|
||||
if("dorf")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","DF")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Code taken from /bay/station.
|
||||
// Modified to allow consequtive querys in one invocation, terminated with ";"
|
||||
|
||||
// Examples
|
||||
/*
|
||||
@@ -10,6 +11,8 @@
|
||||
UPDATE /obj/machinery/light IN world SET color = "#0F0" WHERE icon_state == "tube1"
|
||||
-- Will delete all pickaxes. "IN world" is not required.
|
||||
DELETE /obj/item/weapon/pickaxe
|
||||
-- Will flicker the lights once, then turn all mobs green. The semicolon is important to separate the consecutive querys, but is not required for standard one-query use
|
||||
CALL flicker(1) ON /obj/machinery/light; UPDATE /mob SET color = "#00cc00"
|
||||
|
||||
--You can use operators other than ==, such as >, <=, != and etc..
|
||||
|
||||
@@ -31,123 +34,153 @@
|
||||
if(!query_list || query_list.len < 1)
|
||||
return
|
||||
|
||||
var/list/query_tree = SDQL_parse(query_list)
|
||||
var/list/querys = SDQL_parse(query_list)
|
||||
|
||||
if(query_tree.len < 1)
|
||||
if(!querys || querys.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
|
||||
|
||||
var/query_log = "[usr] executed SDQL query: \"[query_text]\"."
|
||||
world.log << query_log
|
||||
message_admins(query_log)
|
||||
log_game(query_log)
|
||||
|
||||
switch(query_tree[1])
|
||||
if("call")
|
||||
var/list/call_list = query_tree["call"]
|
||||
var/list/args_list = query_tree["args"]
|
||||
for(var/list/query_tree in querys)
|
||||
var/list/from_objs = list()
|
||||
var/list/select_types = list()
|
||||
|
||||
for(var/datum/d in objs)
|
||||
for(var/v in call_list)
|
||||
// To stop any procs which sleep from executing slowly.
|
||||
if(d)
|
||||
if(hascall(d, v))
|
||||
spawn() call(d, v)(arglist(args_list)) // Spawn in case the function sleeps.
|
||||
switch(query_tree[1])
|
||||
if("explain")
|
||||
SDQL_testout(query_tree["explain"])
|
||||
return
|
||||
|
||||
if("delete")
|
||||
for(var/datum/d in objs)
|
||||
del d
|
||||
if("call")
|
||||
if("on" in query_tree)
|
||||
select_types = query_tree["on"]
|
||||
else
|
||||
return
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
for(var/datum/t in objs)
|
||||
text += "<A HREF='?_src_=vars;Vars=\ref[t]'>\ref[t]</A>"
|
||||
if(istype(t, /atom))
|
||||
var/atom/a = t
|
||||
if("select", "delete", "update")
|
||||
select_types = query_tree[query_tree[1]]
|
||||
|
||||
if(a.x)
|
||||
text += ": [t] at ([a.x], [a.y], [a.z])<br>"
|
||||
from_objs = SDQL_from_objs(query_tree["from"])
|
||||
|
||||
else if(a.loc && a.loc.x)
|
||||
text += ": [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])<br>"
|
||||
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
|
||||
|
||||
switch(query_tree[1])
|
||||
if("call")
|
||||
var/list/call_list = query_tree["call"]
|
||||
var/list/args_list = query_tree["args"]
|
||||
|
||||
for(var/datum/d in objs)
|
||||
for(var/v in call_list)
|
||||
// To stop any procs which sleep from executing slowly.
|
||||
if(d)
|
||||
if(hascall(d, v))
|
||||
spawn() call(d, v)(arglist(args_list)) // Spawn in case the function sleeps.
|
||||
|
||||
if("delete")
|
||||
for(var/datum/d in objs)
|
||||
del d
|
||||
|
||||
if("select")
|
||||
var/text = ""
|
||||
for(var/datum/t in objs)
|
||||
text += "<A HREF='?_src_=vars;Vars=\ref[t]'>\ref[t]</A>"
|
||||
if(istype(t, /atom))
|
||||
var/atom/a = t
|
||||
|
||||
if(a.x)
|
||||
text += ": [t] at ([a.x], [a.y], [a.z])<br>"
|
||||
|
||||
else if(a.loc && a.loc.x)
|
||||
text += ": [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])<br>"
|
||||
|
||||
else
|
||||
text += ": [t]<br>"
|
||||
|
||||
else
|
||||
text += ": [t]<br>"
|
||||
|
||||
else
|
||||
text += ": [t]<br>"
|
||||
usr << browse(text, "window=SDQL-result")
|
||||
|
||||
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("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
|
||||
|
||||
if(istype(d, /turf))
|
||||
for(var/v in vals)
|
||||
if(v == "x" || v == "y" || v == "z")
|
||||
continue
|
||||
d.vars[v] = vals[v]
|
||||
|
||||
d.vars[v] = vals[v]
|
||||
|
||||
else
|
||||
for(var/v in vals)
|
||||
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()
|
||||
var/datum/SDQL_parser/parser = new()
|
||||
var/list/querys = list()
|
||||
var/list/query_tree = list()
|
||||
var/pos = 1
|
||||
var/querys_pos = 1
|
||||
var/do_parse = 0
|
||||
|
||||
for(var/val in query_list)
|
||||
if(val == ";")
|
||||
do_parse = 1
|
||||
else if(pos >= query_list.len)
|
||||
query_tree += val
|
||||
do_parse = 1
|
||||
|
||||
if(do_parse)
|
||||
parser.query = query_tree
|
||||
var/list/parsed_tree
|
||||
parsed_tree = parser.parse()
|
||||
if(parsed_tree.len > 0)
|
||||
querys.len = querys_pos
|
||||
querys[querys_pos] = parsed_tree
|
||||
querys_pos++
|
||||
else //There was an error so don't run anything, and tell the user which query has errored.
|
||||
usr << "<span class='danger'>Parsing error on [querys_pos]\th query. Nothing was executed.</span>"
|
||||
return list()
|
||||
query_tree = list()
|
||||
do_parse = 0
|
||||
else
|
||||
query_tree += val
|
||||
pos++
|
||||
|
||||
del(parser)
|
||||
|
||||
return query_tree
|
||||
return querys
|
||||
|
||||
|
||||
|
||||
@@ -350,7 +383,7 @@
|
||||
/proc/SDQL2_tokenize(query_text)
|
||||
|
||||
var/list/whitespace = list(" ", "\n", "\t")
|
||||
var/list/single = list("(", ")", ",", "+", "-", ".")
|
||||
var/list/single = list("(", ")", ",", "+", "-", ".", ";")
|
||||
var/list/multi = list(
|
||||
"=" = list("", "="),
|
||||
"<" = list("", "=", ">"),
|
||||
@@ -451,4 +484,4 @@
|
||||
|
||||
if(word != "")
|
||||
query_list += word
|
||||
return query_list
|
||||
return query_list
|
||||
|
||||
@@ -145,7 +145,6 @@ var/intercom_range_display_status = 0
|
||||
src.verbs += /client/proc/disable_communication
|
||||
src.verbs += /client/proc/print_pointers
|
||||
src.verbs += /client/proc/count_movable_instances
|
||||
src.verbs += /client/proc/SDQL2_query
|
||||
src.verbs += /client/proc/cmd_display_del_log
|
||||
//src.verbs += /client/proc/cmd_admin_rejuvenate
|
||||
|
||||
|
||||
@@ -333,8 +333,9 @@ client/proc/one_click_antag()
|
||||
if(candidates.len >= 3) //Minimum 3 to be considered a squad
|
||||
//Pick the lucky players
|
||||
var/numagents = min(5,candidates.len) //How many commandos to spawn
|
||||
while(numagents && deathsquadspawn.len && candidates.len)
|
||||
var/spawnloc = deathsquadspawn[1]
|
||||
var/list/spawnpoints = deathsquadspawn
|
||||
while(numagents && spawnpoints.len && candidates.len)
|
||||
var/spawnloc = spawnpoints[1]
|
||||
var/mob/dead/observer/chosen_candidate = pick(candidates)
|
||||
candidates -= chosen_candidate
|
||||
if(!chosen_candidate.key)
|
||||
@@ -374,9 +375,9 @@ client/proc/one_click_antag()
|
||||
|
||||
//Logging and cleanup
|
||||
if(numagents == 1)
|
||||
message_admins("The deathsquad has spawned with [key_name_admin(Commando)] as squad leader.")
|
||||
message_admins("The deathsquad has spawned with the mission: [mission].")
|
||||
log_game("[key_name(Commando)] has been selected as a Death Commando")
|
||||
deathsquadspawn -= spawnloc
|
||||
spawnpoints -= spawnloc
|
||||
numagents--
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user