mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Removed the toggle_gravity_on() and toggle_gravity_off() verbs and moved them into a single toggle in the FUN section of the secrets panel.
Likewise, removed the spawn_xeno verb and made an equivalent bit of code in the FUN section of the secrets panel. Fixed the create_xeno proc. It was supposed to ask you which type of alien to spawn but it was sending the popup to src, which should have been usr. Create_xeno can now spawn queens and larva. Create_xeno is fed a ckey (optional) rather than a ghost mob. Which will make it more versatile and reliable should clients log out during popups and such. Created an client.is_afk(duration) proc. If the client has been inactive for duration frames (11 frames is roughly 1 second), it will return the number of frames it has been inactive. Otherwise it returns 0. If no duration value is given it defults to 3000 which is roughly 5 minutes. There's a bunch of code I need to replace with this which I will do after I've got the rest of the admin rank stuff finished as that takes priority. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5040 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -20,7 +20,6 @@ var/global/list/landmarks_list = list() //list of all landmarks created
|
||||
//////////////////////////
|
||||
/////Initial Building/////
|
||||
//////////////////////////
|
||||
//Realistically, these should never be run, but ideally, they should only be run once at round-start
|
||||
|
||||
/proc/make_datum_references_lists()
|
||||
var/list/paths
|
||||
|
||||
@@ -408,11 +408,13 @@ var/global/floorIsLava = 0
|
||||
dat += {"
|
||||
<B>'Random' Events</B><BR>
|
||||
<BR>
|
||||
<A href='?src=\ref[src];secretsfun=gravity'>Toggle station artificial gravity</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=wave'>Spawn a wave of meteors (aka lagocolyptic shower)</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=gravanomalies'>Spawn a gravitational anomaly (aka lagitational anomolag)</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=timeanomalies'>Spawn wormholes</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=goblob'>Spawn blob</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=aliens'>Trigger an Alien infestation</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=alien_silent'>Spawn an Alien silently</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=spaceninja'>Send in a space ninja</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=carp'>Trigger an Carp migration</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=radiation'>Irradiate the station</A><BR>
|
||||
@@ -428,7 +430,6 @@ var/global/floorIsLava = 0
|
||||
<BR>
|
||||
<A href='?src=\ref[src];secretsfun=sec_clothes'>Remove 'internal' clothing</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=sec_all_clothes'>Remove ALL clothing</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=toxic'>Toxic Air (WARNING: dangerous)</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=monkey'>Turn all humans into monkeys</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=sec_classic1'>Remove firesuits, grilles, and pods</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=power'>Make all areas powered</A><BR>
|
||||
|
||||
@@ -71,15 +71,12 @@ var/list/admin_verbs_fun = list(
|
||||
/client/proc/cmd_admin_dress,
|
||||
/client/proc/cmd_admin_gib_self,
|
||||
/client/proc/drop_bomb,
|
||||
/client/proc/toggle_gravity_on,
|
||||
/client/proc/toggle_gravity_off,
|
||||
/client/proc/strike_team,
|
||||
/client/proc/cinematic,
|
||||
/client/proc/triple_ai,
|
||||
/client/proc/one_click_antag,
|
||||
/datum/admins/proc/toggle_aliens,
|
||||
/datum/admins/proc/toggle_space_ninja,
|
||||
/client/proc/spawn_xeno,
|
||||
/client/proc/only_one,
|
||||
/client/proc/send_space_ninja,
|
||||
/client/proc/cmd_admin_add_freeform_ai_law,
|
||||
@@ -171,14 +168,11 @@ var/list/admin_verbs_hideable = list(
|
||||
/client/proc/cmd_admin_dress,
|
||||
/client/proc/cmd_admin_gib_self,
|
||||
/client/proc/drop_bomb,
|
||||
/client/proc/toggle_gravity_on,
|
||||
/client/proc/toggle_gravity_off,
|
||||
/client/proc/strike_team,
|
||||
/client/proc/cinematic,
|
||||
/client/proc/triple_ai,
|
||||
/datum/admins/proc/toggle_aliens,
|
||||
/datum/admins/proc/toggle_space_ninja,
|
||||
/client/proc/spawn_xeno,
|
||||
/client/proc/only_one,
|
||||
/client/proc/send_space_ninja,
|
||||
/client/proc/cmd_admin_add_freeform_ai_law,
|
||||
|
||||
@@ -1169,6 +1169,8 @@
|
||||
usr.client.debug_variables(M)
|
||||
|
||||
else if(href_list["adminplayerobservejump"])
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
var/mob/M = locate(href_list["adminplayerobservejump"])
|
||||
|
||||
var/client/C = usr.client
|
||||
@@ -1177,6 +1179,8 @@
|
||||
C.jumptomob(M)
|
||||
|
||||
else if(href_list["adminplayerobservecoodjump"])
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
var/x = text2num(href_list["X"])
|
||||
var/y = text2num(href_list["Y"])
|
||||
var/z = text2num(href_list["Z"])
|
||||
@@ -1240,6 +1244,8 @@
|
||||
src.owner << "(<a href='?src=\ref[usr];priv_msg=\ref[M]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?src=\ref[src];adminplayervars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservejump=\ref[M]'>JMP</A>) (<A HREF='?src=\ref[src];secretsadmin=check_antagonist'>CA</A>)"
|
||||
|
||||
else if(href_list["adminspawncookie"])
|
||||
if(!check_rights(R_ADMIN|R_FUN)) return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["adminspawncookie"])
|
||||
if(!ishuman(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human"
|
||||
@@ -1262,6 +1268,8 @@
|
||||
H << "\blue Your prayers have been answered!! You received the <b>best cookie</b>!"
|
||||
|
||||
else if(href_list["BlueSpaceArtillery"])
|
||||
if(!check_rights(R_ADMIN|R_FUN)) return
|
||||
|
||||
var/mob/living/M = locate(href_list["BlueSpaceArtillery"])
|
||||
if(!isliving(M))
|
||||
usr << "This can only be used on instances of type /mob/living"
|
||||
@@ -1587,6 +1595,23 @@
|
||||
spawn(0)
|
||||
H.corgize()
|
||||
ok = 1
|
||||
if("gravity")
|
||||
if(!(ticker && ticker.mode))
|
||||
usr << "Please wait until the game starts! Not sure how it will work otherwise."
|
||||
return
|
||||
gravity_is_on = !gravity_is_on
|
||||
for(var/area/A in world)
|
||||
A.gravitychange(gravity_is_on,A)
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","Grav")
|
||||
if(gravity_is_on)
|
||||
log_admin("[key_name(usr)] toggled gravity on.", 1)
|
||||
message_admins("\blue [key_name_admin(usr)] toggled gravity on.", 1)
|
||||
command_alert("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
|
||||
else
|
||||
log_admin("[key_name(usr)] toggled gravity off.", 1)
|
||||
message_admins("\blue [key_name_admin(usr)] toggled gravity off.", 1)
|
||||
command_alert("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")
|
||||
if("power")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","P")
|
||||
@@ -1856,6 +1881,11 @@
|
||||
if(aliens_allowed)
|
||||
alien_infestation()
|
||||
message_admins("[key_name_admin(usr)] has spawned aliens", 1)
|
||||
if("alien_silent") //replaces the spawn_xeno verb
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","ALS")
|
||||
if(aliens_allowed)
|
||||
create_xeno()
|
||||
if("comms_blackout")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","CB")
|
||||
|
||||
@@ -193,69 +193,37 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
|
||||
IonStorm(0)
|
||||
feedback_add_details("admin_verb","ION") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/*
|
||||
Stealth spawns xenos
|
||||
Changed to accomodate specific spawning. It was annoying before. /N
|
||||
*/
|
||||
/client/proc/spawn_xeno()
|
||||
set category = "Fun"
|
||||
set name = "Spawn Xeno"
|
||||
set desc = "Spawns a xenomorph for all those boring rounds, without having you to do so manually."
|
||||
set popup_menu = 0
|
||||
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
|
||||
if(confirm != "Yes") return
|
||||
|
||||
if(create_xeno())
|
||||
feedback_add_details("admin_verb","X") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] spawned a xeno.")
|
||||
message_admins("\blue [key_name_admin(usr)] spawned a xeno.", 1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
//I use this proc for respawn character too. /N
|
||||
/proc/create_xeno(mob/dead/observer/G)
|
||||
var/alien_caste = alert(src, "Please choose which caste to spawn.",,"Hunter","Sentinel","Drone")
|
||||
|
||||
var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)
|
||||
|
||||
var/mob/living/carbon/alien/humanoid/new_xeno
|
||||
switch(alien_caste)
|
||||
if("Hunter")
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(spawn_here)
|
||||
if("Sentinel")
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(spawn_here)
|
||||
if("Drone")
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/drone(spawn_here)
|
||||
else
|
||||
return 0
|
||||
|
||||
var/selected_key
|
||||
if(G && G.key)
|
||||
selected_key = G.key
|
||||
else
|
||||
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
|
||||
for(G in player_list)
|
||||
if(G.client.be_alien)
|
||||
if(((G.client.inactivity/10)/60) <= 5)
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
/proc/create_xeno(ckey)
|
||||
if(!ckey)
|
||||
var/list/candidates = list()
|
||||
for(var/mob/M in player_list)
|
||||
if(M.stat != DEAD) continue //we are not dead!
|
||||
if(!M.client.be_alien) continue //we don't want to be an alium
|
||||
if(M.client.is_afk()) continue //we are afk
|
||||
if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to
|
||||
candidates += M.ckey
|
||||
if(candidates.len)
|
||||
selected_key = input("Pick the client you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates
|
||||
ckey = input("Pick the player you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates
|
||||
else
|
||||
usr << "<font color='red'>Error: create_xeno(): no suitable candidates.</font>"
|
||||
if(!istext(ckey)) return 0
|
||||
|
||||
if(selected_key)
|
||||
new_xeno.key = selected_key
|
||||
message_admins("\blue [key_name_admin(usr)] has spawned [selected_key] as a filthy xeno.", 1)
|
||||
return 1
|
||||
else
|
||||
//we couldn't find a candidate
|
||||
usr << "<font color='red'>Error: create_xeno(): no suitable players.</font>"
|
||||
del(new_xeno)
|
||||
return 0
|
||||
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva")
|
||||
var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)
|
||||
var/mob/living/carbon/alien/new_xeno
|
||||
switch(alien_caste)
|
||||
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen(spawn_here)
|
||||
if("Hunter") new_xeno = new /mob/living/carbon/alien/humanoid/hunter(spawn_here)
|
||||
if("Sentinel") new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(spawn_here)
|
||||
if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(spawn_here)
|
||||
if("Larva") new_xeno = new /mob/living/carbon/alien/larva(spawn_here)
|
||||
else return 0
|
||||
|
||||
new_xeno.ckey = ckey
|
||||
message_admins("\blue [key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].", 1)
|
||||
return 1
|
||||
|
||||
/*
|
||||
If a guy was gibbed and you want to revive him, this is a good way to do so.
|
||||
@@ -298,7 +266,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(T)
|
||||
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen(T)
|
||||
else//If we don't know what special role they have, for whatever reason, or they're a larva.
|
||||
create_xeno(G_found)
|
||||
create_xeno(G_found.ckey)
|
||||
return
|
||||
|
||||
//Now to give them their mind back.
|
||||
@@ -843,38 +811,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
ticker.random_players = 1
|
||||
feedback_add_details("admin_verb","MER") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/toggle_gravity_on()
|
||||
set category = "Debug"
|
||||
set name = "Toggle station gravity on"
|
||||
set desc = "Toggles all gravity to active on the station."
|
||||
|
||||
if (!(ticker && ticker.mode))
|
||||
usr << "Please wait until the game starts! Not sure how it will work otherwise."
|
||||
return
|
||||
|
||||
|
||||
for(var/area/A in world)
|
||||
A.gravitychange(1,A)
|
||||
|
||||
command_alert("CentComm is now beaming gravitons to your station. We appoligize for any inconvience.")
|
||||
feedback_add_details("admin_verb","TSGON") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/toggle_gravity_off()
|
||||
set category = "Debug"
|
||||
set name = "Toggle station gravity off"
|
||||
set desc = "Toggles all gravity to inactive on the station."
|
||||
|
||||
if (!(ticker && ticker.mode))
|
||||
usr << "Please wait until the game starts! Not sure how it will work otherwise."
|
||||
return
|
||||
|
||||
|
||||
for(var/area/A in world)
|
||||
A.gravitychange(0,A)
|
||||
|
||||
command_alert("For budget reasons, Centcomm is no longer beaming gravitons to your station. We appoligize for any inconvience.")
|
||||
feedback_add_details("admin_verb","TSGOFF") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
/client/proc/toggle_random_events()
|
||||
set category = "Server"
|
||||
|
||||
@@ -176,3 +176,9 @@
|
||||
#undef TOPIC_SPAM_DELAY
|
||||
#undef UPLOAD_LIMIT
|
||||
#undef MIN_CLIENT_VERSION
|
||||
|
||||
//checks if a client is afk
|
||||
//3000 frames = 5 minutes
|
||||
/client/proc/is_afk(duration=3000)
|
||||
if(inactivity > duration) return inactivity
|
||||
return 0
|
||||
Reference in New Issue
Block a user