diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index ae0d5a2544..43424f97df 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -160,6 +160,7 @@ var/list/gamemode_cache = list() var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database + var/use_age_restriction_for_antags = 0 //Do antags use account age restrictions? --requires database var/simultaneous_pm_warning_timeout = 100 @@ -278,6 +279,9 @@ var/list/gamemode_cache = list() if ("use_age_restriction_for_jobs") config.use_age_restriction_for_jobs = 1 + if ("use_age_restriction_for_antags") + config.use_age_restriction_for_antags = 1 + if ("jobs_have_minimal_access") config.jobs_have_minimal_access = 1 diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index 348bf6244d..47b82b82ac 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -47,6 +47,7 @@ var/mob_path = /mob/living/carbon/human // Mobtype this antag will use if none is provided. var/feedback_tag = "traitor_objective" // End of round var/bantype = "Syndicate" // Ban to check when spawning this antag. + var/minimum_player_age = 7 // Players need to be at least minimum_player_age days old before they are eligable for auto-spawning var/suspicion_chance = 50 // Prob of being on the initial Command report var/flags = 0 // Various runtime options. @@ -105,6 +106,8 @@ if(ghosts_only && !istype(player.current, /mob/observer/dead)) candidates -= player log_debug("[key_name(player)] is not eligible to become a [role_text]: Only ghosts may join as this role! They have been removed from the draft.") + else if(config.use_age_restriction_for_antags && player.current.client.player_age < minimum_player_age) + log_debug("[key_name(player)] is not eligible to become a [role_text]: Is only [player.current.client.player_age] day\s old, has to be [minimum_player_age] day\s!") else if(istype(player.current, /mob/living/voice)) candidates -= player log_debug("[key_name(player)] is not eligible to become a [role_text]: They are only a communicator voice. They have been removed from the draft.") diff --git a/config/example/config.txt b/config/example/config.txt index 3839b63bac..884316c45c 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -25,6 +25,11 @@ JOBS_HAVE_MINIMAL_ACCESS ## you have noone older than 0 days, since noone has been logged yet. Only turn this on once you have had the database up for 30 days. #USE_AGE_RESTRICTION_FOR_JOBS +## Unhash this entry to have certain antag roles require your account to be at least a certain number of days old for round start and auto-spawn selection. +## Non-automatic antagonist recruitment, such as being converted to cultism is not affected. Has the same database requirements and notes as USE_AGE_RESTRICTION_FOR_JOBS. +#USE_AGE_RESTRICTION_FOR_ANTAGS + + ## Unhash this to use recursive explosions, keep it hashed to use circle explosions. Recursive explosions react to walls, airlocks and blast doors, making them look a lot cooler than the boring old circular explosions. They require more CPU and are (as of january 2013) experimental #USE_RECURSIVE_EXPLOSIONS diff --git a/html/changelogs/Anewbe - Antag_Age.yml b/html/changelogs/Anewbe - Antag_Age.yml new file mode 100644 index 0000000000..0360f8184a --- /dev/null +++ b/html/changelogs/Anewbe - Antag_Age.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: PsiOmegaDelta + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "The round start and auto-antag spawners can now check if players have played long enough to be eligable for selection."