From e1fc0fb4e752ceaed3340db386364c907f4657e0 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 24 Jul 2026 15:32:10 -0400 Subject: [PATCH] Migrate instruments to the new attack chain. (#32299) --- .../instruments/objs/items/_instrument.dm | 8 ++++++- .../objs/items/instrument_items.dm | 24 +++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/code/modules/instruments/objs/items/_instrument.dm b/code/modules/instruments/objs/items/_instrument.dm index 98435283649..a3708103a72 100644 --- a/code/modules/instruments/objs/items/_instrument.dm +++ b/code/modules/instruments/objs/items/_instrument.dm @@ -13,6 +13,7 @@ var/list/allowed_instrument_ids /// How far away our song datum can be heard. var/instrument_range = 15 + new_attack_chain = TRUE /obj/item/instrument/Initialize(mapload) . = ..() @@ -27,8 +28,13 @@ user.visible_message(SPAN_SUICIDE("[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!")) return BRUTELOSS -/obj/item/instrument/attack_self__legacy__attackchain(mob/user) +/obj/item/instrument/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + ui_interact(user) + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE /obj/item/instrument/ui_data(mob/user) return song.ui_data(user) diff --git a/code/modules/instruments/objs/items/instrument_items.dm b/code/modules/instruments/objs/items/instrument_items.dm index aede2eab3a0..94c7a080867 100644 --- a/code/modules/instruments/objs/items/instrument_items.dm +++ b/code/modules/instruments/objs/items/instrument_items.dm @@ -74,6 +74,7 @@ name = "spectral trumpet" desc = "Things are about to get spooky!" icon_state = "spectral_trumpet" + hitsound = 'sound/instruments/trombone/En4.mid' force = 0 attack_verb = list("played", "jazzed", "trumpeted", "mourned", "dooted", "spooked") @@ -81,9 +82,8 @@ . = ..() AddComponent(/datum/component/spooky) -/obj/item/instrument/trumpet/spectral/attack__legacy__attackchain(mob/living/carbon/C, mob/user) - playsound(src, 'sound/instruments/trombone/En4.mid', 100, TRUE, -1) - ..() +/obj/item/instrument/trumpet/spectral/should_play_hitsound(damage) + return TRUE /obj/item/instrument/saxophone name = "saxophone" @@ -94,6 +94,7 @@ /obj/item/instrument/saxophone/spectral name = "spectral saxophone" desc = "This spooky sound will be sure to leave mortals in bones." + hitsound = 'sound/instruments/saxophone/En4.mid' force = 0 attack_verb = list("played", "jazzed", "saxxed", "mourned", "dooted", "spooked") @@ -101,9 +102,8 @@ . = ..() AddComponent(/datum/component/spooky) -/obj/item/instrument/saxophone/spectral/attack__legacy__attackchain(mob/living/carbon/C, mob/user) - playsound(src, 'sound/instruments/saxophone/En4.mid', 100, TRUE,-1) - ..() +/obj/item/instrument/saxophone/spectral/should_play_hitsound(damage) + return TRUE /obj/item/instrument/trombone name = "trombone" @@ -115,6 +115,7 @@ /obj/item/instrument/trombone/spectral name = "spectral trombone" desc = "A skeleton's favorite instrument. Apply directly on the mortals." + hitsound = 'sound/instruments/trombone/Cn4.mid' force = 0 attack_verb = list("played", "jazzed", "tromboned", "mourned", "dooted", "spooked") @@ -122,19 +123,18 @@ . = ..() AddComponent(/datum/component/spooky) -/obj/item/instrument/trombone/spectral/attack__legacy__attackchain(mob/living/carbon/C, mob/user) - playsound (src, 'sound/instruments/trombone/Cn4.mid', 100,1,-1) - ..() +/obj/item/instrument/trombone/spectral/should_play_hitsound(damage) + return TRUE /obj/item/instrument/trombone/sad name = "sad trombone" desc = "Wah. Waah. Waaah. Waaaaaaah." + hitsound = 'sound/misc/sadtrombone.ogg' force = 0 attack_verb = list("Wahed", "Waahed", "Waaahed", "Honked") -/obj/item/instrument/trombone/sad/attack__legacy__attackchain(mob/living/carbon/C, mob/user) - playsound(loc, 'sound/misc/sadtrombone.ogg', 50, TRUE, -1) - ..() +/obj/item/instrument/trombone/sad/should_play_hitsound(damage) + return TRUE /obj/item/instrument/recorder name = "recorder"