Merge pull request #1404 from Citadel-Station-13/upstream-merge-26647

[MIRROR] Refactors the latejoin list
This commit is contained in:
LetterJay
2017-06-05 04:49:27 -05:00
committed by GitHub
14 changed files with 77 additions and 59 deletions
+1 -1
View File
@@ -590,7 +590,7 @@
set category = "Admin"
set name = "Unprison"
if (M.z == ZLEVEL_CENTCOM)
M.loc = pick(GLOB.latejoin)
SSjob.SendToLateJoin(M)
message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]")
log_admin("[key_name(usr)] has unprisoned [key_name(M)]")
else
+10 -5
View File
@@ -227,7 +227,7 @@
return 0
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva")
var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin)
var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : null
var/mob/living/carbon/alien/new_xeno
switch(alien_caste)
if("Queen")
@@ -244,6 +244,8 @@
new_xeno = new /mob/living/carbon/alien/larva(spawn_here)
else
return 0
if(!spawn_here)
SSjob.SendToLateJoin(new_xeno, FALSE)
new_xeno.ckey = ckey
var/msg = "<span class='notice'>[key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].</span>"
@@ -284,8 +286,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/turf/T
if(GLOB.xeno_spawn.len)
T = pick(GLOB.xeno_spawn)
else
T = pick(GLOB.latejoin)
var/mob/living/carbon/alien/new_xeno
switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were.
@@ -302,6 +302,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
else//If we don't know what special role they have, for whatever reason, or they're a larva.
create_xeno(G_found.ckey)
return
if(!T)
SSjob.SendToLateJoin(new_xeno, FALSE)
//Now to give them their mind back.
G_found.mind.transfer_to(new_xeno) //be careful when doing stuff like this! I've already checked the mind isn't in use
@@ -315,7 +318,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
//check if they were a monkey
else if(findtext(G_found.real_name,"monkey"))
if(alert("This character appears to have been a monkey. Would you like to respawn them as such?",,"Yes","No")=="Yes")
var/mob/living/carbon/monkey/new_monkey = new(pick(GLOB.latejoin))
var/mob/living/carbon/monkey/new_monkey = new
SSjob.SendToLateJoin(new_monkey)
G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use
new_monkey.key = G_found.key
to_chat(new_monkey, "You have been fully respawned. Enjoy the game.")
@@ -326,7 +330,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
//Ok, it's not a xeno or a monkey. So, spawn a human.
var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned.
var/mob/living/carbon/human/new_character = new//The mob being spawned.
SSjob.SendToLateJoin(new_character)
var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character.
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
+4 -4
View File
@@ -14,9 +14,7 @@
/datum/round_event/ghost_role/devil/spawn_role()
//selecting a spawn_loc
var/list/spawn_locs = GLOB.latejoin
var/spawn_loc = pick(spawn_locs)
if(!spawn_loc)
if(!SSjob.latejoin_trackers.len)
return MAP_ERROR
//selecting a candidate player
@@ -30,7 +28,7 @@
var/datum/mind/Mind = create_devil_mind(key)
Mind.active = 1
var/mob/living/carbon/human/devil = create_event_devil(spawn_loc)
var/mob/living/carbon/human/devil = create_event_devil()
Mind.transfer_to(devil)
add_devil(devil, ascendable = FALSE)
@@ -45,6 +43,8 @@
/proc/create_event_devil(spawn_loc)
var/mob/living/carbon/human/new_devil = new(spawn_loc)
if(!spawn_loc)
SSjob.SendToLateJoin(new_devil)
var/datum/preferences/A = new() //Randomize appearance for the devil.
A.copy_to(new_devil)
new_devil.dna.update_dna_identity()
+1 -20
View File
@@ -322,28 +322,9 @@
if(isliving(equip)) //Borgs get borged in the equip, so we need to make sure we handle the new mob.
character = equip
var/D
if(GLOB.latejoin.len)
D = get_turf(pick(GLOB.latejoin))
if(!D)
for(var/turf/T in get_area_turfs(/area/shuttle/arrival))
if(!T.density)
var/clear = 1
for(var/obj/O in T)
if(O.density)
clear = 0
break
if(clear)
D = T
continue
character.loc = D
SSjob.SendToLateJoin(character)
character.update_parallax_teleport()
var/atom/movable/chair = locate(/obj/structure/chair) in character.loc
if(chair)
chair.buckle_mob(character)
SSticker.minds += character.mind
var/mob/living/carbon/human/humanc
+4 -4
View File
@@ -48,16 +48,16 @@
console = locate(/obj/machinery/requests_console) in A
areas += A
if(GLOB.latejoin.len)
if(SSjob.latejoin_trackers.len)
WARNING("Map contains predefined latejoin spawn points and an arrivals shuttle. Using the arrivals shuttle.")
if(!new_latejoin.len)
WARNING("Arrivals shuttle contains no chairs for spawn points. Reverting to latejoin landmarks.")
if(!GLOB.latejoin.len)
if(!SSjob.latejoin_trackers.len)
WARNING("No latejoin landmarks exist. Players will spawn unbuckled on the shuttle.")
return
GLOB.latejoin = new_latejoin
SSjob.latejoin_trackers = new_latejoin
/obj/docking_port/mobile/arrivals/dockRoundstart()
SSshuttle.generate_transit_dock(src)
@@ -114,7 +114,7 @@
Launch(FALSE)
/obj/docking_port/mobile/arrivals/proc/CheckTurfsPressure()
for(var/I in GLOB.latejoin)
for(var/I in SSjob.latejoin_trackers)
var/turf/open/T = get_turf(I)
var/pressure = T.air.return_pressure()
if(pressure < HAZARD_LOW_PRESSURE || pressure > HAZARD_HIGH_PRESSURE) //simple safety check