mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-06 15:42:28 +00:00
* refactor: Attack chain, initial setup. * migrate curtain to make dreamchecker happy * update thurible * don't call attacked_by separately for legacy attack chain * remove duplicate proc * condense similar code, put allowances for legacy code in new procs * update docs, include diagram source * add comment on how to update diagram * fix admonition * mindflayer updates * remove commented out code * clarify all steps * after_attack should be overridable * whoops * retrofit recent changes * duh, can't restrict this yet because of tool_acts * i hate ore bags with the fire of a thousand suns * return correct value for object attack logic * Various cleanups. We don't want to attempt to pull stuff out of `/obj/item/attackby`, because those pieces are part of the related objects' migrations, not `/obj/item` itself. Attempting to do this causes knockon effects where things expected to call e.g. `/obj/item/storage/attackby` in the call chain were not ferried over to the new item interaction code, because the related objects hadn't actually been migrated over yet. I've used refactoring /obj/vehicle as the example for migrating `attackby` methods instead. * simplify some argument names * fuck it * make it do the thing * Rename CI module call * Prove that CI works * improve test output * aaand fix it again * fix curtain tool interactions * fix compile error * fix compile error * Better docs, introduce migration plan tool.
54 lines
1.6 KiB
Plaintext
54 lines
1.6 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/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__legacy__attackchain(mob/user)
|
|
ui_interact(user)
|
|
|
|
/obj/item/instrument/ui_data(mob/user)
|
|
return song.ui_data(user)
|
|
|
|
/obj/item/instrument/ui_interact(mob/user)
|
|
if(!isliving(user) || user.incapacitated())
|
|
return
|
|
song.ui_interact(user)
|
|
|
|
/obj/item/instrument/ui_act(action, params)
|
|
if(..())
|
|
return
|
|
return song.ui_act(action, params)
|
|
|
|
/**
|
|
* Whether the instrument should stop playing
|
|
*
|
|
* Arguments:
|
|
* * user - The user
|
|
*/
|
|
/obj/item/instrument/proc/should_stop_playing(mob/user)
|
|
return !(src in user) || !isliving(user) || user.incapacitated()
|