From 58792f6d13264f42f96ab0c25d5a6707a9f3d24e Mon Sep 17 00:00:00 2001 From: texan-down-under <73374039+etherware-novice@users.noreply.github.com> Date: Sun, 10 Jul 2022 02:30:03 -0500 Subject: [PATCH 01/18] attempting to fix issue #435 first commit so im very sorry if i messed up in any way i havent dont git much sorry!!! --- monkestation/icons/mob/catgloves.dmi | Bin 429 -> 467 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/monkestation/icons/mob/catgloves.dmi b/monkestation/icons/mob/catgloves.dmi index 150ddd95e973111d8f97405ceaf528dc75c79802..f58ec9353da971a87ea8c259a1d464a69435a503 100644 GIT binary patch delta 290 zcmV+-0p0$s1JeVLBpww|OjJd{z`+0i|MK$k*VotQ=jY40x!v8}Cidwnkw2M#<4Ht8 zR9J=WmP-zTFcd`#6~`hQfU*H1umK^Cn-J!W1NOfJv3&Z9R1*eb%sqo%UO(rRSs4QW z{0?47V~gOd!{06tnHD6O>qcI9dO1X<{92zZu9G04F|>%60$&)xrP3$!Nf4EKEow!ceT9KOv5D!O;MM;GUb7>`sNk{C5^$E%OIC@ zQ`1?cjkH3`+WrsiE_Mk30N{VX`vC8QRq#Fl006KvY996ye589nbtL2SqoZN38I-%7 oQi_CY_lk2~I?~v10|36y0|enIC;m@G-2eap07*qoM6N<$f&vqV;{X5v delta 252 zcmV(4JV48!>GpD?jNHz2rmL-dp2+?NmmKO|JjHyqfyRfrJ- z5n7EvCE5!f@k|SOjxmz?R=>PJDbn7z1@T1jKIrX^fDl5+U&H$W?+1hsLdX%Z^YSaf zN8Em^fOXh7jP=>V&cN1Mh^?pJIOn4RBVhtUzRwdr9~M08j_bJq0000 Date: Mon, 11 Jul 2022 17:29:46 -0500 Subject: [PATCH 02/18] ssetting down basics for this --- code/modules/shuttle/emergency.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 47af8f005001a..c6016c150dfbe 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -175,6 +175,13 @@ if(ENGINES_STARTED || (!IS_DOCKED)) return . + if (obj_flags & EMAGGED) + var/CUTTIME = rand(0.2, 0.6) + minor_announce("The launch timer was not found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME])", "SYSTEM ERROR:") + SSshuttle.emergency.timeLeft() *= CUTTIME + minor_announce(TIME_LEFT, null) + + // Check to see if we've reached criteria for early launch if((authorized.len >= auth_need) || (obj_flags & EMAGGED)) // shuttle timers use 1/10th seconds internally From b3e413ee16ec8b0c35b4962e150b09e2d0b61f60 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Mon, 11 Jul 2022 17:38:50 -0500 Subject: [PATCH 03/18] gets the new shuttle time and sets it --- code/modules/shuttle/emergency.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index c6016c150dfbe..ae917370ccdf4 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -177,9 +177,9 @@ if (obj_flags & EMAGGED) var/CUTTIME = rand(0.2, 0.6) - minor_announce("The launch timer was not found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME])", "SYSTEM ERROR:") - SSshuttle.emergency.timeLeft() *= CUTTIME - minor_announce(TIME_LEFT, null) + var/NEWTIME = floor(max(TIME_LEFT * CUTTIME)) // makes sure the new time wont interrupt ignite + minor_announce("The launch timer was not found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME]), newtime is [NEWTIME]", "SYSTEM ERROR:") + SSshuttle.emergency.setTimer(NEWTIME) // Check to see if we've reached criteria for early launch From bfa6f24af390ba741fe68fbf2e7462f4e8a110c8 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Mon, 11 Jul 2022 17:56:37 -0500 Subject: [PATCH 04/18] fixes it firing twice and causing a huge earthquake --- code/modules/shuttle/emergency.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index ae917370ccdf4..96bc1a0632bb2 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -176,14 +176,15 @@ return . if (obj_flags & EMAGGED) - var/CUTTIME = rand(0.2, 0.6) - var/NEWTIME = floor(max(TIME_LEFT * CUTTIME)) // makes sure the new time wont interrupt ignite - minor_announce("The launch timer was not found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME]), newtime is [NEWTIME]", "SYSTEM ERROR:") + var/CUTTIME = rand(2, 6) + var/NEWTIME = max(TIME_LEFT / CUTTIME) + NEWTIME = FLOOR(NEWTIME, 1) // makes sure the new time wont interrupt ignite + minor_announce("The launch timer not be found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME]), newtime is [NEWTIME]", "SYSTEM ERROR:") SSshuttle.emergency.setTimer(NEWTIME) // Check to see if we've reached criteria for early launch - if((authorized.len >= auth_need) || (obj_flags & EMAGGED)) + if(authorized.len >= auth_need) // shuttle timers use 1/10th seconds internally SSshuttle.emergency.setTimer(ENGINES_START_TIME) var/system_error = obj_flags & EMAGGED ? "SYSTEM ERROR:" : null From 97c65e11b045ae2fe917eff82db4d323c0cd73a4 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Mon, 11 Jul 2022 18:25:24 -0500 Subject: [PATCH 05/18] tracking down the root cause of the double launch --- code/modules/shuttle/emergency.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 96bc1a0632bb2..7bba074c96b7b 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -267,7 +267,7 @@ if(!IS_DOCKED) return - if((obj_flags & EMAGGED) || ENGINES_STARTED) //SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LAUNCH IN 10 SECONDS + if(ENGINES_STARTED) //SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LAUNCH IN 10 SECONDS to_chat(user, "The shuttle is already launching!") return @@ -277,7 +277,7 @@ obj_flags |= EMAGGED SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20)//YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL - var/datum/species/S = new + var/datum/species/S = new for(var/i in 1 to 10) // the shuttle system doesn't know who these people are, but they // must be important, surely @@ -286,7 +286,7 @@ ID.registered_name = S.random_name(pick(MALE, FEMALE)) ID.assignment = J.title - authorized += ID + // authorized += ID process(SSMACHINES_DT) @@ -294,11 +294,11 @@ // Our fake IDs that the emag generated are just there for colour // They're not supposed to be accessible - for(var/obj/item/card/id/ID in src) + /* for(var/obj/item/card/id/ID in src) qdel(ID) if(authorized?.len) authorized.Cut() - authorized = null + authorized = null */ . = ..() From f7d5bd21554bd30a3048d71c602eadd6736c09ea Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 11:34:30 -0500 Subject: [PATCH 06/18] updated to use modTimer instead of setTime --- code/modules/shuttle/emergency.dm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 7bba074c96b7b..63d6ae008ad02 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -176,11 +176,11 @@ return . if (obj_flags & EMAGGED) - var/CUTTIME = rand(2, 6) - var/NEWTIME = max(TIME_LEFT / CUTTIME) - NEWTIME = FLOOR(NEWTIME, 1) // makes sure the new time wont interrupt ignite - minor_announce("The launch timer not be found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME]), newtime is [NEWTIME]", "SYSTEM ERROR:") - SSshuttle.emergency.setTimer(NEWTIME) + var/OLDTIME = TIME_LEFT + var/CUTTIME = rand(2, 3) + SSshuttle.emergency.modTimer(1 / CUTTIME) + minor_announce("The launch timer not be found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME], original was [OLDTIME])", "SYSTEM ERROR:") + // Check to see if we've reached criteria for early launch @@ -276,8 +276,8 @@ log_game("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [time] seconds before launch.") obj_flags |= EMAGGED - SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20)//YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL - var/datum/species/S = new + SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20) //YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL +/* var/datum/species/S = new for(var/i in 1 to 10) // the shuttle system doesn't know who these people are, but they // must be important, surely @@ -287,19 +287,19 @@ ID.assignment = J.title // authorized += ID - +*/ process(SSMACHINES_DT) /obj/machinery/computer/emergency_shuttle/Destroy() // Our fake IDs that the emag generated are just there for colour // They're not supposed to be accessible - - /* for(var/obj/item/card/id/ID in src) +/* + for(var/obj/item/card/id/ID in src) qdel(ID) if(authorized?.len) authorized.Cut() - authorized = null */ - + authorized = null +*/ . = ..() /obj/docking_port/mobile/emergency From 739a158d1beb2a0487ca0eba36c447facffe0d17 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 12:32:13 -0500 Subject: [PATCH 07/18] fixes the igniting issue! also makes it only repeat *occasionally* --- code/modules/shuttle/emergency.dm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 63d6ae008ad02..8f8172e067c67 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -30,6 +30,8 @@ var/hijack_completion_flight_time_set = 10 SECONDS //How long in deciseconds to set shuttle's timer after hijack is done. var/hijack_hacking = FALSE var/hijack_announce = TRUE + var/emaglast // measures the last world time the emag event triggered + var/emagcooldown = 20 // the actual time until emag again /obj/machinery/computer/emergency_shuttle/examine(mob/user) . = ..() @@ -175,11 +177,21 @@ if(ENGINES_STARTED || (!IS_DOCKED)) return . - if (obj_flags & EMAGGED) - var/OLDTIME = TIME_LEFT - var/CUTTIME = rand(2, 3) - SSshuttle.emergency.modTimer(1 / CUTTIME) - minor_announce("The launch timer not be found, using system clock (debug: curtime is [TIME_LEFT], cuttime is [CUTTIME], original was [OLDTIME])", "SYSTEM ERROR:") + if (obj_flags & EMAGGED && (!emaglast || emagcooldown + emaglast < world.time) && prob(50)) + var/OLDTIME = TIME_LEFT // for admin logs + var/CUTTIME = rand(1, 5) + CUTTIME = 2 / CUTTIME + + if (CUTTIME * TIME_LEFT <= 11) + SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting + else + SSshuttle.emergency.modTimer(CUTTIME) + if (CUTTIME > 1) // providing launch updates if it changes (doesnt roll a 2) + minor_announce("Launch timer corrupted, restarting timer at earlier point..", "SYSTEM ERROR:") + elif(CUTTIME < 1) + minor_announce("Launch timer corrupted, fast forwarding..", "SYSTEM ERROR:") + + emaglast = world.time From ab22a27c37ecc90169e6c99a04dcb8045023bd96 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 12:43:18 -0500 Subject: [PATCH 08/18] minor fix ups --- code/modules/shuttle/emergency.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 8f8172e067c67..525f3bb1e5187 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -177,7 +177,9 @@ if(ENGINES_STARTED || (!IS_DOCKED)) return . - if (obj_flags & EMAGGED && (!emaglast || emagcooldown + emaglast < world.time) && prob(50)) + + // monkestation addition + if(obj_flags & EMAGGED && (!emaglast || emagcooldown + emaglast < world.time) && prob(50)) var/OLDTIME = TIME_LEFT // for admin logs var/CUTTIME = rand(1, 5) CUTTIME = 2 / CUTTIME @@ -188,7 +190,7 @@ SSshuttle.emergency.modTimer(CUTTIME) if (CUTTIME > 1) // providing launch updates if it changes (doesnt roll a 2) minor_announce("Launch timer corrupted, restarting timer at earlier point..", "SYSTEM ERROR:") - elif(CUTTIME < 1) + else if (CUTTIME < 1) minor_announce("Launch timer corrupted, fast forwarding..", "SYSTEM ERROR:") emaglast = world.time From f91fef1572df9c92d6c7cf4ea6b0484634c46f01 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 13:28:24 -0500 Subject: [PATCH 09/18] syntaxical fixes --- code/modules/shuttle/emergency.dm | 39 ++++++++----------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 525f3bb1e5187..d6cf2a9fe987a 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -30,8 +30,11 @@ var/hijack_completion_flight_time_set = 10 SECONDS //How long in deciseconds to set shuttle's timer after hijack is done. var/hijack_hacking = FALSE var/hijack_announce = TRUE - var/emaglast // measures the last world time the emag event triggered - var/emagcooldown = 20 // the actual time until emag again + + // measures the last world time the emag event triggered + var/emaglast + // the actual time until emag again + var/emagcooldown = 20 /obj/machinery/computer/emergency_shuttle/examine(mob/user) . = ..() @@ -180,17 +183,15 @@ // monkestation addition if(obj_flags & EMAGGED && (!emaglast || emagcooldown + emaglast < world.time) && prob(50)) - var/OLDTIME = TIME_LEFT // for admin logs - var/CUTTIME = rand(1, 5) - CUTTIME = 2 / CUTTIME + var/cut_time = 2 / rand(1, 5) - if (CUTTIME * TIME_LEFT <= 11) + if (cut_time * TIME_LEFT <= 11) SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting else - SSshuttle.emergency.modTimer(CUTTIME) - if (CUTTIME > 1) // providing launch updates if it changes (doesnt roll a 2) + SSshuttle.emergency.modTimer(cut_time) + if (cut_time > 1) // providing launch updates if it changes (doesnt roll a 2) minor_announce("Launch timer corrupted, restarting timer at earlier point..", "SYSTEM ERROR:") - else if (CUTTIME < 1) + else if (cut_time < 1) minor_announce("Launch timer corrupted, fast forwarding..", "SYSTEM ERROR:") emaglast = world.time @@ -291,29 +292,9 @@ obj_flags |= EMAGGED SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20) //YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL -/* var/datum/species/S = new - for(var/i in 1 to 10) - // the shuttle system doesn't know who these people are, but they - // must be important, surely - var/obj/item/card/id/ID = new(src) - var/datum/job/J = pick(SSjob.occupations) - ID.registered_name = S.random_name(pick(MALE, FEMALE)) - ID.assignment = J.title - - // authorized += ID -*/ process(SSMACHINES_DT) /obj/machinery/computer/emergency_shuttle/Destroy() - // Our fake IDs that the emag generated are just there for colour - // They're not supposed to be accessible -/* - for(var/obj/item/card/id/ID in src) - qdel(ID) - if(authorized?.len) - authorized.Cut() - authorized = null -*/ . = ..() /obj/docking_port/mobile/emergency From 7381b6da1b163f041e4673026f2d8de92e429459 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 14:09:01 -0500 Subject: [PATCH 10/18] more moving around and renaming --- code/modules/shuttle/emergency.dm | 36 ++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index d6cf2a9fe987a..bedaa1cd06cb9 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -10,6 +10,8 @@ #define STAGE_3 3 #define STAGE_4 4 #define HIJACKED 5 +// the actual time until emag again +#define EMAGCOOLDOWN /obj/machinery/computer/emergency_shuttle name = "emergency shuttle console" @@ -32,9 +34,7 @@ var/hijack_announce = TRUE // measures the last world time the emag event triggered - var/emaglast - // the actual time until emag again - var/emagcooldown = 20 + var/emag_last /obj/machinery/computer/emergency_shuttle/examine(mob/user) . = ..() @@ -182,7 +182,7 @@ // monkestation addition - if(obj_flags & EMAGGED && (!emaglast || emagcooldown + emaglast < world.time) && prob(50)) + if(obj_flags & EMAGGED && (!emag_last || EMAGCOOLDOWN + emag_last < world.time) && prob(50)) var/cut_time = 2 / rand(1, 5) if (cut_time * TIME_LEFT <= 11) @@ -194,7 +194,10 @@ else if (cut_time < 1) minor_announce("Launch timer corrupted, fast forwarding..", "SYSTEM ERROR:") - emaglast = world.time + emag_last = world.time + + message_admins("[ADMIN_LOOKUPFLW(user.client)] has emagged the emergency shuttle, [SSshuttle.emergency.time_left] seconds before launch.") + log_game("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [SSshuttle.emergency.time_left] seconds before launch.") @@ -287,16 +290,32 @@ return var/time = TIME_LEFT - message_admins("[ADMIN_LOOKUPFLW(user.client)] has emagged the emergency shuttle, [time] seconds before launch.") - log_game("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [time] seconds before launch.") + obj_flags |= EMAGGED SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20) //YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL + var/datum/species/S = new + for(var/i in 1 to 10) + // the shuttle system doesn't know who these people are, but they + // must be important, surely + var/obj/item/card/id/ID = new(src) + var/datum/job/J = pick(SSjob.occupations) + ID.registered_name = S.random_name(pick(MALE, FEMALE)) + ID.assignment = J.title + + // authorized += ID + process(SSMACHINES_DT) /obj/machinery/computer/emergency_shuttle/Destroy() - . = ..() + // Our fake IDs that the emag generated are just there for colour + // They're not supposed to be accessible + for(var/obj/item/card/id/ID in src) + qdel(ID) + if(authorized?.len) + authorized.Cut() + authorized = null /obj/docking_port/mobile/emergency name = "emergency shuttle" id = "emergency" @@ -765,3 +784,4 @@ #undef STAGE_3 #undef STAGE_4 #undef HIJACKED +#undef EMAGCOOLDOWN From 3eea0d761df6fffe37299a6f96e7dd8e70d3e08f Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 19:14:42 -0500 Subject: [PATCH 11/18] fixes up syntax and actually defines the define --- code/modules/shuttle/emergency.dm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index bedaa1cd06cb9..29529af5321f9 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -11,7 +11,7 @@ #define STAGE_4 4 #define HIJACKED 5 // the actual time until emag again -#define EMAGCOOLDOWN +#define EMAGCOOLDOWN 20 /obj/machinery/computer/emergency_shuttle name = "emergency shuttle console" @@ -166,6 +166,21 @@ /obj/machinery/computer/emergency_shuttle/proc/clear_recent_action(mob/user) acted_recently -= user +/obj/machinery/computer/emergency_shuttle/proc/pick_emag_amount() + switch(rand(1, 5)) + if(1) + return 2 // possibility to add time to timer + if(2) + return 1 // does nothing + if(3) + return 0.5 + if(4) + return 0.4 + if(5) + return 0.25 + + + /obj/machinery/computer/emergency_shuttle/process() // Launch check is in process in case auth_need changes for some reason // probably external. @@ -183,7 +198,7 @@ // monkestation addition if(obj_flags & EMAGGED && (!emag_last || EMAGCOOLDOWN + emag_last < world.time) && prob(50)) - var/cut_time = 2 / rand(1, 5) + var/cut_time = pick_emag_amount() if (cut_time * TIME_LEFT <= 11) SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting @@ -196,8 +211,8 @@ emag_last = world.time - message_admins("[ADMIN_LOOKUPFLW(user.client)] has emagged the emergency shuttle, [SSshuttle.emergency.time_left] seconds before launch.") - log_game("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [SSshuttle.emergency.time_left] seconds before launch.") + message_admins("Emagged emergency shuttle will launch in [TIME_LEFT] seconds.") + log_game("Emagged emergency shuttle will launch in [TIME_LEFT] seconds.") @@ -289,7 +304,6 @@ to_chat(user, "The shuttle is already launching!") return - var/time = TIME_LEFT obj_flags |= EMAGGED From 3b5496445db28a67454997d8c76c320c5bdbffec Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Tue, 12 Jul 2022 19:43:15 -0500 Subject: [PATCH 12/18] fixes the super() call in Destroy() --- code/modules/shuttle/emergency.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 29529af5321f9..649e40e3013f8 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -317,7 +317,7 @@ ID.registered_name = S.random_name(pick(MALE, FEMALE)) ID.assignment = J.title - // authorized += ID + authorized += ID process(SSMACHINES_DT) @@ -330,6 +330,8 @@ if(authorized?.len) authorized.Cut() authorized = null + . = ..() + /obj/docking_port/mobile/emergency name = "emergency shuttle" id = "emergency" From 7a8e5cc3d29bfc3bc1b9c38a34d9d1d6e06cee0a Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Thu, 14 Jul 2022 16:43:15 -0500 Subject: [PATCH 13/18] fixes the timer mods to use defines instead of hardcoded vals --- code/modules/shuttle/emergency.dm | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 649e40e3013f8..4861d1f663a79 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -11,7 +11,13 @@ #define STAGE_4 4 #define HIJACKED 5 // the actual time until emag again -#define EMAGCOOLDOWN 20 +#define EMAG_COOLDOWN 20 + +// various possibilities for how much it change +#define EMAG_DOUBLE 2 +#define EMAG_STAY 1 +#define EMAG_SLIGHT 0.6 +#define EMAG_HEAVY 0.2 /obj/machinery/computer/emergency_shuttle name = "emergency shuttle console" @@ -166,18 +172,6 @@ /obj/machinery/computer/emergency_shuttle/proc/clear_recent_action(mob/user) acted_recently -= user -/obj/machinery/computer/emergency_shuttle/proc/pick_emag_amount() - switch(rand(1, 5)) - if(1) - return 2 // possibility to add time to timer - if(2) - return 1 // does nothing - if(3) - return 0.5 - if(4) - return 0.4 - if(5) - return 0.25 @@ -197,8 +191,8 @@ // monkestation addition - if(obj_flags & EMAGGED && (!emag_last || EMAGCOOLDOWN + emag_last < world.time) && prob(50)) - var/cut_time = pick_emag_amount() + if(obj_flags & EMAGGED && (!emag_last || EMAG_COOLDOWN + emag_last < world.time) && prob(50)) + var/cut_time = pick(EMAG_DOUBLE, EMAG_STAY, EMAG_SLIGHT, EMAG_HEAVY) if (cut_time * TIME_LEFT <= 11) SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting @@ -800,4 +794,4 @@ #undef STAGE_3 #undef STAGE_4 #undef HIJACKED -#undef EMAGCOOLDOWN +#undef EMAG_COOLDOWN From 8dafaa30ec27b4b84a70d098c2cd5549574dcdd4 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Thu, 14 Jul 2022 17:24:57 -0500 Subject: [PATCH 14/18] undefs the defs --- code/modules/shuttle/emergency.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 4861d1f663a79..88604f74c9f0c 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -795,3 +795,7 @@ #undef STAGE_4 #undef HIJACKED #undef EMAG_COOLDOWN +#undef EMAG_DOUBLE +#undef EMAG_STAY +#undef EMAG_SLIGHT +#undef EMAG_HEAVY From 93bd5a50fb835bce1e5116b43bf3f89f47bddbc2 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Fri, 15 Jul 2022 22:12:20 -0500 Subject: [PATCH 15/18] who woulda thought adding authorized users would make it authorize the thing (adds EMAG_OHNO and adjusts cooldown) --- code/modules/shuttle/emergency.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 88604f74c9f0c..2f7dc5a758e6a 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -11,13 +11,14 @@ #define STAGE_4 4 #define HIJACKED 5 // the actual time until emag again -#define EMAG_COOLDOWN 20 +#define EMAG_COOLDOWN 15 // various possibilities for how much it change #define EMAG_DOUBLE 2 #define EMAG_STAY 1 #define EMAG_SLIGHT 0.6 #define EMAG_HEAVY 0.2 +#define EMAG_OHNO 0.1 /obj/machinery/computer/emergency_shuttle name = "emergency shuttle console" @@ -191,8 +192,8 @@ // monkestation addition - if(obj_flags & EMAGGED && (!emag_last || EMAG_COOLDOWN + emag_last < world.time) && prob(50)) - var/cut_time = pick(EMAG_DOUBLE, EMAG_STAY, EMAG_SLIGHT, EMAG_HEAVY) + if(obj_flags & EMAGGED && (!emag_last || EMAG_COOLDOWN + emag_last < world.time) && prob(40)) + var/cut_time = pick(EMAG_DOUBLE, EMAG_STAY, EMAG_SLIGHT, EMAG_HEAVY. EMAG_OHNO) if (cut_time * TIME_LEFT <= 11) SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting @@ -311,8 +312,6 @@ ID.registered_name = S.random_name(pick(MALE, FEMALE)) ID.assignment = J.title - authorized += ID - process(SSMACHINES_DT) /obj/machinery/computer/emergency_shuttle/Destroy() @@ -799,3 +798,4 @@ #undef EMAG_STAY #undef EMAG_SLIGHT #undef EMAG_HEAVY +#undef EMAG_OHNO From 93ea88a19e61c5f00128825b14f1adf7a4adc593 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Fri, 15 Jul 2022 22:17:24 -0500 Subject: [PATCH 16/18] gotta love it when you put a comma by accident --- code/modules/shuttle/emergency.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 2f7dc5a758e6a..f843ddd7f2471 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -193,7 +193,7 @@ // monkestation addition if(obj_flags & EMAGGED && (!emag_last || EMAG_COOLDOWN + emag_last < world.time) && prob(40)) - var/cut_time = pick(EMAG_DOUBLE, EMAG_STAY, EMAG_SLIGHT, EMAG_HEAVY. EMAG_OHNO) + var/cut_time = pick(EMAG_DOUBLE, EMAG_STAY, EMAG_SLIGHT, EMAG_HEAVY, EMAG_OHNO) if (cut_time * TIME_LEFT <= 11) SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting From a9dfa7b0d058567445cfa1801636b457477b06b5 Mon Sep 17 00:00:00 2001 From: texan-down-under <73374039+etherware-novice@users.noreply.github.com> Date: Sat, 16 Jul 2022 15:13:04 -0500 Subject: [PATCH 17/18] Update code/modules/shuttle/emergency.dm Co-authored-by: nednaZ <62958508+nednaZ@users.noreply.github.com> --- code/modules/shuttle/emergency.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index f843ddd7f2471..aa942a4bd32a9 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -11,7 +11,7 @@ #define STAGE_4 4 #define HIJACKED 5 // the actual time until emag again -#define EMAG_COOLDOWN 15 +#define EMAG_COOLDOWN 1.5 SECONDS // various possibilities for how much it change #define EMAG_DOUBLE 2 From 50fcfdbcdec414f7fdf49a28bd3cb66d1f189d36 Mon Sep 17 00:00:00 2001 From: Candycaneannihalator Date: Sat, 16 Jul 2022 18:29:58 -0500 Subject: [PATCH 18/18] adjusts time fields and adds early launch msg --- code/modules/shuttle/emergency.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index aa942a4bd32a9..361b7a000209c 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -17,8 +17,8 @@ #define EMAG_DOUBLE 2 #define EMAG_STAY 1 #define EMAG_SLIGHT 0.6 -#define EMAG_HEAVY 0.2 -#define EMAG_OHNO 0.1 +#define EMAG_HEAVY 0.35 +#define EMAG_OHNO 0.25 /obj/machinery/computer/emergency_shuttle name = "emergency shuttle console" @@ -196,6 +196,7 @@ var/cut_time = pick(EMAG_DOUBLE, EMAG_STAY, EMAG_SLIGHT, EMAG_HEAVY, EMAG_OHNO) if (cut_time * TIME_LEFT <= 11) + minor_announce("Launch timer too corrupted, starting shuttle early launch..", "SYSTEM ERROR:") SSshuttle.emergency.setTimer(ENGINES_START_TIME) // to make it align with igniting else SSshuttle.emergency.modTimer(cut_time)