Skip to content

Commit

Permalink
lifeboat can now be unhacked by pilot (#6661)
Browse files Browse the repository at this point in the history
# About the pull request

Similar to how dropships can be unhacked after 3 minutes of pilot
interaction, lifeboats now have the same rules.

# Explain why it's good for the game

Another cool interaction that might happen once every 100 rounds or so.


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: pilots can unhack lifeboats, similar to dropship unhacking
/:cl:

---------

Co-authored-by: ihatethisengine <[email protected]>
Co-authored-by: harryob <[email protected]>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
4 people authored Jul 29, 2024
1 parent 79b931c commit 4f9ea4e
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion code/modules/shuttle/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@
unacidable = TRUE
///If true, the lifeboat is in the process of launching, and so the code will not allow another launch.
var/launch_initiated = FALSE
///If true, the lifeboat is in the process of having the xeno override removed by the pilot.
var/override_being_removed = FALSE
///How long it takes to unlock the console
var/remaining_time = 180 SECONDS

/obj/structure/machinery/computer/shuttle/lifeboat/ex_act(severity)
return
Expand All @@ -376,7 +380,31 @@
. = ..()
var/obj/docking_port/mobile/crashable/lifeboat/lifeboat = SSshuttle.getShuttle(shuttleId)
if(lifeboat.status == LIFEBOAT_LOCKED)
to_chat(user, SPAN_WARNING("[src] flickers with error messages."))
if(!skillcheck(user, SKILL_PILOT, SKILL_PILOT_TRAINED))
to_chat(user, SPAN_WARNING("[src] displays an error message and asks you to contact your pilot to resolve the problem."))
return
if(user.action_busy || override_being_removed)
return
to_chat(user, SPAN_NOTICE("You start to remove the lockout."))
override_being_removed = TRUE
user.visible_message(SPAN_NOTICE("[user] starts to type on [src]."),
SPAN_NOTICE("You try to take back control over the lifeboat. It will take around [remaining_time / 10] seconds."))
while(remaining_time > 20 SECONDS)
if(!do_after(user, 20 SECONDS, INTERRUPT_ALL|INTERRUPT_CHANGED_LYING, BUSY_ICON_HOSTILE, numticks = 20))
to_chat(user, SPAN_WARNING("You fail to remove the lockout!"))
override_being_removed = FALSE
return
remaining_time = remaining_time - 20 SECONDS
if(remaining_time > 0)
to_chat(user, SPAN_NOTICE("You partially bypass the lockout, only [remaining_time / 10] seconds left."))
to_chat(user, SPAN_NOTICE("You successfully removed the lockout!"))
playsound(loc, 'sound/machines/terminal_success.ogg', KEYBOARD_SOUND_VOLUME, 1)
lifeboat.status = LIFEBOAT_ACTIVE
lifeboat.available = TRUE
user.visible_message(SPAN_NOTICE("[src] blinks with blue lights."),
SPAN_NOTICE("You have successfully taken back control over the lifeboat."))
override_being_removed = FALSE
return
else if(lifeboat.status == LIFEBOAT_INACTIVE)
to_chat(user, SPAN_NOTICE("[src]'s screen says \"Awaiting evacuation order\"."))
else if(lifeboat.status == LIFEBOAT_ACTIVE)
Expand Down Expand Up @@ -456,6 +484,8 @@
var/obj/docking_port/stationary/lifeboat_dock/lifeboat_dock = lifeboat.get_docked()
lifeboat_dock.open_dock()
xeno_message(SPAN_XENOANNOUNCE("We have wrested away control of one of the metal birds! They shall not escape!"), 3, xeno.hivenumber)
launch_initiated = FALSE
remaining_time = initial(remaining_time)
return XENO_NO_DELAY_ACTION
else
return ..()

0 comments on commit 4f9ea4e

Please sign in to comment.