Skip to content

Commit

Permalink
Creates a framework for per-faction Alt Titles (Aurorastation#19671)
Browse files Browse the repository at this point in the history
Creates a framework to restrict certain alt titles to certain factions.

As an example and natural logical consequence:
"Corporate Reporter" can only be used by Corporate employees
"Freelance Journalist" can only be used by Independent crew

I plan to use this system in a later PR.

---------

Signed-off-by: FlamingLily <[email protected]>
  • Loading branch information
FlamingLily authored Jul 27, 2024
1 parent 7a15a98 commit 4bce820
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
SPECIES_SKRELL_AXIORI = 50
)
var/list/alt_ages = null // assoc list of alt titles to minimum character ages assoc lists (see above -- yes this is slightly awful)
var/list/alt_factions = null // Assoc list of alt titles (as strings) to a list of faction titles (as strings). Defines what alt title can belong to what faction. Remains Null if no restrictions in use.

var/latejoin_at_spawnpoints = FALSE //If this job should use roundstart spawnpoints for latejoin (offstation jobs etc)

Expand Down
4 changes: 4 additions & 0 deletions code/game/jobs/job/outsider/representative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
access = list(ACCESS_JOURNALIST, ACCESS_MAINT_TUNNELS)
minimal_access = list(ACCESS_JOURNALIST, ACCESS_MAINT_TUNNELS)
alt_titles = list("Freelance Journalist")
alt_factions = list(
"Corporate Reporter" = list("NanoTrasen", "Idris Incorporated", "Hephaestus Industries", "Orion Express", "Zavodskoi Interstellar", "Zeng-Hu Pharmaceuticals", "Private Military Contracting Group", "Stellar Corporate Conglomerate"),
"Freelance Journalist" = list("Independent")
)
alt_outfits = list("Freelance Journalist" = /obj/outfit/job/journalistf)
title_accesses = list("Corporate Reporter" = list(ACCESS_MEDICAL, ACCESS_SEC_DOORS, ACCESS_RESEARCH, ACCESS_ENGINE))
outfit = /obj/outfit/job/journalist
Expand Down
5 changes: 5 additions & 0 deletions code/modules/client/preference_setup/occupation/occupation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@
if (!job)
return
var/choices = list(job.title) + job.alt_titles
for(var/t in choices)
if(!isnull(job.alt_factions))
if (src.faction in job.alt_factions[t])
continue
choices -= t
if((GLOB.all_species[src.species].spawn_flags & NO_AGE_MINIMUM))
return choices
for(var/t in choices)
Expand Down
60 changes: 60 additions & 0 deletions html/changelogs/flaminglily-factiontitle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
################################
# 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
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: FlamingLily

# 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, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- code_imp: "Added a system for restricting certain alt titles to certain factions."
- rscadd: "Restricted Freelance Journalist to the independent faction, and Corp reporter to the corporate factions."

0 comments on commit 4bce820

Please sign in to comment.