diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index dfc2c24eb58..ec5b92e84d3 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -27,7 +27,7 @@ var/global/datum/controller/gameticker/ticker /datum/controller/gameticker/proc/pregame() do - pregame_timeleft = 60 + pregame_timeleft = 90 world << "Welcome to the pre-game lobby!" world << "Please, setup your character and select ready. Game will start in [pregame_timeleft] seconds" while(current_state == GAME_STATE_PREGAME) diff --git a/code/game/jobs/jobprocs.dm b/code/game/jobs/jobprocs.dm index 3b7cf85b167..0dd8a220cbd 100644 --- a/code/game/jobs/jobprocs.dm +++ b/code/game/jobs/jobprocs.dm @@ -3,7 +3,7 @@ var/list/candidates = list() for (var/mob/new_player/player in unassigned) - if (player.preferences.occupation[level] == job) + if (player.preferences.occupation[job] == level) if (jobban_isbanned(player, job)) continue // if (player.jobs_restricted_by_gamemode && (job in player.jobs_restricted_by_gamemode)) @@ -20,6 +20,15 @@ player.mind.special_role = null return +/proc/FillHeadPosition(list/unassigned, job) + for (var/level = 1 to 3) + var/list/candidates = FindOccupationCandidates(unassigned, job, 4-level) + if (candidates.len) + var/mob/new_player/candidate = pick(candidates) + unassigned -= candidate + candidate.mind.assigned_role = job + return + /** Proc DivideOccupations * fills var "assigned_role" for all ready players. * This proc must not have any side effects besides of modifying "assigned_role". @@ -31,33 +40,28 @@ for (var/mob/new_player/player in world) if (player.client && player.ready && !player.mind.assigned_role) unassigned += player - for (var/level = 1 to 3) - if (jobban_isbanned(player, player.preferences.occupation[level])) - player.preferences.occupation[level] = "Assistant" +// for (var/level = 1 to 3) +// if (jobban_isbanned(player, player.preferences.occupation[4-level])) +// player.preferences.occupation[level] = "Assistant" // If someone picked AI before it was disabled, or has a saved profile with it // on a game that now lacks it, this will make sure they don't become the AI, // by changing that choice to Captain. - if (!config.allow_ai) - for (var/level = 1 to 3) - if (player.preferences.occupation[level] == "AI") - player.preferences.occupation[level] = "Captain" +// if (!config.allow_ai) +// for (var/level = 1 to 3) +// if (player.preferences.occupation[level] == "AI") +// player.preferences.occupation[level] = "Captain" if (unassigned.len == 0) return 0 - //Check for a Captain first - for (var/level = 1 to 3) - var/list/candidates = FindOccupationCandidates(unassigned, "Captain", level) - if (candidates.len) - var/mob/new_player/candidate = pick(candidates) - unassigned -= candidate - candidate.mind.assigned_role = "Captain" - break + //Fill head positions, first Captain than heads from least to most popular + for(var/occ in head_positions) + FillHeadPosition(unassigned, occ) //Then check for an AI for (var/level = 1 to 3)//Malf is a bit special as it replaces a normal job - var/list/candidates = FindOccupationCandidates(unassigned, "AI", level) + var/list/candidates = FindOccupationCandidates(unassigned, "AI", 4-level) if(ticker.mode.name == "AI malfunction") for(var/mob/new_player/player in candidates) if(!player.preferences.be_special & BE_MALF) @@ -77,13 +81,33 @@ player.mind.assigned_role = "AI" unassigned -= player break - //Now we can go though the rest of the jobs and players who set prefs + + // Now for most positions. Shuffle the list of unassigned players and go through it, giving them + // what they want. Easy for "best", more complicated for "okay" and "good" because we have to + // select randomly from their list of okay or good jobs. + for (var/level = 1 to 3) // Wish this could be from 3 to 1, but whatever. "Good" to "okay". + unassigned = shuffle(unassigned) // Maybe unnecessary to shuffle each time, but it's cheap. + for(var/mob/new_player/player in unassigned) + var/list/wantedJobs = list() + for(var/job in player.preferences.occupation) + if(player.preferences.occupation[job] == 4-level) + if(!(job in head_positions) && job != "AI" && occupation_eligible[job] != 0 && !jobban_isbanned(player,job)) + wantedJobs += job + if(length(wantedJobs) > 0) + player.mind.assigned_role = pick(wantedJobs) + occupation_eligible[player.mind.assigned_role]-- + unassigned -= player + else + player.mind.assigned_role = "Assistant" + + +/* //Now we can go though the rest of the jobs and players who set prefs for (var/level = 1 to 3) //Assistants are checked first for (var/occupation in assistant_occupations) if (unassigned.len == 0) break - var/list/candidates = FindOccupationCandidates(unassigned, occupation, level) + var/list/candidates = FindOccupationCandidates(unassigned, occupation, 4-level) while(candidates.len && assistant_occupations[occupation]) assistant_occupations[occupation]-- var/mob/new_player/candidate = pick_n_take(candidates) @@ -95,7 +119,7 @@ break if (occupation_eligible[occupation] == 0) continue - var/list/candidates = FindOccupationCandidates(unassigned, occupation, level) + var/list/candidates = FindOccupationCandidates(unassigned, occupation, 4-level) while (candidates.len && occupation_eligible[occupation]) occupation_eligible[occupation]-- var/mob/new_player/candidate = pick_n_take(candidates) @@ -126,7 +150,7 @@ player.mind.assigned_role = pick(occupationsPossible) assistant_occupations[player.mind.assigned_role]-- // player.mind.assigned_role = pick(assistant_occupations) - +*/ return 1 /mob/living/carbon/human/proc/Equip_Rank(rank, joined_late) diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index 7ec63c459a1..415c100dcb5 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -293,16 +293,20 @@ proc/assignment_algorithm(var/list/mob/new_player/players) var/list/occupations = list( + "Captain" = 1, //Civilian jobs "Head of Personnel" = 1, //soul "Clown" = 1, "Mime" = 1, + "Chaplain" = 1, + "Librarian" = 1, //body "Bartender" = 1, "Chef" = 1, + "Botanist" = 2, "Janitor" = 1, "Quartermaster" = 1, "Cargo Technician" = 3, @@ -318,22 +322,24 @@ var/list/occupations = list( "Warden" = 1, "Detective" = 1, "Security Officer" = 5, + "Lawyer" = 2, //medbay "Chief Medical Officer" = 1, "Medical Doctor" = 5, + "Geneticist" = 2, "Chemist" = 2, //science dept "Research Director" = 1, - "Geneticist" = 2, "Scientist" = 3, - "Botanist" = 2, "Virologist" = 1, //I afraid I can't do that, Dave -// "AI" = 1,now picked like the captain - "Cyborg" = 1 + "AI" = 1, + "Cyborg" = 1, + + "Assistant" = -1 ) @@ -351,11 +357,11 @@ var/list/assistant_occupations = list( var/list/head_positions = list( "Captain", - "Head of Personnel", - "Head of Security", + "Chief Medical Officer", "Chief Engineer", + "Head of Personnel", "Research Director", - "Chief Medical Officer" + "Head of Security" ) var/list/nonhuman_positions = list( diff --git a/code/game/objects/items/weapons/papers_bins.dm b/code/game/objects/items/weapons/papers_bins.dm index 31106e663fa..5d6475d37e2 100644 --- a/code/game/objects/items/weapons/papers_bins.dm +++ b/code/game/objects/items/weapons/papers_bins.dm @@ -187,6 +187,8 @@ CLIPBOARDS n_name = copytext(n_name, 1, 32) if ((src.loc == usr && usr.stat == 0)) src.name = text("paper[]", (n_name ? text("- '[n_name]'") : null)) + if(src.icon_state == "paper_blank" && n_name != "") + src.icon_state = "paper" src.add_fingerprint(usr) return @@ -235,6 +237,8 @@ CLIPBOARDS */ t = text("[]", t) + if(src.icon_state == "paper_blank") + src.icon_state = "paper" src.info += t else @@ -359,6 +363,7 @@ CLIPBOARDS src.amount-- var/obj/item/weapon/paper/P = new /obj/item/weapon/paper P.loc = usr.loc + P.icon_state = "paper_blank" if(ishuman(usr)) if(!usr.get_active_hand()) usr.put_in_hand(P) diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index e9ef8c6ac67..85470ab0aa2 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -43,7 +43,7 @@ datum/preferences var/underwear = 1 var/bubbles = 0 // 0 if the player doesn't want bubbles to appear - var/occupation[] = list("No Preference", "No Preference", "No Preference") + var/occupation[length(occupations)] var/datum/jobs/wanted_jobs = list() var/h_style = "Short Hair" @@ -68,6 +68,8 @@ datum/preferences New() randomize_name() + for(var/n in occupation) + n=1 ..() //The mob should have a gender you want before running this proc. @@ -379,7 +381,7 @@ datum/preferences update_preview_icon() user << browse_rsc(preview_icon, "previewicon.png") - var/list/destructive = list("Assistant") //only the actual assistants should terminate the list +// var/list/destructive = list("Assistant") //only the actual assistants should terminate the list var/dat = "" dat += "Name: " dat += "[real_name] " @@ -403,30 +405,8 @@ datum/preferences dat += "Change colour
__
" dat += "
Occupation Choices
" - if (destructive.Find(occupation[1])) - dat += "\t[occupation[1]]
" - else - if (jobban_isbanned(user, occupation[1])) - occupation[1] = "Assistant" - if (jobban_isbanned(user, occupation[2])) - occupation[2] = "Assistant" - if (jobban_isbanned(user, occupation[3])) - occupation[3] = "Assistant" - if (occupation[1] != "No Preference") - dat += "\tFirst Choice: [occupation[1]]
" + dat += "\tSet Preferences
" - if (destructive.Find(occupation[2])) - dat += "\tSecond Choice: [occupation[2]]
" - - else - if (occupation[2] != "No Preference") - dat += "\tSecond Choice: [occupation[2]]
" - dat += "\tLast Choice: [occupation[3]]
" - - else - dat += "\tSecond Choice: No Preference
" - else - dat += "\tNo Preference
" dat += "
Body " dat += "(®)" // Random look @@ -486,118 +466,62 @@ datum/preferences user << browse(dat, "window=preferences;size=300x710") - proc/SetChoices(mob/user, occ=1) + proc/SetChoices(mob/user, changedjob) var/HTML = "" HTML += "
" - switch(occ) - if(1.0) - HTML += "Which occupation would you like most?

