mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* uhhhh
* Fixes missing piano
* Fixes
* fixes the boogaloo
* Spacepods dont exist, shoo
* Fixes legacy instruments
* Revert "Fixes legacy instruments"
This reverts commit 753b0874d6.
* fix accordions
* Removes tone for sanity
* Eat Shit piano conflicts
Co-authored-by: silicons <2003111+silicons@users.noreply.github.com>
280 lines
9.0 KiB
Plaintext
280 lines
9.0 KiB
Plaintext
//copy pasta of the space piano, don't hurt me -Pete
|
|
/obj/item/instrument
|
|
name = "generic instrument"
|
|
force = 10
|
|
max_integrity = 100
|
|
resistance_flags = FLAMMABLE
|
|
icon = 'icons/obj/musician.dmi'
|
|
lefthand_file = 'icons/mob/inhands/equipment/instruments_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/instruments_righthand.dmi'
|
|
/// Our song datum.
|
|
var/datum/song/handheld/song
|
|
/// Our allowed list of instrument ids. This is nulled on initialize.
|
|
var/list/allowed_instrument_ids
|
|
/// How far away our song datum can be heard.
|
|
var/instrument_range = 15
|
|
|
|
/obj/item/instrument/Initialize(mapload)
|
|
. = ..()
|
|
song = new(src, allowed_instrument_ids, instrument_range)
|
|
allowed_instrument_ids = null //We don't need this clogging memory after it's used.
|
|
|
|
/obj/item/instrument/Destroy()
|
|
QDEL_NULL(song)
|
|
return ..()
|
|
|
|
/obj/item/instrument/proc/should_stop_playing(mob/user)
|
|
return user.incapacitated() || !((loc == user) || (isturf(loc) && Adjacent(user))) // sorry, no more TK playing.
|
|
|
|
/obj/item/instrument/suicide_act(mob/user)
|
|
user.visible_message("<span class='suicide'>[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
|
return (BRUTELOSS)
|
|
|
|
/obj/item/instrument/attack_self(mob/user)
|
|
if(!user.IsAdvancedToolUser())
|
|
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
|
return TRUE
|
|
interact(user)
|
|
|
|
/obj/item/instrument/interact(mob/user)
|
|
ui_interact(user)
|
|
|
|
/obj/item/instrument/ui_interact(mob/living/user)
|
|
if(!isliving(user) || user.stat || user.restrained() || !(user.mobility_flags & MOBILITY_STAND))
|
|
return
|
|
|
|
user.set_machine(src)
|
|
song.ui_interact(user)
|
|
|
|
/obj/item/instrument/violin
|
|
name = "space violin"
|
|
desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
|
|
icon_state = "violin"
|
|
item_state = "violin"
|
|
hitsound = "swing_hit"
|
|
allowed_instrument_ids = "violin"
|
|
|
|
/obj/item/instrument/violin/golden
|
|
name = "golden violin"
|
|
desc = "A golden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
|
|
icon_state = "golden_violin"
|
|
item_state = "golden_violin"
|
|
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
|
|
|
/obj/item/instrument/piano_synth
|
|
name = "synthesizer"
|
|
desc = "An advanced electronic synthesizer that can be used as various instruments."
|
|
icon_state = "synth"
|
|
allowed_instrument_ids = "piano"
|
|
|
|
/obj/item/instrument/piano_synth/Initialize(mapload)
|
|
. = ..()
|
|
song.allowed_instrument_ids = SSinstruments.synthesizer_instrument_ids
|
|
|
|
/obj/item/instrument/piano_synth/headphones
|
|
name = "headphones"
|
|
desc = "Unce unce unce unce. Boop!"
|
|
icon = 'icons/obj/clothing/accessories.dmi'
|
|
lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/clothing_righthand.dmi'
|
|
icon_state = "headphones"
|
|
slot_flags = ITEM_SLOT_EARS | ITEM_SLOT_HEAD
|
|
force = 0
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
custom_price = 125
|
|
instrument_range = 1
|
|
|
|
/obj/item/instrument/piano_synth/headphones/ComponentInitialize()
|
|
. = ..()
|
|
RegisterSignal(src, COMSIG_SONG_START, .proc/start_playing)
|
|
RegisterSignal(src, COMSIG_SONG_END, .proc/stop_playing)
|
|
|
|
/**
|
|
* Called by a component signal when our song starts playing.
|
|
*/
|
|
/obj/item/instrument/piano_synth/headphones/proc/start_playing()
|
|
icon_state = "[initial(icon_state)]_on"
|
|
update_icon()
|
|
|
|
/**
|
|
* Called by a component signal when our song stops playing.
|
|
*/
|
|
/obj/item/instrument/piano_synth/headphones/proc/stop_playing()
|
|
icon_state = "[initial(icon_state)]"
|
|
update_icon()
|
|
|
|
/obj/item/instrument/banjo
|
|
name = "banjo"
|
|
desc = "A 'Mura' brand banjo. It's pretty much just a drum with a neck and strings."
|
|
icon_state = "banjo"
|
|
attack_verb = list("scruggs-style", "hum-diggity", "shin-dig", "clawhammer")
|
|
hitsound = 'sound/weapons/banjoslap.ogg'
|
|
allowed_instrument_ids = "banjo"
|
|
|
|
/obj/item/instrument/guitar
|
|
name = "guitar"
|
|
desc = "It's made of wood and has bronze strings."
|
|
icon_state = "guitar"
|
|
attack_verb = list("play metal on", "serenade", "crash", "smash")
|
|
hitsound = 'sound/weapons/stringsmash.ogg'
|
|
allowed_instrument_ids = "guitar"
|
|
|
|
/obj/item/instrument/eguitar
|
|
name = "electric guitar"
|
|
desc = "Makes all your shredding needs possible."
|
|
icon_state = "eguitar"
|
|
item_state = "eguitar"
|
|
force = 12
|
|
attack_verb = list("played metal on", "shredded", "crashed", "smashed")
|
|
hitsound = 'sound/weapons/stringsmash.ogg'
|
|
allowed_instrument_ids = "eguitar"
|
|
|
|
/obj/item/instrument/glockenspiel
|
|
name = "glockenspiel"
|
|
desc = "Smooth metal bars perfect for any marching band."
|
|
icon_state = "glockenspiel"
|
|
allowed_instrument_ids = "glockenspiel"
|
|
|
|
/obj/item/instrument/accordion
|
|
name = "accordion"
|
|
desc = "Pun-Pun not included."
|
|
icon_state = "accordion"
|
|
allowed_instrument_ids = "accordion"
|
|
|
|
/obj/item/instrument/trumpet
|
|
name = "trumpet"
|
|
desc = "To announce the arrival of the king!"
|
|
icon_state = "trumpet"
|
|
allowed_instrument_ids = "trombone"
|
|
|
|
/obj/item/instrument/trumpet/spectral
|
|
name = "spectral trumpet"
|
|
desc = "Things are about to get spooky!"
|
|
icon_state = "trumpet"
|
|
item_state = "trombone"
|
|
force = 0
|
|
attack_verb = list("play", "jazz", "trumpet", "mourn", "doot", "spook")
|
|
|
|
/obj/item/instrument/trumpet/spectral/Initialize()
|
|
. = ..()
|
|
AddComponent(/datum/component/spooky)
|
|
|
|
/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user)
|
|
playsound (loc, 'sound/instruments/trombone/En4.mid', 100,1,-1)
|
|
..()
|
|
|
|
/obj/item/instrument/saxophone
|
|
name = "saxophone"
|
|
desc = "This soothing sound will be sure to leave your audience in tears."
|
|
icon_state = "saxophone"
|
|
allowed_instrument_ids = "saxophone"
|
|
|
|
/obj/item/instrument/saxophone/spectral
|
|
name = "spectral saxophone"
|
|
desc = "This spooky sound will be sure to leave mortals in bones."
|
|
icon_state = "saxophone"
|
|
force = 0
|
|
attack_verb = list("played","jazzed","saxxed","mourned","dooted","spooked")
|
|
|
|
/obj/item/instrument/saxophone/spectral/Initialize()
|
|
. = ..()
|
|
AddComponent(/datum/component/spooky)
|
|
|
|
/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user)
|
|
playsound (loc, 'sound/instruments/saxophone/En4.mid', 100,1,-1)
|
|
..()
|
|
|
|
/obj/item/instrument/trombone
|
|
name = "trombone"
|
|
desc = "How can any pool table ever hope to compete?"
|
|
icon_state = "trombone"
|
|
allowed_instrument_ids = "trombone"
|
|
|
|
/obj/item/instrument/trombone/spectral
|
|
name = "spectral trombone"
|
|
desc = "A skeleton's favorite instrument. Apply directly on the mortals."
|
|
icon_state = "trombone"
|
|
item_state = "trombone"
|
|
force = 0
|
|
attack_verb = list("played","jazzed","tromboned","mourned","dooted","spooked")
|
|
|
|
/obj/item/instrument/trombone/spectral/Initialize()
|
|
. = ..()
|
|
AddComponent(/datum/component/spooky)
|
|
|
|
/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user)
|
|
playsound (loc, 'sound/instruments/trombone/Cn4.mid', 100,1,-1)
|
|
..()
|
|
|
|
/obj/item/instrument/recorder
|
|
name = "recorder"
|
|
desc = "Just like in school, playing ability and all."
|
|
force = 5
|
|
icon_state = "recorder"
|
|
allowed_instrument_ids = "recorder"
|
|
|
|
/obj/item/instrument/harmonica
|
|
name = "harmonica"
|
|
desc = "For when you get a bad case of the space blues."
|
|
icon_state = "harmonica"
|
|
allowed_instrument_ids = "harmonica"
|
|
slot_flags = ITEM_SLOT_MASK
|
|
force = 5
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
actions_types = list(/datum/action/item_action/instrument)
|
|
|
|
/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args)
|
|
if(song.playing && ismob(loc))
|
|
to_chat(loc, "<span class='warning'>You stop playing the harmonica to talk...</span>")
|
|
song.playing = FALSE
|
|
|
|
/obj/item/instrument/harmonica/equipped(mob/M, slot)
|
|
. = ..()
|
|
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
|
|
|
|
/obj/item/instrument/harmonica/dropped(mob/M)
|
|
. = ..()
|
|
UnregisterSignal(M, COMSIG_MOB_SAY)
|
|
|
|
/obj/item/instrument/bikehorn
|
|
name = "gilded bike horn"
|
|
desc = "An exquisitely decorated bike horn, capable of honking in a variety of notes."
|
|
icon_state = "bike_horn"
|
|
item_state = "bike_horn"
|
|
lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi'
|
|
allowed_instrument_ids = "bikehorn"
|
|
attack_verb = list("beautifully honk")
|
|
w_class = WEIGHT_CLASS_TINY
|
|
force = 0
|
|
throw_speed = 3
|
|
throw_range = 15
|
|
hitsound = 'sound/items/bikehorn.ogg'
|
|
|
|
/obj/item/choice_beacon/music
|
|
name = "instrument delivery beacon"
|
|
desc = "Summon your tool of art."
|
|
icon_state = "gangtool-red"
|
|
|
|
/obj/item/choice_beacon/music/generate_display_names()
|
|
var/static/list/instruments
|
|
if(!instruments)
|
|
instruments = list()
|
|
var/list/templist = list(/obj/item/instrument/violin,
|
|
/obj/item/instrument/piano_synth,
|
|
/obj/item/instrument/guitar,
|
|
/obj/item/instrument/eguitar,
|
|
/obj/item/instrument/glockenspiel,
|
|
/obj/item/instrument/accordion,
|
|
/obj/item/instrument/trumpet,
|
|
/obj/item/instrument/saxophone,
|
|
/obj/item/instrument/trombone,
|
|
/obj/item/instrument/recorder,
|
|
/obj/item/instrument/harmonica,
|
|
/obj/item/instrument/banjo
|
|
)
|
|
for(var/V in templist)
|
|
var/atom/A = V
|
|
instruments[initial(A.name)] = A
|
|
return instruments
|