mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
## About The Pull Request This PR moves most of the code for using an item to commit suicide from `human` to `living`, so that anything with hands can use what it is holding to commit suicide. This was surprisingly painless, as most `suicide_act` procs were already written without the assumption that the person killing themselves was a human even though they couldn't be anything else. This might occasionally mean that in some cases (like drones) it may reference anatomy that they don't have (like necks) but I think that's not a big deal and don't worry about it. ## Why It's Good For The Game It's funny. ## Changelog 🆑 balance: Anything with hands can now use the things it is holding to commit suicide /🆑
58 lines
2.4 KiB
Plaintext
58 lines
2.4 KiB
Plaintext
/**
|
|
* # Experi-Scanner
|
|
*
|
|
* Handheld scanning unit to perform scanning experiments
|
|
*/
|
|
/obj/item/experi_scanner
|
|
name = "Experi-Scanner"
|
|
desc = "A handheld scanner used for completing the many experiments of modern science."
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
icon = 'icons/obj/devices/scanner.dmi'
|
|
icon_state = "experiscanner"
|
|
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
|
|
sound_vary = TRUE
|
|
pickup_sound = SFX_GENERIC_DEVICE_PICKUP
|
|
drop_sound = SFX_GENERIC_DEVICE_DROP
|
|
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT, /datum/material/glass = HALF_SHEET_MATERIAL_AMOUNT)
|
|
|
|
/obj/item/experi_scanner/Initialize(mapload)
|
|
..()
|
|
return INITIALIZE_HINT_LATELOAD
|
|
|
|
// Late initialize to allow for the rnd servers to initialize first
|
|
/obj/item/experi_scanner/LateInitialize()
|
|
var/static/list/handheld_signals = list(
|
|
COMSIG_ITEM_PRE_ATTACK = TYPE_PROC_REF(/datum/component/experiment_handler, try_run_handheld_experiment),
|
|
COMSIG_ITEM_AFTERATTACK = TYPE_PROC_REF(/datum/component/experiment_handler, ignored_handheld_experiment_attempt),
|
|
)
|
|
AddComponent(/datum/component/experiment_handler, \
|
|
allowed_experiments = list(/datum/experiment/scanning, /datum/experiment/physical), \
|
|
disallowed_traits = EXPERIMENT_TRAIT_DESTRUCTIVE, \
|
|
config_flags = EXPERIMENT_CONFIG_ALWAYS_ANNOUNCE, \
|
|
experiment_signals = handheld_signals, \
|
|
)
|
|
|
|
/obj/item/experi_scanner/suicide_act(mob/living/user)
|
|
user.visible_message(span_suicide("[user] is giving in to the Great Toilet Beyond! It looks like [user.p_theyre()] trying to commit suicide!"))
|
|
|
|
forceMove(drop_location())
|
|
user.forceMove(src)
|
|
user.AddComponent(/datum/component/itembound, src) //basically a bread smite but with a bloody finale
|
|
icon_state = "experiscanner_closed"
|
|
add_atom_colour(COLOR_RED, ADMIN_COLOUR_PRIORITY)
|
|
|
|
playsound(src, 'sound/effects/pope_entry.ogg', 60, TRUE)
|
|
playsound(src, 'sound/machines/destructive_scanner/ScanDangerous.ogg', 40)
|
|
user.emote("scream")
|
|
|
|
addtimer(CALLBACK(src, PROC_REF(make_meat_toilet), user), 5 SECONDS)
|
|
return MANUAL_SUICIDE
|
|
|
|
/obj/item/experi_scanner/proc/make_meat_toilet(mob/living/user)
|
|
///The toilet we're about to unleash unto this cursed plane of existence
|
|
new /obj/structure/toilet/greyscale/flesh (drop_location(), user) //the toilet's Initialize proc will handle the rest from here.
|
|
|
|
icon_state = "experiscanner"
|
|
remove_atom_colour(ADMIN_COLOUR_PRIORITY, COLOR_RED)
|