Files
Ghom a28575aa82 [NO GBP] Fixing more issues with sand (you can make sand walls again, also ghost glass sheets?) (#93215)
## About The Pull Request
Apparently wall construction code is snowflaked and indented as fuck
(and the same goes for door assemblies). I'm not bothering refactoring
everything with them, only to reduce the indentation, changing a couple
vars and overall making it easier to work with them later. This includes
wall construction not being hardcoded to sheets but include the
possibility to use other kind of stacks as well (if you don't count the
snowflake interaction with iron rods). In layman's terms, this means you
can make walls made out of sand (distinct from sandstone) again.

Also I've done some small changes to the materials storage, so that it
can eject ores too if the material doesn't have a sheet type.

Also, I've been told there may be issues with broken, uninteractable
(probably not properly initialized) glass sheets beside the ORM. I'm not
100% sure about the deets, but it may have something to do with spawning
the glass on the same turf the ORM is listening to, when smelting sand,
causing some race conditions, so let's spawn it in nullspace

## Why It's Good For The Game
While I'm sure there may be more elegant solutions (just take a look at
the wall and door construction code, they both use text2path oh god!),
I'm just here to make things a lil' cleaner and be done with issues with
the fact that sand is made of sand.

## Changelog

🆑
fix: You can once again make sand walls.
fix: Deconstructing an autolathe with sand in it should now drop sand.
/🆑
2025-10-02 19:12:11 +03:00

117 lines
4.5 KiB
Plaintext

// Note, the order these in are deliberate, as it affects
// the order they are shown via radial.
GLOBAL_LIST_INIT(runed_metal_recipes, list( \
new /datum/stack_recipe/radial( \
title = "pylon", \
result_type = /obj/structure/destructible/cult/pylon, \
req_amount = 4, \
time = 4 SECONDS, \
crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, \
desc = span_cult_bold("Pylon: Heals and regenerates the blood of nearby blood cultists and constructs, and also \
converts nearby floor tiles into engraved flooring, which allows blood cultists to scribe runes faster."), \
required_noun = "runed metal sheet", \
category = CAT_CULT, \
), \
new /datum/stack_recipe/radial( \
title = "altar", \
result_type = /obj/structure/destructible/cult/item_dispenser/altar, \
req_amount = 3, \
time = 4 SECONDS, \
crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, \
desc = span_cult_bold("Altar: Can make Eldritch Whetstones, Construct Shells, and Flasks of Unholy Water."), \
required_noun = "runed metal sheet", \
category = CAT_CULT, \
), \
new /datum/stack_recipe/radial( \
title = "archives", \
result_type = /obj/structure/destructible/cult/item_dispenser/archives, \
req_amount = 3, \
time = 4 SECONDS, \
crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, \
desc = span_cult_bold("Archives: Can make Zealot's Blindfolds, Shuttle Curse Orbs, \
and Veil Walker equipment. Emits Light."), \
required_noun = "runed metal sheet", \
category = CAT_CULT, \
), \
new /datum/stack_recipe/radial( \
title = "daemon forge", \
result_type = /obj/structure/destructible/cult/item_dispenser/forge, \
req_amount = 3, \
time = 4 SECONDS, \
crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, \
desc = span_cult_bold("Daemon Forge: Can make Nar'Sien Hardened Armor, Flagellant's Robes, \
and Eldritch Longswords. Emits Light."), \
required_noun = "runed metal sheet", \
category = CAT_CULT, \
), \
new /datum/stack_recipe/radial( \
title = "runed door", \
result_type = /obj/machinery/door/airlock/cult, \
time = 5 SECONDS, \
crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, \
desc = span_cult_bold("Runed Door: A weak door which stuns non-blood cultists who touch it."), \
required_noun = "runed metal sheet", \
category = CAT_CULT, \
), \
new /datum/stack_recipe/radial( \
title = "runed girder", \
result_type = /obj/structure/girder/cult, \
time = 5 SECONDS, \
crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, \
desc = span_cult_bold("Runed Girder: A weak girder that can be instantly destroyed by ritual daggers. \
Not a recommended usage of runed metal."), \
required_noun = "runed metal sheet", \
category = CAT_CULT, \
), \
new /datum/stack_recipe("runed stone platform", /obj/structure/platform/cult, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
))
/obj/item/stack/sheet/runed_metal
name = "runed metal"
desc = "Sheets of cold metal with shifting inscriptions writ upon them."
singular_name = "runed metal sheet"
icon_state = "sheet-runed"
inhand_icon_state = "sheet-runed"
icon = 'icons/obj/stack_objects.dmi'
mats_per_unit = list(/datum/material/runedmetal = SHEET_MATERIAL_AMOUNT)
construction_path_type = "runed"
merge_type = /obj/item/stack/sheet/runed_metal
grind_results = list(/datum/reagent/iron = 5, /datum/reagent/blood = 15)
material_type = /datum/material/runedmetal
has_unique_girder = TRUE
use_radial = TRUE
/obj/item/stack/sheet/runed_metal/interact(mob/user)
if(!IS_CULTIST(user))
to_chat(user, span_warning("Only one with forbidden knowledge could hope to work this metal..."))
return FALSE
var/turf/user_turf = get_turf(user)
var/area/user_area = get_area(user)
var/is_valid_turf = user_turf && (is_station_level(user_turf.z) || is_mining_level(user_turf.z))
var/is_valid_area = user_area && (user_area.area_flags & CULT_PERMITTED)
if(!is_valid_turf || !is_valid_area)
to_chat(user, span_warning("The veil is not weak enough here."))
return FALSE
return ..()
/obj/item/stack/sheet/runed_metal/radial_check(mob/builder)
return ..() && IS_CULTIST(builder)
/obj/item/stack/sheet/runed_metal/get_main_recipes()
. = ..()
. += GLOB.runed_metal_recipes
/obj/item/stack/sheet/runed_metal/fifty
amount = 50
/obj/item/stack/sheet/runed_metal/ten
amount = 10
/obj/item/stack/sheet/runed_metal/five
amount = 5