mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
HOSTS OF OTHER SERVERS, READ THIS ONE TOO!!!! Administrator ranks renamed: - Host => Game Master - Coder => Game Agmin - Shit Guy => Admin who Sinned - PA => Trial Agmin - Administrator => Agmin Candidate - SA => Temporary Agmin - Moderator => Agmin Observer - Filthy Xeno => Punnished Agmin Promotion and Demotion ingame can now only be done by Game Admins and Game Masters. THIS COMMIT INCLUDES THE NEW admins.txt FILE FOR TGSTATION. IT USES THE NEW RANK NAMES. ALL OTHER SERVER HOSTS ARE TO UPDATE THEIR ADMIN FILES TO THE NEW RANK NAMES WHEN THEY UPDATE PAST THIS REVISION. Don't yell at me, as if I didn't tell you in caps... git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1318 316c924e-a436-60f5-8080-3fe189b3f50e
372 lines
8.9 KiB
Plaintext
372 lines
8.9 KiB
Plaintext
/client/proc/cmd_modify_object_variables(obj/O as obj|mob|turf|area in world)
|
|
set category = "Debug"
|
|
set name = "Edit Variables"
|
|
set desc="(target) Edit a target item's variables"
|
|
src.modify_variables(O)
|
|
|
|
/client/proc/cmd_modify_ticker_variables()
|
|
set category = "Debug"
|
|
set name = "Edit Ticker Variables"
|
|
|
|
if (ticker == null)
|
|
src << "Game hasn't started yet."
|
|
else
|
|
src.modify_variables(ticker)
|
|
|
|
/client/proc/mod_list_add_ass() //haha
|
|
|
|
var/class = input("What kind of variable?","Variable Type") as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
var/var_value = null
|
|
|
|
switch(class)
|
|
|
|
if("text")
|
|
var_value = input("Enter new text:","Text") as text
|
|
|
|
if("num")
|
|
var_value = input("Enter new number:","Num") as num
|
|
|
|
if("type")
|
|
var_value = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
|
|
|
if("reference")
|
|
var_value = input("Select reference:","Reference") as mob|obj|turf|area in world
|
|
|
|
if("mob reference")
|
|
var_value = input("Select reference:","Reference") as mob in world
|
|
|
|
if("file")
|
|
var_value = input("Pick file:","File") as file
|
|
|
|
if("icon")
|
|
var_value = input("Pick icon:","Icon") as icon
|
|
|
|
if(!var_value) return
|
|
|
|
return var_value
|
|
|
|
|
|
/client/proc/mod_list_add(var/list/L)
|
|
|
|
var/class = input("What kind of variable?","Variable Type") as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
var/var_value = null
|
|
|
|
switch(class)
|
|
|
|
if("text")
|
|
var_value = input("Enter new text:","Text") as text
|
|
|
|
if("num")
|
|
var_value = input("Enter new number:","Num") as num
|
|
|
|
if("type")
|
|
var_value = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
|
|
|
if("reference")
|
|
var_value = input("Select reference:","Reference") as mob|obj|turf|area in world
|
|
|
|
if("mob reference")
|
|
var_value = input("Select reference:","Reference") as mob in world
|
|
|
|
if("file")
|
|
var_value = input("Pick file:","File") as file
|
|
|
|
if("icon")
|
|
var_value = input("Pick icon:","Icon") as icon
|
|
|
|
if(!var_value) return
|
|
|
|
switch(alert("Would you like to associate a var with the list entry?",,"Yes","No"))
|
|
if("Yes")
|
|
L += var_value
|
|
L[var_value] = mod_list_add_ass() //haha
|
|
if("No")
|
|
L += var_value
|
|
|
|
|
|
/client/proc/mod_list(var/list/L)
|
|
if(!istype(L,/list)) src << "Not a List."
|
|
|
|
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
|
|
|
|
var/list/names = sortList(L)
|
|
|
|
var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)"
|
|
|
|
if(variable == "(ADD VAR)")
|
|
mod_list_add(L)
|
|
return
|
|
|
|
if(!variable)
|
|
return
|
|
|
|
var/default
|
|
|
|
var/dir
|
|
|
|
if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin")))
|
|
return
|
|
|
|
if(isnull(variable))
|
|
usr << "Unable to determine variable type."
|
|
|
|
else if(isnum(variable))
|
|
usr << "Variable appears to be <b>NUM</b>."
|
|
default = "num"
|
|
dir = 1
|
|
|
|
else if(istext(variable))
|
|
usr << "Variable appears to be <b>TEXT</b>."
|
|
default = "text"
|
|
|
|
else if(isloc(variable))
|
|
usr << "Variable appears to be <b>REFERENCE</b>."
|
|
default = "reference"
|
|
|
|
else if(isicon(variable))
|
|
usr << "Variable appears to be <b>ICON</b>."
|
|
variable = "\icon[variable]"
|
|
default = "icon"
|
|
|
|
else if(istype(variable,/atom) || istype(variable,/datum))
|
|
usr << "Variable appears to be <b>TYPE</b>."
|
|
default = "type"
|
|
|
|
else if(istype(variable,/list))
|
|
usr << "Variable appears to be <b>LIST</b>."
|
|
default = "list"
|
|
|
|
else if(istype(variable,/client))
|
|
usr << "Variable appears to be <b>CLIENT</b>."
|
|
default = "cancel"
|
|
|
|
else
|
|
usr << "Variable appears to be <b>FILE</b>."
|
|
default = "file"
|
|
|
|
usr << "Variable contains: [variable]"
|
|
if(dir)
|
|
switch(variable)
|
|
if(1)
|
|
dir = "NORTH"
|
|
if(2)
|
|
dir = "SOUTH"
|
|
if(4)
|
|
dir = "EAST"
|
|
if(8)
|
|
dir = "WEST"
|
|
if(5)
|
|
dir = "NORTHEAST"
|
|
if(6)
|
|
dir = "SOUTHEAST"
|
|
if(9)
|
|
dir = "NORTHWEST"
|
|
if(10)
|
|
dir = "SOUTHWEST"
|
|
else
|
|
dir = null
|
|
|
|
if(dir)
|
|
usr << "If a direction, direction is: [dir]"
|
|
|
|
var/class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object", "(DELETE FROM LIST)","restore to default")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
switch(class)
|
|
|
|
if("list")
|
|
mod_list(variable)
|
|
|
|
if("restore to default")
|
|
variable = initial(variable)
|
|
|
|
if("edit referenced object")
|
|
modify_variables(variable)
|
|
|
|
if("(DELETE FROM LIST)")
|
|
L -= variable
|
|
return
|
|
|
|
if("text")
|
|
variable = input("Enter new text:","Text",\
|
|
variable) as text
|
|
|
|
if("num")
|
|
variable = input("Enter new number:","Num",\
|
|
variable) as num
|
|
|
|
if("type")
|
|
variable = input("Enter type:","Type",variable) \
|
|
in typesof(/obj,/mob,/area,/turf)
|
|
|
|
if("reference")
|
|
variable = input("Select reference:","Reference",\
|
|
variable) as mob|obj|turf|area in world
|
|
|
|
if("mob reference")
|
|
variable = input("Select reference:","Reference",\
|
|
variable) as mob in world
|
|
|
|
if("file")
|
|
variable = input("Pick file:","File",variable) \
|
|
as file
|
|
|
|
if("icon")
|
|
variable = input("Pick icon:","Icon",variable) \
|
|
as icon
|
|
|
|
|
|
/client/proc/modify_variables(var/atom/O)
|
|
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
|
|
|
|
if(!src.authenticated || !src.holder)
|
|
src << "Only administrators may use this command."
|
|
return
|
|
|
|
var/list/names = list()
|
|
for (var/V in O.vars)
|
|
names += V
|
|
|
|
names = sortList(names)
|
|
|
|
var/variable = input("Which var?","Var") as null|anything in names
|
|
if(!variable)
|
|
return
|
|
var/default
|
|
var/var_value = O.vars[variable]
|
|
var/dir
|
|
|
|
if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin")))
|
|
return
|
|
|
|
if(isnull(var_value))
|
|
usr << "Unable to determine variable type."
|
|
|
|
else if(isnum(var_value))
|
|
usr << "Variable appears to be <b>NUM</b>."
|
|
default = "num"
|
|
dir = 1
|
|
|
|
else if(istext(var_value))
|
|
usr << "Variable appears to be <b>TEXT</b>."
|
|
default = "text"
|
|
|
|
else if(isloc(var_value))
|
|
usr << "Variable appears to be <b>REFERENCE</b>."
|
|
default = "reference"
|
|
|
|
else if(isicon(var_value))
|
|
usr << "Variable appears to be <b>ICON</b>."
|
|
var_value = "\icon[var_value]"
|
|
default = "icon"
|
|
|
|
else if(istype(var_value,/atom) || istype(var_value,/datum))
|
|
usr << "Variable appears to be <b>TYPE</b>."
|
|
default = "type"
|
|
|
|
else if(istype(var_value,/list))
|
|
usr << "Variable appears to be <b>LIST</b>."
|
|
default = "list"
|
|
|
|
else if(istype(var_value,/client))
|
|
usr << "Variable appears to be <b>CLIENT</b>."
|
|
default = "cancel"
|
|
|
|
else
|
|
usr << "Variable appears to be <b>FILE</b>."
|
|
default = "file"
|
|
|
|
usr << "Variable contains: [var_value]"
|
|
if(dir)
|
|
switch(var_value)
|
|
if(1)
|
|
dir = "NORTH"
|
|
if(2)
|
|
dir = "SOUTH"
|
|
if(4)
|
|
dir = "EAST"
|
|
if(8)
|
|
dir = "WEST"
|
|
if(5)
|
|
dir = "NORTHEAST"
|
|
if(6)
|
|
dir = "SOUTHEAST"
|
|
if(9)
|
|
dir = "NORTHWEST"
|
|
if(10)
|
|
dir = "SOUTHWEST"
|
|
else
|
|
dir = null
|
|
if(dir)
|
|
usr << "If a direction, direction is: [dir]"
|
|
|
|
var/class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
var/original_name
|
|
|
|
if (!istype(O, /atom))
|
|
original_name = "\ref[O] ([O])"
|
|
else
|
|
original_name = O:name
|
|
|
|
switch(class)
|
|
|
|
if("list")
|
|
mod_list(O.vars[variable])
|
|
return
|
|
|
|
if("restore to default")
|
|
O.vars[variable] = initial(O.vars[variable])
|
|
|
|
if("edit referenced object")
|
|
return .(O.vars[variable])
|
|
|
|
if("text")
|
|
O.vars[variable] = input("Enter new text:","Text",\
|
|
O.vars[variable]) as text
|
|
|
|
if("num")
|
|
O.vars[variable] = input("Enter new number:","Num",\
|
|
O.vars[variable]) as num
|
|
|
|
if("type")
|
|
O.vars[variable] = input("Enter type:","Type",O.vars[variable]) \
|
|
in typesof(/obj,/mob,/area,/turf)
|
|
|
|
if("reference")
|
|
O.vars[variable] = input("Select reference:","Reference",\
|
|
O.vars[variable]) as mob|obj|turf|area in world
|
|
|
|
if("mob reference")
|
|
O.vars[variable] = input("Select reference:","Reference",\
|
|
O.vars[variable]) as mob in world
|
|
|
|
if("file")
|
|
O.vars[variable] = input("Pick file:","File",O.vars[variable]) \
|
|
as file
|
|
|
|
if("icon")
|
|
O.vars[variable] = input("Pick icon:","Icon",O.vars[variable]) \
|
|
as icon
|
|
|
|
log_admin("[key_name(src)] modified [original_name]'s [variable] to [O.vars[variable]]")
|
|
message_admins("[key_name_admin(src)] modified [original_name]'s [variable] to [O.vars[variable]]", 1)
|
|
|