Files
Leland KembleandGitHub d6f14fe29d Moves an amount up to interpretation of things from attackby() to item_interaction() (#96757)
## About The Pull Request

Thirty files changed, one's not really changed, one's actually just a
copy of a change from a different pr, because for the sake of pipe
cleaners I decided to change the base turf. Probably wasn't a good idea.
This one contains the full set of `/turf/` `attackby()`s(besides those
meant for attacks), converted all at once because the tree of turf
subtypes looks a lot more like a spire than a bush.

Changes beyond conversion:
I added messaging for when you're crowbarring transit tube pods out of
the tubes because I genuinely wasted half an hour trying to figure out
what I'd done wrong in conversion because they don't look any different
so I thought it wasn't working.

If you're reinforcing plating and the plating is reinforced
mid-reinforcement you will no longer waste your plasteel reinforcing the
reinforced plating.


## Why It's Good For The Game

what are we at, ~120? I was expecting this to be a lot more drawn out,
but most of them are really small. I'm gonna have to do a final pass of
calls to `attackby()` once the dust settles, but the end of non-attack
`attackby()`s is just a week away.
2026-07-15 17:37:00 -05:00

72 lines
2.7 KiB
Plaintext

/obj/structure/closet/crate/large
name = "large crate"
desc = "A hefty wooden crate. You'll need a crowbar to get it open."
icon_state = "largecrate"
base_icon_state = "largecrate"
density = TRUE
pass_flags_self = PASSSTRUCTURE
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 4
delivery_icon = "deliverybox"
integrity_failure = 0 //Makes the crate break when integrity reaches 0, instead of opening and becoming an invisible sprite.
open_sound = 'sound/machines/closet/wooden_closet_open.ogg'
close_sound = 'sound/machines/closet/wooden_closet_close.ogg'
open_sound_volume = 25
close_sound_volume = 50
can_install_electronics = FALSE
elevation = 22
can_weld_shut = FALSE
// Stops people from "diving into" a crate you can't open normally
divable = FALSE
/obj/structure/closet/crate/large/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_NO_MISSING_ITEM_ERROR, TRAIT_GENERIC)
/obj/structure/closet/crate/large/attack_hand(mob/user, list/modifiers)
add_fingerprint(user)
if(manifest)
tear_manifest(user)
else
to_chat(user, span_warning("You need a crowbar to pry this open!"))
/obj/structure/closet/crate/large/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(user.combat_mode)
return ITEM_INTERACT_SKIP_TO_ATTACK //Stops it from opening and turning invisible when items are used on it.
to_chat(user, span_warning("You need a crowbar to pry this open!"))
return ITEM_INTERACT_BLOCKING //Just stop. Do nothing. Don't turn into an invisible sprite. Don't open like a locker.
//The large crate has no non-attack interactions other than the crowbar, anyway.
/obj/structure/closet/crate/large/crowbar_act(mob/living/user, obj/item/tool)
if(manifest)
tear_manifest(user)
if(!open(user))
return ITEM_INTERACT_BLOCKING
user.visible_message(span_notice("[user] pries \the [src] open."), \
span_notice("You pry open \the [src]."), \
span_hear("You hear splitting wood."))
playsound(src.loc, 'sound/items/weapons/slashmiss.ogg', 75, TRUE)
var/turf/dump = get_turf(src)
for(var/i in 1 to material_drop_amount)
new material_drop(src)
for(var/atom/movable/stuff in contents)
stuff.forceMove(dump)
qdel(src)
return ITEM_INTERACT_SUCCESS
/obj/structure/closet/crate/large/hats/PopulateContents()
..()
for (var/i in 1 to 5)
new /obj/effect/spawner/random/clothing/funny_hats(src)
if(prob(1))
var/our_contents = list()
for(var/obj/item/clothing/head/any_hat in contents)
our_contents[any_hat]++
if(our_contents)
var/obj/item/clothing/head/lucky_hat = pick(our_contents)
lucky_hat.AddComponent(/datum/component/unusual_effect, color = "#FFEA0030", include_particles = TRUE)
lucky_hat.name = "unusual [name]"