From 17164bc25e53d3c11750da844f931d318bb8f800 Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:32:39 +0100 Subject: [PATCH 1/7] Update smartgun_mount.dm --- code/modules/cm_marines/smartgun_mount.dm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 308fb79574f6..8e39eadde18a 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -44,6 +44,8 @@ icon_state = "M56D_gun_e" var/rounds = 0 // How many rounds are in the weapon. This is useful if we break down our guns. var/has_mount = FALSE // Indicates whether the M56D will come with its folding mount already attached + var/defense_check_range = 2 + var/can_be_near_defense = FALSE /obj/item/device/m56d_gun/Initialize(mapload, ...) . = ..() @@ -84,7 +86,11 @@ /obj/item/device/m56d_gun/attack_self(mob/user) ..() - + if(!can_be_near_defense) + for(var/obj/structure/machinery/machine in urange(defense_check_range, loc)) + if(istype(machine, var/obj/structure/machinery/m56d_hmg) || istype(machine, var/obj/structure/machinery/m56d_post) + to_chat(user, SPAN_WARNING("This is too close to [machine]!")) + return if(!ishuman(user)) return if(!has_mount) @@ -125,6 +131,11 @@ if(!do_after(user, 1 SECONDS, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) return + if(!can_be_near_defense) + for(var/obj/structure/machinery/machine in urange(defense_check_range, loc)) + if(istype(machine, var/obj/structure/machinery/m56d_hmg) || istype(machine, var/obj/structure/machinery/m56d_post) + to_chat(user, SPAN_WARNING("This is too close to [machine]!")) + return var/obj/structure/machinery/m56d_post/M = new /obj/structure/machinery/m56d_post(user.loc) M.setDir(user.dir) // Make sure we face the right direction From 08bf949fa6128b1ec064bb65323ee860bf4ac1bf Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:29:20 +0100 Subject: [PATCH 2/7] Update smartgun_mount.dm --- code/modules/cm_marines/smartgun_mount.dm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 8e39eadde18a..9a0be8c7c2e5 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -45,7 +45,6 @@ var/rounds = 0 // How many rounds are in the weapon. This is useful if we break down our guns. var/has_mount = FALSE // Indicates whether the M56D will come with its folding mount already attached var/defense_check_range = 2 - var/can_be_near_defense = FALSE /obj/item/device/m56d_gun/Initialize(mapload, ...) . = ..() @@ -86,11 +85,10 @@ /obj/item/device/m56d_gun/attack_self(mob/user) ..() - if(!can_be_near_defense) - for(var/obj/structure/machinery/machine in urange(defense_check_range, loc)) - if(istype(machine, var/obj/structure/machinery/m56d_hmg) || istype(machine, var/obj/structure/machinery/m56d_post) - to_chat(user, SPAN_WARNING("This is too close to [machine]!")) - return + for(var/obj/structure/machinery/machine in urange(defense_check_range, loc)) + if(istype(machine, /obj/structure/machinery/m56d_hmg) || istype(machine, /obj/structure/machinery/m56d_post)) + to_chat(user, SPAN_WARNING("This is too close to [machine]!")) + return if(!ishuman(user)) return if(!has_mount) @@ -131,11 +129,10 @@ if(!do_after(user, 1 SECONDS, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) return - if(!can_be_near_defense) - for(var/obj/structure/machinery/machine in urange(defense_check_range, loc)) - if(istype(machine, var/obj/structure/machinery/m56d_hmg) || istype(machine, var/obj/structure/machinery/m56d_post) - to_chat(user, SPAN_WARNING("This is too close to [machine]!")) - return + for(var/obj/structure/machinery/machine in urange(defense_check_range, loc)) + if(istype(machine, /obj/structure/machinery/m56d_hmg) || istype(machine, /obj/structure/machinery/m56d_post)) + to_chat(user, SPAN_WARNING("This is too close to [machine]!")) + return var/obj/structure/machinery/m56d_post/M = new /obj/structure/machinery/m56d_post(user.loc) M.setDir(user.dir) // Make sure we face the right direction From b9fdbc6cc48128c33b03782e2c615b90aa6e9c8f Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:49:57 +0100 Subject: [PATCH 3/7] Update smartgun_mount.dm --- code/modules/cm_marines/smartgun_mount.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 9a0be8c7c2e5..90344e209568 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -44,7 +44,7 @@ icon_state = "M56D_gun_e" var/rounds = 0 // How many rounds are in the weapon. This is useful if we break down our guns. var/has_mount = FALSE // Indicates whether the M56D will come with its folding mount already attached - var/defense_check_range = 2 + var/defense_check_range = 5 /obj/item/device/m56d_gun/Initialize(mapload, ...) . = ..() From 7307c22b31259314c0c3adbeb45e18dc19fd145f Mon Sep 17 00:00:00 2001 From: vincibrv Date: Sun, 24 Dec 2023 13:23:49 +0100 Subject: [PATCH 4/7] final touches --- code/modules/cm_marines/smartgun_mount.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 90344e209568..5449cb78fd40 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -315,6 +315,10 @@ if(istype(O,/obj/item/device/m56d_gun)) //lets mount the MG onto the mount. var/obj/item/device/m56d_gun/MG = O + for(var/obj/structure/machinery/machine in urange(MG.defense_check_range, loc,1)) + if(istype(machine, /obj/structure/machinery/m56d_hmg) || istype(machine, /obj/structure/machinery/m56d_post)) + to_chat(user, SPAN_WARNING("This is too close to [machine]!")) + return if(!anchored) to_chat(user, SPAN_WARNING("[src] must be anchored! Use a screwdriver!")) return From b82b940d244adab67e0c08e8c3ff42cc73130e30 Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:19:26 +0100 Subject: [PATCH 5/7] Update code/modules/cm_marines/smartgun_mount.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/cm_marines/smartgun_mount.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 5449cb78fd40..05b9c6fa436f 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -315,7 +315,7 @@ if(istype(O,/obj/item/device/m56d_gun)) //lets mount the MG onto the mount. var/obj/item/device/m56d_gun/MG = O - for(var/obj/structure/machinery/machine in urange(MG.defense_check_range, loc,1)) + for(var/obj/structure/machinery/machine in urange(MG.defense_check_range, loc, TRUE)) if(istype(machine, /obj/structure/machinery/m56d_hmg) || istype(machine, /obj/structure/machinery/m56d_post)) to_chat(user, SPAN_WARNING("This is too close to [machine]!")) return From 7584ff8a3064456e003342b957c7e02e0d406a78 Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:19:39 +0100 Subject: [PATCH 6/7] Update code/modules/cm_marines/smartgun_mount.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/cm_marines/smartgun_mount.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 05b9c6fa436f..0208dea56844 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -44,6 +44,7 @@ icon_state = "M56D_gun_e" var/rounds = 0 // How many rounds are in the weapon. This is useful if we break down our guns. var/has_mount = FALSE // Indicates whether the M56D will come with its folding mount already attached + ///The distance this has to be away from other m56d_hmg and m56d_post to be placed. var/defense_check_range = 5 /obj/item/device/m56d_gun/Initialize(mapload, ...) From 66d543fe3396752dcb8259baf1e6ede954cbd538 Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:19:53 +0100 Subject: [PATCH 7/7] Update code/modules/cm_marines/smartgun_mount.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/cm_marines/smartgun_mount.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 0208dea56844..c50be0c679f2 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -42,8 +42,10 @@ flags_equip_slot = SLOT_BACK icon = 'icons/turf/whiskeyoutpost.dmi' icon_state = "M56D_gun_e" - var/rounds = 0 // How many rounds are in the weapon. This is useful if we break down our guns. - var/has_mount = FALSE // Indicates whether the M56D will come with its folding mount already attached + ///How many rounds are in the weapon. This is useful if we break down our guns. + var/rounds = 0 + ///Indicates whether the M56D will come with its folding mount already attached + var/has_mount = FALSE ///The distance this has to be away from other m56d_hmg and m56d_post to be placed. var/defense_check_range = 5