" - if(2.0) - HTML += "Which occupation would you like if you couldn't have your first?

" - if(3.0) - HTML += "Which occupation would you like if you couldn't have the others?

" - else - for(var/job in uniquelist(occupations + assistant_occupations) ) - if ((job!="AI" || config.allow_ai) && !jobban_isbanned(user, job)) - HTML += "[job]
" + HTML += "Choose occupations
Unavailable occupations are in red.
" + for(var/job in occupations ) + if ((job!="AI" || config.allow_ai)) + if(jobban_isbanned(user, job)) + HTML += "" + if(job in head_positions || job=="AI") + HTML += "[job]" + else + HTML += "[job]" + if(jobban_isbanned(user, job)) + HTML += "" + if (!occupation[job]) + occupation[job]=0 + switch(occupation[job]) + if(0) + if(job=="Assistant") + HTML += "\[PleaseNo]" + else + HTML += "\[NEVER]" + if(1) + HTML += "\[Okay]" + if(2) + HTML += "\[Good]" + if(3) + HTML += "\[Best!]" + else HTML += "*"+occupation[job]+"*" + HTML += "
" - if(!jobban_isbanned(user, "AI")) - HTML += "AI
" - if(!jobban_isbanned(user, "Captain")) - HTML += "Captain
" HTML += "
" - HTML += "\[No Preference\]
" - HTML += "\[Cancel\]" + HTML += "\[Done\]" HTML += "
" user << browse(null, "window=preferences") user << browse(HTML, "window=mob_occupation;size=320x600") return - proc/SetJob(mob/user, occ=1, job="Captain") - if ((!( occupations.Find(job) ) && !( assistant_occupations.Find(job) ) && (job != "Captain" && job != "AI" && job != "No Preference"))) - return - if (job=="AI" && (!config.allow_ai)) - return - if (jobban_isbanned(user, job)) + proc/SetJob(mob/user, job="Captain") + if ((!( occupations.Find(job) ) && !( assistant_occupations.Find(job) ) && (job != "No Preference"))) + user << browse(null, "window=mob_occupation") + ShowChoices(user) return - switch(occ) - if(1.0) - if (job == occupation[1]) - user << browse(null, "window=mob_occupation") - return - else - if (job == "No Preference") - occupation[1] = "No Preference" - else - if (job == occupation[2]) - job = occupation[1] - occupation[1] = occupation[2] - occupation[2] = job - else - if (job == occupation[3]) - job = occupation[1] - occupation[1] = occupation[3] - occupation[3] = job - else - occupation[1] = job - if(2.0) - if (job == occupation[2]) - user << browse(null, "window=mob_occupation") - return - else - if (job == "No Preference") - if (occupation[3] != "No Preference") - occupation[2] = occupation[3] - occupation[3] = "No Preference" - else - occupation[2] = "No Preference" - else - if (job == occupation[1]) - if (occupation[2] == "No Preference") - user << browse(null, "window=mob_occupation") - return - job = occupation[2] - occupation[2] = occupation[1] - occupation[1] = job - else - if (job == occupation[3]) - job = occupation[2] - occupation[2] = occupation[3] - occupation[3] = job - else - occupation[2] = job - if(3.0) - if (job == occupation[3]) - user << browse(null, "window=mob_occupation") - return - else - if (job == "No Preference") - occupation[3] = "No Preference" - else - if (job == occupation[1]) - if (occupation[3] == "No Preference") - user << browse(null, "window=mob_occupation") - return - job = occupation[3] - occupation[3] = occupation[1] - occupation[1] = job - else - if (job == occupation[2]) - if (occupation[3] == "No Preference") - user << browse(null, "window=mob_occupation") - return - job = occupation[3] - occupation[3] = occupation[2] - occupation[2] = job - else - occupation[3] = job + if(occupation[job] == 2) // If it's going from good to best + for(var/j in occupation) + if(occupation[j] == 3) + occupation[j] = 2 - user << browse(null, "window=mob_occupation") - ShowChoices(user) + occupation[job] = (occupation[job]+1)%4 - return 1 + + SetChoices(user) + + return proc/process_link(mob/user, list/link_tags) @@ -606,9 +530,9 @@ datum/preferences user << browse(null, "window=\ref[user]occupation") return else if(link_tags["job"]) - SetJob(user, text2num(link_tags["occ"]), link_tags["job"]) + SetJob(user, link_tags["job"]) else - SetChoices(user, text2num(link_tags["occ"])) + SetChoices(user) return 1 @@ -835,9 +759,8 @@ datum/preferences randomize_name() age = 30 - occupation[1] = "No Preference" - occupation[2] = "No Preference" - occupation[3] = "No Preference" + for(var/o in occupation) + occupation[o] = 1 underwear = 1 //be_syndicate = 0 be_special = 0 diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 5957b6f99ae..744f4364436 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -22,9 +22,12 @@ datum/preferences/proc/savefile_save(mob/user) F["real_name"] << src.real_name F["gender"] << src.gender F["age"] << src.age - F["occupation_1"] << src.occupation[1] - F["occupation_2"] << src.occupation[2] - F["occupation_3"] << src.occupation[3] + for(var/job in uniquelist(occupations + assistant_occupations)) + //world << src.occupation[job] + F["occupation_"+job] << src.occupation[job] + //F["occupation_1"] << src.occupation[1] + //F["occupation_2"] << src.occupation[2] + //F["occupation_3"] << src.occupation[3] F["hair_red"] << src.r_hair F["hair_green"] << src.g_hair F["hair_blue"] << src.b_hair @@ -83,9 +86,11 @@ datum/preferences/proc/savefile_load(mob/user, var/silent = 1) F["real_name"] >> src.real_name F["gender"] >> src.gender F["age"] >> src.age - F["occupation_1"] >> src.occupation[1] - F["occupation_2"] >> src.occupation[2] - F["occupation_3"] >> src.occupation[3] + for(var/job in uniquelist(occupations + assistant_occupations)) + F["occupation_"+job] >> src.occupation[job] + //F["occupation_1"] >> src.occupation[1] + //F["occupation_2"] >> src.occupation[2] + //F["occupation_3"] >> src.occupation[3] F["hair_red"] >> src.r_hair F["hair_green"] >> src.g_hair F["hair_blue"] >> src.b_hair diff --git a/icons/changelog.html b/icons/changelog.html index 87fd51cd6af..9968897ac48 100644 --- a/icons/changelog.html +++ b/icons/changelog.html @@ -54,6 +54,15 @@ Stuff which is in development and not yet visible to players or just code relate (ie. code improvements for expandability, etc.) should not be listed here. They should be listed in the changelog upon commit tho. Thanks. --> +28 September 2011: +
    +
  • Rolan7 updated: +
      +
    • New method for job assignment. Remember to review your preferences. Sned all your hate and bug reports to me.
    • +
    +
  • +
+ 22 September 2011, OneWebDay:
  • Errorage updated: diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index 5693b9c9e08..e75cbc7be26 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