Files
VOREStation/code/modules/instruments/items.dm
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

266 lines
8.2 KiB
Plaintext

//copy pasta of the space piano, don't hurt me -Pete
/obj/item/instrument
name = "generic instrument"
force = 10
health = 100
//resistance_flags = FLAMMABLE
icon = 'icons/obj/musician.dmi'
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_instruments.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_instruments.dmi',
)
abstract_type = /obj/item/instrument
/// 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 its used.
/obj/item/instrument/Destroy()
QDEL_NULL(song)
return ..()
/obj/item/instrument/proc/can_play(atom/music_player)
if(!ismob(music_player))
return FALSE
var/mob/user = music_player
if(user.incapacitated())
return FALSE
if(!Adjacent(user))
return FALSE
return TRUE
/obj/item/instrument/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(!user.IsAdvancedToolUser())
return
tgui_interact(user)
/obj/item/instrument/tgui_interact(mob/user, datum/tgui/ui)
return song.tgui_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"
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"
/obj/item/instrument/xylophone
name = "xylophone"
desc = "A percussion instrument consisting of a series of wooden bars graduated in length."
icon_state = "xylophone"
allowed_instrument_ids = "xylophone"
/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-styled", "hum-diggitied", "shin-dug", "clawhammered")
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("played metal on", "serenaded", "crashed", "smashed")
hitsound = 'sound/weapons/stringsmash.ogg'
allowed_instrument_ids = list("guitar","csteelgt","cnylongt", "ccleangt", "cmutedgt")
/obj/item/instrument/eguitar
name = "electric guitar"
desc = "Makes all your shredding needs possible."
icon_state = "eguitar"
force = 12
attack_verb = list("played metal on", "shreded", "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 = list("glockenspiel","crvibr", "sgmmbox", "r3celeste")
/obj/item/instrument/accordion
name = "accordion"
desc = "Pun-Pun not included."
icon_state = "accordion"
allowed_instrument_ids = list("crack", "crtango", "accordion")
/obj/item/instrument/trumpet
name = "trumpet"
desc = "To announce the arrival of the king!"
icon_state = "trumpet"
allowed_instrument_ids = "crtrumpet"
/obj/item/instrument/trumpet/spectral
name = "spectral trumpet"
desc = "Things are about to get spooky!"
icon_state = "spectral_trumpet"
force = 0
attack_verb = list("played", "jazzed", "trumpeted", "mourned", "dooted", "spooked")
/*
/obj/item/instrument/trumpet/spectral/Initialize(mapload)
. = ..()
AddComponent(/datum/component/spooky)
*/
/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user)
playsound (src, 'sound/runtime/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", "saxed", "mourned", "dooted", "spooked")
/*
/obj/item/instrument/saxophone/spectral/Initialize(mapload)
. = ..()
AddComponent(/datum/component/spooky)
*/
/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user)
playsound (src, 'sound/runtime/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 = list("crtrombone", "crbrass", "trombone")
/obj/item/instrument/trombone/spectral
name = "spectral trombone"
desc = "A skeleton's favorite instrument. Apply directly on the mortals."
icon_state = "trombone"
force = 0
attack_verb = list("played", "jazzed", "tromboneed", "mourned", "dooted", "spooked")
/*
/obj/item/instrument/trombone/spectral/Initialize(mapload)
. = ..()
AddComponent(/datum/component/spooky)
*/
/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user)
playsound (src, 'sound/runtime/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 = list("crharmony", "harmonica")
slot_flags = SLOT_MASK
force = 5
w_class = ITEMSIZE_SMALL
/*
actions_types = list(/datum/action/item_action/instrument)
/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
if(song.playing && ismob(loc))
to_chat(loc, span_warning("You stop playing the harmonica to talk..."))
song.playing = FALSE
/obj/item/instrument/harmonica/equipped(mob/M, slot)
. = ..()
RegisterSignal(M, COMSIG_MOB_SAY, PROC_REF(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_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_horns.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_horns.dmi',
)
allowed_instrument_ids = list("bikehorn", "honk")
attack_verb = list("beautifully honked")
w_class = ITEMSIZE_SMALL
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/banjo,
/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/piano_synth/headphones
)
for(var/atom/A as anything in templist)
instruments[initial(A.name)] = A
return instruments
*/
/obj/item/instrument/musicalmoth
name = "musical moth"
desc = "Despite its popularity, this controversial musical toy was eventually banned due to its unethically sampled sounds of moths screaming in agony."
icon_state = "mothsician"
allowed_instrument_ids = "mothscream"
attack_verb = list("fluttered", "flaped")
w_class = ITEMSIZE_SMALL
force = 0
hitsound = 'sound/voice/moth/scream_moth.ogg'
//////////////Fluff items
/obj/item/instrument/recorder/fluff_tief
name = "flute"
desc = "A blue wooden flute."
icon_state = "flute_tief"
allowed_instrument_ids = "recorder"