mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Let admins allow ERT borgs to choose sec modules (#17874)
* Let admins allow secborgs in ERT * dont force them to be secborgs * fixes up some logic * remove this * Update code/modules/tgui/modules/ert_manager.dm * le indent * deconflict * tgui deconflict * Update code/modules/tgui/modules/ert_manager.dm Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
This commit is contained in:
@@ -57,10 +57,11 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
|
||||
|
||||
return 1
|
||||
|
||||
/proc/trigger_armed_response_team(datum/response_team/response_team_type, commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots)
|
||||
/proc/trigger_armed_response_team(datum/response_team/response_team_type, commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots, cyborg_security)
|
||||
GLOB.response_team_members = list()
|
||||
GLOB.active_team = response_team_type
|
||||
GLOB.active_team.setSlots(commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots)
|
||||
GLOB.active_team.cyborg_security_permitted = cyborg_security
|
||||
|
||||
GLOB.send_emergency_team = TRUE
|
||||
var/list/ert_candidates = shuffle(SSghost_spawns.poll_candidates("Join the Emergency Response Team?",, GLOB.responseteam_age, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_ERT]))
|
||||
@@ -136,6 +137,8 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
|
||||
/client/proc/create_response_team(new_gender, role, turf/spawn_location)
|
||||
if(role == "Cyborg")
|
||||
var/mob/living/silicon/robot/ert/R = new GLOB.active_team.borg_path(spawn_location)
|
||||
if(GLOB.active_team.cyborg_security_permitted)
|
||||
R.force_modules = list("Security", "Engineering", "Medical")
|
||||
return R
|
||||
|
||||
var/mob/living/carbon/human/M = new(null)
|
||||
@@ -209,6 +212,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
|
||||
var/janitor_outfit
|
||||
var/paranormal_outfit
|
||||
var/borg_path = /mob/living/silicon/robot/ert
|
||||
var/cyborg_security_permitted = FALSE
|
||||
|
||||
/datum/response_team/proc/setSlots(com=1, sec=4, med=0, eng=0, jan=0, par=0, cyb=0)
|
||||
slots["Commander"] = com
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
var/janitor_slots = 0
|
||||
var/paranormal_slots = 0
|
||||
var/cyborg_slots = 0
|
||||
/// The below is a toggle for if sec cyborgs are enabled or not
|
||||
var/cyborg_security = FALSE
|
||||
|
||||
/datum/ui_module/ert_manager/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ERTManager", name, 350, 430, master_ui, state)
|
||||
ui = new(user, src, ui_key, "ERTManager", name, 350, 470, master_ui, state)
|
||||
ui.autoupdate = TRUE
|
||||
ui.open()
|
||||
|
||||
@@ -36,6 +38,7 @@
|
||||
data["jan"] = janitor_slots
|
||||
data["par"] = paranormal_slots
|
||||
data["cyb"] = cyborg_slots
|
||||
data["secborg"] = cyborg_security
|
||||
data["total"] = commander_slots + security_slots + medical_slots + engineering_slots + janitor_slots + paranormal_slots + cyborg_slots
|
||||
data["spawnpoints"] = GLOB.emergencyresponseteamspawn.len
|
||||
return data
|
||||
@@ -47,6 +50,8 @@
|
||||
switch(action)
|
||||
if("ert_type")
|
||||
ert_type = params["ert_type"]
|
||||
if(ert_type != "Red")
|
||||
cyborg_security = FALSE
|
||||
if("toggle_com")
|
||||
commander_slots = commander_slots ? 0 : 1
|
||||
if("set_sec")
|
||||
@@ -61,6 +66,10 @@
|
||||
paranormal_slots = text2num(params["set_par"])
|
||||
if("set_cyb")
|
||||
cyborg_slots = text2num(params["set_cyb"])
|
||||
if(!cyborg_slots)
|
||||
cyborg_security = FALSE
|
||||
if("toggle_secborg")
|
||||
cyborg_security = !cyborg_security
|
||||
if("dispatch_ert")
|
||||
var/datum/response_team/D
|
||||
switch(ert_type)
|
||||
@@ -90,10 +99,10 @@
|
||||
if(cyborg_slots > 0)
|
||||
slots_list += "cyborg: [cyborg_slots]"
|
||||
var/slot_text = english_list(slots_list)
|
||||
notify_ghosts("An ERT is being dispatched. Open positions: [slot_text]")
|
||||
notify_ghosts("An ERT is being dispatched. Type: [ert_type]. Open positions: [slot_text]")
|
||||
message_admins("[key_name_admin(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]", 1)
|
||||
log_admin("[key_name(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]")
|
||||
GLOB.event_announcement.Announce("Attention, [station_name()]. We are attempting to assemble an ERT. Standby.", "ERT Protocol Activated")
|
||||
trigger_armed_response_team(D, commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots)
|
||||
trigger_armed_response_team(D, commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots, cyborg_security)
|
||||
else
|
||||
return FALSE
|
||||
|
||||
@@ -39,8 +39,9 @@ export const ERTManager = (props, context) => {
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Commander">
|
||||
<Button
|
||||
content={data.com > 0 ? 'Yes' : 'No'}
|
||||
selected={data.com > 0}
|
||||
icon={data.com ? 'toggle-on' : 'toggle-off'}
|
||||
selected={data.com}
|
||||
content={data.com ? 'Yes' : 'No'}
|
||||
onClick={() => act('toggle_com')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
@@ -128,6 +129,15 @@ export const ERTManager = (props, context) => {
|
||||
/>
|
||||
))}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Security Module">
|
||||
<Button
|
||||
disabled={(data.ert_type !== 'Red' || !data.cyb)}
|
||||
icon={data.secborg ? 'toggle-on' : 'toggle-off'}
|
||||
color={data.secborg ? 'red' : ''}
|
||||
content={data.secborg ? 'Enabled' : (data.ert_type !== 'Red' ? 'Unavailable' : 'Disabled')}
|
||||
onClick={() => act('toggle_secborg')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Total Slots">
|
||||
<Box color={data.total > data.spawnpoints ? 'red' : 'green'}>
|
||||
{data.total} total, versus {data.spawnpoints} spawnpoints
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user