The big tooltype_act de-cargo-cult-ing (#95408)

## About The Pull Request

Removes a lot of cargo cult copypasta with
`default_deconstruction_screwdriver`, `default_deconstruction_crowbar`,
and to a lesser extent `default_pry_open` and
`default_change_direction_wrench`

ALL you gotta do now if you want your machine to have an openable panel
or be deconstructible with a crowbar is this
```dm
/obj/machinery/dish_drive/screwdriver_act(mob/living/user, obj/item/tool)
	return default_deconstruction_screwdriver(user, tool)

/obj/machinery/dish_drive/crowbar_act(mob/living/user, obj/item/tool)
	return default_deconstruction_crowbar(user, tool)
```

`default_deconstruction_screwdriver` no longer directly sets
`icon_state`, requiring the user pass in the open and closed icon
states. Now, it just calls `update_appearance`, and everything that once
passed the icon state now uses `base_icon_state` and
`update_icon_state`.

## Why It's Good For The Game

Many of these procs were terribly overcomplicated and difficult to work
with for what should be a relatively simple action

Streamlining it makes it easier for coders to understand and work with

## Changelog

🆑 Melbert
refactor: A majority of machines had their screwdriver/crowbar/wrench
interactions rewritten, report any oddities like being unable to open a
machine's panel or deconstruct a machine
/🆑
This commit is contained in:
MrMelbert
2026-04-14 18:46:24 -05:00
committed by GitHub
parent 2f5f386231
commit 4eadf5caf7
121 changed files with 1141 additions and 1291 deletions
@@ -3,6 +3,7 @@
desc = "You shouldn't be seeing this! And bouldertech isn't even a real company!"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "ore_redemption"
base_icon_state = "ore_redemption"
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.5
anchored = TRUE
density = TRUE
@@ -98,7 +99,7 @@
var/suffix = ""
if(!anchored || panel_open || !is_operational || (machine_stat & (BROKEN | NOPOWER)))
suffix = "-off"
icon_state ="[initial(icon_state)][suffix]"
icon_state ="[base_icon_state][suffix]"
/obj/machinery/bouldertech/CanAllowThrough(atom/movable/mover, border_dir)
if(!anchored)
@@ -290,15 +291,10 @@
return ITEM_INTERACT_SUCCESS
/obj/machinery/bouldertech/screwdriver_act(mob/living/user, obj/item/tool)
. = ITEM_INTERACT_BLOCKING
if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-off", initial(icon_state), tool))
update_appearance(UPDATE_ICON_STATE)
return ITEM_INTERACT_SUCCESS
return default_deconstruction_screwdriver(user, tool)
/obj/machinery/bouldertech/crowbar_act(mob/living/user, obj/item/tool)
. = ITEM_INTERACT_BLOCKING
if(default_deconstruction_crowbar(tool))
return ITEM_INTERACT_SUCCESS
return default_deconstruction_crowbar(user, tool)
/obj/machinery/bouldertech/attack_hand_secondary(mob/user, list/modifiers)
. = ..()
@@ -14,6 +14,7 @@
desc = "A teleportation matrix used to retrieve boulders excavated by mining NODEs from ore vents."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "brm"
base_icon_state = "brm"
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.5
circuit = /obj/item/circuitboard/machine/brm
processing_flags = START_PROCESSING_MANUALLY
@@ -72,7 +73,7 @@
. += span_notice("The whole machine can be [EXAMINE_HINT("pried")] apart.")
/obj/machinery/brm/update_icon_state()
icon_state = initial(icon_state)
icon_state = base_icon_state
if(!anchored || !is_operational || machine_stat & (BROKEN | NOPOWER) || panel_open)
icon_state = "[icon_state]-off"
@@ -91,15 +92,10 @@
return ITEM_INTERACT_SUCCESS
/obj/machinery/brm/screwdriver_act(mob/living/user, obj/item/tool)
. = ITEM_INTERACT_BLOCKING
if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-off", initial(icon_state), tool))
update_appearance(UPDATE_ICON_STATE)
return ITEM_INTERACT_SUCCESS
return default_deconstruction_screwdriver(user, tool)
/obj/machinery/brm/crowbar_act(mob/living/user, obj/item/tool)
. = ITEM_INTERACT_BLOCKING
if(default_deconstruction_crowbar(tool))
return ITEM_INTERACT_SUCCESS
return default_deconstruction_crowbar(user, tool)
///To allow boulders on a conveyor belt to move unobstructed if multiple machines are made on a single line
/obj/machinery/brm/CanAllowThrough(atom/movable/mover, border_dir)
@@ -7,6 +7,7 @@
name = "boulder refinery"
desc = "BR for short. Accepts boulders and refines non-metallic ores into sheets using internal chemicals."
icon_state = "stacker"
base_icon_state = "stacker"
circuit = /obj/item/circuitboard/machine/refinery
usage_sound = 'sound/machines/mining/refinery.ogg'
action = "crushing"
@@ -45,6 +46,7 @@
name = "boulder smelter"
desc = "BS for short. Accept boulders and refines metallic ores into sheets."
icon_state = "smelter"
base_icon_state = "smelter"
light_system = OVERLAY_LIGHT
light_range = 2
light_power = 3
@@ -55,7 +57,7 @@
/obj/machinery/bouldertech/refinery/smelter/Initialize(mapload)
. = ..()
set_light_on(TRUE)
update_light_value()
/obj/machinery/bouldertech/refinery/smelter/can_process_material(datum/material/possible_mat)
var/static/list/processable_materials
@@ -69,21 +71,17 @@
)
return is_type_in_list(possible_mat, processable_materials)
/obj/machinery/bouldertech/refinery/smelter/set_light_on(new_value)
if(panel_open || !anchored || !is_operational || machine_stat & (BROKEN | NOPOWER))
new_value = FALSE
return ..()
/obj/machinery/bouldertech/refinery/smelter/proc/update_light_value()
set_light_on(!panel_open && anchored && is_operational)
/obj/machinery/bouldertech/refinery/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver)
. = ..()
set_light_on(TRUE)
/obj/machinery/bouldertech/refinery/default_unfasten_wrench(mob/user, obj/item/wrench, time)
. = ..()
set_light_on(TRUE)
/obj/machinery/bouldertech/refinery/smelter/on_set_anchored(atom/movable/source, anchorvalue)
update_light_value()
/obj/machinery/bouldertech/refinery/smelter/on_set_is_operational(old_value)
set_light_on(TRUE)
update_light_value()
/obj/machinery/bouldertech/refinery/smelter/on_set_panel_open(old_value)
update_light_value()
/obj/machinery/bouldertech/refinery/smelter/maim_golem(mob/living/carbon/human/rockman)
rockman.visible_message(span_warning("[rockman] is processed by [src]!"), span_userdanger("You get melted into rock by [src]!"))