mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +01:00
Security + Heads of Staff are less likely to become certain types of antags (#7083)
Revives #5809 Chances of getting antag: Security Officer: 50% chance to get antag. Security Cadet: 75% chance to get antag. Warden: 40% chance to get antag. Detective: 50% chance to get antag. Forensic Technician 50% chance to get antag. Heads of Staff: 25% chance to get antag. Antags affected: Changeling Traitor Vampire Cultist Revolutionary Loyalist
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
var/list/restricted_jobs = list() // Jobs that cannot be this antagonist (depending on config)
|
||||
var/list/protected_jobs = list() // As above.
|
||||
var/list/restricted_species = list() // species that cannot be this antag - Ryan784
|
||||
var/list/chance_restricted_jobs = list() // chance based restrictions
|
||||
|
||||
// Strings.
|
||||
var/welcome_text = "Cry havoc and let slip the dogs of war!"
|
||||
@@ -93,7 +94,7 @@
|
||||
return 1
|
||||
|
||||
// Get the raw list of potential players.
|
||||
/datum/antagonist/proc/build_candidate_list(var/ghosts_only, var/allow_animals = 0)
|
||||
/datum/antagonist/proc/build_candidate_list(var/ghosts_only, var/allow_animals = 0, var/chance_per_job = TRUE)
|
||||
candidates = list() // Clear.
|
||||
|
||||
// Prune restricted status. Broke it up for readability.
|
||||
@@ -111,6 +112,8 @@
|
||||
log_debug("[key_name(player)] is not eligible to become a [role_text]: They are blacklisted for this role!")
|
||||
else if(player_is_antag(player))
|
||||
log_debug("[key_name(player)] is not eligible to become a [role_text]: They are already an antagonist!")
|
||||
else if(!can_become_antag_chance(player) && chance_per_job)
|
||||
log_debug("[key_name(player)] is not eligible to become a [role_text]: They are unlucky (based on job)!")
|
||||
else
|
||||
candidates += player
|
||||
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/antagonist/proc/can_become_antag_chance(var/datum/mind/player)
|
||||
if(!isnull(chance_restricted_jobs[player.assigned_role]))
|
||||
return prob(chance_restricted_jobs[player.assigned_role])
|
||||
else
|
||||
return 1
|
||||
|
||||
/datum/antagonist/proc/antags_are_dead()
|
||||
for(var/datum/mind/antag in current_antagonists)
|
||||
if(mob_path && !istype(antag.current,mob_path))
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
restricted_jobs = list("AI", "Cyborg", "Head of Security", "Captain", "Internal Affairs Agent")
|
||||
|
||||
protected_jobs = list("Security Officer", "Security Cadet", "Warden", "Detective", "Forensic Technician")
|
||||
chance_restricted_jobs = list("Security Officer" = 50, "Security Cadet" = 75, "Warden" = 40, "Detective" = 50, "Forensic Technician" = 50, "Head of Personnel" = 25, "Chief Engineer" = 25, "Research Director" = 25, "Chief Medical Officer" = 25) //Second value is chance to be considered for antag. Unlisted roles here are 100 by default.
|
||||
restricted_species = list(
|
||||
"Baseline Frame",
|
||||
"Shell Frame",
|
||||
|
||||
@@ -19,6 +19,7 @@ var/datum/antagonist/cultist/cult
|
||||
bantype = "cultist"
|
||||
restricted_jobs = list("Chaplain","AI", "Cyborg", "Internal Affairs Agent", "Head of Security", "Captain")
|
||||
protected_jobs = list("Security Officer", "Security Cadet", "Warden", "Detective", "Forensic Technician")
|
||||
chance_restricted_jobs = list("Security Officer" = 50, "Security Cadet" = 75, "Warden" = 40, "Detective" = 50, "Forensic Technician" = 50, "Head of Personnel" = 25, "Chief Engineer" = 25, "Research Director" = 25, "Chief Medical Officer" = 25) //Second value is chance to be considered for antag. Unlisted roles here are 100 by default.
|
||||
feedback_tag = "cult_objective"
|
||||
antag_indicator = "cult"
|
||||
welcome_text = "You have a talisman in your possession; one that will help you start the cult on this station. Use it well and remember - there are others."
|
||||
|
||||
@@ -28,6 +28,7 @@ var/datum/antagonist/loyalists/loyalists
|
||||
faction_indicator = "loyal"
|
||||
faction_invisible = 1
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
chance_restricted_jobs = list("Security Officer" = 50, "Security Cadet" = 75, "Warden" = 40, "Detective" = 50, "Forensic Technician" = 50) //Second value is chance to be considered for antag. Unlisted roles here are 100 by default.
|
||||
|
||||
/datum/antagonist/loyalists/New()
|
||||
..()
|
||||
|
||||
@@ -30,6 +30,7 @@ var/datum/antagonist/revolutionary/revs
|
||||
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Security Cadet", "Warden", "Detective", "Forensic Technician", "Head of Personnel", "Chief Engineer", "Research Director", "Chief Medical Officer", "Captain", "Head of Security", "Internal Affairs Agent")
|
||||
chance_restricted_jobs = list("Security Officer" = 50, "Security Cadet" = 75, "Warden" = 40, "Detective" = 50, "Forensic Technician" = 50, "Head of Personnel" = 25, "Chief Engineer" = 25, "Research Director" = 25, "Chief Medical Officer" = 25) //Second value is chance to be considered for antag. Unlisted roles here are 100 by default.
|
||||
|
||||
/datum/antagonist/revolutionary/New()
|
||||
..()
|
||||
|
||||
@@ -5,6 +5,7 @@ var/datum/antagonist/traitor/traitors
|
||||
id = MODE_TRAITOR
|
||||
restricted_jobs = list("Internal Affairs Agent", "Head of Security", "Captain", "AI")
|
||||
protected_jobs = list("Security Officer", "Security Cadet", "Warden", "Detective", "Forensic Technician")
|
||||
chance_restricted_jobs = list("Security Officer" = 50, "Security Cadet" = 75, "Warden" = 40, "Detective" = 50, "Forensic Technician" = 50, "Head of Personnel" = 25, "Chief Engineer" = 25, "Research Director" = 25, "Chief Medical Officer" = 25) //Second value is chance to be considered for antag. Unlisted roles here are 100 by default.
|
||||
flags = ANTAG_SUSPICIOUS | ANTAG_RANDSPAWN | ANTAG_VOTABLE
|
||||
|
||||
faction = "syndicate"
|
||||
|
||||
@@ -9,6 +9,7 @@ var/datum/antagonist/vampire/vamp = null
|
||||
restricted_jobs = list("AI", "Cyborg", "Chaplain", "Head of Security", "Captain", "Internal Affairs Agent")
|
||||
|
||||
protected_jobs = list("Security Officer", "Security Cadet", "Warden", "Detective", "Forensic Technician")
|
||||
chance_restricted_jobs = list("Security Officer" = 50, "Security Cadet" = 75, "Warden" = 40, "Detective" = 50, "Forensic Technician" = 50, "Head of Personnel" = 25, "Chief Engineer" = 25, "Research Director" = 25, "Chief Medical Officer" = 25) //Second value is chance to be considered for antag. Unlisted roles here are 100 by default.
|
||||
restricted_species = list(
|
||||
"Baseline Frame",
|
||||
"Shell Frame",
|
||||
|
||||
@@ -218,6 +218,10 @@ var/global/list/additional_antag_types = list()
|
||||
antag.update_initial_spawn_target()
|
||||
antag.build_candidate_list() //compile a list of all eligible candidates
|
||||
|
||||
//can't find enough antags? check again but don't apply the antag chance restrictions per job
|
||||
if(antag.candidates < required_enemies)
|
||||
antag.build_candidate_list(FALSE, FALSE, FALSE)
|
||||
|
||||
//antag roles that replace jobs need to be assigned before the job controller hands out jobs.
|
||||
if(antag.flags & ANTAG_OVERRIDE_JOB)
|
||||
antag.attempt_spawn() //select antags to be spawned
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
################################
|
||||
# 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
|
||||
# balance
|
||||
# admin
|
||||
# backend
|
||||
# security
|
||||
# refactor
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: Geeves, code by BurgerBB
|
||||
|
||||
# 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:
|
||||
- rscadd: "Security and Heads of Staff are less likely to gain antag status (Range: 25-75%)."
|
||||
Reference in New Issue
Block a user