From 9a84f1ed267f963274ccb95f2bbf2986135d030b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rig=C3=B3=20J=C3=A1nos?= Date: Mon, 28 Aug 2023 13:11:24 +0200 Subject: [PATCH 1/2] Made machete cut in front --- code/game/objects/items/weapons/blades.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/game/objects/items/weapons/blades.dm b/code/game/objects/items/weapons/blades.dm index dccbf56049e0..497a01473ae4 100644 --- a/code/game/objects/items/weapons/blades.dm +++ b/code/game/objects/items/weapons/blades.dm @@ -32,6 +32,25 @@ icon_state = "machete" w_class = SIZE_LARGE +/obj/item/weapon/claymore/mercsword/machete/attack_self(mob/user) + if(user.action_busy) + return + + var/turf/root = get_turf(user) + var/facing = user.dir + // List containing the 3 tiles in front of the user + var/list/in_front = list(get_step(root, facing), get_step(root, turn(facing, 45)), get_step(root, turn(facing, -45))) + + // We check each tile in front of us, if it has flora that can be cut we will attempt to cut it + for(var/turf/current_turf in in_front) + for(var/obj/structure/flora/target in current_turf) + if(target.cut_level > 1) + if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) + return + target.attackby(src, user) + + return ..() + /obj/item/weapon/claymore/mercsword/machete/arnold name = "\improper M2100 \"Ngájhe\" machete" desc = "An older issue USCM machete, never left testing. Designed in the Central African Republic. The notching made it hard to clean, and as such the USCM refused to adopt it - despite the superior bludgeoning power offered. Difficult to carry with the usual kit." From 78d95b3c5d7446979f998897980462603e419c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rig=C3=B3=20J=C3=A1nos?= Date: Mon, 28 Aug 2023 23:53:03 +0200 Subject: [PATCH 2/2] Reduce to 1 tile --- code/game/objects/items/weapons/blades.dm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/weapons/blades.dm b/code/game/objects/items/weapons/blades.dm index 497a01473ae4..4b4b31539064 100644 --- a/code/game/objects/items/weapons/blades.dm +++ b/code/game/objects/items/weapons/blades.dm @@ -38,16 +38,14 @@ var/turf/root = get_turf(user) var/facing = user.dir - // List containing the 3 tiles in front of the user - var/list/in_front = list(get_step(root, facing), get_step(root, turn(facing, 45)), get_step(root, turn(facing, -45))) - - // We check each tile in front of us, if it has flora that can be cut we will attempt to cut it - for(var/turf/current_turf in in_front) - for(var/obj/structure/flora/target in current_turf) - if(target.cut_level > 1) - if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) - return - target.attackby(src, user) + var/turf/in_front = get_step(root, facing) + + // We check the tile in front of us, if it has flora that can be cut we will attempt to cut it + for(var/obj/structure/flora/target in in_front) + if(target.cut_level > 1) + if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) + return + target.attackby(src, user) return ..()