Makes it plausible to join as ghost roles from the latejoin menu (#7726)

* Makes it plausible to join as ghost roles from the latejoin menu

* Clarifies a little bit of the text
This commit is contained in:
deathride58
2018-11-16 17:47:42 -05:00
committed by kevinz000
parent 464d759701
commit 402a5ba9e4
7 changed files with 66 additions and 3 deletions
@@ -16,6 +16,7 @@
mob_type = /mob/living/simple_animal/hostile/swarmer
mob_name = "a swarmer"
job_description = "Swarmer"
death = FALSE
roundstart = FALSE
flavour_text = {"
+23 -3
View File
@@ -6,6 +6,7 @@
name = "Unknown"
density = TRUE
anchored = TRUE
var/job_description = null
var/mob_type = null
var/mob_name = ""
var/mob_gender = null
@@ -29,7 +30,7 @@
var/ghost_usable = TRUE
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/effect/mob_spawn/attack_ghost(mob/user)
/obj/effect/mob_spawn/attack_ghost(mob/user, latejoinercalling)
if(!SSticker.HasRoundStarted() || !loc || !ghost_usable)
return
if(!uses)
@@ -40,11 +41,19 @@
return
if(QDELETED(src) || QDELETED(user))
return
var/ghost_role = alert("Become [mob_name]? (Warning, You can no longer be cloned!)",,"Yes","No")
var/ghost_role = alert(latejoinercalling ? "Latejoin as [mob_name]? (This is a ghost role, and as such, it's very likely to be off-station.)" : "Become [mob_name]? (Warning, You can no longer be cloned!)",,"Yes","No")
if(ghost_role == "No" || !loc)
return
if(QDELETED(src) || QDELETED(user))
return
if(latejoinercalling)
var/mob/dead/new_player/NP = user
if(istype(NP))
NP.close_spawn_windows()
NP.stop_sound_channel(CHANNEL_LOBBYMUSIC)
log_game("[key_name(user)] became [mob_name]")
create(ckey = user.ckey)
return TRUE
/obj/effect/mob_spawn/Initialize(mapload)
. = ..()
@@ -52,7 +61,7 @@
create()
else if(ghost_usable)
GLOB.poi_list |= src
LAZYADD(GLOB.mob_spawners[name], src)
LAZYADD(GLOB.mob_spawners[job_description ? job_description : name], src)
/obj/effect/mob_spawn/Destroy()
GLOB.poi_list -= src
@@ -262,6 +271,7 @@
mob_type = /mob/living/simple_animal/mouse
death = FALSE
roundstart = FALSE
job_description = "Mouse"
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
@@ -270,6 +280,7 @@
mob_type = /mob/living/simple_animal/cow
death = FALSE
roundstart = FALSE
job_description = "Cow"
mob_gender = FEMALE
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
@@ -314,6 +325,7 @@
icon_state = "sleeper"
flavour_text = "<span class='big bold'>You are a space doctor!</span>"
assignedrole = "Space Doctor"
job_description = "Off-station Doctor"
/obj/effect/mob_spawn/human/doctor/alive/equip(mob/living/carbon/human/H)
..()
@@ -364,6 +376,7 @@
death = FALSE
roundstart = FALSE
random = TRUE
job_description = "Off-station Bartender"
name = "bartender sleeper"
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
@@ -387,6 +400,7 @@
death = FALSE
roundstart = FALSE
random = TRUE
job_description = "Beach Biodome Bum"
mob_name = "Beach Bum"
name = "beach bum sleeper"
icon = 'icons/obj/machines/sleeper.dmi'
@@ -399,6 +413,7 @@
mob_gender = "female"
name = "lifeguard sleeper"
id_job = "Lifeguard"
job_description = "Beach Biodome Lifeguard"
uniform = /obj/item/clothing/under/shorts/red
/datum/outfit/beachbum
@@ -474,6 +489,7 @@
/obj/effect/mob_spawn/human/commander/alive
death = FALSE
roundstart = FALSE
job_description = "Nanotrasen Commander"
mob_name = "Nanotrasen Commander"
name = "sleeper"
icon = 'icons/obj/machines/sleeper.dmi'
@@ -484,6 +500,7 @@
death = FALSE
roundstart = FALSE
mob_name = "Private Security Officer"
job_description = "Nanotrasen Security"
name = "sleeper"
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
@@ -502,6 +519,7 @@
/obj/effect/mob_spawn/human/skeleton/alive
death = FALSE
roundstart = FALSE
job_description = "Skeleton"
icon = 'icons/effects/blood.dmi'
icon_state = "remains"
flavour_text = "<span class='big bold'>By unknown powers, your skeletal remains have been reanimated!</span><b> Walk this mortal plain and terrorize all living adventurers who dare cross your path.</b>"
@@ -516,6 +534,7 @@
/obj/effect/mob_spawn/human/zombie/alive
death = FALSE
roundstart = FALSE
job_description = "Zombie"
icon = 'icons/effects/blood.dmi'
icon_state = "remains"
flavour_text = "<span class='big bold'>By unknown powers, your rotting remains have been resurrected!</span><b> Walk this mortal plain and terrorize all living adventurers who dare cross your path.</b>"
@@ -542,6 +561,7 @@
uses = -1
outfit = /datum/outfit/spacebartender
assignedrole = "Space Bar Patron"
job_description = "Space Bar Patron"
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/effect/mob_spawn/human/alive/space_bar_patron/attack_hand(mob/user)
@@ -589,6 +589,7 @@
icon_state = "sleeper"
roundstart = FALSE
death = FALSE
job_description = "Syndicate Snow Operative"
faction = ROLE_SYNDICATE
outfit = /datum/outfit/snowsyndie
flavour_text = "<span class='big bold'>You are a syndicate operative recently awoken from cryostasis in an underground outpost. Monitor Nanotrasen communications and record information. All intruders should be \
@@ -153,6 +153,21 @@
AttemptLateSpawn(href_list["SelectedJob"])
return
if(href_list["JoinAsGhostRole"])
if(!GLOB.enter_allowed)
to_chat(usr, "<span class='notice'> There is an administrative lock on entering the game!</span>")
if(SSticker.queued_players.len && !(ckey(key) in GLOB.admin_datums))
if((living_player_count() >= relevant_cap) || (src != SSticker.queued_players[1]))
to_chat(usr, "<span class='warning'>Server is full.</span>")
return
var/obj/effect/mob_spawn/MS = pick(GLOB.mob_spawners[href_list["JoinAsGhostRole"]])
if(istype(MS) && MS.attack_ghost(src, latejoinercalling = TRUE))
SSticker.queued_players -= src
SSticker.queue_delay = 4
qdel(src)
if(!ready && href_list["preference"])
if(client)
client.prefs.process_link(src, href_list)
@@ -427,6 +442,8 @@
for(var/datum/job/job in SSjob.occupations)
if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE)
available_job_count++;
for(var/spawner in GLOB.mob_spawners)
available_job_count++
for(var/datum/job/prioritized_job in SSjob.prioritized_jobs)
if(prioritized_job.current_positions >= prioritized_job.total_positions)
@@ -444,6 +461,7 @@
dat += " [a.title]. </div>"
dat += "<div class='clearBoth'>Choose from the following open positions:</div><br>"
dat += "<small>(G) - Ghost Role</small><br>"
dat += "<div class='jobs'><div class='jobsColumn'>"
var/job_count = 0
for(var/datum/job/job in SSjob.occupations)
@@ -461,6 +479,10 @@
continue
dat += "<a class='otherPosition' href='byond://?src=[REF(src)];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a><br>"
break
for(var/spawner in GLOB.mob_spawners)
job_count++
if(job_count > round(available_job_count / 2))
dat += "<a class='otherPosition' href='byond://?src=[REF(src)];JoinAsGhostRole=[spawner]'>[spawner] (G)</a><br>"
dat += "</div></div>"
// Removing the old window method but leaving it here for reference
+3
View File
@@ -96,6 +96,7 @@
name = "Syndicate Bioweapon Scientist"
roundstart = FALSE
death = FALSE
job_description = "Off-station Syndicate Scientist"
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper_s"
flavour_text = "<span class='big bold'>You are a syndicate agent,</span><b> employed in a top secret research facility developing biological weapons. Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. <b>Continue your research as best you can, and try to keep a low profile. <font size=6>DON'T</font> abandon the base without good cause.</b> The base is rigged with explosives should the worst happen, do not let the base fall into enemy hands!</b>"
@@ -107,6 +108,7 @@
/datum/outfit/lavaland_syndicate
name = "Lavaland Syndicate Agent"
name = "Off-station Syndicate Agent"
r_hand = /obj/item/gun/ballistic/automatic/sniper_rifle
uniform = /obj/item/clothing/under/syndicate
suit = /obj/item/clothing/suit/toggle/labcoat
@@ -123,6 +125,7 @@
/obj/effect/mob_spawn/human/lavaland_syndicate/comms
name = "Syndicate Comms Agent"
job_description = "Off-station Syndicate Comms Agent"
flavour_text = "<span class='big bold'>You are a syndicate agent,</span><b> employed in a top secret research facility developing biological weapons. Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. <b>Monitor enemy activity as best you can, and try to keep a low profile. <font size=6>DON'T</font> abandon the base without good cause.</b> Use the communication equipment to provide support to any field agents, and sow disinformation to throw Nanotrasen off your trail. Do not let the base fall into enemy hands!</b>"
outfit = /datum/outfit/lavaland_syndicate/comms