From b93313eb48a572797a1f5fcaeecc95b8bb15e543 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 17 Sep 2023 19:12:56 -0400 Subject: [PATCH 1/6] First Pass --- code/game/gamemodes/cm_initialize.dm | 12 +++++++----- code/game/jobs/job/civilians/support/working_joe.dm | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 36271054bb21..b4983c985e4e 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -957,11 +957,6 @@ Additional game mode variables. to_chat(joe_candidate, SPAN_WARNING("You are not whitelisted! You may apply on the forums to be whitelisted as a synth.")) return - if((joe_candidate.ckey in joes) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) - if(show_warning) - to_chat(joe_candidate, SPAN_WARNING("You already were a Working Joe this round!")) - return - // council doesn't count towards this conditional. if(joe_job.get_whitelist_status(RoleAuthority.roles_whitelist, joe_candidate.client) == WHITELIST_NORMAL) var/joe_max = joe_job.total_positions @@ -970,6 +965,13 @@ Additional game mode variables. to_chat(joe_candidate, SPAN_WARNING("Only [joe_max] Working Joes may spawn per round.")) return + var/deathtime = world.time - joe_candidate.timeofdeath + if(istype(joe_candidate, /mob/new_player)) + deathtime = JOE_DEAD_TIME //so new players don't have to wait to latejoin as Working Joe in the round's first 10 mins. + if(deathtime < JOE_DEAD_TIME && !check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) + return FALSE + if(!enter_allowed && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("There is an administrative lock from entering the game.")) diff --git a/code/game/jobs/job/civilians/support/working_joe.dm b/code/game/jobs/job/civilians/support/working_joe.dm index 00a848cce427..6912ac450ba0 100644 --- a/code/game/jobs/job/civilians/support/working_joe.dm +++ b/code/game/jobs/job/civilians/support/working_joe.dm @@ -1,6 +1,10 @@ #define STANDARD_VARIANT "Working Joe" #define HAZMAT_VARIANT "Hazmat Joe" +/// Time until someone can respawn as Working Joe + +#define JOE_DEAD_TIME = 10 MINUTES + /datum/job/civilian/working_joe title = JOB_WORKING_JOE total_positions = 6 From 940e8c885ae1e98e7da408241fb88dce90d9aefd Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 17 Sep 2023 19:18:25 -0400 Subject: [PATCH 2/6] Second pass --- code/__DEFINES/ARES.dm | 3 +++ code/game/gamemodes/cm_initialize.dm | 6 +++--- code/game/jobs/job/civilians/support/working_joe.dm | 4 ---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index a1b82af25821..6e9b62d022c0 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -70,3 +70,6 @@ /// Cooldowns #define COOLDOWN_ARES_SENSOR 60 SECONDS #define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS + +/// Time until someone can respawn as Working Joe +#define JOE_JOIN_DEAD_TIME = 10 MINUTES diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index b4983c985e4e..46b1c66ba74f 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -967,9 +967,9 @@ Additional game mode variables. var/deathtime = world.time - joe_candidate.timeofdeath if(istype(joe_candidate, /mob/new_player)) - deathtime = JOE_DEAD_TIME //so new players don't have to wait to latejoin as Working Joe in the round's first 10 mins. - if(deathtime < JOE_DEAD_TIME && !check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) - to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) + deathtime = JOE_JOIN_DEAD_TIME //so new players don't have to wait to latejoin as Working Joe in the round's first 10 mins. + if(deathtime < JOE_JOIN_DEAD_TIME && !check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_JOIN_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) return FALSE if(!enter_allowed && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) diff --git a/code/game/jobs/job/civilians/support/working_joe.dm b/code/game/jobs/job/civilians/support/working_joe.dm index 6912ac450ba0..00a848cce427 100644 --- a/code/game/jobs/job/civilians/support/working_joe.dm +++ b/code/game/jobs/job/civilians/support/working_joe.dm @@ -1,10 +1,6 @@ #define STANDARD_VARIANT "Working Joe" #define HAZMAT_VARIANT "Hazmat Joe" -/// Time until someone can respawn as Working Joe - -#define JOE_DEAD_TIME = 10 MINUTES - /datum/job/civilian/working_joe title = JOB_WORKING_JOE total_positions = 6 From 7bd1c025b6028c5e897cc2a5807f4e036f8d2ddf Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 17 Sep 2023 19:48:50 -0400 Subject: [PATCH 3/6] More testing --- code/__DEFINES/ARES.dm | 2 +- code/game/gamemodes/cm_initialize.dm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index 6e9b62d022c0..d9f71ba88f0a 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -72,4 +72,4 @@ #define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS /// Time until someone can respawn as Working Joe -#define JOE_JOIN_DEAD_TIME = 10 MINUTES +#define JOE_JOIN_DEAD_TIME (10 MINUTES) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 46b1c66ba74f..8abe0182b25d 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -966,9 +966,10 @@ Additional game mode variables. return var/deathtime = world.time - joe_candidate.timeofdeath - if(istype(joe_candidate, /mob/new_player)) + if(isnewplayer(joe_candidate)) + message_admins("This triggered.") deathtime = JOE_JOIN_DEAD_TIME //so new players don't have to wait to latejoin as Working Joe in the round's first 10 mins. - if(deathtime < JOE_JOIN_DEAD_TIME && !check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if(deathtime < JOE_JOIN_DEAD_TIME && check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_JOIN_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) return FALSE From 103750981c9f3ce6567f0324bce98939dd36a917 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 17 Sep 2023 20:14:53 -0400 Subject: [PATCH 4/6] Remove unusable code --- code/game/gamemodes/cm_initialize.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 8abe0182b25d..e2205b5b9f53 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -966,9 +966,6 @@ Additional game mode variables. return var/deathtime = world.time - joe_candidate.timeofdeath - if(isnewplayer(joe_candidate)) - message_admins("This triggered.") - deathtime = JOE_JOIN_DEAD_TIME //so new players don't have to wait to latejoin as Working Joe in the round's first 10 mins. if(deathtime < JOE_JOIN_DEAD_TIME && check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_JOIN_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) return FALSE From db6cd9a8229de409b8fe27f82b9aea2ae3281c1b Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 17 Sep 2023 20:15:09 -0400 Subject: [PATCH 5/6] oops --- code/game/gamemodes/cm_initialize.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index e2205b5b9f53..a9c0097d78ca 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -966,7 +966,7 @@ Additional game mode variables. return var/deathtime = world.time - joe_candidate.timeofdeath - if(deathtime < JOE_JOIN_DEAD_TIME && check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if(deathtime < JOE_JOIN_DEAD_TIME && !check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_JOIN_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) return FALSE From 5b12467bb35b3529180eb1e4338c8b83580a9c3f Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sun, 17 Sep 2023 22:52:14 -0400 Subject: [PATCH 6/6] Forest Changes --- code/game/gamemodes/cm_initialize.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index a9c0097d78ca..c434734df9d5 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -966,7 +966,7 @@ Additional game mode variables. return var/deathtime = world.time - joe_candidate.timeofdeath - if(deathtime < JOE_JOIN_DEAD_TIME && !check_client_rights(joe_candidate.client, R_ADMIN, FALSE) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if(deathtime < JOE_JOIN_DEAD_TIME && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_JOIN_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) return FALSE