[MIRROR] Ports #10649 from Citadel: An attempt at making hijack not shit and more about point defence (#1311)

* Ports #10649 from Citadel: An attempt at making hijack not shit and more about point defence (#54146)

So essentially there was discussion already here (https://tgstation13.org/phpBB/viewtopic.php?f=33&t=27620) about how hijack is one of the few objectives on Manuel that you can murderbone with, which is mildly at odds with the intention of the server.

Personally, I think hijack is just straight up terrible regardless of what server you're on. The way it functions is dreadful. Nobody must be aboard the shuttle in any part of the shuttle at all. This means you have people hiding in the walls or hiding in some invisible corner of the shuttle, cucking you of the hijack. For the most part, the only way to actually hijack the shuttle is to render it completely inhospitable or destroying it utterly save for, maybe, one square. The one you are standing on.

It's absurd. So, I knew kev made a pretty honest attempt at reworking hijack. And it works pretty well. It doesn't necessarily solve the problem of hijackers being mandatory mass shooters, but it goes some ways to improving the objective in a more interesting fashion, and allows for the discussion around the objective to be a little more open ended for the sake of the higher roleplay servers without actually detracting from the lower roleplay servers at all. If anything, this should improve the experience of being that gamer to stage a hijacking all the more interesting and about robustness, and less of hide-and-go-seek.

* Ports #10649 from Citadel: An attempt at making hijack not shit and more about point defence

Co-authored-by: necromanceranne <40847847+necromanceranne@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-10-15 08:35:34 +02:00
committed by GitHub
parent febd2cc0b3
commit 491e445a35
18 changed files with 177 additions and 40 deletions
+103 -8
View File
@@ -4,15 +4,39 @@
#define IS_DOCKED (SSshuttle.emergency.mode == SHUTTLE_DOCKED || (ENGINES_STARTED))
#define SHUTTLE_CONSOLE_ACTION_DELAY (5 SECONDS)
#define NOT_BEGUN 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"
resistance_flags = INDESTRUCTIBLE
var/auth_need = 3
var/list/authorized = list()
var/list/acted_recently = list()
var/hijack_last_stage_increase = 0 SECONDS
var/hijack_stage_time = 5 SECONDS
var/hijack_stage_cooldown = 5 SECONDS
var/hijack_flight_time_increase = 30 SECONDS
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
/obj/machinery/computer/emergency_shuttle/examine(mob/user)
. = ..()
if(hijack_announce)
. += "<span class='danger'>Security systems present on console. Any unauthorized tampering will result in an emergency announcement.</span>"
if(user?.mind?.get_hijack_speed())
. += "<span class='danger'>Alt click on this to attempt to hijack the shuttle. This will take multiple tries (current: stage [SSshuttle.emergency.hijack_status]/[HIJACKED]).</span>"
. += "<span class='notice'>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.</span>"
if(hijack_announce)
. += "<span class='warning'>It is probably best to fortify your position as to be uninterrupted during the attempt, given the automatic announcements..</span>"
/obj/machinery/computer/emergency_shuttle/attackby(obj/item/I, mob/user,params)
if(istype(I, /obj/item/card/id))
@@ -152,6 +176,67 @@
[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++
if(hijack_announce)
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)
if(isliving(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?.get_hijack_speed())
to_chat(user, "<span class='warning'>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.</span.")
return
if(hijack_hacking == TRUE)
return
if(SSshuttle.emergency.hijack_status >= HIJACKED)
to_chat(user, "<span class='warning'>The emergency shuttle is already loaded with a corrupt navigational payload. What more do you want from it?</span>")
return
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, "<span class='boldwarning'>You [SSshuttle.emergency.hijack_status == NOT_BEGUN? "begin" : "continue"] to override [src]'s navigational protocols.</span>")
say("Software override initiated.")
. = FALSE
if(do_after(user, hijack_stage_time * (1 / user.mind.get_hijack_speed()), target = src))
increase_hijack_stage()
. = TRUE
to_chat(user, "<span class='notice'>You reprogram some of [src]'s programming, putting it on timeout for [hijack_stage_cooldown/10] seconds.</span>")
hijack_hacking = FALSE
/obj/machinery/computer/emergency_shuttle/proc/announce_hijack_stage()
var/msg
switch(SSshuttle.emergency.hijack_status)
if(NOT_BEGUN)
return
if(STAGE_1)
msg = "AUTHENTICATING - FAIL. AUTHENTICATING - FAIL. AUTHENTICATING - FAI###### Welcome, technician JOHN DOE."
if(STAGE_2)
msg = "Warning: Navigational route fails \"IS_AUTHORIZED\". Please try againNN[scramble_message_replace_chars("againagainagainagainagain", 70)]."
if(STAGE_3)
msg = "CRC mismatch at ~h~ in calculated route buffer. Full reset initiated of FTL_NAVIGATION_SERVICES. Memory decrypted for automatic repair."
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..."
if(HIJACKED)
msg = "<font color='red'><b>SYSTEM OVERRIDE</b></font> - 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)}.</font>[SSshuttle.emergency.mode == SHUTTLE_ESCAPE ? "Diverting from existing route - Bluespace exit in [hijack_completion_flight_time_set/10] seconds." : ""]"
minor_announce(scramble_message_replace_chars(msg, replaceprob = 10), "Emergency Shuttle", TRUE)
/obj/machinery/computer/emergency_shuttle/emag_act(mob/user)
// How did you even get on the shuttle before it go to the station?
if(!IS_DOCKED)
@@ -202,6 +287,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 = 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
@@ -265,9 +351,8 @@
SSticker.emergency_reason = null
/**
* Proc that handles checking if the emergency shuttle was successfully hijacked
* Proc that handles checking if the emergency shuttle was successfully hijacked via being the only people present on the shuttle for the elimination hijack or highlander objective
*
* Checks for all mobs on the shuttle, checks their status, and checks if they're
* borgs or simple animals. Depending on the args, certain mobs may be ignored,
@@ -276,7 +361,7 @@
* filter_by_human, default TRUE, tells the proc that only humans should block a hijack. Borgs and animals are ignored and will not block if this is TRUE.
* solo_hijack, default FALSE, tells the proc to fail with multiple hijackers, such as for Highlander mode.
*/
/obj/docking_port/mobile/emergency/proc/is_hijacked(filter_by_human = TRUE, solo_hijack = FALSE)
/obj/docking_port/mobile/emergency/proc/elimination_hijack(filter_by_human = TRUE, solo_hijack = FALSE)
var/has_people = FALSE
var/hijacker_count = 0
for(var/mob/living/player in GLOB.player_list)
@@ -297,11 +382,11 @@
//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)
if(A.can_elimination_hijack == ELIMINATION_ENABLED)
hijacker_count += 1
prevent = FALSE
break //If we have both prevent and hijacker antags assume we want to hijack.
else if(A.can_hijack == HIJACK_PREVENT)
else if(A.can_elimination_hijack == ELIMINATION_PREVENT)
prevent = TRUE
if(prevent)
return FALSE
@@ -309,6 +394,9 @@
//has people AND either there's only one hijacker or there's any but solo_hijack is disabled
return has_people && ((hijacker_count == 1) || (hijacker_count && !solo_hijack))
/obj/docking_port/mobile/emergency/proc/is_hijacked()
return hijack_status == HIJACKED
/obj/docking_port/mobile/emergency/proc/ShuttleDBStuff()
set waitfor = FALSE
if(!SSdbcore.Connect())
@@ -437,7 +525,7 @@
// now move the actual emergency shuttle to centcom
// unless the shuttle is "hijacked"
var/destination_dock = "emergency_away"
if(is_hijacked())
if(is_hijacked() && elimination_hijack())
destination_dock = "emergency_syndicate"
minor_announce("Corruption detected in \
shuttle navigation protocols. Please contact your \
@@ -454,7 +542,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
@@ -629,3 +717,10 @@
#undef ENGINES_STARTED
#undef IS_DOCKED
#undef SHUTTLE_CONSOLE_ACTION_DELAY
#undef NOT_BEGUN
#undef STAGE_1
#undef STAGE_2
#undef STAGE_3
#undef STAGE_4
#undef HIJACKED