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:
tralezab
2023-04-28 18:15:16 -07:00
committed by GitHub
parent 1e61ac2f19
commit fefd9aa4ea
6 changed files with 64 additions and 0 deletions
@@ -142,6 +142,17 @@
result = /obj/item/ore_sensor
category = CAT_EQUIPMENT
/datum/crafting_recipe/material_sniffer
name = "Material Sniffer"
time = 3 SECONDS
reqs = list(
/obj/item/analyzer = 1,
/obj/item/stack/cable_coil = 5,
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
result = /obj/item/pinpointer/material_sniffer
category = CAT_EQUIPMENT
/datum/crafting_recipe/pressureplate
name = "Pressure Plate"
result = /obj/item/pressure_plate
+35
View File
@@ -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
@@ -32,6 +32,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
matter_amount = 4
cost = 500
source = /datum/robot_energy_storage/glass
sniffable = TRUE
/datum/armor/sheet_glass
fire = 50
@@ -152,6 +152,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
cost = 500
source = /datum/robot_energy_storage/iron
stairs_type = /obj/structure/stairs
sniffable = TRUE
/obj/item/stack/sheet/iron/Initialize(mapload)
. = ..()
@@ -17,11 +17,27 @@
var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity.
///What type of wall does this sheet spawn
var/walltype
/// whether this sheet can be sniffed by the material sniffer
var/sniffable = FALSE
/obj/item/stack/sheet/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1)
. = ..()
pixel_x = rand(-4, 4)
pixel_y = rand(-4, 4)
if(sniffable && is_station_level(z) && amount < 10)
GLOB.sniffable_sheets += src
/obj/item/stack/sheet/Destroy(force)
if(sniffable)
GLOB.sniffable_sheets -= src
return ..()
/obj/item/stack/sheet/add(_amount)
. = ..()
if(sniffable && is_station_level(z) && amount > 10)
GLOB.sniffable_sheets += src
/// removing from sniffable handled by the sniffer itself when it checks for targets
/**
* Facilitates sheets being smacked on the floor
Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB