"
if(sprite)
body += "| [bicon(D, use_class=0)] | "
else
body += ""
var/formatted_type = text("[D.type]")
if(length(formatted_type) > 25)
var/middle_point = length(formatted_type) / 2
var/splitpoint = findtext(formatted_type,"/",middle_point)
if(splitpoint)
formatted_type = "[copytext(formatted_type,1,splitpoint)] [copytext(formatted_type,splitpoint)]"
else
formatted_type = "Type too long" //No suitable splitpoint (/) found.
body += "[formatted_type]"
if(src.holder && src.holder.marked_datum && src.holder.marked_datum == D)
body += " Marked Object"
body += " "
body += " | "
body += " |
"
body += "E - Edit, tries to determine the variable type by itself. "
body += "C - Change, asks you for the var type first. "
body += "M - Mass modify: changes this variable for all objects of this type. "
body += "
"
body += ""
var/list/names = list()
for(var/V in D.vars)
names += V
names = sortList(names)
for(var/V in names)
body += debug_variable(V, D.vars[V], 0, D)
body += " "
var/html = ""
if(title)
html += "[title]"
html += {""}
html += ""
html += body.Join("")
html += {"
"}
html += ""
usr << browse(html, "window=variables[D.UID()];size=475x650")
return
/client/proc/debug_variable(name, value, level, var/datum/DA = null)
var/list/html = list()
if(DA)
html += "(E) (C) (M) "
else
html += ""
if(isnull(value))
html += "[name] = null"
else if(istext(value))
html += "[name] = \"[value]\""
else if(isicon(value))
#ifdef VARSICON
html += "[name] = /icon ([value]) [bicon(value, use_class=0)]"
#else
html += "[name] = /icon ([value])"
#endif
else if(istype(value, /image))
var/image/I = value
#ifdef VARSICON
html += "[name] \ref[value] = /image ([value]) [bicon(value, use_class=0)]"
#else
html += "[name] \ref[value] = /image ([value])"
#endif
else if(isfile(value))
html += "[name] = '[value]'"
else if(istype(value, /datum))
var/datum/D = value
html += "[name] \ref[value] = [D.type]"
else if(istype(value, /client))
var/client/C = value
html += "[name] \ref[value] = [C] [C.type]"
//
else if(istype(value, /list))
var/list/L = value
html += "[name] = /list ([L.len])"
if(L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500))
// not sure if this is completely right...
if(0) //(L.vars.len > 0)
html += ""
html += " "
else
html += ""
var/index = 1
for(var/entry in L)
if(istext(entry))
html += debug_variable(entry, L[entry], level + 1)
else
html += debug_variable(index, L[index], level + 1)
index++
html += " "
else
html += "[name] = [value]"
/*
// Bitfield stuff
if(round(value)==value) // Require integers.
var/idx=0
var/bit=0
var/bv=0
html += ""
for(var/block=0;block<8;block++)
html += " "
for(var/i=0;i<4;i++)
idx=(block*4)+i
to_chat(bit=1, idx)
bv=value & bit
html += "[bv?1:0]"
html += ""
html += " "
*/
html += ""
return html.Join("")
/client/proc/view_var_Topic(href, href_list, hsrc)
//This should all be moved over to datum/admins/Topic() or something ~Carn
if(!check_rights(R_ADMIN|R_MOD))
return
// Correct and warn about any VV topic links that aren't using UIDs
for(var/paramname in href_list)
if(findtext(href_list[paramname], "]_"))
continue // Contains UID-specific formatting, skip it
var/datum/D = locate(href_list[paramname])
if(!D)
continue
var/datuminfo = "[D]"
if(istype(D))
datuminfo = datum_info_line(D)
href_list[paramname] = D.UID()
else if(isclient(D))
var/client/C = D
href_list[paramname] = C.UID()
log_runtime(EXCEPTION("Found \\ref-based '[paramname]' param in VV topic for [datuminfo], should be UID: [href]"))
if(href_list["Vars"])
debug_variables(locateUID(href_list["Vars"]))
//~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records).
else if(href_list["rename"])
if(!check_rights(R_ADMIN)) return
var/mob/M = locateUID(href_list["rename"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
var/new_name = sanitize(copytext(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null,1,MAX_NAME_LEN))
if( !new_name || !M ) return
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].")
M.rename_character(M.real_name, new_name)
href_list["datumrefresh"] = href_list["rename"]
else if(href_list["varnameedit"] && href_list["datumedit"])
if(!check_rights(R_VAREDIT)) return
var/D = locateUID(href_list["datumedit"])
if(!istype(D,/datum) && !istype(D,/client))
to_chat(usr, "This can only be used on instances of types /client or /datum")
return
modify_variables(D, href_list["varnameedit"], 1)
else if(href_list["togbit"])
if(!check_rights(R_VAREDIT)) return
var/atom/D = locateUID(href_list["subject"])
if(!istype(D,/datum) && !istype(D,/client))
to_chat(usr, "This can only be used on instances of types /client or /datum")
return
if(!(href_list["var"] in D.vars))
to_chat(usr, "Unable to find variable specified.")
return
var/value = D.vars[href_list["var"]]
value ^= 1 << text2num(href_list["togbit"])
D.vars[href_list["var"]] = value
else if(href_list["varnamechange"] && href_list["datumchange"])
if(!check_rights(R_VAREDIT)) return
var/D = locateUID(href_list["datumchange"])
if(!istype(D,/datum) && !istype(D,/client))
to_chat(usr, "This can only be used on instances of types /client or /datum")
return
modify_variables(D, href_list["varnamechange"], 0)
else if(href_list["varnamemass"] && href_list["datummass"])
if(!check_rights(R_VAREDIT)) return
var/atom/A = locateUID(href_list["datummass"])
if(!istype(A))
to_chat(usr, "This can only be used on instances of type /atom")
return
cmd_mass_modify_object_variables(A, href_list["varnamemass"])
else if(href_list["mob_player_panel"])
if(!check_rights(R_ADMIN|R_MOD)) return
var/mob/M = locateUID(href_list["mob_player_panel"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
src.holder.show_player_panel(M)
href_list["datumrefresh"] = href_list["mob_player_panel"]
else if(href_list["give_spell"])
if(!check_rights(R_SERVER|R_EVENT)) return
var/mob/M = locateUID(href_list["give_spell"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
src.give_spell(M)
href_list["datumrefresh"] = href_list["give_spell"]
else if(href_list["give_disease"])
if(!check_rights(R_SERVER|R_EVENT)) return
var/mob/M = locateUID(href_list["give_disease"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
src.give_disease(M)
href_list["datumrefresh"] = href_list["give_spell"]
else if(href_list["godmode"])
if(!check_rights(R_REJUVINATE)) return
var/mob/M = locateUID(href_list["godmode"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
src.cmd_admin_godmode(M)
href_list["datumrefresh"] = href_list["godmode"]
else if(href_list["gib"])
if(!check_rights(R_ADMIN|R_EVENT)) return
var/mob/M = locateUID(href_list["gib"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
src.cmd_admin_gib(M)
else if(href_list["build_mode"])
if(!check_rights(R_BUILDMODE)) return
var/mob/M = locateUID(href_list["build_mode"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
togglebuildmode(M)
href_list["datumrefresh"] = href_list["build_mode"]
else if(href_list["drop_everything"])
if(!check_rights(R_DEBUG|R_ADMIN)) return
var/mob/M = locateUID(href_list["drop_everything"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
if(usr.client)
usr.client.cmd_admin_drop_everything(M)
else if(href_list["direct_control"])
if(!check_rights(R_DEBUG|R_ADMIN)) return
var/mob/M = locateUID(href_list["direct_control"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
if(usr.client)
usr.client.cmd_assume_direct_control(M)
else if(href_list["make_skeleton"])
if(!check_rights(R_SERVER|R_EVENT)) return
var/mob/living/carbon/human/H = locateUID(href_list["make_skeleton"])
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
var/confirm = alert("Are you sure you want to turn this mob into a skeleton?","Confirm Skeleton Transformation","Yes","No")
if(confirm != "Yes")
return
H.makeSkeleton()
message_admins("[key_name(usr)] has turned [key_name(H)] into a skeleton")
log_admin("[key_name_admin(usr)] has turned [key_name_admin(H)] into a skeleton")
href_list["datumrefresh"] = href_list["make_skeleton"]
else if(href_list["offer_control"])
if(!check_rights(R_ADMIN)) return
var/mob/M = locateUID(href_list["offer_control"])
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
to_chat(M, "Control of your mob has been offered to dead players.")
log_admin("[key_name(usr)] has offered control of ([key_name(M)]) to ghosts.")
message_admins("[key_name_admin(usr)] has offered control of ([key_name_admin(M)]) to ghosts")
var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [M.real_name]?", poll_time = 100)
var/mob/dead/observer/theghost = null
if(candidates.len)
theghost = pick(candidates)
to_chat(M, "Your mob has been taken over by a ghost!")
message_admins("[key_name_admin(theghost)] has taken control of ([key_name_admin(M)])")
M.ghostize()
M.key = theghost.key
else
to_chat(M, "There were no ghosts willing to take control.")
message_admins("No ghosts were willing to take control of [key_name_admin(M)])")
else if(href_list["delall"])
if(!check_rights(R_DEBUG|R_SERVER)) return
var/obj/O = locateUID(href_list["delall"])
if(!isobj(O))
to_chat(usr, "This can only be used on instances of type /obj")
return
var/action_type = alert("Strict type ([O.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel")
if(action_type == "Cancel" || !action_type)
return
if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes")
return
if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes")
return
var/O_type = O.type
switch(action_type)
if("Strict type")
var/i = 0
for(var/obj/Obj in world)
if(Obj.type == O_type)
i++
qdel(Obj)
if(!i)
to_chat(usr, "No objects of this type exist")
return
log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted)")
message_admins("[key_name_admin(usr)] deleted all objects of type [O_type] ([i] objects deleted)")
if("Type and subtypes")
var/i = 0
for(var/obj/Obj in world)
if(istype(Obj,O_type))
i++
qdel(Obj)
if(!i)
to_chat(usr, "No objects of this type exist")
return
log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted)")
message_admins("[key_name_admin(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted)")
else if(href_list["addreagent"]) /* Made on /TG/, credit to them. */
if(!check_rights(R_DEBUG|R_ADMIN)) return
var/atom/A = locateUID(href_list["addreagent"])
if(!A.reagents)
var/amount = input(usr, "Specify the reagent size of [A]", "Set Reagent Size", 50) as num
if(amount)
A.create_reagents(amount)
if(A.reagents)
var/list/reagent_options = list()
for(var/r_id in chemical_reagents_list)
var/datum/reagent/R = chemical_reagents_list[r_id]
reagent_options[R.name] = r_id
if(reagent_options.len)
reagent_options = sortAssoc(reagent_options)
reagent_options.Insert(1, "CANCEL")
var/chosen = input(usr, "Choose a reagent to add.", "Choose a reagent.") in reagent_options
var/chosen_id = reagent_options[chosen]
if(chosen_id)
var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num
if(amount)
A.reagents.add_reagent(chosen_id, amount)
log_admin("[key_name(usr)] has added [amount] units of [chosen] to \the [A]")
message_admins("[key_name_admin(usr)] has added [amount] units of [chosen] to \the [A]")
else if(href_list["explode"])
if(!check_rights(R_DEBUG|R_EVENT)) return
var/atom/A = locateUID(href_list["explode"])
if(!isobj(A) && !ismob(A) && !isturf(A))
to_chat(usr, "This can only be done to instances of type /obj, /mob and /turf")
return
src.cmd_admin_explosion(A)
href_list["datumrefresh"] = href_list["explode"]
else if(href_list["emp"])
if(!check_rights(R_DEBUG|R_EVENT)) return
var/atom/A = locateUID(href_list["emp"])
if(!isobj(A) && !ismob(A) && !isturf(A))
to_chat(usr, "This can only be done to instances of type /obj, /mob and /turf")
return
src.cmd_admin_emp(A)
href_list["datumrefresh"] = href_list["emp"]
else if(href_list["mark_object"])
if(!check_rights(0)) return
var/datum/D = locateUID(href_list["mark_object"])
if(!istype(D))
to_chat(usr, "This can only be done to instances of type /datum")
return
src.holder.marked_datum = D
href_list["datumrefresh"] = href_list["mark_object"]
else if(href_list["proc_call"])
if(!check_rights(R_PROCCALL))
return
var/T = locateUID(href_list["proc_call"])
if(T)
callproc_datum(T)
else if(href_list["jump_to"])
if(!check_rights(R_ADMIN))
return
var/atom/A = locateUID(href_list["jump_to"])
var/turf/T = get_turf(A)
if(T)
usr.client.jumptoturf(T)
href_list["datumrefresh"] = href_list["jump_to"]
else if(href_list["rotatedatum"])
if(!check_rights(R_DEBUG|R_ADMIN)) return
var/atom/A = locateUID(href_list["rotatedatum"])
if(!istype(A))
to_chat(usr, "This can only be done to instances of type /atom")
return
switch(href_list["rotatedir"])
if("right") A.dir = turn(A.dir, -45)
if("left") A.dir = turn(A.dir, 45)
message_admins("[key_name_admin(usr)] has rotated \the [A]")
log_admin("[key_name(usr)] has rotated \the [A]")
href_list["datumrefresh"] = href_list["rotatedatum"]
else if(href_list["makemonkey"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["makemonkey"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("monkeyone"=href_list["makemonkey"]))
else if(href_list["makerobot"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["makerobot"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makerobot"=href_list["makerobot"]))
else if(href_list["makealien"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["makealien"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makealien"=href_list["makealien"]))
else if(href_list["makeslime"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["makeslime"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makeslime"=href_list["makeslime"]))
else if(href_list["makesuper"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["makesuper"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makesuper"=href_list["makesuper"]))
else if(href_list["makeai"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["makeai"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makeai"=href_list["makeai"]))
else if(href_list["makemask"])
if(!check_rights(R_SPAWN)) return
var/mob/currentMob = locateUID(href_list["makemask"])
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!currentMob)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makemask"=href_list["makemask"]))
else if(href_list["setspecies"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/human/H = locateUID(href_list["setspecies"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
var/new_species = input("Please choose a new species.","Species",null) as null|anything in all_species
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
if(H.set_species(new_species))
to_chat(usr, "Set species of [H] to [H.species].")
H.regenerate_icons()
message_admins("[key_name_admin(usr)] has changed the species of [key_name_admin(H)] to [new_species]")
log_admin("[key_name(usr)] has changed the species of [key_name(H)] to [new_species]")
else
to_chat(usr, "Failed! Something went wrong.")
else if(href_list["addlanguage"])
if(!check_rights(R_SPAWN)) return
var/mob/H = locateUID(href_list["addlanguage"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob")
return
var/new_language = input("Please choose a language to add.","Language",null) as null|anything in all_languages
if(!new_language)
return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
if(H.add_language(new_language))
to_chat(usr, "Added [new_language] to [H].")
message_admins("[key_name_admin(usr)] has given [key_name_admin(H)] the language [new_language]")
log_admin("[key_name(usr)] has given [key_name(H)] the language [new_language]")
else
to_chat(usr, "Mob already knows that language.")
else if(href_list["remlanguage"])
if(!check_rights(R_SPAWN)) return
var/mob/H = locateUID(href_list["remlanguage"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob")
return
if(!H.languages.len)
to_chat(usr, "This mob knows no languages.")
return
var/datum/language/rem_language = input("Please choose a language to remove.","Language",null) as null|anything in H.languages
if(!rem_language)
return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
if(H.remove_language(rem_language.name))
to_chat(usr, "Removed [rem_language] from [H].")
message_admins("[key_name_admin(usr)] has removed language [rem_language] from [key_name_admin(H)]")
log_admin("[key_name(usr)] has removed language [rem_language] from [key_name(H)]")
else
to_chat(usr, "Mob doesn't know that language.")
else if(href_list["addverb"])
if(!check_rights(R_DEBUG)) return
var/mob/living/H = locateUID(href_list["addverb"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living")
return
var/list/possibleverbs = list()
possibleverbs += "Cancel" // One for the top...
possibleverbs += typesof(/mob/proc,/mob/verb,/mob/living/proc,/mob/living/verb)
switch(H.type)
if(/mob/living/carbon/human)
possibleverbs += typesof(/mob/living/carbon/proc,/mob/living/carbon/verb,/mob/living/carbon/human/verb,/mob/living/carbon/human/proc)
if(/mob/living/silicon/robot)
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/robot/proc,/mob/living/silicon/robot/verb)
if(/mob/living/silicon/ai)
possibleverbs += typesof(/mob/living/silicon/proc,/mob/living/silicon/ai/proc,/mob/living/silicon/ai/verb)
possibleverbs -= H.verbs
possibleverbs += "Cancel" // ...And one for the bottom
var/verb = input("Select a verb!", "Verbs",null) as anything in possibleverbs
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
if(!verb || verb == "Cancel")
return
else
H.verbs += verb
message_admins("[key_name_admin(usr)] has given [key_name_admin(H)] the verb [verb]")
log_admin("[key_name(usr)] has given [key_name(H)] the verb [verb]")
else if(href_list["remverb"])
if(!check_rights(R_DEBUG)) return
var/mob/H = locateUID(href_list["remverb"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob")
return
var/verb = input("Please choose a verb to remove.","Verbs",null) as null|anything in H.verbs
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
if(!verb)
return
else
H.verbs -= verb
message_admins("[key_name_admin(usr)] has removed verb [verb] from [key_name_admin(H)]")
log_admin("[key_name(usr)] has removed verb [verb] from [key_name(H)]")
else if(href_list["addorgan"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/M = locateUID(href_list["addorgan"])
if(!istype(M))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
var/new_organ = input("Please choose an organ to add.","Organ",null) as null|anything in subtypesof(/obj/item/organ)-/obj/item/organ
if(!new_organ) return
if(!M)
to_chat(usr, "Mob doesn't exist anymore")
return
if(locateUID(new_organ) in M.internal_organs)
to_chat(usr, "Mob already has that organ.")
return
var/obj/item/organ/internal/organ = new new_organ
organ.insert(M)
message_admins("[key_name_admin(usr)] has given [key_name_admin(M)] the organ [new_organ]")
log_admin("[key_name(usr)] has given [key_name(M)] the organ [new_organ]")
else if(href_list["remorgan"])
if(!check_rights(R_SPAWN)) return
var/mob/living/carbon/M = locateUID(href_list["remorgan"])
if(!istype(M))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
var/obj/item/organ/internal/rem_organ = input("Please choose an organ to remove.","Organ",null) as null|anything in M.internal_organs
if(!M)
to_chat(usr, "Mob doesn't exist anymore")
return
if(!(rem_organ in M.internal_organs))
to_chat(usr, "Mob does not have that organ.")
return
to_chat(usr, "Removed [rem_organ] from [M].")
rem_organ.remove(M)
message_admins("[key_name_admin(usr)] has removed the organ [rem_organ] from [key_name_admin(M)]")
log_admin("[key_name(usr)] has removed the organ [rem_organ] from [key_name(M)]")
qdel(rem_organ)
else if(href_list["fix_nano"])
if(!check_rights(R_DEBUG)) return
var/mob/H = locateUID(href_list["fix_nano"])
if(!istype(H) || !H.client)
to_chat(usr, "This can only be done on mobs with clients")
return
H.client.reload_nanoui_resources()
to_chat(usr, "Resource files sent")
to_chat(H, "Your NanoUI Resource files have been refreshed")
log_admin("[key_name(usr)] resent the NanoUI resource files to [key_name(H)]")
else if(href_list["regenerateicons"])
if(!check_rights(0)) return
var/mob/M = locateUID(href_list["regenerateicons"])
if(!ismob(M))
to_chat(usr, "This can only be done to instances of type /mob")
return
M.regenerate_icons()
else if(href_list["adjustDamage"] && href_list["mobToDamage"])
if(!check_rights(R_DEBUG|R_ADMIN|R_EVENT)) return
var/mob/living/L = locateUID(href_list["mobToDamage"])
if(!istype(L)) return
var/Text = href_list["adjustDamage"]
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
if(!L)
to_chat(usr, "Mob doesn't exist anymore")
return
switch(Text)
if("brute") L.adjustBruteLoss(amount)
if("fire") L.adjustFireLoss(amount)
if("toxin") L.adjustToxLoss(amount)
if("oxygen")L.adjustOxyLoss(amount)
if("brain") L.adjustBrainLoss(amount)
if("clone") L.adjustCloneLoss(amount)
else
to_chat(usr, "You caused an error. DEBUG: Text:[Text] Mob:[L]")
return
if(amount != 0)
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L]")
message_admins("[key_name_admin(usr)] dealt [amount] amount of [Text] damage to [L]")
href_list["datumrefresh"] = href_list["mobToDamage"]
if(href_list["datumrefresh"])
var/datum/DAT = locateUID(href_list["datumrefresh"])
if(!istype(DAT, /datum))
return
src.debug_variables(DAT)
return
|