mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
Craftable material sniffers (#74798)
## About The Pull Request Are YOU annoyed about never finding the fucking mats you need? Slap some cable coil on an analyzer and find that untouched sheet of iron and or glass. It's a pinpointer for basic sheets. ## Why It's Good For The Game Originally I meant to give this as something borgs might want, but I realized they really won't have a great time using it and the situation is more about botanists not being asked, and not knowing how to grow lots of iron, repeat for all other departments. Awareness problems!!! But I still like the item as a miscellaneous craftable. ## Changelog 🆑 add: Craftable Material sniffers /🆑 --------- Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
This commit is contained in:
@@ -216,3 +216,38 @@
|
||||
/obj/item/pinpointer/shuttle/Destroy()
|
||||
shuttleport = null
|
||||
. = ..()
|
||||
|
||||
///list of all sheets with sniffable = TRUE for the sniffer to locate
|
||||
GLOBAL_LIST_EMPTY(sniffable_sheets)
|
||||
|
||||
/obj/item/pinpointer/material_sniffer
|
||||
name = "material sniffer"
|
||||
desc = "A handheld tracking device that locates sheets of glass and iron."
|
||||
icon_state = "pinpointer_sniffer"
|
||||
worn_icon_state = "pinpointer_black"
|
||||
|
||||
/obj/item/pinpointer/material_sniffer/scan_for_target()
|
||||
if(target)
|
||||
return
|
||||
var/obj/item/stack/sheet/new_sheet_target
|
||||
var/closest_distance = INFINITY
|
||||
for(var/obj/item/stack/sheet/potential_sheet as anything in GLOB.sniffable_sheets)
|
||||
// not enough for lag reasons, and shouldn't even be on this
|
||||
if(potential_sheet.amount < 10)
|
||||
GLOB.sniffable_sheets -= potential_sheet
|
||||
continue
|
||||
//held by someone
|
||||
if(isliving(potential_sheet.loc))
|
||||
continue
|
||||
//not on scanner's z
|
||||
if(potential_sheet.z != z)
|
||||
continue
|
||||
var/distance_from_sniffer = get_dist(src, potential_sheet)
|
||||
if(distance_from_sniffer < closest_distance)
|
||||
closest_distance = distance_from_sniffer
|
||||
new_sheet_target = potential_sheet
|
||||
if(!new_sheet_target)
|
||||
target = null
|
||||
return
|
||||
say("Located [new_sheet_target.amount] [new_sheet_target.singular_name]s!")
|
||||
target = new_sheet_target
|
||||
|
||||
Reference in New Issue
Block a user