Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PO can remove queens override again, bit by bit edition #5143

Merged
merged 12 commits into from
Dec 7, 2023
34 changes: 27 additions & 7 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
unacidable = TRUE
exproof = TRUE
needs_power = FALSE
var/override_being_removed = FALSE

// Admin disabled
var/disabled = FALSE
Expand Down Expand Up @@ -143,15 +144,33 @@
to_chat(user, SPAN_NOTICE("\The [src] is not responsive"))
return

if(dropship_control_lost && skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT))
if(dropship_control_lost)
var/remaining_time = timeleft(door_control_cooldown) / 10
if(remaining_time > 60)
to_chat(user, SPAN_WARNING("The shuttle is not responding, try again in [remaining_time] seconds."))
to_chat(user, SPAN_WARNING("The shuttle is not responding due to the Queen's override, the system will automatically remove the override in about [remaining_time] seconds."))
if(!skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT))
return
Drulikar marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, SPAN_NOTICE("You start to remove the Queens override."))
if(!do_after(user, 3 MINUTES, INTERRUPT_ALL, BUSY_ICON_HOSTILE))
to_chat(user, SPAN_WARNING("You fail to remove the Queens override"))
if(user.action_busy || override_being_removed)
return
to_chat(user, SPAN_NOTICE("You start to remove the Queen's override."))
override_being_removed = TRUE
for(var/i in 1 to n_ceil(remaining_time/40))
if(!do_after(user, 20 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE))
to_chat(user, SPAN_WARNING("You fail to remove the Queen's override!"))
override_being_removed = FALSE
return
if(!dropship_control_lost)
to_chat(user, SPAN_NOTICE("The Queen's override is already removed."))
break
remaining_time = timeleft(door_control_cooldown) / 10 - 20
if(remaining_time > 0)
to_chat(user, SPAN_NOTICE("You partly remove the Queen's override, about [remaining_time] seconds left."))
door_control_cooldown = addtimer(CALLBACK(src, PROC_REF(remove_door_lock)), remaining_time SECONDS, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT)
else
break
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved
override_being_removed = FALSE
if(dropship_control_lost)
remove_door_lock()
to_chat(user, SPAN_NOTICE("You succesfully removed the Queen's override!"))
playsound(loc, 'sound/machines/terminal_success.ogg', KEYBOARD_SOUND_VOLUME, 1)

if(!shuttle.is_hijacked)
Expand Down Expand Up @@ -216,7 +235,7 @@
if(!dropship_control_lost)
dropship.control_doors("unlock", "all", TRUE)
dropship_control_lost = TRUE
door_control_cooldown = addtimer(CALLBACK(src, PROC_REF(remove_door_lock)), SHUTTLE_LOCK_COOLDOWN, TIMER_STOPPABLE)
door_control_cooldown = addtimer(CALLBACK(src, PROC_REF(remove_door_lock)), SHUTTLE_LOCK_COOLDOWN, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT)
if(GLOB.almayer_orbital_cannon)
GLOB.almayer_orbital_cannon.is_disabled = TRUE
addtimer(CALLBACK(GLOB.almayer_orbital_cannon, TYPE_PROC_REF(/obj/structure/orbital_cannon, enable)), 10 MINUTES, TIMER_UNIQUE)
Expand Down Expand Up @@ -299,6 +318,7 @@
playsound(loc, 'sound/machines/terminal_success.ogg', KEYBOARD_SOUND_VOLUME, 1)
dropship_control_lost = FALSE
if(door_control_cooldown)
deltimer(door_control_cooldown)
door_control_cooldown = null

/obj/structure/machinery/computer/shuttle/dropship/flight/ui_data(mob/user)
Expand Down