Files
Bubberstation/code/datums/elements/door_pryer.dm
grungussuss 58501dce77 Reorganizes the sound folder (#86726)
## About The Pull Request

<details>

- renamed ai folder to announcer

-- announcer --
- moved vox_fem to announcer
- moved approachingTG to announcer

- separated the ambience folder into ambience and instrumental
-- ambience --

- created holy folder moved all related sounds there
- created engineering folder and moved all related sounds there
- created security folder and moved ambidet there
- created general folder and moved ambigen there
- created icemoon folder and moved all icebox-related ambience there
- created medical folder and moved all medbay-related ambi there
- created ruin folder and moves all ruins ambi there
- created beach folder and moved seag and shore there
- created lavaland folder and moved related ambi there
- created aurora_caelus folder and placed its ambi there
- created misc folder and moved the rest of the files that don't have a
specific category into it

-- instrumental --

- moved traitor folder here
- created lobby_music folder and placed our songs there (title0 not used
anywhere? - server-side modification?)

-- items --

- moved secdeath to hailer
- moved surgery to handling

-- effects --

- moved chemistry into effects
- moved hallucinations into effects
- moved health into effects
- moved magic into effects

-- vehicles --

- moved mecha into vehicles


created mobs folder

-- mobs --

- moved creatures folder into mobs
- moved voice into mobs

renamed creatures to non-humanoids
renamed voice to humanoids

-- non-humanoids--

created cyborg folder
created hiss folder
moved harmalarm.ogg to cyborg

-- humanoids --




-- misc --

moved ghostwhisper to misc
moved insane_low_laugh to misc

I give up trying to document this.

</details>

- [X] ambience
- [x] announcer
- [x] effects
- [X] instrumental
- [x] items
- [x] machines
- [x] misc 
- [X] mobs
- [X] runtime
- [X] vehicles

- [ ] attributions

## Why It's Good For The Game

This folder is so disorganized that it's vomit inducing, will make it
easier to find and add new sounds, providng a minor structure to the
sound folder.

## Changelog
🆑 grungussuss
refactor: the sound folder in the source code has been reorganized,
please report any oddities with sounds playing or not playing
server: lobby music has been repathed to sound/music/lobby_music
/🆑
2024-09-23 22:24:50 -07:00

72 lines
2.6 KiB
Plaintext

/**
* Attached to a basic mob.
* Causes attacks on doors to attempt to open them.
*/
/datum/element/door_pryer
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// Time it takes to open a door with force
var/pry_time
/// Interaction key for if we force a door open
var/interaction_key
/datum/element/door_pryer/Attach(datum/target, pry_time = 10 SECONDS, interaction_key = null)
. = ..()
if (!isliving(target))
return ELEMENT_INCOMPATIBLE
src.pry_time = pry_time
src.interaction_key = interaction_key
RegisterSignal(target, COMSIG_LIVING_UNARMED_ATTACK, PROC_REF(on_attack))
/datum/element/door_pryer/Detach(datum/source)
. = ..()
UnregisterSignal(source, COMSIG_LIVING_UNARMED_ATTACK)
/// If we're targeting an airlock, open it
/datum/element/door_pryer/proc/on_attack(mob/living/basic/attacker, atom/target, proximity_flag)
SIGNAL_HANDLER
if(!proximity_flag || !istype(target, /obj/machinery/door/airlock))
return NONE
var/obj/machinery/door/airlock/airlock_target = target
if (!airlock_target.density)
return NONE // It's already open numbnuts
if(DOING_INTERACTION_WITH_TARGET(attacker, target) || (!isnull(interaction_key) && DOING_INTERACTION(attacker, interaction_key)))
attacker.balloon_alert(attacker, "busy!")
return COMPONENT_CANCEL_ATTACK_CHAIN
if (attacker.combat_mode)
return // Attack the door
if (airlock_target.locked || airlock_target.welded || airlock_target.seal)
airlock_target.balloon_alert(attacker, "it's sealed!")
return COMPONENT_CANCEL_ATTACK_CHAIN
INVOKE_ASYNC(src, PROC_REF(open_door), attacker, airlock_target)
return COMPONENT_CANCEL_ATTACK_CHAIN
/// Try opening the door, and if we can't then try forcing it
/datum/element/door_pryer/proc/open_door(mob/living/basic/attacker, obj/machinery/door/airlock/airlock_target)
if (!airlock_target.hasPower())
attacker.visible_message(span_warning("[attacker] forces the [airlock_target] to open."))
airlock_target.open(FORCING_DOOR_CHECKS)
return
if (airlock_target.allowed(attacker))
airlock_target.open(DEFAULT_DOOR_CHECKS)
return
attacker.visible_message(\
message = span_warning("[attacker] starts forcing the [airlock_target] open!"),
blind_message = span_hear("You hear a metal screeching sound."),
)
playsound(airlock_target, 'sound/machines/airlock/airlock_alien_prying.ogg', 100, TRUE)
airlock_target.balloon_alert(attacker, "prying...")
if(!do_after(attacker, pry_time, airlock_target))
airlock_target.balloon_alert(attacker, "interrupted!")
return
if(airlock_target.locked)
return
attacker.visible_message(span_warning("[attacker] forces the [airlock_target] to open."))
airlock_target.open(BYPASS_DOOR_CHECKS)