From 522aea42f8620b2be09ef024000239b71b449961 Mon Sep 17 00:00:00 2001 From: Trilby Date: Fri, 19 Apr 2024 19:30:31 -0400 Subject: [PATCH 1/2] GP turret fixes --- code/game/machinery/os_portable_turret.dm | 23 +++++++++++-------- .../circuitboards/machinery/tesla_turret.dm | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/os_portable_turret.dm b/code/game/machinery/os_portable_turret.dm index c204bddddf4..b4c33e3070a 100644 --- a/code/game/machinery/os_portable_turret.dm +++ b/code/game/machinery/os_portable_turret.dm @@ -17,7 +17,7 @@ // Targeting var/should_target_players = TRUE // TRUE targets players, FALSE targets superior animals (roaches, golems, and spiders) - var/firing_range = 8 // Starts firing just out of player sight + var/firing_range = 7 // 15x15 atm, so we dont no-scope off screen target var/returning_fire = FALSE // Will attempt to fire at the nearest target when attacked and no one is in range var/last_target //last target fired at, prevents turrets from erratically firing at all valid targets in range @@ -43,7 +43,6 @@ /obj/machinery/power/os_turret/laser icon_state = "os_laser" circuit = /obj/item/circuitboard/os_turret/laser - firing_range = 10 projectile = /obj/item/projectile/beam/os_turret number_of_shots = 3 time_between_shots = 0.3 SECONDS @@ -53,7 +52,8 @@ /obj/machinery/power/os_turret/Initialize() . = ..() update_icon() - + RefreshParts() + firing_range = world.view if(!cooldown_time) cooldown_time = time_between_shots * number_of_shots @@ -144,15 +144,18 @@ if(!check_trajectory(L, src)) //check if we have true line of sight return TURRET_NOT_TARGET - if(should_target_players && ishuman(L)) - return TURRET_PRIORITY_TARGET + if(!should_target_players && ishuman(L)) + return TURRET_NOT_TARGET - if(should_target_players && issilicon(L)) //We shoot non GP robots - return TURRET_SECONDARY_TARGET + if(!should_target_players && issilicon(L)) //We shoot non GP robots + return TURRET_NOT_TARGET - if(!should_target_players && !ishuman(L)) + if(should_target_players && !ishuman(L)) return TURRET_NOT_TARGET + if(!should_target_players && !L.faction == "greyson") + return TURRET_PRIORITY_TARGET + return TURRET_PRIORITY_TARGET //if the perp has passed all previous tests, congrats, it is now a "shoot-me!" nominee @@ -250,11 +253,11 @@ /obj/machinery/power/os_turret/RefreshParts() var/obj/item/circuitboard/os_turret/C = circuit - should_target_players = !C.target_superior_mobs + should_target_players = C.should_target_players /obj/machinery/power/os_turret/on_deconstruction() var/obj/item/circuitboard/os_turret/C = circuit - C.target_superior_mobs = TRUE + C.should_target_players = FALSE /obj/machinery/power/os_turret/proc/take_damage(amount) health = max(health - amount, 0) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/tesla_turret.dm b/code/game/objects/items/weapons/circuitboards/machinery/tesla_turret.dm index 431bc6d08de..0ffcf5c37ec 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/tesla_turret.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/tesla_turret.dm @@ -19,7 +19,7 @@ /obj/item/stock_parts/scanning_module/one_star = 1, /obj/item/cell/large = 1 ) - var/target_superior_mobs = FALSE + var/should_target_players = TRUE /obj/item/circuitboard/os_turret/laser build_name = "Greyson Positronic laser turret" From 5944df73413156c86489fe635fa5b98fd2e8c582 Mon Sep 17 00:00:00 2001 From: Trilbyspaceclone <30435998+Trilbyspaceclone@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:38:24 -0400 Subject: [PATCH 2/2] Update os_portable_turret.dm --- code/game/machinery/os_portable_turret.dm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/game/machinery/os_portable_turret.dm b/code/game/machinery/os_portable_turret.dm index b4c33e3070a..489862837c2 100644 --- a/code/game/machinery/os_portable_turret.dm +++ b/code/game/machinery/os_portable_turret.dm @@ -150,12 +150,6 @@ if(!should_target_players && issilicon(L)) //We shoot non GP robots return TURRET_NOT_TARGET - if(should_target_players && !ishuman(L)) - return TURRET_NOT_TARGET - - if(!should_target_players && !L.faction == "greyson") - return TURRET_PRIORITY_TARGET - return TURRET_PRIORITY_TARGET //if the perp has passed all previous tests, congrats, it is now a "shoot-me!" nominee