mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 07:08:03 +01:00
f8d6a01a37
## About The Pull Request Pretty simple one this time. Cleans up pinpointer code, previously the ranges at which pinpointer arrows determined how close you were to an object were hardcoded numbers, now I've moved those numbers over to a set of variables so you can determine what's close/medium/far. Autodocs pinpointer variables and subtype variables as well. Removed a functionally useless variable off of crew pinpointers, moving from a boolean-`has_owner` to just checking against the assigned `pinpointer_owner` mob. Lastly, tweaked some of the numbers on the ventpointer, a pinpointer purchasable by shaft miners for points. Namely, I've lowered it's minimum range to 8 from 14, meaning that you can get closer before it says that you've arrived at your vent, as before you could still be completely off screen and be unable to find the vent. In addition, I adjusted the close and medium range variables to be wider than the standard range, since in practice using the ventpointer in-round tends to just show a red arrow for the vast majority of the time you're using it. ## Why It's Good For The Game Pinpointer code improvements were mostly because I was in the area and in theory, pinpointer code should be more flexible considering how much of the game's core game-modes rely on pinpointers to function properly. On ventpointers, these things are clearly meant to be somewhat inaccurate, but due to having the distance values on pinpointers hardcoded, It was previously impossible to ever even reach close range on the vent before it claimed you had arrived. I've lowered the close range value to be in the ballpark of a single screenwidth of tiles in all directions, and adjusted the other colors so that you can get a better idea if you've switched vent targets. As a result, the ventpointer should be a more valuable investment as a direct result. ## Changelog 🆑 balance: The mining ventpointer has been adjusted so that it can now more accurately show the distance to the nearest vent, and will now claim you've arrived if you're within 8 tiles away from a vent, down from 14. code: Several backend improvements to the pinpointer functionality and adjustability. /🆑
22 lines
615 B
Plaintext
22 lines
615 B
Plaintext
/obj/item/pinpointer/vent
|
|
name = "ventpointer"
|
|
desc = "A handheld tracking device. It will locate and point to nearby vents. A bit unreliable though."
|
|
icon_state = "pinpointer_vent"
|
|
minimum_range = 8 //gotta use them eyes
|
|
close_range = 12
|
|
medium_range = 20
|
|
|
|
/obj/item/pinpointer/vent/scan_for_target()
|
|
var/closest_dist = INFINITY
|
|
|
|
for(var/obj/structure/ore_vent/vent in SSore_generation.possible_vents)
|
|
if(vent.discovered || vent.tapped)
|
|
continue
|
|
if(vent.z != loc.z)
|
|
continue
|
|
|
|
var/target_dist = get_dist(src, vent)
|
|
if(target_dist < closest_dist)
|
|
closest_dist = target_dist
|
|
target = vent
|