Adds a new option to how the game handles a situation where a player doesn't qualify for any jobs they have set. Previously you could only have it set to play a random job (risky and potentially unfun) or play assistant (greytide).

This commit is contained in:
Incoming
2016-07-18 19:45:06 -04:00
parent 4065f6dc96
commit 6b3bc18a5b
4 changed files with 37 additions and 13 deletions

View File

@@ -50,3 +50,8 @@ var/global/list/special_roles = list(
ROLE_DEVIL = /datum/game_mode/devil,
ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult,
)
//Job defines for what happens when you fail to qualify for any job during job selection
#define BEASSISTANT 1
#define BERANDOMJOB 2
#define RETURNTOLOBBY 3

View File

@@ -328,7 +328,7 @@ var/datum/subsystem/job/SSjob
for(var/mob/new_player/player in unassigned)
if(PopcapReached())
RejectPlayer(player)
else if(player.client.prefs.userandomjob)
else if(player.client.prefs.joblessrole == BERANDOMJOB)
GiveRandomJob(player)
Debug("DO, Standard Check end")
@@ -339,8 +339,15 @@ var/datum/subsystem/job/SSjob
for(var/mob/new_player/player in unassigned)
if(PopcapReached())
RejectPlayer(player)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
if(player.client.prefs.joblessrole == BEASSISTANT)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
else // For those who don't want to play if their preference were filled, back you go.
RejectPlayer(player)
for(var/mob/new_player/player in unassigned) //Players that wanted to back out but couldn't because they're antags (can you feel the edge case?)
GiveRandomJob(player)
return 1
//Gives the player the stuff he should have with his rank
@@ -470,7 +477,8 @@ var/datum/subsystem/job/SSjob
/datum/subsystem/job/proc/RejectPlayer(mob/new_player/player)
if(player.mind && player.mind.special_role)
return
Debug("Popcap overflow Check observer located, Player: [player]")
if(PopcapReached())
Debug("Popcap overflow Check observer located, Player: [player]")
player << "<b>You have failed to qualify for any job you desired.</b>"
unassigned -= player
player.ready = 0

View File

@@ -78,7 +78,7 @@ var/list/preferences_datums = list()
var/job_engsec_low = 0
// Want randomjob if preferences already filled - Donkie
var/userandomjob = 1 //defaults to 1 for fewer assistants
var/joblessrole = BERANDOMJOB //defaults to 1 for fewer assistants
// 0 = character settings, 1 = game preferences
var/current_tab = 0
@@ -551,7 +551,12 @@ var/list/preferences_datums = list()
HTML += "</center></table>"
HTML += "<center><br><a href='?_src_=prefs;preference=job;task=random'>[userandomjob ? "Get random job if preferences unavailable" : "Be an Assistant if preference unavailable"]</a></center>"
var/message = "Be an Assistant if preferences unavailable"
if(joblessrole == BERANDOMJOB)
message = "Get random job if preferences unavailable"
else if(joblessrole == RETURNTOLOBBY)
message = "Return to lobby if preferences unavailable"
HTML += "<center><br><a href='?_src_=prefs;preference=job;task=random'>[message]</a></center>"
HTML += "<center><a href='?_src_=prefs;preference=job;task=reset'>Reset Preferences</a></center>"
user << browse(null, "window=preferences")
@@ -726,10 +731,16 @@ var/list/preferences_datums = list()
ResetJobs()
SetChoices(user)
if("random")
if(jobban_isbanned(user, "Assistant"))
userandomjob = 1
else
userandomjob = !userandomjob
switch(joblessrole)
if(RETURNTOLOBBY)
if(jobban_isbanned(user, "Assistant"))
joblessrole = BERANDOMJOB
else
joblessrole = BEASSISTANT
if(BEASSISTANT)
joblessrole = BERANDOMJOB
if(BERANDOMJOB)
joblessrole = RETURNTOLOBBY
SetChoices(user)
if("setJobLevel")
UpdateJobPreference(user, href_list["text"], text2num(href_list["level"]))

View File

@@ -346,7 +346,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["deity_name"] >> custom_names["deity"]
//Jobs
S["userandomjob"] >> userandomjob
S["joblessrole"] >> joblessrole
S["job_civilian_high"] >> job_civilian_high
S["job_civilian_med"] >> job_civilian_med
S["job_civilian_low"] >> job_civilian_low
@@ -398,7 +398,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
features["spines"] = sanitize_inlist(features["spines"], spines_list)
features["body_markings"] = sanitize_inlist(features["body_markings"], body_markings_list)
userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob))
joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole))
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))
@@ -456,7 +456,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["deity_name"] << custom_names["deity"]
//Jobs
S["userandomjob"] << userandomjob
S["joblessrole"] << joblessrole
S["job_civilian_high"] << job_civilian_high
S["job_civilian_med"] << job_civilian_med
S["job_civilian_low"] << job_civilian_low