Adds roles for golems, ash walkers and robot brains to player preferences + Splits antags and neutral roles in the UI window (#31168)

* split antags and neutrals, sentient to brains and golems

* proper roles for golems and brains

* potentially added golem ban

* added role for ash walker

* i -> role

* strings to defines

* spacing

* style

* early return
This commit is contained in:
Christer2222
2026-01-27 01:55:22 +00:00
committed by GitHub
parent 70b9bed2c3
commit ece644c3ca
8 changed files with 67 additions and 34 deletions
+11 -3
View File
@@ -219,6 +219,7 @@
jobs_to_ban += temp.title
if("nonhumandept")
jobs_to_ban += "pAI"
jobs_to_ban += ROLE_GOLEM
for(var/jobPos in GLOB.nonhuman_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
@@ -683,7 +684,7 @@
counter = 0
jobs += "</tr></table>"
//Non-Human (Green)
// Non-Human (Green)
counter = 0
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(GLOB.nonhuman_positions)+1]'><a href='byond://?src=[UID()];jobban3=nonhumandept;jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'>Non-human Positions</a></th></tr><tr align='center'>"
@@ -703,18 +704,24 @@
jobs += "</tr><tr align='center'>"
counter = 0
//Drone
// Drone
if(jobban_isbanned(M, "Drone"))
jobs += "<td width='20%'><a href='byond://?src=[UID()];jobban3=Drone;jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'><font color=red>Drone</font></a></td>"
else
jobs += "<td width='20%'><a href='byond://?src=[UID()];jobban3=Drone;jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'>Drone</a></td>"
//pAI
// pAI
if(jobban_isbanned(M, "pAI"))
jobs += "<td width='20%'><a href='byond://?src=[UID()];jobban3=pAI;jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'><font color=red>pAI</font></a></td>"
else
jobs += "<td width='20%'><a href='byond://?src=[UID()];jobban3=pAI;jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'>pAI</a></td>"
// golem
if(jobban_isbanned(M, ROLE_GOLEM))
jobs += "<td width='20%'><a href='byond://?src=[UID()];jobban3=[ROLE_GOLEM];jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'><font color=red>golem</font></a></td>"
else
jobs += "<td width='20%'><a href='byond://?src=[UID()];jobban3=[ROLE_GOLEM];jobban4=[M.UID()];dbbanaddckey=[M.last_known_ckey]'>golem</a></td>"
jobs += "</tr></table>"
//Antagonist (Orange)
@@ -824,6 +831,7 @@
joblist += temp.title
if("nonhumandept")
joblist += "pAI"
joblist += ROLE_GOLEM
for(var/jobPos in GLOB.nonhuman_positions)
if(!jobPos) continue
var/datum/job/temp = SSjobs.GetJob(jobPos)
@@ -87,10 +87,10 @@
var/area/A = get_area(src)
if(!mapload && A)
if(COOLDOWN_FINISHED(src, ghost_flash_cooldown))
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in [A.name].", source = src)
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in [A.name].", source = src, role = ROLE_GOLEM)
COOLDOWN_START(src, ghost_flash_cooldown, 20 MINUTES)
else
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in [A.name].", source = src, flashwindow = FALSE)
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in [A.name].", source = src, role = ROLE_GOLEM, flashwindow = FALSE)
if(has_owner && creator)
important_info = "Serve your creator, even if they are an antag."
flavour_text = "You are a golem created to serve your creator."
+31 -20
View File
@@ -1,5 +1,7 @@
/// Minimum age (in days) for accounts to play these roles.
GLOBAL_LIST_INIT(special_role_times, list(
ROLE_ROBOT_BRAIN = 0,
ROLE_GOLEM = 0,
ROLE_PAI = 0,
ROLE_GUARDIAN = 0,
ROLE_TRAITOR = 7,
@@ -492,26 +494,11 @@ GLOBAL_LIST_INIT(special_role_times, list(
if(TAB_ANTAG) // Antagonist's Preferences (and maps)
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>Special Role Settings</h2>"
if(jobban_isbanned(user, ROLE_SYNDICATE))
dat += "<b>You are banned from special roles.</b>"
be_special = list()
else
for(var/i in GLOB.special_roles)
if(jobban_isbanned(user, i))
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[BANNED]</b></font><br>"
else if(!player_old_enough_antag(user.client, i))
var/available_in_days_antag = available_in_days_antag(user.client, i)
var/role_available_in_playtime = get_exp_format(role_available_in_playtime(user.client, i))
if(available_in_days_antag)
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[IN [(available_in_days_antag)] DAYS]</b></font><br>"
else if(role_available_in_playtime)
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[IN [(role_available_in_playtime)]]</b></font><br>"
else
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[ERROR]</b></font><br>"
else
var/is_special = (i in src.be_special)
dat += "<b>Be [capitalize(i)]:</b><a class=[is_special ? "green" : "red"] href='byond://?_src_=prefs;preference=be_special;role=[i]'><b>[(is_special) ? "Yes" : "No"]</b></a><br>"
dat += "<h2>Antagonist Role Settings</h2>"
dat += get_role_settings(user, GLOB.special_roles_antags)
dat += "<h2>Neutral Role Settings</h2>"
dat += get_role_settings(user, GLOB.special_roles_neutral)
dat += "<h2>Total Playtime:</h2>"
if(!GLOB.configuration.jobs.enable_exp_tracking)
dat += SPAN_WARNING("Playtime tracking is not enabled.")
@@ -638,6 +625,30 @@ GLOBAL_LIST_INIT(special_role_times, list(
popup.set_content(dat.Join(""))
popup.open(FALSE)
/datum/preferences/proc/get_role_settings(mob/user, list/global_role_list)
var/html
if(jobban_isbanned(user, ROLE_SYNDICATE))
html += "<b>You are banned from special roles.</b>"
be_special = list()
return html
for(var/role in global_role_list)
if(jobban_isbanned(user, role))
html += "<b>Be [capitalize(role)]:</b> <font color='red'><b> \[BANNED]</b></font><br>"
else if(!player_old_enough_antag(user.client, role))
var/available_in_days_antag = available_in_days_antag(user.client, role)
var/role_available_in_playtime = get_exp_format(role_available_in_playtime(user.client, role))
if(available_in_days_antag)
html += "<b>Be [capitalize(role)]:</b> <font color='red'><b> \[IN [(available_in_days_antag)] DAYS]</b></font><br>"
else if(role_available_in_playtime)
html += "<b>Be [capitalize(role)]:</b> <font color='red'><b> \[IN [(role_available_in_playtime)]]</b></font><br>"
else
html += "<b>Be [capitalize(role)]:</b> <font color='red'><b> \[ERROR]</b></font><br>"
else
var/is_special = (role in src.be_special)
html += "<b>Be [capitalize(role)]:</b><a class='[is_special ? "green" : "red"]' href='byond://?_src_=prefs;preference=be_special;role=[role]'><b>[(is_special) ? "Yes" : "No"]</b></a><br>"
return html
/datum/preferences/proc/open_load_dialog(mob/user)
var/dat = "<body>"
dat += "<tt><center>"
@@ -47,7 +47,7 @@
var/area/our_area = get_area(src)
icon_state = searching_icon
searching = TRUE
notify_ghosts("A robotic brain has been activated in [our_area.name].", source = src, flashwindow = FALSE, action = NOTIFY_ATTACK)
notify_ghosts("A robotic brain has been activated in [our_area.name].", source = src, flashwindow = FALSE, role = ROLE_ROBOT_BRAIN, action = NOTIFY_ATTACK)
addtimer(CALLBACK(src, PROC_REF(reset_search)), 60 SECONDS)
// This should not ever happen, but let's be safe
@@ -81,7 +81,7 @@
. = ..()
var/area/A = get_area(src)
if(A)
notify_ghosts("An ash walker egg is ready to hatch in \the [A.name].", source = src, action = NOTIFY_ATTACK, flashwindow = FALSE)
notify_ghosts("An ash walker egg is ready to hatch in \the [A.name].", source = src, action = NOTIFY_ATTACK, flashwindow = FALSE, role = ROLE_ASH_WALKER)
/datum/outfit/ashwalker
name = "Ashwalker"