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 09:55:50 -05:00
committed by AnturK
parent ccf3e74074
commit 3ab308aa0f
8 changed files with 91 additions and 42 deletions
+2 -1
View File
@@ -44,7 +44,8 @@
var/outfit = null
//Only override this proc
/datum/job/proc/after_spawn(mob/living/carbon/human/H)
/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/announce(mob/living/carbon/human/H)
+3 -3
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)
/datum/job/officer/after_spawn(mob/living/carbon/human/H, mob/M)
// 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)
H << "<b>You have been assigned to [department]!</b>"
M << "<b>You have been assigned to [department]!</b>"
else
H << "<b>You have not been assigned to any department. Patrol the halls and help where needed.</b>"
M << "<b>You have not been assigned to any department. Patrol the halls and help where needed.</b>"
+17 -10
View File
@@ -13,6 +13,7 @@
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++]"
@@ -301,7 +302,7 @@
SSjob.AssignRole(src, rank, 1)
var/mob/living/character = create_character() //creates the human and transfers vars and mind
var/mob/living/character = create_character(TRUE) //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
@@ -422,27 +423,33 @@
popup.open(0) // 0 is passed to open so that it doesn't use the onclose() proc
/mob/new_player/proc/create_character()
/mob/new_player/proc/create_character(transfer_after)
spawning = 1
close_spawn_windows()
var/mob/living/carbon/human/new_character = new(loc)
var/mob/living/carbon/human/H = 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(new_character)
new_character.dna.update_dna_identity()
client.prefs.copy_to(H)
H.dna.update_dna_identity()
if(mind)
mind.active = 0 //we wish to transfer the key manually
mind.transfer_to(new_character) //won't transfer key since the mind is not active
mind.transfer_to(H) //won't transfer key since the mind is not active
new_character.name = real_name
H.name = real_name
new_character.key = key //Manually transfer the key to log them in
new_character.stopLobbySound()
. = H
new_character = .
if(transfer_after)
transfer_character()
return new_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()
/mob/new_player/proc/ViewManifest()
var/dat = "<html><body>"
+12 -6
View File
@@ -287,9 +287,12 @@
qdel(src)
/mob/new_player/AIize()
/mob/new_player/AIize(transfer_after)
spawning = 1
return ..()
. = ..()
new_character = .
if(!transfer_after) //name can't be set in AI/New without the client
new_character.rename_self("ai", client)
/mob/living/carbon/human/AIize()
if (notransform)
@@ -311,7 +314,7 @@
invisibility = INVISIBILITY_MAXIMUM
return ..()
/mob/proc/AIize()
/mob/proc/AIize(transfer_after = TRUE)
if(client)
stopLobbySound()
@@ -334,10 +337,13 @@
if (sloc.name == "AI")
loc_landmark = sloc.loc
. = new /mob/living/silicon/ai(loc_landmark, null, src)
qdel(src)
return
if(!transfer_after)
mind.active = FALSE
. = new /mob/living/silicon/ai(loc_landmark, null, src)
if(transfer_after)
qdel(src)
//human -> robot
/mob/living/carbon/human/proc/Robotize(delete_items = 0)