Files
GhomandGitHub 6eb2d1674a Implementing materials checks for techweb designs. (#96257)
## About The Pull Request
In similar fashion to what was done with crafting recipes last year,
this year it's time for techweb designs and printed items to be audited.
This is mostly just about consistency, we've a lot of items that can be
printed by protolathes, autolathes, circuit printers and techfab etc.
However they almost all (except most stacks, mainly) have custom
materials that do not match in one way or another with the materials
used by the design, which is what this PR is for.

"But items printed from lathes etc. already get the mats used to make
them." Yes, they do, however that isn't the case for items of the same
type that were spawned in some other way (cargo shuttle, space/maints
loot, mapped, admins), this create a subtle discrepancy. It isn't a huge
deal (in spite of the size of this PR, ton of designs), but given that I
have done something similar with crafting recipes before, I may as well
give it a second arc of some sort and bring things to completion. And
fix a few possible oversights.

TL;DR consistency and stuff

## Why It's Good For The Game
Consistency, unit test checks to make it harder not to be consistent in
the future. Still has a few TODOs like:

- [x] Fixed newly printed, fully charged RCDs costing less than the RCD
cartridges required to fully charge one. EDIT: I had to tweak the newly
added RDD as well because it suffered from the same fundamental issue.
- [x] Fixed plates being made of iron and yet shattering like ceramic
ones. A new subtype for metallic ones has been made.

## Changelog

🆑
refactor: Refactored a few things with techweb designs (the ones for
autolathes, protolathes, circuit printers, mechfabs etc.) to make sure
that the materials of items that can be made from these designs more
closely match the materials used to make them.
fix: Lizard fries no longer need a plate to be made, like all other
treats that used to require plates in a distant past.
balance: Tweaked the materials cost of RCD, RDD and RCD cartridges.
image: Oven trays now have a more metallic hue.
balance: Plates printed printed from lathes won't shatter like ceramic
ones, in virtue of them being made out of iron instead.
/🆑
2026-07-06 00:13:02 -07:00

116 lines
4.4 KiB
Plaintext

/**********************Mining Scanners**********************/
/obj/item/mining_scanner
desc = "A scanner that checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations."
name = "manual mining scanner"
icon = 'icons/obj/devices/scanner.dmi'
icon_state = "manual_mining"
inhand_icon_state = "analyzer"
worn_icon_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
obj_flags = CONDUCTS_ELECTRICITY
slot_flags = ITEM_SLOT_BELT
/// The cooldown between scans.
var/cooldown = 35
/// Current time until the next scan can be performed.
var/current_cooldown = 0
/obj/item/mining_scanner/attack_self(mob/user)
if(!user.client)
return
if(current_cooldown <= world.time)
current_cooldown = world.time + cooldown
mineral_scan_pulse(get_turf(user), scanner = src)
//Debug item to identify all ore spread quickly
/obj/item/mining_scanner/admin
/obj/item/mining_scanner/admin/attack_self(mob/user)
for(var/turf/closed/mineral/rock in world)
if(rock.scan_state)
var/mutable_appearance/rock_overlay = mutable_appearance(rock.scan_icon, rock.scan_state, FLASH_LAYER, rock, ABOVE_LIGHTING_PLANE, appearance_flags = RESET_TRANSFORM)
rock.add_overlay(rock_overlay)
qdel(src)
/obj/item/t_scanner/adv_mining_scanner
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. This one has an extended range."
name = "advanced automatic mining scanner"
icon_state = "advmining0"
inhand_icon_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
obj_flags = CONDUCTS_ELECTRICITY
slot_flags = ITEM_SLOT_BELT
/// The cooldown between scans.
var/cooldown = 35
/// Current time until the next scan can be performed.
var/current_cooldown = 0
/// The range of the scanner in tiles.
var/range = 7
//get no effects from the t-ray scanner, which auto-shuts off.
/obj/item/t_scanner/adv_mining_scanner/cyborg_unequip(mob/user)
return
/obj/item/t_scanner/adv_mining_scanner/cyborg/Initialize(mapload)
. = ..()
toggle_on()
/obj/item/t_scanner/adv_mining_scanner/lesser
name = "automatic mining scanner"
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations."
icon_state = "mining0"
range = 4
cooldown = 50
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT, /datum/material/glass = HALF_SHEET_MATERIAL_AMOUNT, /datum/material/silver = HALF_SHEET_MATERIAL_AMOUNT)
/obj/item/t_scanner/adv_mining_scanner/scan()
if(current_cooldown <= world.time)
current_cooldown = world.time + cooldown
var/turf/t = get_turf(src)
mineral_scan_pulse(t, range, src)
/proc/mineral_scan_pulse(turf/start_turf, range = world.view, obj/item/scanner)
var/vents_nearby = FALSE
var/undiscovered = FALSE
var/radar_volume = 30
for(var/obj/structure/ore_vent/vent in range(range, start_turf))
if(!vents_nearby && (!vent.discovered || !vent.tapped))
vents_nearby = TRUE
if(vent.discovered)
undiscovered = TRUE
var/potential_volume = 80 - (get_dist(scanner, vent) * 10)
radar_volume = max(potential_volume, radar_volume)
vent.add_mineral_overlays()
for(var/turf/closed/mineral/mineral in RANGE_TURFS(range, start_turf))
if(mineral.scan_state)
mineral.flash_scan()
if(vents_nearby && scanner)
if(undiscovered)
playsound(scanner, 'sound/machines/radar-ping.ogg', radar_volume, FALSE)
scanner.balloon_alert_to_viewers("ore vent nearby")
else
playsound(scanner, 'sound/machines/sonar-ping.ogg', radar_volume, FALSE)
scanner.spasm_animation(1.5 SECONDS)
/obj/effect/temp_visual/mining_overlay
plane = HIGH_GAME_PLANE
layer = FLASH_LAYER
icon = 'icons/blanks/480x480.dmi'
icon_state = "nothing"
appearance_flags = NONE // to avoid having TILE_BOUND in the flags, so that the 480x480 icon states let you see it no matter where you are
duration = 3.5 SECONDS
pixel_x = -224
pixel_y = -224
/// What animation easing to use when we create the ore overlay on rock walls/ore vents.
var/easing_style = EASE_IN
/obj/effect/temp_visual/mining_overlay/Initialize(mapload)
. = ..()
animate(src, alpha = 0, time = duration, easing = easing_style)