mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Allows players to return to lobby if job prefernces unavailable
This commit is contained in:
@@ -264,6 +264,8 @@ var/global/datum/controller/gameticker/ticker
|
||||
if(player.mind.assigned_role=="AI")
|
||||
player.close_spawn_windows()
|
||||
player.AIize()
|
||||
else if(!player.mind.assigned_role)
|
||||
continue
|
||||
else
|
||||
player.create_character()
|
||||
del(player)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
var/global/datum/controller/occupations/job_master
|
||||
|
||||
#define GET_RANDOM_JOB 0
|
||||
#define BE_ASSISTANT 1
|
||||
#define RETURN_TO_LOBBY 2
|
||||
|
||||
/datum/controller/occupations
|
||||
//List of all jobs
|
||||
var/list/occupations = list()
|
||||
@@ -270,9 +274,8 @@ var/global/datum/controller/occupations/job_master
|
||||
// Hand out random jobs to the people who didn't get any in the last check
|
||||
// Also makes sure that they got their preference correct
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
if(player.client.prefs.userandomjob)
|
||||
if(player.client.prefs.alternate_option == GET_RANDOM_JOB)
|
||||
GiveRandomJob(player)
|
||||
|
||||
/*
|
||||
Old job system
|
||||
for(var/level = 1 to 3)
|
||||
@@ -297,8 +300,14 @@ var/global/datum/controller/occupations/job_master
|
||||
|
||||
// For those who wanted to be assistant if their preferences were filled, here you go.
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
Debug("AC2 Assistant located, Player: [player]")
|
||||
AssignRole(player, "Assistant")
|
||||
if(player.client.prefs.alternate_option == BE_ASSISTANT)
|
||||
Debug("AC2 Assistant located, Player: [player]")
|
||||
AssignRole(player, "Assistant")
|
||||
|
||||
//For ones returning to lobby
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
if(player.client.prefs.alternate_option == RETURN_TO_LOBBY)
|
||||
unassigned -= player
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set
|
||||
|
||||
var/const/MAX_SAVE_SLOTS = 10
|
||||
|
||||
//used for alternate_option
|
||||
#define GET_RANDOM_JOB 0
|
||||
#define BE_ASSISTANT 1
|
||||
#define RETURN_TO_LOBBY 2
|
||||
|
||||
datum/preferences
|
||||
//doohickeys for savefiles
|
||||
@@ -32,7 +36,6 @@ datum/preferences
|
||||
var/last_ip
|
||||
var/last_id
|
||||
|
||||
|
||||
//game-preferences
|
||||
var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
|
||||
var/ooccolor = "#b82e00"
|
||||
@@ -79,9 +82,8 @@ datum/preferences
|
||||
var/job_engsec_med = 0
|
||||
var/job_engsec_low = 0
|
||||
|
||||
// Want randomjob if preferences already filled - Donkie
|
||||
var/userandomjob = 1 //defaults to 1 for fewer assistants
|
||||
|
||||
//Keeps track of preferrence for not getting any wanted jobs
|
||||
var/alternate_option = 0
|
||||
|
||||
var/used_skillpoints = 0
|
||||
var/skill_specialization = null
|
||||
@@ -441,7 +443,15 @@ datum/preferences
|
||||
|
||||
HTML += "</center></table>"
|
||||
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=[userandomjob ? "green>Get random job if preferences unavailable" : "red>Be assistant if preference unavailable"]</font></a></u></center><br>"
|
||||
switch(alternate_option)
|
||||
if(GET_RANDOM_JOB)
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=green>Get random job if preferences unavailable</font></a></u></center><br>"
|
||||
if(BE_ASSISTANT)
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=red>Be assistant if preference unavailable</font></a></u></center><br>"
|
||||
if(RETURN_TO_LOBBY)
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=purple>Return to lobby if prefernce unavailable</font></a></u></center><br>"
|
||||
else return;
|
||||
|
||||
HTML += "<center><a href='?_src_=prefs;preference=job;task=reset'>\[Reset\]</a></center>"
|
||||
HTML += "</tt>"
|
||||
|
||||
@@ -641,7 +651,12 @@ datum/preferences
|
||||
ResetJobs()
|
||||
SetChoices(user)
|
||||
if("random")
|
||||
userandomjob = !userandomjob
|
||||
if(alternate_option == GET_RANDOM_JOB || alternate_option == BE_ASSISTANT)
|
||||
alternate_option += 1
|
||||
else if(alternate_option == RETURN_TO_LOBBY)
|
||||
alternate_option = 0
|
||||
else
|
||||
return 0
|
||||
SetChoices(user)
|
||||
if ("alt_title")
|
||||
var/datum/job/job = locate(href_list["job"])
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
S["b_type"] >> b_type
|
||||
|
||||
//Jobs
|
||||
S["userandomjob"] >> userandomjob
|
||||
S["alternate_option"] >> alternate_option
|
||||
S["job_civilian_high"] >> job_civilian_high
|
||||
S["job_civilian_med"] >> job_civilian_med
|
||||
S["job_civilian_low"] >> job_civilian_low
|
||||
@@ -173,7 +173,7 @@
|
||||
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
|
||||
b_type = sanitize_text(b_type, initial(b_type))
|
||||
|
||||
userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob))
|
||||
alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
|
||||
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
|
||||
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
|
||||
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
|
||||
@@ -223,7 +223,7 @@
|
||||
S["b_type"] << b_type
|
||||
|
||||
//Jobs
|
||||
S["userandomjob"] << userandomjob
|
||||
S["alternate_option"] << alternate_option
|
||||
S["job_civilian_high"] << job_civilian_high
|
||||
S["job_civilian_med"] << job_civilian_med
|
||||
S["job_civilian_low"] << job_civilian_low
|
||||
|
||||
Reference in New Issue
Block a user