Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
+103 -90
View File
@@ -33,17 +33,36 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!check_rights(R_DEBUG)) return
var/datum/target = null
var/target = null
var/targetselected = 0
var/returnval = null
var/class = null
switch(alert("Proc owned by something?",,"Yes","No"))
if("Yes")
targetselected = 1
var/list/value = vv_get_value(default_class = VV_ATOM_REFERENCE, classes = list(VV_ATOM_REFERENCE, VV_DATUM_REFERENCE, VV_MOB_REFERENCE, VV_CLIENT))
if (!value["class"] || !value["value"])
return
target = value["value"]
if(src.holder && src.holder.marked_datum)
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client","Marked datum ([holder.marked_datum.type])")
if(class == "Marked datum ([holder.marked_datum.type])")
class = "Marked datum"
else
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client")
switch(class)
if("Obj")
target = input("Enter target:","Target",usr) as obj in world
if("Mob")
target = input("Enter target:","Target",usr) as mob in world
if("Area or Turf")
target = input("Enter target:","Target",usr.loc) as area|turf in world
if("Client")
var/list/keys = list()
for(var/client/C)
keys += C
target = input("Please, select a player!", "Selection", null, null) as null|anything in keys
if("Marked datum")
target = holder.marked_datum
else
return
if("No")
target = null
targetselected = 0
@@ -51,9 +70,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null
if(!procname)
return
if(targetselected && !hascall(target,procname))
usr << "<font color='red'>Error: callproc(): type [target.type] has no proc named [procname].</font>"
usr << "<font color='red'>Error: callproc(): target has no such call [procname].</font>"
return
else
var/procpath = text2path(procname)
@@ -81,7 +99,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
usr << .
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/callproc_datum(datum/A as null|area|mob|obj|turf)
/client/proc/callproc_datum(A as null|area|mob|obj|turf)
set category = "Debug"
set name = "Atom ProcCall"
set waitfor = 0
@@ -93,7 +111,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!procname)
return
if(!hascall(A,procname))
usr << "<font color='red'>Error: callproc_datum(): type [A.type] has no proc named [procname].</font>"
usr << "<span class='warning'>Error: callproc_datum(): target has no such call [procname].</span>"
return
var/list/lst = get_callproc_args()
if(!lst)
@@ -115,17 +133,59 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
/client/proc/get_callproc_args()
var/argnum = input("Number of arguments","Number:",0) as num|null
if(isnull(argnum))
if(!argnum && (argnum!=0))
return
var/list/lst = list()
//TODO: make a list to store whether each argument was initialised as null.
//Reason: So we can abort the proccall if say, one of our arguments was a mob which no longer exists
//this will protect us from a fair few errors ~Carn
while(argnum--)
var/value = vv_get_value(restricted_classes = list(VV_RESTORE_DEFAULT))
if (!value["class"])
return
lst += value["value"]
var/class = null
// Make a list with each index containing one variable, to be given to the proc
if(src.holder && src.holder.marked_datum)
class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","icon","file","client","mob's area","Marked datum ([holder.marked_datum.type])","CANCEL")
if(holder.marked_datum && class == "Marked datum ([holder.marked_datum.type])")
class = "Marked datum"
else
class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","icon","file","client","mob's area","CANCEL")
switch(class)
if("CANCEL")
return null
if("text")
lst += input("Enter new text:","Text",null) as text
if("num")
lst += input("Enter new number:","Num",0) as num
if("type")
lst += input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
if("reference")
lst += input("Select reference:","Reference",src) as mob|obj|turf|area in world
if("mob reference")
lst += input("Select reference:","Reference",usr) as mob in world
if("file")
lst += input("Pick file:","File") as file
if("icon")
lst += input("Pick icon:","Icon") as icon
if("client")
var/list/keys = list()
for(var/mob/M in world)
keys += M.client
lst += input("Please, select a player!", "Selection", null, null) as null|anything in keys
if("mob's area")
var/mob/temp = input("Select mob", "Selection", usr) as mob in world
lst += temp.loc
if("Marked datum")
lst += holder.marked_datum
return lst
@@ -150,7 +210,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
. += "</font>"
else
. = "<font color='blue'>[procname] returned: [!isnull(returnval) ? returnval : "null"]</font>"
. = "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
/client/proc/Cell()
@@ -160,7 +220,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
var/turf/T = mob.loc
if(!isturf(T))
if (!( istype(T, /turf) ))
return
var/datum/gas_mixture/env = T.return_air()
@@ -181,7 +241,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!ticker || !ticker.mode)
alert("Wait until the game starts")
return
if(ishuman(M))
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has robotized [M.key].")
var/mob/living/carbon/human/H = M
spawn(0)
@@ -197,11 +257,11 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!ticker || !ticker.mode)
alert("Wait until the game starts")
return
if(ishuman(M))
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has blobized [M.key].")
var/mob/living/carbon/human/H = M
spawn(0)
var/mob/camera/blob/B = H.become_overmind(FALSE)
var/mob/camera/blob/B = H.become_overmind()
B.place_blob_core(B.base_point_rate, -1) //place them wherever they are
else
@@ -220,7 +280,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
alert("That mob doesn't seem to exist, close the panel and try again.")
return
if(isnewplayer(M))
if(istype(M, /mob/new_player))
alert("The mob must not be a new_player.")
return
@@ -241,7 +301,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available
if(!choice)
return 0
if(!isobserver(choice))
if(!istype(choice, /mob/dead/observer))
var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No")
if(confirm != "Yes")
return 0
@@ -298,51 +358,26 @@ var/list/TYPES_SHORTCUTS = list(
/obj/item/weapon/reagent_containers/food/drinks = "DRINK", //longest paths comes first
/obj/item/weapon/reagent_containers/food = "FOOD",
/obj/item/weapon/reagent_containers = "REAGENT_CONTAINERS",
/obj/item/weapon = "WEAPON",
/obj/machinery/atmospherics = "ATMOS_MECH",
/obj/machinery/atmospherics = "ATMOS",
/obj/machinery/portable_atmospherics = "PORT_ATMOS",
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/missile_rack = "MECHA_MISSILE_RACK",
/obj/item/mecha_parts/mecha_equipment = "MECHA_EQUIP",
/obj/item/organ = "ORGAN",
/obj/item = "ITEM",
/obj/machinery = "MACHINERY",
/obj/effect = "EFFECT",
/obj = "O",
/datum = "D",
/turf/open = "OPEN",
/turf/closed = "CLOSED",
/turf = "T",
/mob/living/carbon = "CARBON",
/mob/living/simple_animal = "SIMPLE",
/mob/living = "LIVING",
/mob = "M"
)
/proc/make_types_fancy(var/list/types)
if (ispath(types))
types = list(types)
. = list()
for(var/type in types)
var/typename = "[type]"
for (var/tn in TYPES_SHORTCUTS)
if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
break
.[typename] = type
/proc/get_fancy_list_of_atom_types()
var/static/list/pre_generated_list
if (!pre_generated_list) //init
pre_generated_list = make_types_fancy(typesof(/atom))
return pre_generated_list
/proc/get_fancy_list_of_datum_types()
var/static/list/pre_generated_list
if (!pre_generated_list) //init
pre_generated_list = make_types_fancy(sortList(typesof(/datum) - typesof(/atom)))
return pre_generated_list
var/global/list/g_fancy_list_of_types = null
/proc/get_fancy_list_of_types()
if (isnull(g_fancy_list_of_types)) //init
var/list/temp = sortList(subtypesof(/atom) - typesof(/area) - /atom/movable)
g_fancy_list_of_types = new(temp.len)
for(var/type in temp)
var/typename = "[type]"
for (var/tn in TYPES_SHORTCUTS)
if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
break
g_fancy_list_of_types[typename] = type
return g_fancy_list_of_types
/proc/filter_fancy_list(list/L, filter as text)
var/list/matches = new
@@ -357,7 +392,7 @@ var/list/TYPES_SHORTCUTS = list(
set category = "Debug"
set name = "Del-All"
var/list/matches = get_fancy_list_of_atom_types()
var/list/matches = get_fancy_list_of_types()
if (!isnull(object) && object!="")
matches = filter_fancy_list(matches, object)
@@ -392,7 +427,7 @@ var/list/TYPES_SHORTCUTS = list(
if(!ticker || !ticker.mode)
alert("Wait until the game starts")
return
if(ishuman(M))
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/worn = H.wear_id
var/obj/item/weapon/card/id/id = null
@@ -538,6 +573,7 @@ var/list/TYPES_SHORTCUTS = list(
if(!ishuman(M))
alert("Invalid mob")
return
//log_admin("[key_name(src)] has alienized [M.key].")
var/list/outfits = list("Naked","Custom","As Job...")
@@ -570,7 +606,9 @@ var/list/TYPES_SHORTCUTS = list(
return
feedback_add_details("admin_verb","SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
for (var/obj/item/I in M.get_equipped_items())
for (var/obj/item/I in M)
if (istype(I, /obj/item/weapon/implant))
continue
qdel(I)
switch(dresscode)
if ("Naked")
@@ -592,6 +630,7 @@ var/list/TYPES_SHORTCUTS = list(
log_admin("[key_name(usr)] changed the equipment of [key_name(M)] to [dresscode].")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] changed the equipment of [key_name_admin(M)] to [dresscode]..</span>")
return
/client/proc/startSinglo()
@@ -727,30 +766,4 @@ var/list/TYPES_SHORTCUTS = list(
var/datum/map_template/ruin/template = landmark.ruin_template
usr.forceMove(get_turf(landmark))
usr << "<span class='name'>[template.name]</span>"
usr << "<span class='italics'>[template.description]</span>"
/client/proc/clear_dynamic_transit()
set category = "Debug"
set name = "Clear Dynamic Transit"
set desc = "Deallocates all transit space, restoring it to round start \
conditions."
if(!holder)
return
SSshuttle.clear_transit = TRUE
message_admins("<span class='adminnotice'>[key_name_admin(src)] cleared dynamic transit space.</span>")
feedback_add_details("admin_verb","CDT") // If...
log_admin("[key_name(src)] cleared dynamic transit space.")
/client/proc/toggle_medal_disable()
set category = "Debug"
set name = "Toggle Medal Disable"
set desc = "Toggles the safety lock on trying to contact the medal hub."
if(!holder)
return
global.medals_enabled = !global.medals_enabled
message_admins("<span class='adminnotice'>[key_name_admin(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.</span>")
feedback_add_details("admin_verb","TMH") // If...
log_admin("[key_name(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
usr << "<span class='italics'>[template.description]</span>"