From 5b6f95cb1ea692c54bf235b9080e7b042bc705b8 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:16:33 -0700
Subject: [PATCH 01/12] shuttle hijack
---
code/__HELPERS/text.dm | 17 ++-
code/datums/mind.dm | 8 ++
code/game/gamemodes/objective.dm | 6 +-
.../antagonists/_common/antag_datum.dm | 14 +-
.../antagonists/traitor/datum_traitor.dm | 2 +-
code/modules/shuttle/emergency.dm | 134 +++++++++++++-----
6 files changed, 143 insertions(+), 38 deletions(-)
diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm
index 60c43b0869..2e350808ea 100644
--- a/code/__HELPERS/text.dm
+++ b/code/__HELPERS/text.dm
@@ -793,4 +793,19 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
. = message
#define is_alpha(X) ((text2ascii(X) <= 122) && (text2ascii(X) >= 97))
-#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1))
\ No newline at end of file
+#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1))
+
+/// Slightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML!
+/proc/scramble_message_replace_chars(original, replaceprob = 25, list/replacementchars = list("$", "@", "!", "#", "%", "^", "&", "*"), replace_letters_only = FALSE, replace_whitespace = FALSE)
+ var/list/out = list()
+ var/static/list/whitespace = list(" ", "\n", "\t")
+ for(var/i in 1 to length(original))
+ var/char = original[i]
+ if(!replace_whitespace && (char in whitespace))
+ out += char
+ continue
+ if(replace_letters_only && (!ISINRANGE(char, 65, 90) && !ISINRANGE(char, 97, 122)))
+ out += char
+ continue
+ out += prob(replaceprob)? pick(replacementchars) : char
+ return out.Join("")
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 464ea37d02..fd7ddd12c5 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -62,6 +62,8 @@
var/force_escaped = FALSE // Set by Into The Sunset command of the shuttle manipulator
+ var/hijack_speed = 0 //whether or not we can hackerman the shuttle and hijack it. 0 means you can't, 1 is normal speed hack, 2 is double, 0.5 is half, etc.
+
var/list/learned_recipes //List of learned recipe TYPES.
/datum/mind/New(var/key)
@@ -714,6 +716,12 @@
if(G)
G.reenter_corpse()
+/// Sets our can_hijack to the fastest speed our antag datums allow.
+/datum/mind/proc/update_can_hijack()
+ can_hijack = 0
+ for(var/datum/antagonist/A in antag_datums)
+ can_hijack = max(can_hijack, A.hijack_speed())
+ return can_hijack
/datum/mind/proc/has_objective(objective_type)
for(var/datum/antagonist/A in antag_datums)
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index f99fe5c3e4..a0cfab2bd9 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -293,9 +293,11 @@ GLOBAL_LIST_EMPTY(objectives)
/datum/objective/hijack
name = "hijack"
- explanation_text = "Hijack the shuttle to ensure no loyalist Nanotrasen crew escape alive and out of custody."
- team_explanation_text = "Hijack the shuttle to ensure no loyalist Nanotrasen crew escape alive and out of custody. Leave no team member behind."
+ explanation_text = "Hijack the emergency shuttle by hacking its navigational protocols through the control console."
+ team_explanation_text = "Hijack the emergency shuttle by hacking its navigational protocols through the control console. Leave no team member behind."
martyr_compatible = 0 //Technically you won't get both anyway.
+ /// Overrides the hijack speed of any antagonist datum it is on ONLY, no other datums are impacted.
+ var/hijack_speed_override = 1
/datum/objective/hijack/check_completion() // Requires all owners to escape.
if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME)
diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm
index 1894d8c7ae..724b93a205 100644
--- a/code/modules/antagonists/_common/antag_datum.dm
+++ b/code/modules/antagonists/_common/antag_datum.dm
@@ -11,10 +11,11 @@ GLOBAL_LIST_EMPTY(antagonists)
var/delete_on_mind_deletion = TRUE
var/job_rank
var/replace_banned = TRUE //Should replace jobbaned player with ghosts if granted.
- var/list/objectives = list()
+ var/list/_objectives = list()
var/antag_memory = ""//These will be removed with antag datum
var/antag_moodlet //typepath of moodlet that the mob will gain with their status
- var/can_hijack = HIJACK_NEUTRAL //If these antags are alone on shuttle hijack happens.
+ /// If above 0, this is the multiplier for the speed at which we hijack the shuttle. Do not directly read, use hijack_speed().
+ var/hijack_speed = 0
//Antag panel properties
var/show_in_antagpanel = TRUE //This will hide adding this antag type in antag panel, use only for internal subtypes that shouldn't be added directly but still show if possessed by mind
@@ -72,6 +73,7 @@ GLOBAL_LIST_EMPTY(antagonists)
give_antag_moodies()
if(is_banned(owner.current) && replace_banned)
replace_banned_player()
+ owner.update_can_hijack()
/datum/antagonist/proc/is_banned(mob/M)
if(!M)
@@ -99,6 +101,7 @@ GLOBAL_LIST_EMPTY(antagonists)
var/datum/team/team = get_team()
if(team)
team.remove_member(owner)
+ owner.update_can_hijack()
qdel(src)
/datum/antagonist/proc/greet()
@@ -215,6 +218,13 @@ GLOBAL_LIST_EMPTY(antagonists)
return
antag_memory = new_memo
+/// Gets how fast we can hijack the shuttle, return 0 for can not hijack. Defaults to hijack_speed var, override for custom stuff like buffing hijack speed for hijack objectives or something.
+/datum/antagonist/proc/hijack_speed()
+ var/datum/objective/hijack/H = locate() in objectives
+ if(!isnull(H?.hijack_speed_override))
+ return H.hijack_speed_override
+ return hijack_speed
+
//This one is created by admin tools for custom objectives
/datum/antagonist/custom
antagpanel_category = "Custom"
diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm
index 595ce5bb90..17c88a33b9 100644
--- a/code/modules/antagonists/traitor/datum_traitor.dm
+++ b/code/modules/antagonists/traitor/datum_traitor.dm
@@ -13,7 +13,7 @@
var/should_give_codewords = TRUE
var/should_equip = TRUE
var/traitor_kind = TRAITOR_HUMAN //Set on initial assignment
- can_hijack = HIJACK_HIJACKER
+ hijack_speed = 0.5 //10 seconds per hijack stage by default
/datum/antagonist/traitor/on_gain()
if(owner.current && isAI(owner.current))
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index c863e0e44a..1e9439a547 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -3,13 +3,38 @@
#define ENGINES_STARTED (SSshuttle.emergency.mode == SHUTTLE_IGNITING)
#define IS_DOCKED (SSshuttle.emergency.mode == SHUTTLE_DOCKED || (ENGINES_STARTED))
+#define INTACT 0
+#define STAGE_1 1
+#define STAGE_2 2
+#define STAGE_3 3
+#define STAGE_4 4
+#define HIJACKED 5
+
/obj/machinery/computer/emergency_shuttle
name = "emergency shuttle console"
desc = "For shuttle control."
icon_screen = "shuttle"
icon_keyboard = "tech_key"
+ obj_flags = INDESTRUCTIBLE
var/auth_need = 3
var/list/authorized = list()
+ var/hijack_last_stage_increase = 0
+ var/hijack_stage_time = 50
+ var/hijack_stage_cooldown = 50
+ var/hijack_flight_time_incrase = 300
+ var/hijack_completion_flight_time_set = 100 //How long in deciseconds to set shuttle's timer after hijack is done.
+ var/hijack_hacking = FALSE
+ var/hijack_announce = TRUE
+
+/obj/machinery/computer/emergency_shuttle/examine(mob/user)
+ . = ..()
+ if(hijack_announce)
+ . += "Security systems present on console. Any unauthorized tampering will result in an emergency announcement."
+ if(user?.mind.hijack_speed)
+ . += "Alt click on this to attempt to hijack the shuttle. This will take multiple tries (current: stage [SSshuttle.emergency.hijack_status]/[HIJACKED])."
+ . += "It will take you [(hijack_stage_time * user.mind.hijack_speed) / 10] seconds to reprogram a stage of the shuttle's navigational firmware, and the console will undergo automated timed lockout for [hijack_stage_cooldown/10] seconds after each stage."
+ if(hijack_announce)
+ . += "It is probably best to fortify your position as to be uninterrupted during the attempt, given the automatic announcements.."
/obj/machinery/computer/emergency_shuttle/attackby(obj/item/I, mob/user,params)
if(istype(I, /obj/item/card/id))
@@ -133,6 +158,73 @@
[TIME_LEFT] seconds", system_error, alert=TRUE)
. = TRUE
+/obj/machinery/computer/emergency_shuttle/proc/increase_hijack_stage()
+ var/obj/docking_port/mobile/emergency/shuttle = SSshuttle.emergency
+ shuttle.hijack_status++
+ announce_hijack_stage()
+ hijack_last_stage_increase = world.time
+ say("Navigational protocol error! Rebooting systems.")
+ if(shuttle.mode == SHUTTLE_ESCAPE)
+ if(shuttle.hijack_status == HIJACKED)
+ shuttle.setTimer(hijack_completion_flight_time_set)
+ else
+ shuttle.setTimer(shuttle.timeLeft(1) + hijack_flight_time_increase) //give the guy more time to hijack if it's already in flight.
+ return shuttle.hijack_status
+
+/obj/machinery/computer/emergency_shuttle/AltClick(user)
+ attempt_hijack_stage(user)
+
+/obj/machinery/computer/emergency_shuttle/proc/attempt_hijack_stage(mob/living/user)
+ if(!user.CanReach(src))
+ return
+ if(!user?.mind?,hijack_speed)
+ to_chat(user, "You manage to open a user-mode shell on [src], and hundreds of lines of debugging output fly through your vision. It is probably best to leave this alone.You [SSshuttle.emergency.hijack_status == INTACT? "begin" : "continue"] to override [src]'s navigational protocols.")
+ say("Software override initiated.")
+ . = FALSE
+ if(do_after(user, hijack_stage_time * user.mind.hijack_speed, target = src))
+ increase_hijack_stage()
+ . = TRUE
+ to_chat(user, "You reprogram some of [src]'s programming, putting it on timeout for [hijack_stage_cooldown/10] seconds.")
+ hijack_hacking = FALSE
+
+/obj/machinery/computer/emergency_shuttle/announce_hijack_stage()
+ var/msg
+ var/replaceprob
+ switch(SSshuttle.emergency.hijack_status)
+ if(INTACT)
+ return
+ if(STAGE_1)
+ var/datum/species/S = new
+ msg = "AUTHENTICATING - FAIL. AUTHENTICATING - FAIL. AUTHENTICATING - FAI###### Welcome, technician [S.random_name(pick(MALE, FEMALE))]."
+ replaceprob = 10
+ qdel(S)
+ if(STAGE_2)
+ msg = "Warning: Navigational route fails \"IS_AUTHORIZED\". Please try againNN[scramble_message_replace_chars("againagainagainagainagain", 70)]."
+ replaceprob = 20
+ if(STAGE_3)
+ var/hex = ""
+ for(var/i in 1 to 8)
+ hex += num2hex(rand(1,16))
+ msg = "CRC mismatch at 0x[hex] in calculated route buffer. Full reset initiated of FTL_NAVIGATION_SERVICES. Memory decrypted for automatic repair."
+ replaceprob = 30
+ if(STAGE_4)
+ msg = "~ACS_directive module_load(cyberdyne.exploit.nanotrasen.shuttlenav)... NT key mismatch. Confirm load? Y...###Reboot complete. $SET transponder_state = 0; System link initiated with connected engines..."
+ replaceprob = 35
+ if(HIJACKED)
+ msg = "SYSTEM OVERRIDE - Resetting course to \[[scramble_message_replace_chars("###########", 100))]\] \
+ ([scramble_message_replace_chars("#######", 100))]/[scramble_message_replace_chars("#######", 100))]/[scramble_message_replace_chars("#######", 100))]) \
+ {AUTH - ROOT (uid: 0)}.[SSshuttle.emergency.mode == SHUTTLE_ESCAPE? "Diverting from existing route - Bluespace exit in [hijack_completion_flight_time_set/10] seconds." : ""]"
+ replaceprob = 25
+ minor_announce(scramble_message_replace_chars(msg, replaceprob = replaceprob), "Emergency Shuttle", TRUE)
+
/obj/machinery/computer/emergency_shuttle/emag_act(mob/user)
. = ..()
@@ -185,6 +277,7 @@
dir = EAST
port_direction = WEST
var/sound_played = 0 //If the launch sound has been sent to all players on the shuttle itself
+ var/hijack_status = INTACT
/obj/docking_port/mobile/emergency/canDock(obj/docking_port/stationary/S)
return SHUTTLE_CAN_DOCK //If the emergency shuttle can't move, the whole game breaks, so it will force itself to land even if it has to crush a few departments in the process
@@ -250,37 +343,7 @@
priority_announce("The emergency shuttle has been recalled.[SSshuttle.emergencyLastCallLoc ? " Recall signal traced. Results can be viewed on any communications console." : "" ]", null, "shuttlerecalled", "Priority")
/obj/docking_port/mobile/emergency/proc/is_hijacked()
- var/has_people = FALSE
- var/hijacker_present = FALSE
- for(var/mob/living/player in GLOB.player_list)
- if(player.mind)
- if(player.stat != DEAD)
- if(issilicon(player)) //Borgs are technically dead anyways
- continue
- if(isanimal(player)) //animals don't count
- continue
- if(isbrain(player)) //also technically dead
- continue
- if(shuttle_areas[get_area(player)])
- has_people = TRUE
- var/location = get_turf(player.mind.current)
- //Non-antag present. Can't hijack.
- if(!(player.mind.has_antag_datum(/datum/antagonist)) && !istype(location, /turf/open/floor/plasteel/shuttle/red) && !istype(location, /turf/open/floor/mineral/plastitanium/red/brig))
- return FALSE
- //Antag present, doesn't stop but let's see if we actually want to hijack
- var/prevent = FALSE
- for(var/datum/antagonist/A in player.mind.antag_datums)
- if(A.can_hijack == HIJACK_HIJACKER)
- hijacker_present = TRUE
- prevent = FALSE
- break //If we have both prevent and hijacker antags assume we want to hijack.
- else if(A.can_hijack == HIJACK_PREVENT)
- prevent = TRUE
- if(prevent)
- return FALSE
-
-
- return has_people && hijacker_present
+ return hijack_status == HIJACKED
/obj/docking_port/mobile/emergency/proc/ShuttleDBStuff()
set waitfor = FALSE
@@ -422,7 +485,7 @@
mode = SHUTTLE_ESCAPE
launch_status = ENDGAME_LAUNCHED
setTimer(SSshuttle.emergencyEscapeTime)
- priority_announce("The Emergency Shuttle preparing for direct jump. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, "Priority")
+ priority_announce("The Emergency Shuttle is preparing for direct jump. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, "Priority")
/obj/docking_port/mobile/pod
@@ -567,3 +630,10 @@
#undef ENGINES_START_TIME
#undef ENGINES_STARTED
#undef IS_DOCKED
+
+#undef INTACT
+#undef STAGE_1
+#undef STAGE_2
+#undef STAGE_3
+#undef STAGE_4
+#undef HIJACKED
From 9ef3879e53e7211ddd86047c08662c820a418d12 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:17:59 -0700
Subject: [PATCH 02/12] fix
---
code/modules/shuttle/emergency.dm | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 1e9439a547..a24cb3be7a 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -30,7 +30,7 @@
. = ..()
if(hijack_announce)
. += "Security systems present on console. Any unauthorized tampering will result in an emergency announcement."
- if(user?.mind.hijack_speed)
+ if(user?.mind?.hijack_speed)
. += "Alt click on this to attempt to hijack the shuttle. This will take multiple tries (current: stage [SSshuttle.emergency.hijack_status]/[HIJACKED])."
. += "It will take you [(hijack_stage_time * user.mind.hijack_speed) / 10] seconds to reprogram a stage of the shuttle's navigational firmware, and the console will undergo automated timed lockout for [hijack_stage_cooldown/10] seconds after each stage."
if(hijack_announce)
@@ -161,7 +161,8 @@
/obj/machinery/computer/emergency_shuttle/proc/increase_hijack_stage()
var/obj/docking_port/mobile/emergency/shuttle = SSshuttle.emergency
shuttle.hijack_status++
- announce_hijack_stage()
+ if(hijack_announce)
+ announce_hijack_stage()
hijack_last_stage_increase = world.time
say("Navigational protocol error! Rebooting systems.")
if(shuttle.mode == SHUTTLE_ESCAPE)
@@ -177,10 +178,13 @@
/obj/machinery/computer/emergency_shuttle/proc/attempt_hijack_stage(mob/living/user)
if(!user.CanReach(src))
return
- if(!user?.mind?,hijack_speed)
+ if(!user?.mind?.hijack_speed)
to_chat(user, "You manage to open a user-mode shell on [src], and hundreds of lines of debugging output fly through your vision. It is probably best to leave this alone.= HIJACKED)
+ to_chat(user, "The emergency shuttle is already loaded with a corrupt navigational payload. What more do you want from it?")
return
if(hijack_last_stage_increase <= world.time + hijack_stage_cooldown)
say("Error - Catastrophic software error detected. Input is currently on timeout.")
From a8628cee333049ac726cc64929b2cf7670d94c8c Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:32:57 -0700
Subject: [PATCH 03/12] udpates
---
code/game/gamemodes/objective.dm | 4 ++--
code/modules/antagonists/traitor/datum_traitor.dm | 3 +++
code/modules/shuttle/emergency.dm | 4 ++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index a0cfab2bd9..397c58152f 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -293,8 +293,8 @@ GLOBAL_LIST_EMPTY(objectives)
/datum/objective/hijack
name = "hijack"
- explanation_text = "Hijack the emergency shuttle by hacking its navigational protocols through the control console."
- team_explanation_text = "Hijack the emergency shuttle by hacking its navigational protocols through the control console. Leave no team member behind."
+ explanation_text = "Hijack the emergency shuttle by hacking its navigational protocols through the control console (alt click emergency shuttle console)."
+ team_explanation_text = "Hijack the emergency shuttle by hacking its navigational protocols through the control console (alt click emergency shuttle console). Leave no team member behind."
martyr_compatible = 0 //Technically you won't get both anyway.
/// Overrides the hijack speed of any antagonist datum it is on ONLY, no other datums are impacted.
var/hijack_speed_override = 1
diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm
index 17c88a33b9..f9b02ac09e 100644
--- a/code/modules/antagonists/traitor/datum_traitor.dm
+++ b/code/modules/antagonists/traitor/datum_traitor.dm
@@ -60,11 +60,14 @@
message = GLOB.syndicate_code_response_regex.Replace(message, "$1")
hearing_args[HEARING_RAW_MESSAGE] = message
+// needs to be refactored to base /datum/antagonist sometime..
/datum/antagonist/traitor/proc/add_objective(datum/objective/O)
objectives += O
+ owner?.update_hijack_speed()
/datum/antagonist/traitor/proc/remove_objective(datum/objective/O)
objectives -= O
+ owner?.update_hijack_speed()
/datum/antagonist/traitor/proc/forge_traitor_objectives()
switch(traitor_kind)
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index a24cb3be7a..8bd3912435 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -223,8 +223,8 @@
msg = "~ACS_directive module_load(cyberdyne.exploit.nanotrasen.shuttlenav)... NT key mismatch. Confirm load? Y...###Reboot complete. $SET transponder_state = 0; System link initiated with connected engines..."
replaceprob = 35
if(HIJACKED)
- msg = "SYSTEM OVERRIDE - Resetting course to \[[scramble_message_replace_chars("###########", 100))]\] \
- ([scramble_message_replace_chars("#######", 100))]/[scramble_message_replace_chars("#######", 100))]/[scramble_message_replace_chars("#######", 100))]) \
+ msg = "SYSTEM OVERRIDE - Resetting course to \[[scramble_message_replace_chars("###########", 100)]\] \
+ ([scramble_message_replace_chars("#######", 100)]/[scramble_message_replace_chars("#######", 100)]/[scramble_message_replace_chars("#######", 100)]) \
{AUTH - ROOT (uid: 0)}.[SSshuttle.emergency.mode == SHUTTLE_ESCAPE? "Diverting from existing route - Bluespace exit in [hijack_completion_flight_time_set/10] seconds." : ""]"
replaceprob = 25
minor_announce(scramble_message_replace_chars(msg, replaceprob = replaceprob), "Emergency Shuttle", TRUE)
From ff98fe7bf50a8bc22e8a133ad5596050dc5e1f02 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:35:21 -0700
Subject: [PATCH 04/12] update
---
code/datums/mind.dm | 2 +-
code/modules/antagonists/_common/antag_datum.dm | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index fd7ddd12c5..d7c478c586 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -717,7 +717,7 @@
G.reenter_corpse()
/// Sets our can_hijack to the fastest speed our antag datums allow.
-/datum/mind/proc/update_can_hijack()
+/datum/mind/proc/update_hijack_speed()
can_hijack = 0
for(var/datum/antagonist/A in antag_datums)
can_hijack = max(can_hijack, A.hijack_speed())
diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm
index 724b93a205..9f18ca9bea 100644
--- a/code/modules/antagonists/_common/antag_datum.dm
+++ b/code/modules/antagonists/_common/antag_datum.dm
@@ -11,7 +11,7 @@ GLOBAL_LIST_EMPTY(antagonists)
var/delete_on_mind_deletion = TRUE
var/job_rank
var/replace_banned = TRUE //Should replace jobbaned player with ghosts if granted.
- var/list/_objectives = list()
+ var/list/objectives = list()
var/antag_memory = ""//These will be removed with antag datum
var/antag_moodlet //typepath of moodlet that the mob will gain with their status
/// If above 0, this is the multiplier for the speed at which we hijack the shuttle. Do not directly read, use hijack_speed().
@@ -73,7 +73,7 @@ GLOBAL_LIST_EMPTY(antagonists)
give_antag_moodies()
if(is_banned(owner.current) && replace_banned)
replace_banned_player()
- owner.update_can_hijack()
+ owner.update_hijack_speed()
/datum/antagonist/proc/is_banned(mob/M)
if(!M)
@@ -101,7 +101,7 @@ GLOBAL_LIST_EMPTY(antagonists)
var/datum/team/team = get_team()
if(team)
team.remove_member(owner)
- owner.update_can_hijack()
+ owner.update_hijack_speed()
qdel(src)
/datum/antagonist/proc/greet()
From ccb5d32ab22bf23bb6117aa193e4f4bf806d894d Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:38:09 -0700
Subject: [PATCH 05/12] varnames
---
code/datums/mind.dm | 6 +++---
code/modules/antagonists/brother/brother.dm | 1 -
code/modules/antagonists/ert/ert.dm | 1 -
code/modules/antagonists/highlander/highlander.dm | 2 +-
code/modules/antagonists/ninja/ninja.dm | 7 -------
code/modules/antagonists/nukeop/nukeop.dm | 1 -
code/modules/antagonists/wizard/wizard.dm | 1 -
code/modules/shuttle/emergency.dm | 2 +-
8 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index d7c478c586..9ba56b2ffe 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -718,10 +718,10 @@
/// Sets our can_hijack to the fastest speed our antag datums allow.
/datum/mind/proc/update_hijack_speed()
- can_hijack = 0
+ hijack_speed = 0
for(var/datum/antagonist/A in antag_datums)
- can_hijack = max(can_hijack, A.hijack_speed())
- return can_hijack
+ hijack_speed = max(hijack_speed, A.hijack_speed())
+ return hijack_speed
/datum/mind/proc/has_objective(objective_type)
for(var/datum/antagonist/A in antag_datums)
diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm
index 7c589bb3ab..7097617afe 100644
--- a/code/modules/antagonists/brother/brother.dm
+++ b/code/modules/antagonists/brother/brother.dm
@@ -5,7 +5,6 @@
var/special_role = ROLE_BROTHER
var/datum/team/brother_team/team
antag_moodlet = /datum/mood_event/focused
- can_hijack = HIJACK_HIJACKER
/datum/antagonist/brother/create_team(datum/team/brother_team/new_team)
if(!new_team)
diff --git a/code/modules/antagonists/ert/ert.dm b/code/modules/antagonists/ert/ert.dm
index 0fb41cabc8..5c878bcc55 100644
--- a/code/modules/antagonists/ert/ert.dm
+++ b/code/modules/antagonists/ert/ert.dm
@@ -12,7 +12,6 @@
var/list/name_source
show_in_antagpanel = FALSE
antag_moodlet = /datum/mood_event/focused
- can_hijack = HIJACK_PREVENT
/datum/antagonist/ert/on_gain()
update_name()
diff --git a/code/modules/antagonists/highlander/highlander.dm b/code/modules/antagonists/highlander/highlander.dm
index 49635356ac..eccf7e3c60 100644
--- a/code/modules/antagonists/highlander/highlander.dm
+++ b/code/modules/antagonists/highlander/highlander.dm
@@ -3,7 +3,7 @@
var/obj/item/claymore/highlander/sword
show_in_antagpanel = FALSE
show_name_in_check_antagonists = TRUE
- can_hijack = HIJACK_HIJACKER
+ hijack_speed = 2 //if you kill everyone and actually haev a hand to hijack with, you win??
/datum/antagonist/highlander/apply_innate_effects(mob/living/mob_override)
var/mob/living/L = owner.current || mob_override
diff --git a/code/modules/antagonists/ninja/ninja.dm b/code/modules/antagonists/ninja/ninja.dm
index 52e13bdc69..9094c44ba4 100644
--- a/code/modules/antagonists/ninja/ninja.dm
+++ b/code/modules/antagonists/ninja/ninja.dm
@@ -8,11 +8,6 @@
var/give_objectives = TRUE
var/give_equipment = TRUE
-/datum/antagonist/ninja/New()
- if(helping_station)
- can_hijack = HIJACK_PREVENT
- . = ..()
-
/datum/antagonist/ninja/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_ninja_icons_added(M)
@@ -141,8 +136,6 @@
adj = "objectiveless"
else
return
- if(helping_station)
- can_hijack = HIJACK_PREVENT
new_owner.assigned_role = ROLE_NINJA
new_owner.special_role = ROLE_NINJA
new_owner.add_antag_datum(src)
diff --git a/code/modules/antagonists/nukeop/nukeop.dm b/code/modules/antagonists/nukeop/nukeop.dm
index d343951d53..4a63ba65bd 100644
--- a/code/modules/antagonists/nukeop/nukeop.dm
+++ b/code/modules/antagonists/nukeop/nukeop.dm
@@ -8,7 +8,6 @@
var/always_new_team = FALSE //If not assigned a team by default ops will try to join existing ones, set this to TRUE to always create new team.
var/send_to_spawnpoint = TRUE //Should the user be moved to default spawnpoint.
var/nukeop_outfit = /datum/outfit/syndicate
- can_hijack = HIJACK_HIJACKER //Alternative way to wipe out the station.
/datum/antagonist/nukeop/proc/update_synd_icons_added(mob/living/M)
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
diff --git a/code/modules/antagonists/wizard/wizard.dm b/code/modules/antagonists/wizard/wizard.dm
index a88eb1e42a..6dfcf88fcc 100644
--- a/code/modules/antagonists/wizard/wizard.dm
+++ b/code/modules/antagonists/wizard/wizard.dm
@@ -12,7 +12,6 @@
var/move_to_lair = TRUE
var/outfit_type = /datum/outfit/wizard
var/wiz_age = WIZARD_AGE_MIN /* Wizards by nature cannot be too young. */
- can_hijack = HIJACK_HIJACKER
/datum/antagonist/wizard/on_gain()
register()
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 8bd3912435..653aefacc2 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -199,7 +199,7 @@
to_chat(user, "You reprogram some of [src]'s programming, putting it on timeout for [hijack_stage_cooldown/10] seconds.")
hijack_hacking = FALSE
-/obj/machinery/computer/emergency_shuttle/announce_hijack_stage()
+/obj/machinery/computer/emergency_shuttle/proc/announce_hijack_stage()
var/msg
var/replaceprob
switch(SSshuttle.emergency.hijack_status)
From a28ebcc041e77f44efeaac5386c57dde78b426cf Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:38:53 -0700
Subject: [PATCH 06/12] variables
---
code/modules/antagonists/official/official.dm | 1 -
code/modules/antagonists/wishgranter/wishgranter.dm | 1 -
2 files changed, 2 deletions(-)
diff --git a/code/modules/antagonists/official/official.dm b/code/modules/antagonists/official/official.dm
index 9165a99d42..1d340253c4 100644
--- a/code/modules/antagonists/official/official.dm
+++ b/code/modules/antagonists/official/official.dm
@@ -4,7 +4,6 @@
show_in_antagpanel = FALSE
var/datum/objective/mission
var/datum/team/ert/ert_team
- can_hijack = HIJACK_PREVENT
/datum/antagonist/official/greet()
to_chat(owner, "You are a CentCom Official.")
diff --git a/code/modules/antagonists/wishgranter/wishgranter.dm b/code/modules/antagonists/wishgranter/wishgranter.dm
index 21cab26d1e..d22d1b5e39 100644
--- a/code/modules/antagonists/wishgranter/wishgranter.dm
+++ b/code/modules/antagonists/wishgranter/wishgranter.dm
@@ -2,7 +2,6 @@
name = "Wishgranter Avatar"
show_in_antagpanel = FALSE
show_name_in_check_antagonists = TRUE
- can_hijack = HIJACK_HIJACKER
/datum/antagonist/wishgranter/proc/forge_objectives()
var/datum/objective/hijack/hijack = new
From c4475b1dda8fae1062375b9ae1fe6048657a8511 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 22 Jan 2020 05:39:16 -0700
Subject: [PATCH 07/12] variables
---
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 653aefacc2..299b1982fe 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -21,7 +21,7 @@
var/hijack_last_stage_increase = 0
var/hijack_stage_time = 50
var/hijack_stage_cooldown = 50
- var/hijack_flight_time_incrase = 300
+ var/hijack_flight_time_increase = 300
var/hijack_completion_flight_time_set = 100 //How long in deciseconds to set shuttle's timer after hijack is done.
var/hijack_hacking = FALSE
var/hijack_announce = TRUE
From e7bf1738cd634fc292a2ddc62dc509a0cb608041 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 23 Jan 2020 18:00:33 -0700
Subject: [PATCH 08/12] ok putnom
---
code/datums/mind.dm | 10 +++-------
code/modules/antagonists/_common/antag_datum.dm | 2 --
code/modules/antagonists/traitor/datum_traitor.dm | 2 --
code/modules/shuttle/emergency.dm | 8 ++++----
4 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 9ba56b2ffe..ce97711589 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -61,9 +61,6 @@
var/late_joiner = FALSE
var/force_escaped = FALSE // Set by Into The Sunset command of the shuttle manipulator
-
- var/hijack_speed = 0 //whether or not we can hackerman the shuttle and hijack it. 0 means you can't, 1 is normal speed hack, 2 is double, 0.5 is half, etc.
-
var/list/learned_recipes //List of learned recipe TYPES.
/datum/mind/New(var/key)
@@ -717,11 +714,10 @@
G.reenter_corpse()
/// Sets our can_hijack to the fastest speed our antag datums allow.
-/datum/mind/proc/update_hijack_speed()
- hijack_speed = 0
+/datum/mind/proc/get_hijack_speed()
+ . = 0
for(var/datum/antagonist/A in antag_datums)
- hijack_speed = max(hijack_speed, A.hijack_speed())
- return hijack_speed
+ . = max(., A.hijack_speed())
/datum/mind/proc/has_objective(objective_type)
for(var/datum/antagonist/A in antag_datums)
diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm
index 9f18ca9bea..93516765cc 100644
--- a/code/modules/antagonists/_common/antag_datum.dm
+++ b/code/modules/antagonists/_common/antag_datum.dm
@@ -73,7 +73,6 @@ GLOBAL_LIST_EMPTY(antagonists)
give_antag_moodies()
if(is_banned(owner.current) && replace_banned)
replace_banned_player()
- owner.update_hijack_speed()
/datum/antagonist/proc/is_banned(mob/M)
if(!M)
@@ -101,7 +100,6 @@ GLOBAL_LIST_EMPTY(antagonists)
var/datum/team/team = get_team()
if(team)
team.remove_member(owner)
- owner.update_hijack_speed()
qdel(src)
/datum/antagonist/proc/greet()
diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm
index f9b02ac09e..e532d0b824 100644
--- a/code/modules/antagonists/traitor/datum_traitor.dm
+++ b/code/modules/antagonists/traitor/datum_traitor.dm
@@ -63,11 +63,9 @@
// needs to be refactored to base /datum/antagonist sometime..
/datum/antagonist/traitor/proc/add_objective(datum/objective/O)
objectives += O
- owner?.update_hijack_speed()
/datum/antagonist/traitor/proc/remove_objective(datum/objective/O)
objectives -= O
- owner?.update_hijack_speed()
/datum/antagonist/traitor/proc/forge_traitor_objectives()
switch(traitor_kind)
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 299b1982fe..8c5e36076e 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -30,9 +30,9 @@
. = ..()
if(hijack_announce)
. += "Security systems present on console. Any unauthorized tampering will result in an emergency announcement."
- if(user?.mind?.hijack_speed)
+ if(user?.mind?.get_hijack_speed())
. += "Alt click on this to attempt to hijack the shuttle. This will take multiple tries (current: stage [SSshuttle.emergency.hijack_status]/[HIJACKED])."
- . += "It will take you [(hijack_stage_time * user.mind.hijack_speed) / 10] seconds to reprogram a stage of the shuttle's navigational firmware, and the console will undergo automated timed lockout for [hijack_stage_cooldown/10] seconds after each stage."
+ . += "It will take you [(hijack_stage_time * user.mind.get_hijack_speed()) / 10] seconds to reprogram a stage of the shuttle's navigational firmware, and the console will undergo automated timed lockout for [hijack_stage_cooldown/10] seconds after each stage."
if(hijack_announce)
. += "It is probably best to fortify your position as to be uninterrupted during the attempt, given the automatic announcements.."
@@ -178,7 +178,7 @@
/obj/machinery/computer/emergency_shuttle/proc/attempt_hijack_stage(mob/living/user)
if(!user.CanReach(src))
return
- if(!user?.mind?.hijack_speed)
+ if(!user?.mind?.get_hijack_speed())
to_chat(user, "You manage to open a user-mode shell on [src], and hundreds of lines of debugging output fly through your vision. It is probably best to leave this alone.You [SSshuttle.emergency.hijack_status == INTACT? "begin" : "continue"] to override [src]'s navigational protocols.")
say("Software override initiated.")
. = FALSE
- if(do_after(user, hijack_stage_time * user.mind.hijack_speed, target = src))
+ if(do_after(user, hijack_stage_time * user.mind.get_hijack_speed(), target = src))
increase_hijack_stage()
. = TRUE
to_chat(user, "You reprogram some of [src]'s programming, putting it on timeout for [hijack_stage_cooldown/10] seconds.")
From 289bb590cffa939e0e0a5d6d4dda3d4ca77ebeba Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 23 Jan 2020 19:20:35 -0700
Subject: [PATCH 09/12] changes
---
code/modules/shuttle/emergency.dm | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 8c5e36076e..7462cc52bc 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -186,14 +186,14 @@
if(SSshuttle.emergency.hijack_status >= HIJACKED)
to_chat(user, "The emergency shuttle is already loaded with a corrupt navigational payload. What more do you want from it?")
return
- if(hijack_last_stage_increase <= world.time + hijack_stage_cooldown)
+ if(hijack_last_stage_increase >= world.time + hijack_stage_cooldown)
say("Error - Catastrophic software error detected. Input is currently on timeout.")
return
hijack_hacking = TRUE
to_chat(user, "You [SSshuttle.emergency.hijack_status == INTACT? "begin" : "continue"] to override [src]'s navigational protocols.")
say("Software override initiated.")
. = FALSE
- if(do_after(user, hijack_stage_time * user.mind.get_hijack_speed(), target = src))
+ if(do_after(user, hijack_stage_time * (1 / user.mind.get_hijack_speed()), target = src))
increase_hijack_stage()
. = TRUE
to_chat(user, "You reprogram some of [src]'s programming, putting it on timeout for [hijack_stage_cooldown/10] seconds.")
@@ -201,33 +201,27 @@
/obj/machinery/computer/emergency_shuttle/proc/announce_hijack_stage()
var/msg
- var/replaceprob
switch(SSshuttle.emergency.hijack_status)
if(INTACT)
return
if(STAGE_1)
var/datum/species/S = new
msg = "AUTHENTICATING - FAIL. AUTHENTICATING - FAIL. AUTHENTICATING - FAI###### Welcome, technician [S.random_name(pick(MALE, FEMALE))]."
- replaceprob = 10
qdel(S)
if(STAGE_2)
msg = "Warning: Navigational route fails \"IS_AUTHORIZED\". Please try againNN[scramble_message_replace_chars("againagainagainagainagain", 70)]."
- replaceprob = 20
if(STAGE_3)
var/hex = ""
for(var/i in 1 to 8)
hex += num2hex(rand(1,16))
msg = "CRC mismatch at 0x[hex] in calculated route buffer. Full reset initiated of FTL_NAVIGATION_SERVICES. Memory decrypted for automatic repair."
- replaceprob = 30
if(STAGE_4)
msg = "~ACS_directive module_load(cyberdyne.exploit.nanotrasen.shuttlenav)... NT key mismatch. Confirm load? Y...###Reboot complete. $SET transponder_state = 0; System link initiated with connected engines..."
- replaceprob = 35
if(HIJACKED)
msg = "SYSTEM OVERRIDE - Resetting course to \[[scramble_message_replace_chars("###########", 100)]\] \
([scramble_message_replace_chars("#######", 100)]/[scramble_message_replace_chars("#######", 100)]/[scramble_message_replace_chars("#######", 100)]) \
{AUTH - ROOT (uid: 0)}.[SSshuttle.emergency.mode == SHUTTLE_ESCAPE? "Diverting from existing route - Bluespace exit in [hijack_completion_flight_time_set/10] seconds." : ""]"
- replaceprob = 25
- minor_announce(scramble_message_replace_chars(msg, replaceprob = replaceprob), "Emergency Shuttle", TRUE)
+ minor_announce(scramble_message_replace_chars(msg, replaceprob = 10), "Emergency Shuttle", TRUE)
/obj/machinery/computer/emergency_shuttle/emag_act(mob/user)
. = ..()
From 40a2698b557868b66992c8e087a26b6ad9d241f0 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 23 Jan 2020 19:22:00 -0700
Subject: [PATCH 10/12] Update emergency.dm
---
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 7462cc52bc..666e3d92fe 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -3,7 +3,7 @@
#define ENGINES_STARTED (SSshuttle.emergency.mode == SHUTTLE_IGNITING)
#define IS_DOCKED (SSshuttle.emergency.mode == SHUTTLE_DOCKED || (ENGINES_STARTED))
-#define INTACT 0
+#define NOT_BEGUN 0
#define STAGE_1 1
#define STAGE_2 2
#define STAGE_3 3
@@ -190,7 +190,7 @@
say("Error - Catastrophic software error detected. Input is currently on timeout.")
return
hijack_hacking = TRUE
- to_chat(user, "You [SSshuttle.emergency.hijack_status == INTACT? "begin" : "continue"] to override [src]'s navigational protocols.")
+ to_chat(user, "You [SSshuttle.emergency.hijack_status == NOT_BEGUN? "begin" : "continue"] to override [src]'s navigational protocols.")
say("Software override initiated.")
. = FALSE
if(do_after(user, hijack_stage_time * (1 / user.mind.get_hijack_speed()), target = src))
@@ -202,7 +202,7 @@
/obj/machinery/computer/emergency_shuttle/proc/announce_hijack_stage()
var/msg
switch(SSshuttle.emergency.hijack_status)
- if(INTACT)
+ if(NOT_BEGUN)
return
if(STAGE_1)
var/datum/species/S = new
@@ -275,7 +275,7 @@
dir = EAST
port_direction = WEST
var/sound_played = 0 //If the launch sound has been sent to all players on the shuttle itself
- var/hijack_status = INTACT
+ var/hijack_status = NOT_BEGUN
/obj/docking_port/mobile/emergency/canDock(obj/docking_port/stationary/S)
return SHUTTLE_CAN_DOCK //If the emergency shuttle can't move, the whole game breaks, so it will force itself to land even if it has to crush a few departments in the process
@@ -629,7 +629,7 @@
#undef ENGINES_STARTED
#undef IS_DOCKED
-#undef INTACT
+#undef NOT_BEGUN
#undef STAGE_1
#undef STAGE_2
#undef STAGE_3
From fb0f12520c0dc724980e59eca793f2b4704f1a0f Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 2 Feb 2020 16:23:54 -0700
Subject: [PATCH 11/12] Update emergency.dm
---
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 666e3d92fe..24c233b97d 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -15,7 +15,7 @@
desc = "For shuttle control."
icon_screen = "shuttle"
icon_keyboard = "tech_key"
- obj_flags = INDESTRUCTIBLE
+ resistance_flags = INDESTRUCTIBLE
var/auth_need = 3
var/list/authorized = list()
var/hijack_last_stage_increase = 0
From d7403b3436b14299efe09b2e1133ecd327825bf5 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 19 Feb 2020 22:26:10 -0700
Subject: [PATCH 12/12] john doe
---
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 2a33576373..a3cbe2c82d 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -206,7 +206,7 @@
return
if(STAGE_1)
var/datum/species/S = new
- msg = "AUTHENTICATING - FAIL. AUTHENTICATING - FAIL. AUTHENTICATING - FAI###### Welcome, technician [S.random_name(pick(MALE, FEMALE))]."
+ msg = "AUTHENTICATING - FAIL. AUTHENTICATING - FAIL. AUTHENTICATING - FAI###### Welcome, technician JOHN DOE."
qdel(S)
if(STAGE_2)
msg = "Warning: Navigational route fails \"IS_AUTHORIZED\". Please try againNN[scramble_message_replace_chars("againagainagainagainagain", 70)]."