Skip to content

Commit

Permalink
hijack sound refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
doom committed Dec 23, 2023
1 parent 72282fb commit e9c2594
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
needs_power = FALSE
var/override_being_removed = FALSE

// DS alarm when a queen attempts a hijack
COOLDOWN_DECLARE(hijack_alarm)
var/hijack_alarm_cooldown = 3 MINUTES

// Admin disabled
var/disabled = FALSE

Expand Down Expand Up @@ -169,7 +173,8 @@
if(dropship_control_lost)
remove_door_lock()
to_chat(user, SPAN_NOTICE("You succesfully removed the lockout!"))
playsound(loc, 'sound/machines/terminal_success.ogg', KEYBOARD_SOUND_VOLUME, 1)
playsound(src, 'sound/AI/ai_female_autopilot_deactivated.ogg', 100, FALSE, 30, VOLUME_SFX, 0, 0, 7)
playsound(src, 'sound/machines/terminal_success.ogg', KEYBOARD_SOUND_VOLUME, 1)

if(!shuttle.is_hijacked)
tgui_interact(user)
Expand Down Expand Up @@ -231,19 +236,26 @@

// door controls being overriden
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|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)
if(!GLOB.resin_lz_allowed)
set_lz_resin_allowed(TRUE)

to_chat(xeno, SPAN_XENONOTICE("You override the doors."))
xeno_message(SPAN_XENOANNOUNCE("The doors of the metal bird have been overridden! Rejoice!"), 3, xeno.hivenumber)
message_admins("[key_name(xeno)] has locked the dropship '[dropship]'", xeno.x, xeno.y, xeno.z)
notify_ghosts(header = "Dropship Locked", message = "[xeno] has locked [dropship]!", source = xeno, action = NOTIFY_ORBIT)
play_hijack_alarm()
INVOKE_ASYNC(usr, TYPE_PROC_REF(/mob, emote), "roar")
if(do_after(usr, 11 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE))
playsound(src, 'sound/AI/ai_female_access_granted.ogg', 15)
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|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)
if(!GLOB.resin_lz_allowed)
set_lz_resin_allowed(TRUE)

to_chat(xeno, SPAN_XENONOTICE("You override the doors."))
xeno_message(SPAN_XENOANNOUNCE("The doors of the metal bird have been overridden! Rejoice!"), 3, xeno.hivenumber)
message_admins("[key_name(xeno)] has locked the dropship '[dropship]'", xeno.x, xeno.y, xeno.z)
notify_ghosts(header = "Dropship Locked", message = "[xeno] has locked [dropship]!", source = xeno, action = NOTIFY_ORBIT)
else:
playsound(src, 'sound/AI/ai_female_access_denied.ogg', 15)

return

if(dropship_control_lost)
Expand All @@ -268,6 +280,7 @@
// select crash location
var/turf/source_turf = get_turf(src)
var/obj/docking_port/mobile/marine_dropship/dropship = SSshuttle.getShuttle(shuttleId)
playsound(src, pick('sound/AI/ai_female_autopilot_activated.ogg','sound/AI/ai_female_launch.ogg'), 10)
var/result = tgui_input_list(user, "Where to 'land'?", "Dropship Hijack", GLOB.almayer_ship_sections , timeout = 10 SECONDS)
if(!result)
return
Expand Down Expand Up @@ -513,6 +526,13 @@
shuttle.playing_launch_announcement_alarm = FALSE
return

/obj/structure/machinery/computer/shuttle/dropship/flight/proc/play_hijack_alarm()
if(!COOLDOWN_FINISHED(src, hijack_alarm))
return

COOLDOWN_START(src, hijack_alarm, hijack_alarm_cooldown)
playsound(src, 'sound/AI/ai_female_xeno_alarm.ogg', 100, FALSE, 30, VOLUME_SFX, 0, 0, 7)

/obj/structure/machinery/computer/shuttle/dropship/flight/lz1
icon = 'icons/obj/structures/machinery/computer.dmi'
icon_state = "shuttle"
Expand Down
Binary file added sound/AI/ai_female_access_denied.ogg
Binary file not shown.
Binary file added sound/AI/ai_female_access_granted.ogg
Binary file not shown.
Binary file added sound/AI/ai_female_autopilot_activated.ogg
Binary file not shown.
Binary file added sound/AI/ai_female_autopilot_deactivated.ogg
Binary file not shown.
Binary file added sound/AI/ai_female_launch.ogg
Binary file not shown.
Binary file added sound/AI/ai_female_xeno_alarm.ogg
Binary file not shown.

0 comments on commit e9c2594

Please sign in to comment.