Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GP turret fixes #5194

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions code/game/machinery/os_portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -144,13 +144,10 @@
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 && issilicon(L)) //We shoot non GP robots
return TURRET_SECONDARY_TARGET
if(!should_target_players && ishuman(L))
return TURRET_NOT_TARGET

if(!should_target_players && !ishuman(L))
if(!should_target_players && issilicon(L)) //We shoot non GP robots
return TURRET_NOT_TARGET

return TURRET_PRIORITY_TARGET //if the perp has passed all previous tests, congrats, it is now a "shoot-me!" nominee
Expand Down Expand Up @@ -250,11 +247,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading