Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ограничения Раса/Роль #1693

Merged
merged 15 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/modules/client/preference/character.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,9 @@
if(restrictions)
html += "<del class='dark'>[rank]</del></td><td class='bad'><b> \[[restrictions]]</b></td></tr>"
continue
if(job.species_ban(user.client))
html += "<del class='dark'>[rank]</del></td><td class='bad'><b> \[WRONG SPECIES\]</b></td></tr>"
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
continue
if(job.barred_by_disability(user.client))
html += "<del class='dark'>[rank]</del></td><td class='bad'><b> \[DISABILITY\]</b></td></tr>"
continue
Expand Down
57 changes: 57 additions & 0 deletions config/example/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,63 @@ job_slot_amounts = [
{ name = "Assistant", lowpop = -1, highpop = -1 },
]

# Should enable job ban for species
allow_to_ban_job_for_species = false
# Job blacklist marks. Add specie name to ban job for a specific specie. Example: { name = "Captain", species_blacklist = ["Vox"] },
job_species_blacklist = [
# Commmand
{ name = "Captain", species_blacklist = [] },
{ name = "Head of Personnel", species_blacklist = [] },
{ name = "Head of Security", species_blacklist = [] },
{ name = "Chief Engineer", species_blacklist = [] },
{ name = "Research Director", species_blacklist = [] },
{ name = "Chief Medical Officer", species_blacklist = [] },
{ name = "Quartermaster", species_blacklist = [] },
{ name = "Nanotrasen Representative", species_blacklist = [] },
{ name = "Blueshield", species_blacklist = [] },
{ name = "Magistrate", species_blacklist = [] },
# Engineering
{ name = "Life Support Specialist", species_blacklist = [] },
{ name = "Station Engineer", species_blacklist = [] },
{ name = "Trainee Engineer", species_blacklist = [] },
# Medical
{ name = "Chemist", species_blacklist = [] },
{ name = "Paramedic", species_blacklist = [] },
{ name = "Geneticist", species_blacklist = [] },
{ name = "Coroner", species_blacklist = [] },
{ name = "Psychiatrist", species_blacklist = [] },
{ name = "Medical Doctor", species_blacklist = [] },
{ name = "Medical Intern", species_blacklist = [] },
{ name = "Virologist", species_blacklist = [] },
# Science
{ name = "Roboticist", species_blacklist = [] },
{ name = "Scientist", species_blacklist = [] },
{ name = "Student Scientist", species_blacklist = [] },
# Security
{ name = "Detective", species_blacklist = [] },
{ name = "Security Officer", species_blacklist = [] },
{ name = "Security Cadet", species_blacklist = [] },
{ name = "Warden", species_blacklist = [] },
{ name = "Internal Affairs Agent", species_blacklist = [] },
# Service
{ name = "Bartender", species_blacklist = [] },
{ name = "Botanist", species_blacklist = [] },
{ name = "Chaplain", species_blacklist = [] },
{ name = "Chef", species_blacklist = [] },
{ name = "Janitor", species_blacklist = [] },
{ name = "Librarian", species_blacklist = [] },
{ name = "Clown", species_blacklist = [] },
{ name = "Mime", species_blacklist = [] },
# Cargo/Supply
{ name = "Explorer", species_blacklist = [] },
{ name = "Shaft Miner", species_blacklist = [] },
{ name = "Cargo Technician", species_blacklist = [] },
# Silicon
{ name = "AI", species_blacklist = [] },
{ name = "Cyborg", species_blacklist = [] },
# Misc
{ name = "Assistant", species_blacklist = [] },
]
msw7007 marked this conversation as resolved.
Show resolved Hide resolved

msw7007 marked this conversation as resolved.
Show resolved Hide resolved
################################################################

Expand Down
1 change: 1 addition & 0 deletions modular_ss220/jobs/_jobs.dme
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "_jobs.dm"

#include "code/configuration.dm"
#include "code/card_computer.dm"
#include "code/card_id.dm"
#include "code/departaments.dm"
Expand Down
8 changes: 8 additions & 0 deletions modular_ss220/jobs/code/configuration.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/datum/configuration_section/job_configuration
var/list/blacklist_species = list()
var/enable_black_list = FALSE

/datum/configuration_section/job_configuration/load_data(list/data)
. = .. ()
CONFIG_LOAD_BOOL(enable_black_list, data["allow_to_ban_job_for_species"])
CONFIG_LOAD_LIST(blacklist_species, data["job_species_blacklist"])
13 changes: 13 additions & 0 deletions modular_ss220/jobs/code/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,16 @@
if(title in GLOB.all_jobs_ss220)
return TRUE
return FALSE

/datum/job/proc/species_ban(client/C)
if(!GLOB.configuration.jobs.enable_black_list)
return FALSE

var/list/job_ban = GLOB.configuration.jobs.blacklist_species.Copy()
msw7007 marked this conversation as resolved.
Show resolved Hide resolved

if(!C || !length(job_ban))
return FALSE
for(var/job_data in job_ban)
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
if((src.title == job_data["name"]) && (C.prefs.active_character.species in job_data["species_blacklist"]))
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
return TRUE
return FALSE
Loading