Revert "Makes game start smoother (#23552)"

This reverts commit 3ab308aa0f.
This commit is contained in:
Cyberboss
2017-02-22 20:43:17 -05:00
parent 4aefd57cca
commit 16c4656eb3
8 changed files with 41 additions and 90 deletions

View File

@@ -186,17 +186,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
return 1
//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame()
/mob/proc/rename_self(role, client/C)
if(!C)
C = client
/mob/proc/rename_self(role)
var/oldname = real_name
var/newname
var/loop = 1
var/safety = 0
while(loop && safety < 5)
if(C && C.prefs.custom_names[role] && !safety)
newname = C.prefs.custom_names[role]
if(client && client.prefs.custom_names[role] && !safety)
newname = client.prefs.custom_names[role]
else
switch(role)
if("clown")

View File

@@ -357,15 +357,7 @@ var/datum/subsystem/job/SSjob
return 1
//Gives the player the stuff he should have with his rank
/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
/datum/subsystem/job/proc/EquipRank(mob/living/H, rank, joined_late=0)
var/datum/job/job = GetJob(rank)
H.job = rank
@@ -407,16 +399,16 @@ var/datum/subsystem/job/SSjob
if(ismob(new_mob))
H = new_mob
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>"
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>"
if(job.req_admin_notify)
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>"
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>"
if(config.minimal_access_threshold)
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>"
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>"
if(job && H)
job.after_spawn(H, M)
job.after_spawn(H)
return H

View File

@@ -127,8 +127,6 @@ 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")
@@ -158,13 +156,10 @@ 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)
@@ -176,7 +171,6 @@ 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)
@@ -187,28 +181,18 @@ 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
CHECK_TICK
create_characters() //Create player characters and transfer them
collect_minds()
CHECK_TICK
equip_characters()
CHECK_TICK
data_core.manifest()
CHECK_TICK
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")
Master.RoundStart()
world << "<FONT color='blue'><B>Welcome to [station_name()], enjoy your stay!</B></FONT>"
world << sound('sound/AI/welcome.ogg')
@@ -373,41 +357,33 @@ var/datum/subsystem/ticker/ticker
joined_player_list += player.ckey
if(player.mind.assigned_role=="AI")
player.close_spawn_windows()
player.AIize(FALSE)
player.AIize()
else
player.create_character(FALSE)
player.create_character()
qdel(player)
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/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")
for(var/mob/living/carbon/human/player in player_list)
if(player && player.mind && player.mind.assigned_role)
if(player.mind.assigned_role == "Captain")
captainless=0
if(player.mind.assigned_role != player.mind.special_role)
SSjob.EquipRank(N, player.mind.assigned_role, 0)
CHECK_TICK
SSjob.EquipRank(player, player.mind.assigned_role, 0)
if(captainless)
for(var/mob/new_player/N in player_list)
if(N.new_character)
N << "Captainship not forced on anyone."
CHECK_TICK
for(var/mob/M in player_list)
if(!isnewplayer(M))
M << "Captainship not forced on anyone."
/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()

View File

@@ -68,7 +68,6 @@
/datum/datacore/proc/manifest()
for(var/mob/living/carbon/human/H in player_list)
manifest_inject(H)
CHECK_TICK
/datum/datacore/proc/manifest_modify(name, assignment)
var/datum/data/record/foundrecord = find_record("name", name, data_core.general)

View File

@@ -44,8 +44,7 @@
var/outfit = null
//Only override this proc
/datum/job/proc/after_spawn(mob/living/carbon/human/H, mob/M)
//do actions on H but send messages to M as the key may not have been transferred_yet
/datum/job/proc/after_spawn(mob/living/carbon/human/H)
/datum/job/proc/announce(mob/living/carbon/human/H)

View File

@@ -183,7 +183,7 @@ Security Officer
var/list/available_depts = list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY)
/datum/job/officer/after_spawn(mob/living/carbon/human/H, mob/M)
/datum/job/officer/after_spawn(mob/living/carbon/human/H)
// Assign department security
var/department
if(H && H.client && H.client.prefs)
@@ -255,9 +255,9 @@ var/list/available_depts = list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT
else
break
if(department)
M << "<b>You have been assigned to [department]!</b>"
H << "<b>You have been assigned to [department]!</b>"
else
M << "<b>You have not been assigned to any department. Patrol the halls and help where needed.</b>"
H << "<b>You have not been assigned to any department. Patrol the halls and help where needed.</b>"

View File

@@ -13,7 +13,6 @@
canmove = 0
anchored = 1 // don't get pushed around
var/mob/living/new_character //for instant transfer once the round is set up
/mob/new_player/New()
tag = "mob_[next_mob_id++]"
@@ -302,7 +301,7 @@
SSjob.AssignRole(src, rank, 1)
var/mob/living/character = create_character(TRUE) //creates the human and transfers vars and mind
var/mob/living/character = create_character() //creates the human and transfers vars and mind
var/equip = SSjob.EquipRank(character, rank, 1)
if(iscyborg(equip)) //Borgs get borged in the equip, so we need to make sure we handle the new mob.
character = equip
@@ -423,34 +422,28 @@
popup.open(0) // 0 is passed to open so that it doesn't use the onclose() proc
/mob/new_player/proc/create_character(transfer_after)
/mob/new_player/proc/create_character()
spawning = 1
close_spawn_windows()
var/mob/living/carbon/human/H = new(loc)
var/mob/living/carbon/human/new_character = new(loc)
if(config.force_random_names || jobban_isbanned(src, "appearance"))
client.prefs.random_character()
client.prefs.real_name = client.prefs.pref_species.random_name(gender,1)
client.prefs.copy_to(H)
H.dna.update_dna_identity()
client.prefs.copy_to(new_character)
new_character.dna.update_dna_identity()
if(mind)
mind.active = 0 //we wish to transfer the key manually
mind.transfer_to(H) //won't transfer key since the mind is not active
mind.transfer_to(new_character) //won't transfer key since the mind is not active
H.name = real_name
new_character.name = real_name
. = H
new_character = .
if(transfer_after)
transfer_character()
/mob/new_player/proc/transfer_character()
. = new_character
if(.)
new_character.key = key //Manually transfer the key to log them in
new_character.stopLobbySound()
return new_character
/mob/new_player/proc/ViewManifest()
var/dat = "<html><body>"
dat += "<h4>Crew Manifest</h4>"

View File

@@ -287,12 +287,9 @@
qdel(src)
/mob/new_player/AIize(transfer_after)
/mob/new_player/AIize()
spawning = 1
. = ..()
new_character = .
if(!transfer_after) //name can't be set in AI/New without the client
new_character.rename_self("ai", client)
return ..()
/mob/living/carbon/human/AIize()
if (notransform)
@@ -314,7 +311,7 @@
invisibility = INVISIBILITY_MAXIMUM
return ..()
/mob/proc/AIize(transfer_after = TRUE)
/mob/proc/AIize()
if(client)
stopLobbySound()
@@ -337,13 +334,10 @@
if (sloc.name == "AI")
loc_landmark = sloc.loc
if(!transfer_after)
mind.active = FALSE
. = new /mob/living/silicon/ai(loc_landmark, null, src)
if(transfer_after)
qdel(src)
return
//human -> robot
/mob/living/carbon/human/proc/Robotize(delete_items = 0)