Skip to content

Commit

Permalink
Emergency Response Team Housekeeping (shiptest-ss13#2744)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
This PR introduces a system to limit special roles picked in ERTs, which
can be toggled in the settings screen, and sorts out the antagonist
datums into factional files.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

![imagen](https://github.com/shiptest-ss13/Shiptest/assets/75212565/e3e18d92-6dfc-4be6-8d0f-7bf1bc366b3a)
This could happen to you.

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
code: ERT antag datums are now sorted into factional files
admin: ERTs can have limited special roles
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: meem <[email protected]>
Co-authored-by: Mark Suckerberg <[email protected]>
  • Loading branch information
2 people authored and MysticalFaceLesS committed Mar 5, 2024
1 parent f48d827 commit 67f1d11
Show file tree
Hide file tree
Showing 11 changed files with 505 additions and 492 deletions.
10 changes: 6 additions & 4 deletions code/datums/ert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
var/polldesc
/// If TRUE, gives the team members "[role] [random last name]" style names
var/random_names = FALSE
/// If TRUE, the admin who created the response team will be spawned in the briefing room in their preferred briefing outfit (assuming they're a ghost)
/// If TRUE, special slots (that are not the leader) will use a predefined limit
var/limit_slots = FALSE
/// If TRUE, the admin who created the response team will be spawned in the briefing room (or in the shuttle) in their preferred briefing outfit (assuming they're a ghost)
var/spawn_admin = FALSE
/// If TRUE, we try and pick one of the most experienced players who volunteered to fill the leader slot
var/leader_experience = TRUE
Expand Down Expand Up @@ -51,7 +53,7 @@

/datum/ert/marine
leader_role = /datum/antagonist/ert/marine
roles = list(/datum/antagonist/ert/marine/security, /datum/antagonist/ert/marine/engineer, /datum/antagonist/ert/marine/medic)
roles = list(/datum/antagonist/ert/marine/security, /datum/antagonist/ert/marine/engineer = 1, /datum/antagonist/ert/marine/medic = 1)
rename_team = "Marine Squad"
polldesc = "an 'elite' Nanotrasen Strike Team"
opendoors = FALSE
Expand Down Expand Up @@ -102,7 +104,7 @@
teamsize = 4
opendoors = FALSE
leader_role = /datum/antagonist/ert/lp/lieutenant
roles = list(/datum/antagonist/ert/lp, /datum/antagonist/ert/lp/medic, /datum/antagonist/ert/lp/engineer)
roles = list(/datum/antagonist/ert/lp, /datum/antagonist/ert/lp/medic = 1, /datum/antagonist/ert/lp/engineer = 1)
rename_team = "Loss Prevention Team"
polldesc = "a Nanotrasen loss prevention team"

Expand Down Expand Up @@ -195,7 +197,7 @@

/datum/ert/syndicate/gorlex
leader_role = /datum/antagonist/ert/syndicate/gorlex/leader
roles = list(/datum/antagonist/ert/syndicate/gorlex, /datum/antagonist/ert/syndicate/gorlex/pointman, /datum/antagonist/ert/syndicate/gorlex/medic, /datum/antagonist/ert/syndicate/gorlex/sniper)
roles = list(/datum/antagonist/ert/syndicate/gorlex, /datum/antagonist/ert/syndicate/gorlex/pointman = 1, /datum/antagonist/ert/syndicate/gorlex/medic = 1, /datum/antagonist/ert/syndicate/gorlex/sniper = 1)
mission = "Serve the interests of the 2nd Battlegroup."
rename_team = "2nd Battlegroup Squad"
polldesc = "a loyalist Gorlex squad"
Expand Down
22 changes: 21 additions & 1 deletion code/modules/admin/verbs/one_click_antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
.["mainsettings"]["open_armory"]["value"] = newtemplate.opendoors ? "Yes" : "No"
.["mainsettings"]["leader_experience"]["value"] = newtemplate.leader_experience ? "Yes" : "No"
.["mainsettings"]["random_names"]["value"] = newtemplate.random_names ? "Yes" : "No"
.["mainsettings"]["limit_slots"]["value"] = newtemplate.limit_slots ? "Yes" : "No"
.["mainsettings"]["spawn_admin"]["value"] = newtemplate.spawn_admin ? "Yes" : "No"
.["mainsettings"]["use_custom_shuttle"]["value"] = newtemplate.use_custom_shuttle ? "Yes" : "No"
.["mainsettings"]["spawn_at_outpost"]["value"] = newtemplate.spawn_at_outpost ? "Yes" : "No"
Expand Down Expand Up @@ -293,6 +294,7 @@
"open_armory" = list("desc" = "Open armory doors", "type" = "boolean", "value" = "[(ertemplate.opendoors ? "Yes" : "No")]"),
"leader_experience" = list("desc" = "Pick an experienced leader", "type" = "boolean", "value" = "[(ertemplate.leader_experience ? "Yes" : "No")]"),
"random_names" = list("desc" = "Randomize names", "type" = "boolean", "value" = "[(ertemplate.random_names ? "Yes" : "No")]"),
"limit_slots" = list("desc" = "Limit special roles", "type" = "boolean", "value" = "[(ertemplate.limit_slots ? "Yes" : "No")]"),
"spawn_admin" = list("desc" = "Spawn yourself as briefing officer", "type" = "boolean", "value" = "[(ertemplate.spawn_admin ? "Yes" : "No")]"),
"use_custom_shuttle" = list("desc" = "Use the ERT's custom shuttle (if it has one)", "type" = "boolean", "value" = "[(ertemplate.use_custom_shuttle ? "Yes" : "No")]"),
"spawn_at_outpost" = list("desc" = "Spawn the ERT/Dock the ERT at the Outpost", "type" = "boolean", "value" = "[(ertemplate.spawn_at_outpost ? "Yes" : "No")]"),
Expand All @@ -317,10 +319,11 @@
ertemplate.teamsize = prefs["teamsize"]["value"]
ertemplate.mission = prefs["mission"]["value"]
ertemplate.polldesc = prefs["polldesc"]["value"]
ertemplate.enforce_human = prefs["enforce_human"]["value"] == "Yes" // these next 7 are effectively toggles
ertemplate.enforce_human = prefs["enforce_human"]["value"] == "Yes" // these next 8 are effectively toggles
ertemplate.opendoors = prefs["open_armory"]["value"] == "Yes"
ertemplate.leader_experience = prefs["leader_experience"]["value"] == "Yes"
ertemplate.random_names = prefs["random_names"]["value"] == "Yes"
ertemplate.limit_slots = prefs["limit_slots"]["value"] == "Yes"
ertemplate.spawn_admin = prefs["spawn_admin"]["value"] == "Yes"
ertemplate.use_custom_shuttle = prefs["use_custom_shuttle"]["value"] == "Yes"
ertemplate.spawn_at_outpost = prefs["spawn_at_outpost"]["value"] == "Yes"
Expand Down Expand Up @@ -459,6 +462,23 @@
ert_antag = new ertemplate.leader_role ()
earmarked_leader = null
leader_spawned = TRUE
else if(ertemplate.limit_slots)
// pick a role from the role list
var/rolepick
rolepick = pick(ertemplate.roles)
var/count = ertemplate.roles[rolepick]
// is it a special role (does it have a number value)? if not, tough luck, spawn
if(!isnum(count))
ert_antag = rolepick
ert_antag = new ert_antag
// pick another if the count is 0
else if(!count)
continue
// pick it and decrease the count by one
else
count =- 1
ert_antag = rolepick
ert_antag = new ert_antag
else
ert_antag = ertemplate.roles[WRAP(numagents,1,length(ertemplate.roles) + 1)]
ert_antag = new ert_antag
Expand Down
Loading

0 comments on commit 67f1d11

Please sign in to comment.