mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
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:
@@ -353,18 +353,11 @@
|
||||
user.put_in_hands(previous_bci_to_implant)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/machinery/bci_implanter/attackby_secondary(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if (!occupant && default_deconstruction_screwdriver(user, icon_state, icon_state, weapon))
|
||||
update_appearance()
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
/obj/machinery/bci_implanter/screwdriver_act_secondary(mob/living/user, obj/item/tool)
|
||||
return isnull(occupant) ? default_deconstruction_screwdriver(user, tool) : NONE
|
||||
|
||||
if (default_pry_open(weapon, close_after_pry = FALSE, open_density = FALSE, closed_density = TRUE))
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
if (default_deconstruction_crowbar(weapon))
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
/obj/machinery/bci_implanter/crowbar_act_secondary(mob/living/user, obj/item/tool)
|
||||
return default_pry_open(user, user, tool, close_after_pry = FALSE, open_density = FALSE, closed_density = TRUE, deconstruct_on_fail = TRUE)
|
||||
|
||||
/obj/machinery/bci_implanter/proc/start_process()
|
||||
if (machine_stat & (NOPOWER|BROKEN))
|
||||
|
||||
Reference in New Issue
Block a user