mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-30 20:13:53 +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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user