diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index e155cbc9ae3..bcad314c461 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -2,118 +2,54 @@ //The name of the job var/title = "NOPE" - //Job access. The use of minimal_access or access is determined by a config setting: config.jobs_have_minimal_access - var/list/minimal_access = list() //Useful for servers which prefer to only have access given to the places a job absolutely needs (Larger server population) - var/list/access = list() //Useful for servers which either have fewer players, so each person needs to fill more than one role, or servers which like to give more access, so players can't hide forever in their super secure departments (I'm looking at you, chemistry!) - - //Bitflags for the job - var/flag = 0 + var/list/minimal_access = list() // Useful for servers which prefer to only have access given to the places a job absolutely needs (Larger server population) + var/list/access = list() // Useful for servers which either have fewer players, so each person needs to fill more than one role, or servers which like to give more access, so players can't hide forever in their super secure departments (I'm looking at you, chemistry!) + var/flag = 0 // Bitflags for the job var/department_flag = 0 - - //Players will be allowed to spawn in as jobs that are set to "Station" - var/faction = "None" - - //How many players can be this job - var/total_positions = 0 - - //How many players can spawn in as this job - var/spawn_positions = 0 - - //How many players have this job - var/current_positions = 0 - - //Supervisors, who this person answers to directly - var/supervisors = "" - - //Sellection screen color - var/selection_color = "#ffffff" - - //the type of the ID the player will have - var/idtype = /obj/item/weapon/card/id - - //List of alternate titles, if any - var/list/alt_titles - - //If this is set to 1, a text is printed to the player when jobs are assigned, telling him that he should let admins know that he has to disconnect. - var/req_admin_notify - - //If you have use_age_restriction_for_jobs config option enabled and the database set up, this option will add a requirement for players to be at least minimal_player_age days old. (meaning they first signed in at least that many days before.) - var/minimal_player_age = 0 - - var/department = null - var/head_position = 0 - + var/faction = "None" // Players will be allowed to spawn in as jobs that are set to "Station" + var/total_positions = 0 // How many players can be this job + var/spawn_positions = 0 // How many players can spawn in as this job + var/current_positions = 0 // How many players have this job + var/supervisors = "" // Supervisors, who this person answers to directly + var/selection_color = "#ffffff" // Selection screen color + var/idtype = /obj/item/weapon/card/id // The type of the ID the player will have + var/list/alt_titles // List of alternate titles, if any + var/req_admin_notify // If this is set to 1, a text is printed to the player when jobs are assigned, telling him that he should let admins know that he has to disconnect. + var/minimal_player_age = 0 // If you have use_age_restriction_for_jobs config option enabled and the database set up, this option will add a requirement for players to be at least minimal_player_age days old. (meaning they first signed in at least that many days before.) + var/department = null // Does this position have a department tag? + var/head_position = 0 // Is this position Command? /datum/job/proc/equip(var/mob/living/carbon/human/H) return 1 /datum/job/proc/get_access() - if(!config) //Needed for robots. - return src.minimal_access.Copy() - - if(config.jobs_have_minimal_access) + if(!config || config.jobs_have_minimal_access) return src.minimal_access.Copy() else return src.access.Copy() //If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1 /datum/job/proc/player_old_enough(client/C) - if(available_in_days(C) == 0) - return 1 //Available in 0 days = available right now = player is old enough to play. - return 0 - + return (available_in_days(C) == 0) //Available in 0 days = available right now = player is old enough to play. /datum/job/proc/available_in_days(client/C) - if(!C) - return 0 - if(!config.use_age_restriction_for_jobs) - return 0 - if(!isnum(C.player_age)) - return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced - if(!isnum(minimal_player_age)) - return 0 + if(C && config.use_age_restriction_for_jobs && isnum(C.player_age) && isnum(minimal_player_age)) + return max(0, minimal_player_age - C.player_age) + return 0 - return max(0, minimal_player_age - C.player_age) - -/datum/job/proc/apply_fingerprints(var/mob/living/carbon/human/H) - if(!istype(H)) - return - if(H.back) - H.back.add_fingerprint(H,1) //The 1 sets a flag to ignore gloves - for(var/obj/item/I in H.back.contents) - I.add_fingerprint(H,1) - if(H.wear_id) - H.wear_id.add_fingerprint(H,1) - if(H.w_uniform) - H.w_uniform.add_fingerprint(H,1) - if(H.wear_suit) - H.wear_suit.add_fingerprint(H,1) - if(H.wear_mask) - H.wear_mask.add_fingerprint(H,1) - if(H.head) - H.head.add_fingerprint(H,1) - if(H.shoes) - H.shoes.add_fingerprint(H,1) - if(H.gloves) - H.gloves.add_fingerprint(H,1) - if(H.l_ear) - H.l_ear.add_fingerprint(H,1) - if(H.r_ear) - H.r_ear.add_fingerprint(H,1) - if(H.glasses) - H.glasses.add_fingerprint(H,1) - if(H.belt) - H.belt.add_fingerprint(H,1) - for(var/obj/item/I in H.belt.contents) - I.add_fingerprint(H,1) - if(H.s_store) - H.s_store.add_fingerprint(H,1) - if(H.l_store) - H.l_store.add_fingerprint(H,1) - if(H.r_store) - H.r_store.add_fingerprint(H,1) +/datum/job/proc/apply_fingerprints(var/mob/living/carbon/human/target) + if(!istype(target)) + return 0 + for(var/obj/item/item in target.contents) + apply_fingerprints_to_item(target, item) return 1 +/datum/job/proc/apply_fingerprints_to_item(var/mob/living/carbon/human/holder, var/obj/item/item) + item.add_fingerprint(holder,1) + if(item.contents.len) + for(var/obj/item/sub_item in item.contents) + apply_fingerprints_to_item(holder, sub_item) + /datum/job/proc/is_position_available() return (current_positions < total_positions) || (total_positions == -1)