Makes game start smoother (#23552)

* Makes game start smoother

* Hide the sausage making

* Fix the shit

* Fixes AI's losing their name prefs
This commit is contained in:
Cyberboss
2017-02-22 15:55:50 +01:00
committed by AnturK
parent ccf3e74074
commit 3ab308aa0f
8 changed files with 91 additions and 42 deletions
+15 -7
View File
@@ -357,7 +357,15 @@ var/datum/subsystem/job/SSjob
return 1
//Gives the player the stuff he should have with his rank
/datum/subsystem/job/proc/EquipRank(mob/living/H, rank, joined_late=0)
/datum/subsystem/job/proc/EquipRank(mob/M, rank, joined_late=0)
var/mob/new_player/N
var/mob/living/H
if(!joined_late)
N = M
H = N.new_character
else
H = M
var/datum/job/job = GetJob(rank)
H.job = rank
@@ -399,16 +407,16 @@ var/datum/subsystem/job/SSjob
if(ismob(new_mob))
H = new_mob
H << "<b>You are the [rank].</b>"
H << "<b>As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
H << "<b>To speak on your departments radio, use the :h button. To see others, look closely at your headset.</b>"
M << "<b>You are the [rank].</b>"
M << "<b>As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
M << "<b>To speak on your departments radio, use the :h button. To see others, look closely at your headset.</b>"
if(job.req_admin_notify)
H << "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"
M << "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"
if(config.minimal_access_threshold)
H << "<FONT color='blue'><B>As this station was initially staffed with a [config.jobs_have_minimal_access ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.</B></font>"
M << "<FONT color='blue'><B>As this station was initially staffed with a [config.jobs_have_minimal_access ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.</B></font>"
if(job && H)
job.after_spawn(H)
job.after_spawn(H, M)
return H
+36 -12
View File
@@ -127,6 +127,8 @@ var/datum/subsystem/ticker/ticker
declare_completion(force_ending)
/datum/subsystem/ticker/proc/setup()
world << "<span class='boldannounce'>Starting game...</span>"
var/init_start = world.timeofday
//Create and announce mode
var/list/datum/game_mode/runnable_modes
if(master_mode == "random" || master_mode == "secret")
@@ -156,10 +158,13 @@ var/datum/subsystem/ticker/ticker
SSjob.ResetOccupations()
return 0
CHECK_TICK
//Configure mode and assign player to special mode stuff
var/can_continue = 0
can_continue = src.mode.pre_setup() //Choose antagonists
CHECK_TICK
SSjob.DivideOccupations() //Distribute jobs
CHECK_TICK
if(!Debug2)
if(!can_continue)
@@ -171,6 +176,7 @@ var/datum/subsystem/ticker/ticker
else
message_admins("<span class='notice'>DEBUG: Bypassing prestart checks...</span>")
CHECK_TICK
if(hide_mode)
var/list/modes = new
for (var/datum/game_mode/M in runnable_modes)
@@ -181,18 +187,28 @@ var/datum/subsystem/ticker/ticker
else
mode.announce()
CHECK_TICK
current_state = GAME_STATE_PLAYING
if(!config.ooc_during_round)
toggle_ooc(0) // Turn it off
round_start_time = world.time
CHECK_TICK
start_landmarks_list = shuffle(start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left
create_characters() //Create player characters and transfer them
create_characters() //Create player characters
CHECK_TICK
collect_minds()
CHECK_TICK
equip_characters()
CHECK_TICK
data_core.manifest()
CHECK_TICK
Master.RoundStart()
transfer_characters() //transfer keys to the new mobs
Master.RoundStart() //let the party begin...
log_world("Game start took [(world.timeofday - init_start)/10]s")
world << "<FONT color='blue'><B>Welcome to [station_name()], enjoy your stay!</B></FONT>"
world << sound('sound/AI/welcome.ogg')
@@ -357,34 +373,42 @@ var/datum/subsystem/ticker/ticker
joined_player_list += player.ckey
if(player.mind.assigned_role=="AI")
player.close_spawn_windows()
player.AIize()
player.AIize(FALSE)
else
player.create_character()
qdel(player)
player.create_character(FALSE)
else
player.new_player_panel()
CHECK_TICK
/datum/subsystem/ticker/proc/collect_minds()
for(var/mob/living/player in player_list)
if(player.mind)
ticker.minds += player.mind
CHECK_TICK
/datum/subsystem/ticker/proc/equip_characters()
var/captainless=1
for(var/mob/living/carbon/human/player in player_list)
if(player && player.mind && player.mind.assigned_role)
for(var/mob/new_player/N in player_list)
var/mob/living/carbon/human/player = N.new_character
if(istype(player) && player.mind && player.mind.assigned_role && player.mind.assigned_role != "AI")
if(player.mind.assigned_role == "Captain")
captainless=0
if(player.mind.assigned_role != player.mind.special_role)
SSjob.EquipRank(player, player.mind.assigned_role, 0)
SSjob.EquipRank(N, player.mind.assigned_role, 0)
CHECK_TICK
if(captainless)
for(var/mob/M in player_list)
if(!isnewplayer(M))
M << "Captainship not forced on anyone."
for(var/mob/new_player/N in player_list)
if(N.new_character)
N << "Captainship not forced on anyone."
CHECK_TICK
/datum/subsystem/ticker/proc/transfer_characters()
for(var/mob/new_player/player in player_list)
if(player.transfer_character())
qdel(player)
/datum/subsystem/ticker/proc/declare_completion()
set waitfor = FALSE