Tool Qualities Framework (#22380)

This PR adds a framework for Tool Qualities. This is done via adding a
new Tool Quality Container Component, which allows any arbitrary datum
to have tool qualities, which can be checked for by other systems as
desired. These are handled as key/value pairs in an associative list,
allowing atoms to have different quality levels as a given tool, such as
being a "level 3 crowbar" and a "level 1 hammer" at the same time.

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
Co-authored-by: Batrachophreno <Batrochophreno@gmail.com>
This commit is contained in:
VMSolidus
2026-05-15 16:49:58 +00:00
committed by GitHub
co-authored by Batrachophreno
parent ed20d4d9a9
commit 1f9b926ed7
12 changed files with 91 additions and 3 deletions
+1
View File
@@ -366,6 +366,7 @@
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked", "slashed", "cut")
sharp = TRUE
tool_behaviour = TOOL_CROWBAR
tool_quality = STANDARD_TOOL_LEVEL - 2
// Flags.
@@ -3,7 +3,7 @@
icon_state = "crowbar"
force = 11
tool_behaviour = TOOL_CROWBAR
var/list/tools = list("crowbar", "wrench", "screwdriver", "cutters")
var/list/tools = list(TOOL_CROWBAR, TOOL_WRENCH, TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
/obj/item/psychic_power/tinker/Initialize(mapload, ...)
. = ..()
@@ -26,7 +26,8 @@
if(!owner || loc != owner)
return
tool_behaviour = lowertext(choice)
tool_behaviour = choice
LOAD_TOOL_QUALITIES(src, alist(choice = owner.check_psi_sensitivity()), toolComp)
name = "psychokinetic [tool_behaviour]"
icon_state = tool_behaviour
to_chat(owner, SPAN_NOTICE("You begin emulating \a [tool_behaviour]."))