Moves a greater manyer morer things from attackby() to item_interaction() (#96739)

## About The Pull Request

50 files, plus additonal file that was necessary because I slightly
refactored windoor construction. This ended up like three and a half
times larger than most of the other ones, I really wasn't meaning for
that to happen. Maybe its because I more vigorously enforced the empty
line after every return thing. The only way to find out is to read 1700
lines of changes, and I don't feel like doing that again. I pinky
promise it all works, and I've tested every item changed individually.

Changes beyond conversion:
You can't welder down reinforced falsewalls anymore, pretty sure it was
an oversight because they're supposed to be taken down by wirecutters
You can right click to close gun lockers with an empty hand, because
otherwise you can't close the lockers at all if there's a gun in them
Meatspikes no longer runtime on construction due to the old trick of
balloon alert + qdel
Windoor assembly no longer SUCKS DICK!!, it's no longer storing
essentially a boolean in an undocumented number in a string, it no
longer requires a VERB to flip its direction.
on a related note, the creator of the windoor assembly construction
steps has been sent to live on a farm far out in the country

Also, a quick note about how these prs are gonna fuck everything up
until they're all together. There's a lot more places where `attackby()`
is directly called than I would have assumed, and given as those are
being changed to call `item_interaction()` potentially(usually) in a
different pr than the pr in which that atom's `attackby()` is actually
converted, that function's not going to work at all until both are
merged. The good news is that almost every instance this is happening,
it's pure convenience, where the user would have access to both items
anyway and could just manually call the attack chain by clicking them
together. Instances where this is not the case are being skipped over
until they can be packaged together to avoid the issue, but I'm not
bothering to do this on ones where the desync won't make an interaction
actually unusable, because that would require me to turn a 1700 line pr
into a 3500 line pr and I really was aiming for like 500

## Why It's Good For The Game

Ignore the paragraph about how I expect this to create a hostage
situation where the only fix to the bugs I make is to merge my other
prs, and instead think about how cool swing combat would be and how much
you want it

## Changelog
🆑
fix: you now can only use a wirecutter to take down a reinforced
falsewall
fix: meatspikes no longer runtime on construction
fix: you no longer have to use a verb that you can't use to flip windoor
assemblies

qol: you can right click a gun locker to close it

code: 50 files have been moved from attackby() to item_interaction()
/🆑
This commit is contained in:
Leland Kemble
2026-07-16 15:07:43 +02:00
committed by GitHub
parent 8586a2eb08
commit 06608081d2
51 changed files with 1697 additions and 1333 deletions
+108 -71
View File
@@ -506,6 +506,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0)
//2021 AND STILLLL GOING STRONG
//2022 BABYYYYY ~lewc
//2023 ONE YEAR TO GO! -LT3
//2026 just a week away - kemble
/datum/armor/window_reinforced
melee = 80
bomb = 25
@@ -517,79 +518,113 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0)
return list("delay" = 3 SECONDS, "cost" = 15)
return FALSE
/obj/structure/window/reinforced/attackby_secondary(obj/item/tool, mob/user, list/modifiers, list/attack_modifiers)
/obj/structure/window/reinforced/item_interaction_secondary(mob/living/user, obj/item/tool, list/modifiers)
if(resistance_flags & INDESTRUCTIBLE)
balloon_alert(user, "too resilient!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
return ITEM_INTERACT_BLOCKING
if(!tool.tool_behaviour)
return NONE
// to have gotten to this point, any tool must be innapropriate for its step
switch(state)
if(RWINDOW_SECURE)
if(tool.tool_behaviour == TOOL_WELDER)
if(tool.tool_start_check(user, heat_required = HIGH_TEMPERATURE_REQUIRED))
user.visible_message(span_notice("[user] holds \the [tool] to the security screws on \the [src]..."),
span_notice("You begin heating the security screws on \the [src]..."))
if(tool.use_tool(src, user, 15 SECONDS, volume = 100))
to_chat(user, span_notice("The security screws are glowing white hot and look ready to be removed."))
state = RWINDOW_BOLTS_HEATED
addtimer(CALLBACK(src, PROC_REF(cool_bolts)), 30 SECONDS)
else if (tool.tool_behaviour)
to_chat(user, span_warning("The security screws need to be heated first!"))
to_chat(user, span_warning("The security screws need to be heated first!"))
if(RWINDOW_BOLTS_HEATED)
if(tool.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(span_notice("[user] digs into the heated security screws and starts removing them..."),
span_notice("You dig into the heated screws hard and they start turning..."))
if(tool.use_tool(src, user, 50, volume = 50))
state = RWINDOW_BOLTS_OUT
to_chat(user, span_notice("The screws come out, and a gap forms around the edge of the pane."))
else if (tool.tool_behaviour)
to_chat(user, span_warning("The security screws need to be removed first!"))
to_chat(user, span_warning("The security screws need to be removed first!"))
if(RWINDOW_BOLTS_OUT)
if(tool.tool_behaviour == TOOL_CROWBAR)
user.visible_message(span_notice("[user] wedges \the [tool] into the gap in the frame and starts prying..."),
span_notice("You wedge \the [tool] into the gap in the frame and start prying..."))
if(tool.use_tool(src, user, 40, volume = 50))
state = RWINDOW_POPPED
to_chat(user, span_notice("The panel pops out of the frame, exposing some thin metal bars that looks like they can be cut."))
else if (tool.tool_behaviour)
to_chat(user, span_warning("The gap needs to be pried first!"))
to_chat(user, span_warning("The gap needs to be pried first!"))
if(RWINDOW_POPPED)
if(tool.tool_behaviour == TOOL_WIRECUTTER)
user.visible_message(span_notice("[user] starts cutting the exposed bars on \the [src]..."),
span_notice("You start cutting the exposed bars on \the [src]"))
if(tool.use_tool(src, user, 20, volume = 50))
state = RWINDOW_BARS_CUT
to_chat(user, span_notice("The panels falls out of the way exposing the frame bolts."))
else if (tool.tool_behaviour)
to_chat(user, span_warning("The bars need to be cut first!"))
to_chat(user, span_warning("The bars need to be cut first!"))
if(RWINDOW_BARS_CUT)
if(tool.tool_behaviour == TOOL_WRENCH)
user.visible_message(span_notice("[user] starts unfastening \the [src] from the frame..."),
span_notice("You start unfastening the bolts from the frame..."))
if(tool.use_tool(src, user, 40, volume = 50))
to_chat(user, span_notice("You unscrew the bolts from the frame and the window pops loose."))
state = WINDOW_OUT_OF_FRAME
set_anchored(FALSE)
else if (tool.tool_behaviour)
to_chat(user, span_warning("The bolts need to be loosened first!"))
to_chat(user, span_warning("The bolts need to be loosened first!"))
if (tool.tool_behaviour)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
return ..()
return ITEM_INTERACT_BLOCKING
/obj/structure/window/reinforced/crowbar_act(mob/living/user, obj/item/tool)
if(!anchored)
return FALSE
return NONE
if(state != WINDOW_OUT_OF_FRAME)
return FALSE
return NONE
to_chat(user, span_notice("You begin to lever the window back into the frame..."))
if(tool.use_tool(src, user, 10 SECONDS, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored)))
state = RWINDOW_SECURE
to_chat(user, span_notice("You pry the window back into the frame."))
if(!tool.use_tool(src, user, 10 SECONDS, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored)))
return ITEM_INTERACT_BLOCKING
state = RWINDOW_SECURE
to_chat(user, span_notice("You pry the window back into the frame."))
return ITEM_INTERACT_SUCCESS
/obj/structure/window/reinforced/welder_act_secondary(mob/living/user, obj/item/tool)
if(state != RWINDOW_SECURE)
return NONE // we got all that messaging for innapropriate tools, no skip to attack
if(!tool.tool_start_check(user, heat_required = HIGH_TEMPERATURE_REQUIRED))
return ITEM_INTERACT_BLOCKING
user.visible_message(span_notice("[user] holds \the [tool] to the security screws on \the [src]..."),
span_notice("You begin heating the security screws on \the [src]..."))
if(!tool.use_tool(src, user, 15 SECONDS, volume = 100))
return ITEM_INTERACT_BLOCKING
to_chat(user, span_notice("The security screws are glowing white hot and look ready to be removed."))
state = RWINDOW_BOLTS_HEATED
addtimer(CALLBACK(src, PROC_REF(cool_bolts)), 30 SECONDS)
return ITEM_INTERACT_SUCCESS
/obj/structure/window/reinforced/screwdriver_act_secondary(mob/living/user, obj/item/tool)
if(state != RWINDOW_BOLTS_HEATED)
return NONE
user.visible_message(span_notice("[user] digs into the heated security screws and starts removing them..."),
span_notice("You dig into the heated screws hard and they start turning..."))
if(!tool.use_tool(src, user, 5 SECONDS, volume = 50))
return ITEM_INTERACT_BLOCKING
state = RWINDOW_BOLTS_OUT
to_chat(user, span_notice("The screws come out, and a gap forms around the edge of the pane."))
return ITEM_INTERACT_SUCCESS
/obj/structure/window/reinforced/crowbar_act_secondary(mob/living/user, obj/item/tool)
if(state != RWINDOW_BOLTS_OUT)
return NONE
user.visible_message(span_notice("[user] wedges \the [tool] into the gap in the frame and starts prying..."),
span_notice("You wedge \the [tool] into the gap in the frame and start prying..."))
if(!tool.use_tool(src, user, 4 SECONDS, volume = 50))
return ITEM_INTERACT_BLOCKING
state = RWINDOW_POPPED
to_chat(user, span_notice("The panel pops out of the frame, exposing some thin metal bars that looks like they can be cut."))
return ITEM_INTERACT_SUCCESS
/obj/structure/window/reinforced/wirecutter_act_secondary(mob/living/user, obj/item/tool)
if(state != RWINDOW_POPPED)
return NONE
user.visible_message(span_notice("[user] starts cutting the exposed bars on \the [src]..."),
span_notice("You start cutting the exposed bars on \the [src]"))
if(!tool.use_tool(src, user, 2 SECONDS, volume = 50))
return ITEM_INTERACT_BLOCKING
state = RWINDOW_BARS_CUT
to_chat(user, span_notice("The panels falls out of the way exposing the frame bolts."))
return ITEM_INTERACT_SUCCESS
/obj/structure/window/reinforced/wrench_act_secondary(mob/living/user, obj/item/tool)
if(state != RWINDOW_BARS_CUT)
return NONE
user.visible_message(span_notice("[user] starts unfastening \the [src] from the frame..."),
span_notice("You start unfastening the bolts from the frame..."))
if(!tool.use_tool(src, user, 4 SECONDS, volume = 50))
return ITEM_INTERACT_BLOCKING
to_chat(user, span_notice("You unscrew the bolts from the frame and the window pops loose."))
state = WINDOW_OUT_OF_FRAME
set_anchored(FALSE)
return ITEM_INTERACT_SUCCESS
/obj/structure/window/proc/cool_bolts()
@@ -980,25 +1015,27 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/reinforced/tinted/frosted/spaw
. = ..()
. += (atom_integrity < max_integrity) ? torn : paper
/obj/structure/window/paperframe/attackby(obj/item/W, mob/living/user)
if(W.get_temperature() >= FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
fire_act(W.get_temperature())
return
/obj/structure/window/paperframe/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(tool.get_temperature() >= FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
fire_act(tool.get_temperature())
return ITEM_INTERACT_SUCCESS
if(user.combat_mode)
return ..()
return NONE
if(istype(W, /obj/item/paper) && atom_integrity < max_integrity)
user.visible_message(span_notice("[user] starts to patch the holes in \the [src]."))
if(do_after(user, 2 SECONDS, target = src))
atom_integrity = min(atom_integrity+4,max_integrity)
qdel(W)
user.visible_message(span_notice("[user] patches some of the holes in \the [src]."))
if(atom_integrity == max_integrity)
update_appearance()
return
..()
update_appearance()
if(!istype(tool, /obj/item/paper) || atom_integrity == max_integrity)
return NONE
user.visible_message(span_notice("[user] starts to patch the holes in \the [src]."))
if(!do_after(user, 2 SECONDS, target = src))
return ITEM_INTERACT_BLOCKING
atom_integrity = min(atom_integrity+4,max_integrity)
qdel(tool)
user.visible_message(span_notice("[user] patches some of the holes in \the [src]."))
if(atom_integrity == max_integrity)
update_appearance()
return ITEM_INTERACT_SUCCESS
/obj/structure/window/bronze
name = "brass window"