[MIRROR] Allows you to change the blade color of toy swords with a screwdriver [MDB IGNORE] (#16792)

* Allows you to change the blade color of toy swords with a screwdriver (#70376)

Requires #70364

cl ShizCalev
qol: You can now change the color of toy energy swords with a screwdriver!
/cl

* Allows you to change the blade color of toy swords with a screwdriver

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-10-12 00:21:56 -04:00
committed by GitHub
co-authored by ShizCalev
parent 36f5cc2135
commit b33260d06f
+27
View File
@@ -402,6 +402,13 @@
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, .proc/on_transform)
AddElement(/datum/element/update_icon_updates_onmob)
var/static/list/tool_behaviors = list(
TOOL_SCREWDRIVER = list(
SCREENTIP_CONTEXT_LMB = "Change blade color"
),
)
AddElement(/datum/element/contextual_screentip_tools, tool_behaviors)
/*
* Signal proc for [COMSIG_TRANSFORMING_ON_TRANSFORM].
*
@@ -414,6 +421,26 @@
update_appearance(UPDATE_ICON)
return COMPONENT_NO_DEFAULT_MESSAGE
/obj/item/toy/sword/examine(mob/user)
. = ..()
. += span_notice("It has a lighting dial currently set to [saber_color] which looks like it can be turned with a <b>screwdriver</b>.")
/obj/item/toy/sword/screwdriver_act(mob/living/user, obj/item/tool)
switch(saber_color)
if("red")
saber_color = "blue"
if("blue")
saber_color = "green"
if("green")
saber_color = "purple"
if("purple")
saber_color = "red"
else
return TOOL_ACT_TOOLTYPE_SUCCESS
balloon_alert(user, "changed to [saber_color]")
update_appearance(UPDATE_ICON)
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/item/toy/sword/vv_edit_var(vname, vval)
. = ..()
if(vname == NAMEOF(src, saber_color))