Files
Bubberstation/code/modules/instruments/stationary.dm
SkyratBot 49d1a6d1a9 [MIRROR] Adds falling hazard element, beware of falling tools, wear your hardhat, comically timed piano falling on the clown [MDB IGNORE] (#17539)
* Adds falling hazard element, beware of falling tools, wear your hardhat, comically timed piano falling on the clown (#70970)

## About The Pull Request

https://user-images.githubusercontent.com/82386923/199180691-6605c8cc-e8aa-490e-ab65-909d45d12ca0.mp4

Do note that the damage in this video is extremely exaggerated compared
to what the normal value is.
## Why It's Good For The Game

All these signs about engineers needing to wear their hardhat, and for
what? For the assistant dropping toolboxes onto them from above, that's
what! Also allows people to do as god intended by allowing them to drop
pianos on people.
## Changelog
🆑
add: A variety of items, mainly tools, around the station might hurt if
they fall on your head, remember to wear your hardhat and to avoid
standing under large red X marks on the ground with a piano hanging
above them.
/🆑

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* Adds falling hazard element, beware of falling tools, wear your hardhat, comically timed piano falling on the clown

* Made anvil and large mortar falling hazards

Co-authored-by: Paxilmaniac <82386923+Paxilmaniac@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
2022-11-18 14:10:59 -05:00

69 lines
2.3 KiB
Plaintext

/obj/structure/musician
name = "Not A Piano"
desc = "Something broke, contact coderbus."
interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT | INTERACT_ATOM_REQUIRES_DEXTERITY
integrity_failure = 0.25
var/can_play_unanchored = FALSE
var/list/allowed_instrument_ids = list("r3grand","r3harpsi","crharpsi","crgrand1","crbright1", "crichugan", "crihamgan","piano")
var/datum/song/song
/obj/structure/musician/Initialize(mapload)
. = ..()
song = new(src, allowed_instrument_ids)
allowed_instrument_ids = null
/obj/structure/musician/Destroy()
QDEL_NULL(song)
return ..()
/obj/structure/musician/proc/should_stop_playing(atom/music_player)
if(!(anchored || can_play_unanchored) || !ismob(music_player))
return STOP_PLAYING
var/mob/user = music_player
if(!user.canUseTopic(src, FALSE, TRUE, FALSE, FALSE)) //can play with TK and while resting because fun.
return STOP_PLAYING
/obj/structure/musician/ui_interact(mob/user)
. = ..()
song.ui_interact(user)
/obj/structure/musician/wrench_act(mob/living/user, obj/item/tool)
. = ..()
default_unfasten_wrench(user, tool, time = 4 SECONDS)
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/structure/musician/piano
name = "space piano"
desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't."
icon = 'icons/obj/art/musician.dmi'
icon_state = "piano"
anchored = TRUE
density = TRUE
var/broken_icon_state = "pianobroken"
/obj/structure/musician/piano/Initialize(mapload)
. = ..()
AddElement(/datum/element/falling_hazard, damage = 60, wound_bonus = 10, hardhat_safety = FALSE, crushes = TRUE, impact_sound = 'sound/effects/piano_hit.ogg')
/obj/structure/musician/piano/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
playsound(src, 'sound/effects/piano_hit.ogg', 100, TRUE)
if(BURN)
playsound(src, 'sound/items/welder.ogg', 100, TRUE)
/obj/structure/musician/piano/atom_break(damage_flag)
. = ..()
if(!broken)
broken = TRUE
icon_state = broken_icon_state
/obj/structure/musician/piano/unanchored
anchored = FALSE
/obj/structure/musician/piano/minimoog
name = "space minimoog"
desc = "This is a minimoog, like a space piano, but more spacey!"
icon_state = "minimoog"
broken_icon_state = "minimoogbroken"