Tracker for projectiles (#26026)

This commit is contained in:
ShiftyRail
2020-03-25 20:20:29 +01:00
committed by GitHub
parent 21efc9052f
commit a67f8798a3
7 changed files with 216 additions and 1 deletions

View File

@@ -1618,3 +1618,17 @@ proc/formatPlayerPanel(var/mob/U,var/text="PP")
dat += "Max [T.max_per_turf] per turf. Lasts up to [T.max_age] rounds.<hr>"
usr << browse(dat, "window=persistencepanel;size=350x600")
/datum/admins/proc/ViewAllRods()
if(!check_rights(0))
return
var/dat = "<center><B>View all active rods</B></center><hr>"
for (var/obj/item/projectile/immovablerod/rod in all_rods)
dat += "<b>[rod]</b> in z = [rod.z] (<a href='?_src_=vars;Vars=\ref[rod]'>\[VV\]</A>)"
if (rod.tracking)
dat += "- <A href='?src=\ref[src];rod_to_untrack=\ref[rod]'>(UNTRACK)</A>"
dat += "<br/>"
usr << browse(dat, "window=rodswindow;size=350x300")

View File

@@ -128,7 +128,8 @@ var/list/admin_verbs_fun = list(
/client/proc/makepAI,
/client/proc/set_blob_looks,
/client/proc/set_teleport_pref,
/client/proc/deadchat_singularity
/client/proc/deadchat_singularity,
/client/proc/view_all_rods,
)
var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_atom, // Allows us to spawn instances
@@ -1265,3 +1266,11 @@ var/list/admin_verbs_mod = list(
holder.PersistencePanel()
feedback_add_details("admin_verb","PEP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/client/proc/view_all_rods()
set name = "VIEW-ALL-RODS"
set category = "Fun"
if(holder)
holder.ViewAllRods()
feedback_add_details("admin_verb","V-ROD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return

View File

@@ -5375,6 +5375,30 @@
PersistencePanel() //refresh!
// --- Rod tracking
else if (href_list["rod_to_untrack"])
if(!check_rights(R_FUN))
return
var/obj/item/projectile/P = locate(href_list["rod_to_untrack"])
if (!P)
return
P.tracking = FALSE
P.tracker_datum = null
qdel(P.tracker_datum)
var/log_data = "[P.original]"
if (ismob(P.original))
var/mob/M = P.original
if (M.client)
log_data += " (M.client.ckey)"
log_admin("[key_name(usr)] stopped a rod thrown at [log_data].")
message_admins("<span class='notice'>[key_name(usr)] stopped a rod thrown at [log_data].</span>")
ViewAllRods()
// ----- Religion and stuff
else if(href_list["ashpaper"])