Late Join Ghost Role Things (#8466)

This commit is contained in:
Geeves
2020-03-26 22:18:30 +02:00
committed by GitHub
parent 48a6b58aaf
commit ebadb532ad
7 changed files with 42 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
#define COLOR_BLACK "#000000"
#define COLOR_NAVY_BLUE "#000080"
#define COLOR_GREEN "#008000"
#define COLOR_BRIGHT_GREEN "#13cf13"
#define COLOR_DARK_GRAY "#404040"
#define COLOR_MAROON "#800000"
#define COLOR_PURPLE "#800080"

View File

@@ -137,6 +137,9 @@
if(cant_spawn)
to_chat(usr, "Unable to spawn: [cant_spawn]")
return
if(isnewplayer(usr))
var/mob/abstract/new_player/N = usr
N.close_spawn_windows()
if(!S.pre_spawn(usr))
to_chat(usr, "Unable to spawn: pre_spawn failed. Report this on GitHub")
return

View File

@@ -2,6 +2,7 @@
var/short_name = null
var/name = null
var/desc = null
var/show_on_job_select = TRUE
var/welcome_message = null
var/list/tags = list() //Tags associated with that spawner
@@ -66,7 +67,7 @@
var/cant_see = cant_see(user)
if(cant_see) //If we cant see it, we cant spawn it
return cant_see
if(!istype(user, /mob/abstract/observer))
if(!(istype(user, /mob/abstract/observer) || isnewplayer(user)))
return "You are not a ghost."
if(!enabled) //If the spawner id disabled, we cant spawn in
return "This spawner is not enabled."
@@ -167,4 +168,4 @@
announce_ghost_joinleave(user, 0, "They are now a [name].")
S.ckey = user.ckey
return S
return S

View File

@@ -2,6 +2,7 @@
short_name = "maintdrone"
name = "Maintenence Drone"
desc = "Maintain and Improve the Systems on the Aurora"
show_on_job_select = FALSE
tags = list("Simple Mobs")
respawn_flag = MINISYNTH //Flag to check for when trying to spawn someone of that type (CREW, ANIMAL, MINISYNTH)

View File

@@ -3,6 +3,7 @@
name = "Rat"
desc = "Join as a Rat on the aurora, a common nuisance to the crew."
welcome_message = "You are now a rat. Though you may interact with players, do not give any hints away that you are more than a simple rodent. Find food, avoid cats, and try to survive!"
show_on_job_select = FALSE
tags = list("Simple Mobs")
respawn_flag = ANIMAL //Flag to check for when trying to spawn someone of that type (CREW, ANIMAL, MINISYNTH)

View File

@@ -27,7 +27,10 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
new_player_panel_proc()
/mob/abstract/new_player/proc/new_player_panel_proc()
var/output = "<div align='center'><B>New Player Options</B>"
var/output = "<div align='center'><B>New Player Options</B><br>"
var/character_name = client.prefs.real_name
if(character_name)
output += "<b>Selected Character: [character_name]</b>"
output +="<hr>"
output += "<p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
@@ -187,6 +190,12 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
if(href_list["manifest"])
ViewManifest()
if(href_list["ghostspawner"])
if(!ROUND_IS_STARTED)
to_chat(usr, SPAN_WARNING("The round hasn't started yet!"))
return
SSghostroles.vui_interact(src)
if(href_list["SelectedJob"])
if(!config.enter_allowed)
@@ -383,6 +392,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
var/dat = "<center>"
dat += "<b>Welcome, [name].<br></b>"
dat += "Round Duration: [get_round_duration_formatted()]<br>"
dat += "Alert Level: [capitalize(get_security_level())]<br>"
if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles.
if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled
@@ -393,6 +403,20 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
else // Crew transfer initiated
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
var/unique_role_available = FALSE
for(var/ghost_role in SSghostroles.spawners)
var/datum/ghostspawner/G = SSghostroles.spawners[ghost_role]
if(!G.show_on_job_select)
continue
if(!G.enabled)
continue
unique_role_available = TRUE
break
if(unique_role_available)
dat += "<font color='[COLOR_BRIGHT_GREEN]'><b>A unique ghost role is available:</b></font><br>"
dat += "<a href='byond://?src=\ref[src];ghostspawner=1'>Ghost Spawner Menu</A><br>"
dat += "Choose from the following open/valid positions:<br>"
for(var/datum/job/job in SSjobs.occupations)
if(job && IsJobAvailable(job.title))