mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
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>
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
/obj/item/psychic_power/tinker
|
|
name = "psychokinetic crowbar"
|
|
icon_state = "crowbar"
|
|
force = 11
|
|
tool_behaviour = TOOL_CROWBAR
|
|
var/list/tools = list(TOOL_CROWBAR, TOOL_WRENCH, TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
|
|
|
/obj/item/psychic_power/tinker/Initialize(mapload, ...)
|
|
. = ..()
|
|
var/list/new_tools = list()
|
|
for(var/tool_name in tools)
|
|
var/image/radial_image = image('icons/obj/psychic_powers.dmi', tool_name)
|
|
new_tools[capitalize_first_letters(tool_name)] = radial_image
|
|
tools = new_tools
|
|
|
|
/obj/item/psychic_power/tinker/attack_self(mob/user)
|
|
if(!owner || loc != owner)
|
|
return
|
|
|
|
var/choice = show_radial_menu(user, user, tools, radius = 42, tooltips = TRUE)
|
|
if(!choice)
|
|
playsound(get_turf(src), 'sound/effects/psi/power_fail.ogg', 40, TRUE)
|
|
owner.drop_from_inventory(src)
|
|
return
|
|
|
|
if(!owner || loc != owner)
|
|
return
|
|
|
|
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]."))
|
|
playsound(get_turf(src), 'sound/effects/psi/power_fabrication.ogg', 40, TRUE)
|