From 8defd1a41c19e4a379c01016f305eade01797dd5 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 16 Nov 2022 16:17:36 +0100 Subject: [PATCH] [MIRROR] Boxcutters and Switchblades are now both knives when they should be knives [MDB IGNORE] (#17497) * Boxcutters and Switchblades are now both knives when they should be knives (#71245) ## About The Pull Request The humble boxcutter always had knife tool behaviour turned to true instead of only being a knife when the blade is out, and its rulebreaking older brother the switch blade, despite having a description that calls it a knife, never had any knife tool behaviour. I have fixed both of these things. ## Why It's Good For The Game This is more consistent behaviour. ## Changelog :cl: fix: Boxcutter is only the knife tool when it is active fix: Switchblade is now a knife tool when it is active /:cl: Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Boxcutters and Switchblades are now both knives when they should be knives Co-authored-by: Sol N <116288367+flowercuco@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> --- code/game/objects/items/boxcutter.dm | 3 ++- code/game/objects/items/weaponry.dm | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/boxcutter.dm b/code/game/objects/items/boxcutter.dm index aa649f2960d..d6fc81fc82a 100644 --- a/code/game/objects/items/boxcutter.dm +++ b/code/game/objects/items/boxcutter.dm @@ -25,7 +25,7 @@ speed = 7 SECONDS, \ effectiveness = 100, \ ) - tool_behaviour = TOOL_KNIFE + AddComponent(/datum/component/transforming, \ start_transformed = start_extended, \ force_on = 10, \ @@ -45,5 +45,6 @@ on = active playsound(src, on_sound, 50) + tool_behaviour = (active ? TOOL_KNIFE : NONE) return COMPONENT_NO_DEFAULT_MESSAGE diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 5308cbb7c2c..55d7238b175 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -401,6 +401,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 speed = 7 SECONDS, \ effectiveness = 100, \ ) + AddComponent(/datum/component/transforming, \ start_transformed = start_extended, \ force_on = 20, \ @@ -410,7 +411,16 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 hitsound_on = 'sound/weapons/bladeslice.ogg', \ w_class_on = WEIGHT_CLASS_NORMAL, \ attack_verb_continuous_on = list("slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts"), \ - attack_verb_simple_on = list("slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")) + attack_verb_simple_on = list("slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut"), \ + ) + + RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) + +/obj/item/switchblade/proc/on_transform(obj/item/source, mob/user, active) + SIGNAL_HANDLER + + tool_behaviour = (active ? TOOL_KNIFE : NONE) + return COMPONENT_NO_DEFAULT_MESSAGE /obj/item/switchblade/suicide_act(mob/living/user) user.visible_message(span_suicide("[user] is slitting [user.p_their()] own throat with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))