mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 22:17:32 +01:00
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:
@@ -31,6 +31,9 @@
|
||||
// Role tags for EVERYONE!
|
||||
#define ROLE_DEMON "demon"
|
||||
#define ROLE_SENTIENT "sentient animal"
|
||||
#define ROLE_GOLEM "golem"
|
||||
#define ROLE_ROBOT_BRAIN "robot brain"
|
||||
#define ROLE_ASH_WALKER "ash walker"
|
||||
#define ROLE_GUARDIAN "guardian"
|
||||
#define ROLE_MORPH "morph"
|
||||
#define ROLE_ERT "emergency response team"
|
||||
@@ -49,7 +52,7 @@
|
||||
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
|
||||
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
|
||||
//(in game days played) to play that role
|
||||
GLOBAL_LIST_INIT(special_roles, list(
|
||||
GLOBAL_LIST_INIT(special_roles_antags, list(
|
||||
ROLE_ABDUCTOR = /datum/game_mode/abduction, // Abductor
|
||||
ROLE_BLOB, // Blob
|
||||
ROLE_CHANGELING = /datum/game_mode/changeling, // Changeling
|
||||
@@ -57,22 +60,31 @@ GLOBAL_LIST_INIT(special_roles, list(
|
||||
ROLE_GUARDIAN, // Guardian
|
||||
ROLE_MORPH, // Morph
|
||||
ROLE_OPERATIVE = /datum/game_mode/nuclear, // Operative
|
||||
ROLE_PAI, // PAI
|
||||
ROLE_REVENANT, // Revenant
|
||||
ROLE_REV = /datum/game_mode/revolution, // Revolutionary
|
||||
ROLE_SENTIENT, // Sentient animal
|
||||
ROLE_DEMON, // Slaguther demon
|
||||
ROLE_ELITE, // Lavaland Elite
|
||||
ROLE_TRADER, // Trader
|
||||
ROLE_TRAITOR = /datum/game_mode/traitor, // Traitor
|
||||
ROLE_TOURIST, // Tourist
|
||||
ROLE_VAMPIRE = /datum/game_mode/vampire, // Vampire
|
||||
ROLE_ALIEN, // Xenomorph
|
||||
ROLE_WIZARD = /datum/game_mode/wizard, // Wizard
|
||||
ROLE_MIND_FLAYER,
|
||||
|
||||
// UNUSED/BROKEN ANTAGS
|
||||
// ROLE_HOG_GOD = /datum/game_mode/hand_of_god,
|
||||
// ROLE_HOG_CULTIST = /datum/game_mode/hand_of_god,
|
||||
// ROLE_MONKEY = /datum/game_mode/monkey, Sooner or later these are going to get ported
|
||||
// ROLE_GANG = /datum/game_mode/gang
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(special_roles_neutral, list(
|
||||
ROLE_ASH_WALKER,
|
||||
ROLE_GOLEM,
|
||||
ROLE_PAI, // PAI
|
||||
ROLE_ROBOT_BRAIN,
|
||||
ROLE_SENTIENT, // Sentient animal
|
||||
ROLE_TOURIST, // Tourist
|
||||
ROLE_TRADER, // Trader
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(special_roles, special_roles_antags | special_roles_neutral)
|
||||
|
||||
@@ -24,5 +24,6 @@ GLOBAL_LIST_INIT(other_roles, list(
|
||||
ROLE_GHOST,
|
||||
ROLEBAN_AHUD,
|
||||
ROLEBAN_RECORDS,
|
||||
ROLE_ELITE
|
||||
ROLE_ELITE,
|
||||
ROLE_ASH_WALKER,
|
||||
))
|
||||
|
||||
@@ -105,7 +105,8 @@ GLOBAL_LIST_INIT(nonhuman_positions, list(
|
||||
"AI",
|
||||
"Cyborg",
|
||||
"Drone",
|
||||
"pAI"
|
||||
"pAI",
|
||||
"golem",
|
||||
))
|
||||
|
||||
/proc/get_job_datums()
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user