[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.
/🆑
This commit is contained in:
Ghom
2025-10-02 18:12:11 +02:00
committed by GitHub
parent bdb51942a8
commit a28575aa82
15 changed files with 362 additions and 343 deletions

View File

@@ -7,8 +7,8 @@
#define MATCONTAINER_BLOCK_INSERT (1<<1)
/// Called from datum/component/material_container/proc/insert_item() : (item, primary_mat, mats_consumed, material_amount, context)
#define COMSIG_MATCONTAINER_ITEM_CONSUMED "matcontainer_item_consumed"
/// Called from datum/component/material_container/proc/retrieve_sheets() : (new_sheets, context)
#define COMSIG_MATCONTAINER_SHEETS_RETRIEVED "matcontainer_sheets_retrieved"
/// Called from datum/component/material_container/proc/retrieve_stack() : (new_stack, context)
#define COMSIG_MATCONTAINER_STACK_RETRIEVED "matcontainer_stack_retrieved"
//mat container signals but from the ore silo's perspective
/// Called from /obj/machinery/ore_silo/on_item_consumed() : (container, item_inserted, last_inserted_id, mats_consumed, amount_inserted)

View File

@@ -673,16 +673,16 @@
//===========================================HIGH LEVEL=======================================
/**
* For spawning mineral sheets at a specific location. Used by machines to output sheets.
* For spawning stacks (mineral sheets or ore) at a specific location. Used by machines to output sheets.
*
* Arguments:
* sheet_amt: number of sheets to extract
* stack_amt: number of sheets to extract
* [material][datum/material]: type of sheets present in this container to extract
* [target][atom]: drop location
* [atom][context]: context - the atom performing the operation, this is the last argument sent in COMSIG_MATCONTAINER_SHEETS_RETRIEVED and is used mostly for silo logging
* [atom][context]: context - the atom performing the operation, this is the last argument sent in COMSIG_MATCONTAINER_STACK_RETRIEVED and is used mostly for silo logging
* user_data - in the form rendered by ID_DATA(user), for material logging (and if this component is connected to a silo, also for permission checking)
*/
/datum/component/material_container/proc/retrieve_sheets(sheet_amt, datum/material/material, atom/target = null, atom/context = parent, alist/user_data)
/datum/component/material_container/proc/retrieve_stack(stack_amt, datum/material/material, atom/target = null, atom/context = parent, alist/user_data)
//do we support sheets of this material
if(!material.sheet_type)
return 0 //Add greyscale sheet handling here later
@@ -690,8 +690,8 @@
return 0
//requested amount greater than available amount or just an invalid value
sheet_amt = min(round(materials[material] / SHEET_MATERIAL_AMOUNT), sheet_amt)
if(sheet_amt <= 0)
stack_amt = min(round(materials[material] / SHEET_MATERIAL_AMOUNT), stack_amt)
if(stack_amt <= 0)
return 0
//auto drop location
if(!target)
@@ -702,27 +702,30 @@
//eject sheets based on available amount after each iteration
var/count = 0
while(sheet_amt > 0)
while(stack_amt > 0)
var/type_to_retrieve = material.sheet_type || material.ore_type
//don't merge yet. we need to do stuff with it first
var/obj/item/stack/sheet/new_sheets = new material.sheet_type(target, min(sheet_amt, MAX_STACK_SIZE), FALSE)
var/obj/item/stack/new_stack = new type_to_retrieve(target, min(stack_amt, MAX_STACK_SIZE), FALSE)
if(istype(new_stack, /obj/item/stack/sheet))
var/obj/item/stack/sheet/new_sheets = new_stack
new_sheets.manufactured = TRUE
count += new_sheets.amount
count += new_stack.amount
//use material & deduct work needed
use_amount_mat(new_sheets.amount * SHEET_MATERIAL_AMOUNT, material)
sheet_amt -= new_sheets.amount
use_amount_mat(new_stack.amount * SHEET_MATERIAL_AMOUNT, material)
stack_amt -= new_stack.amount
//send signal
SEND_SIGNAL(src, COMSIG_MATCONTAINER_SHEETS_RETRIEVED, new_sheets, context, user_data)
SEND_SIGNAL(src, COMSIG_MATCONTAINER_STACK_RETRIEVED, new_stack, context, user_data)
//no point merging anything into an already full stack
if(new_sheets.amount == new_sheets.max_amount)
if(new_stack.amount == new_stack.max_amount)
continue
//now we can merge since we are done with it
for(var/obj/item/stack/item_stack in target)
if(item_stack == new_sheets || item_stack.type != material.sheet_type) //don't merge with self or different type
if(item_stack == new_stack || new_stack.type != type_to_retrieve) //don't merge with self or different type
continue
//speed merge
var/merge_amount = min(item_stack.amount, new_sheets.max_amount - new_sheets.get_amount())
var/merge_amount = min(item_stack.amount, new_stack.max_amount - new_stack.get_amount())
item_stack.use(merge_amount)
new_sheets.add(merge_amount)
new_stack.add(merge_amount)
break
return count
@@ -736,7 +739,7 @@
/datum/component/material_container/proc/retrieve_all(target = null, atom/context = parent)
var/result = 0
for(var/MAT in materials)
result += retrieve_sheets(amount2sheet(materials[MAT]), MAT, target, context, user_data = ID_DATA(null))
result += retrieve_stack(amount2sheet(materials[MAT]), MAT, target, context, user_data = ID_DATA(null))
return result
//============================================================================================

View File

@@ -271,7 +271,7 @@ handles linking back and forth.
if(isnull(drop_target))
drop_target = movable_parent.drop_location()
return mat_container.retrieve_sheets(eject_amount, material_ref, target = drop_target, context = parent, user_data = user_data)
return mat_container.retrieve_stack(eject_amount, material_ref, target = drop_target, context = parent, user_data = user_data)
/**
* Insert an item into the mat container, helper proc to insert items with the correct context

View File

@@ -373,7 +373,7 @@
say("No power to dispense sheets")
return
materials.retrieve_sheets(amount, material)
materials.retrieve_stack(amount, material)
return TRUE
/**

View File

@@ -38,7 +38,7 @@ GLOBAL_LIST_INIT(sandstone_recipes, list ( \
throw_speed = 3
throw_range = 5
mats_per_unit = list(/datum/material/sandstone=SHEET_MATERIAL_AMOUNT)
sheettype = "sandstone"
construction_path_type = "sandstone"
merge_type = /obj/item/stack/sheet/mineral/sandstone
walltype = /turf/closed/wall/mineral/sandstone
material_type = /datum/material/sandstone
@@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
icon_state = "sheet-diamond"
inhand_icon_state = "sheet-diamond"
singular_name = "diamond"
sheettype = "diamond"
construction_path_type = "diamond"
mats_per_unit = list(/datum/material/diamond=SHEET_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/carbon = 20)
gulag_valid = TRUE
@@ -130,7 +130,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \
icon_state = "sheet-uranium"
inhand_icon_state = "sheet-uranium"
singular_name = "uranium sheet"
sheettype = "uranium"
construction_path_type = "uranium"
mats_per_unit = list(/datum/material/uranium=SHEET_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/uranium = 20)
gulag_valid = TRUE
@@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
icon_state = "sheet-plasma"
inhand_icon_state = "sheet-plasma"
singular_name = "plasma sheet"
sheettype = "plasma"
construction_path_type = "plasma"
resistance_flags = FLAMMABLE
max_integrity = 100
mats_per_unit = list(/datum/material/plasma=SHEET_MATERIAL_AMOUNT)
@@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \
icon_state = "sheet-gold"
inhand_icon_state = "sheet-gold"
singular_name = "gold bar"
sheettype = "gold"
construction_path_type = "gold"
mats_per_unit = list(/datum/material/gold=SHEET_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/gold = 20)
gulag_valid = TRUE
@@ -236,7 +236,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \
icon_state = "sheet-silver"
inhand_icon_state = "sheet-silver"
singular_name = "silver bar"
sheettype = "silver"
construction_path_type = "silver"
mats_per_unit = list(/datum/material/silver=SHEET_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/silver = 20)
gulag_valid = TRUE
@@ -266,7 +266,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \
icon_state = "sheet-bananium"
inhand_icon_state = null
singular_name = "bananium sheet"
sheettype = "bananium"
construction_path_type = "bananium"
mats_per_unit = list(/datum/material/bananium=SHEET_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/consumable/banana = 20)
gulag_valid = TRUE
@@ -298,7 +298,7 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 1
throw_range = 3
sheettype = "titanium"
construction_path_type = "titanium"
mats_per_unit = list(/datum/material/titanium=SHEET_MATERIAL_AMOUNT)
gulag_valid = TRUE
merge_type = /obj/item/stack/sheet/mineral/titanium
@@ -352,7 +352,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 1
throw_range = 3
sheettype = "plastitanium"
construction_path_type = "plastitanium"
mats_per_unit = list(/datum/material/alloy/plastitanium=SHEET_MATERIAL_AMOUNT)
gulag_valid = TRUE
material_type = /datum/material/alloy/plastitanium
@@ -463,7 +463,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list(
icon_state = "sheet-abductor"
inhand_icon_state = "sheet-abductor"
singular_name = "alien alloy sheet"
sheettype = "abductor"
construction_path_type = "abductor"
mats_per_unit = list(/datum/material/alloy/alien=SHEET_MATERIAL_AMOUNT)
merge_type = /obj/item/stack/sheet/mineral/abductor
material_type = /datum/material/alloy/alien

View File

@@ -75,7 +75,7 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list( \
inhand_icon_state = "sheet-runed"
icon = 'icons/obj/stack_objects.dmi'
mats_per_unit = list(/datum/material/runedmetal = SHEET_MATERIAL_AMOUNT)
sheettype = "runed"
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

View File

@@ -406,7 +406,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
inhand_icon_state = "sheet-wood"
icon = 'icons/obj/stack_objects.dmi'
mats_per_unit = list(/datum/material/wood=SHEET_MATERIAL_AMOUNT)
sheettype = "wood"
construction_path_type = "wood"
armor_type = /datum/armor/mineral_wood
resistance_flags = FLAMMABLE
merge_type = /obj/item/stack/sheet/mineral/wood
@@ -471,7 +471,7 @@ GLOBAL_LIST_INIT(bamboo_recipes, list ( \
icon_state = "sheet-bamboo"
inhand_icon_state = "sheet-bamboo"
icon = 'icons/obj/stack_objects.dmi'
sheettype = "bamboo"
construction_path_type = "bamboo"
mats_per_unit = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT)
throwforce = 15
armor_type = /datum/armor/mineral_bamboo
@@ -783,7 +783,7 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \
lefthand_file = 'icons/mob/inhands/items/sheets_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/sheets_righthand.dmi'
resistance_flags = FIRE_PROOF | ACID_PROOF
sheettype = "bronze"
construction_path_type = "bronze"
force = 5
throwforce = 10
max_amount = 50

View File

@@ -18,14 +18,13 @@
pickup_sound = 'sound/items/handling/materials/metal_pick_up.ogg'
drop_sound = 'sound/items/handling/materials/metal_drop.ogg'
sound_vary = TRUE
/// this is used for girders in the creation of walls/false walls
var/sheettype = null
usable_for_construction = TRUE
/// text string used to find typepaths used in door and wall (false and tram too) construction for door assemblies and girders respectively
var/construction_path_type = null
///If true, this is worth points in the gulag labour stacker
var/gulag_valid = FALSE
///Set to true if this is vended from a material storage
var/manufactured = FALSE
///What type of wall does this sheet spawn
var/walltype
/// whether this sheet can be sniffed by the material sniffer
var/sniffable = FALSE

View File

@@ -45,8 +45,6 @@
// these amounts will be multiplied by the stack size in on_grind()
/// Amount of matter given back to RCDs
var/matter_amount = 0
/// Does this stack require a unique girder in order to make a wall?
var/has_unique_girder = FALSE
/// What typepath table we create from this stack
var/obj/structure/table/table_type
/// What typepath stairs do we create from this stack
@@ -73,6 +71,13 @@
/// or until the cut heals, whichever comes first
var/absorption_rate
/// Can this stack be used for contruction of girders?
var/usable_for_construction = FALSE
/// Does this stack require a unique girder in order to make a wall?
var/has_unique_girder = FALSE
///What type of wall does this sheet spawn
var/walltype
/obj/item/stack/Initialize(mapload, new_amount = amount, merge = TRUE, list/mat_override=null, mat_amt=1)
amount = new_amount
if(amount <= 0)

View File

@@ -212,44 +212,50 @@
electronics = null
ae.forceMove(src.loc)
else if(istype(W, /obj/item/stack/sheet) && (!glass || !mineral))
var/obj/item/stack/sheet/G = W
if(G)
if(G.get_amount() >= 1)
if(!noglass)
if(!glass)
if(istype(G, /obj/item/stack/sheet/rglass) || istype(G, /obj/item/stack/sheet/glass))
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
user.visible_message(span_notice("[user] adds [G.name] to the airlock assembly."), \
span_notice("You start to install [G.name] into the airlock assembly..."))
if(do_after(user, 4 SECONDS, target = src))
if(G.get_amount() < 1 || glass)
else if(istype(W, /obj/item/stack/sheet))
var/obj/item/stack/sheet/sheet = W
if(!glass && (istype(sheet, /obj/item/stack/sheet/rglass) || istype(sheet, /obj/item/stack/sheet/glass)))
if(noglass)
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
return
if(G.type == /obj/item/stack/sheet/rglass)
to_chat(user, span_notice("You install [G.name] windows into the airlock assembly."))
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
user.visible_message(span_notice("[user] adds [sheet.name] to the airlock assembly."), \
span_notice("You start to install [sheet.name] into the airlock assembly..."))
if(do_after(user, 4 SECONDS, target = src))
if(sheet.get_amount() < 1 || glass)
return
if(sheet.type == /obj/item/stack/sheet/rglass)
to_chat(user, span_notice("You install [sheet.name] windows into the airlock assembly."))
heat_proof_finished = 1 //reinforced glass makes the airlock heat-proof
name = "near finished heat-proofed window airlock assembly"
else
to_chat(user, span_notice("You install regular glass windows into the airlock assembly."))
name = "near finished window airlock assembly"
G.use(1)
sheet.use(1)
glass = TRUE
if(!nomineral && !mineral)
if(istype(G, /obj/item/stack/sheet/mineral) && G.sheettype)
var/M = G.sheettype
return
if(istype(sheet, /obj/item/stack/sheet/mineral) && sheet.construction_path_type)
if(nomineral || mineral)
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
return
var/M = sheet.construction_path_type
var/mineralassembly = text2path("/obj/structure/door_assembly/door_assembly_[M]")
if(!ispath(mineralassembly))
to_chat(user, span_warning("You cannot add [G] to [src]!"))
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
return
if(G.get_amount() >= 2)
if(sheet.get_amount() < 2)
to_chat(user, span_warning("You need at least two sheets add a mineral cover!"))
return
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
user.visible_message(span_notice("[user] adds [G.name] to the airlock assembly."), \
span_notice("You start to install [G.name] into the airlock assembly..."))
if(do_after(user, 4 SECONDS, target = src))
if(G.get_amount() < 2 || mineral)
user.visible_message(span_notice("[user] adds [sheet.name] to the airlock assembly."), \
span_notice("You start to install [sheet.name] into the airlock assembly..."))
if(!do_after(user, 4 SECONDS, target = src) || sheet.get_amount() < 2 || mineral)
return
to_chat(user, span_notice("You install [M] plating into the airlock assembly."))
G.use(2)
sheet.use(2)
var/obj/structure/door_assembly/MA = new mineralassembly(loc)
if(MA.noglass && glass) //in case the new door doesn't support glass. prevents the new one from reverting to a normal airlock after being constructed.
@@ -263,12 +269,6 @@
to_chat(user, span_notice("As you finish, a [dropped_glass.singular_name] falls out of [MA]'s frame."))
transfer_assembly_vars(src, MA, TRUE)
else
to_chat(user, span_warning("You need at least two sheets add a mineral cover!"))
else
to_chat(user, span_warning("You cannot add [G] to [src]!"))
else
to_chat(user, span_warning("You cannot add [G] to [src]!"))
else if((W.tool_behaviour == TOOL_SCREWDRIVER) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
user.visible_message(span_notice("[user] finishes the airlock."), \

View File

@@ -44,12 +44,7 @@
. += span_notice("[src] is designed for tram usage. Deconstructed with a screwdriver!")
/obj/structure/girder/attackby(obj/item/W, mob/user, list/modifiers, list/attack_modifiers)
var/platingmodifier = 1
if(HAS_TRAIT(user, TRAIT_QUICK_BUILD))
platingmodifier = 0.7
if(next_beep <= world.time)
next_beep = world.time + 10
playsound(src, 'sound/machines/clockcult/integration_cog_install.ogg', 50, TRUE)
add_fingerprint(user)
if(istype(W, /obj/item/gun/energy/plasmacutter))
@@ -66,7 +61,12 @@
qdel(src)
return
else if(isstack(W))
if(isstack(W))
var/obj/item/stack/stack = W
if(!stack.usable_for_construction)
balloon_alert(user, "can't make walls with it!")
return
if(iswallturf(loc) || (locate(/obj/structure/falsewall) in src.loc.contents))
balloon_alert(user, "wall already present!")
return
@@ -78,8 +78,29 @@
balloon_alert(user, "need tram floors!")
return
if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/rod = W
make_wall(stack, user)
return
if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
if(!user.transfer_item_to_turf(P, drop_location()))
return
balloon_alert(user, "inserted pipe")
return
return ..()
/obj/structure/girder/proc/make_wall(obj/item/stack/stack, mob/user)
var/speed_modifier = 1
if(HAS_TRAIT(user, TRAIT_QUICK_BUILD))
speed_modifier = 0.7
if(next_beep <= world.time)
next_beep = world.time + 10
playsound(src, 'sound/machines/clockcult/integration_cog_install.ogg', 50, TRUE)
if(istype(stack, /obj/item/stack/rods))
var/obj/item/stack/rods/rod = stack
var/amount = construction_cost[rod.type]
if(state == GIRDER_DISPLACED)
if(rod.get_amount() < amount)
@@ -94,10 +115,11 @@
transfer_fingerprints_to(FW)
qdel(src)
return
else if(state == GIRDER_REINF)
if(state == GIRDER_REINF)
balloon_alert(user, "need plasteel sheet!")
return
else
if(rod.get_amount() < amount)
balloon_alert(user, "need [amount] rods!")
return
@@ -112,21 +134,17 @@
qdel(src)
return
if(!istype(W, /obj/item/stack/sheet))
return
var/obj/item/stack/sheet/sheets = W
if(istype(sheets, /obj/item/stack/sheet/iron))
if(istype(stack, /obj/item/stack/sheet/iron))
var/amount = construction_cost[/obj/item/stack/sheet/iron]
if(state == GIRDER_DISPLACED)
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "concealing entrance...")
if(do_after(user, 20*platingmodifier, target = src))
if(sheets.get_amount() < amount)
if(do_after(user, 20 * speed_modifier, target = src))
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/obj/structure/falsewall/F = new (loc)
transfer_fingerprints_to(F)
qdel(src)
@@ -135,72 +153,72 @@
balloon_alert(user, "need plasteel sheet!")
return
else if(state == GIRDER_TRAM)
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "adding plating...")
if (do_after(user, 4 SECONDS, target = src))
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/obj/structure/tram/alt/iron/tram_wall = new(loc)
transfer_fingerprints_to(tram_wall)
qdel(src)
return
else
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "adding plating...")
if (do_after(user, 40*platingmodifier, target = src))
if(sheets.get_amount() < amount)
if (do_after(user, 40 * speed_modifier, target = src))
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/turf/T = get_turf(src)
T.place_on_top(/turf/closed/wall)
transfer_fingerprints_to(T)
qdel(src)
return
if(istype(sheets, /obj/item/stack/sheet/titaniumglass) && state == GIRDER_TRAM)
if(istype(stack, /obj/item/stack/sheet/titaniumglass) && state == GIRDER_TRAM)
var/amount = construction_cost[/obj/item/stack/sheet/titaniumglass]
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "adding panel...")
if (do_after(user, 2 SECONDS, target = src))
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/obj/structure/tram/tram_wall = new(loc)
transfer_fingerprints_to(tram_wall)
qdel(src)
return
if(istype(sheets, /obj/item/stack/sheet/plasteel))
if(istype(stack, /obj/item/stack/sheet/plasteel))
var/amount = construction_cost[/obj/item/stack/sheet/plasteel]
if(state == GIRDER_DISPLACED)
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "concealing entrance...")
if(do_after(user, 2 SECONDS, target = src))
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/obj/structure/falsewall/reinforced/FW = new (loc)
transfer_fingerprints_to(FW)
qdel(src)
return
else if(state == GIRDER_REINF)
amount = 1 // hur dur let's make plasteel have different construction amounts 4norasin
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
balloon_alert(user, "adding plating...")
if(do_after(user, 50*platingmodifier, target = src))
if(sheets.get_amount() < amount)
if(do_after(user, 50 * speed_modifier, target = src))
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/turf/T = get_turf(src)
T.place_on_top(/turf/closed/wall/r_wall)
transfer_fingerprints_to(T)
@@ -208,27 +226,27 @@
return
else
amount = 1 // hur dur x2
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
balloon_alert(user, "reinforcing frame...")
if(do_after(user, 60*platingmodifier, target = src))
if(sheets.get_amount() < amount)
if(do_after(user, 60 * speed_modifier, target = src))
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/obj/structure/girder/reinforced/R = new (loc)
transfer_fingerprints_to(R)
qdel(src)
return
if(istype(sheets, /obj/item/stack/sheet/mineral/plastitanium))
if(istype(stack, /obj/item/stack/sheet/mineral/plastitanium))
if(state == GIRDER_REINF)
if(sheets.get_amount() < 1)
if(stack.get_amount() < 1)
return
balloon_alert(user, "adding plating...")
if(do_after(user, 50*platingmodifier, target = src))
if(sheets.get_amount() < 1)
if(do_after(user, 50 * speed_modifier, target = src))
if(stack.get_amount() < 1)
return
sheets.use(1)
stack.use(1)
var/turf/T = get_turf(src)
T.place_on_top(/turf/closed/wall/r_wall/plastitanium)
transfer_fingerprints_to(T)
@@ -236,48 +254,51 @@
return
// No return here because generic material construction handles making normal plastitanium walls
if(!sheets.has_unique_girder && sheets.material_type)
if(!stack.has_unique_girder && stack.material_type)
if(istype(src, /obj/structure/girder/reinforced))
balloon_alert(user, "need plasteel or plastitanium!")
return
var/M = sheets.sheettype
var/material
if(istype(stack, /obj/item/stack/sheet))
var/obj/item/stack/sheet/sheet = stack
material = sheet.construction_path_type
var/amount = construction_cost["exotic_material"]
if(state == GIRDER_TRAM)
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
var/tram_wall_type = text2path("/obj/structure/tram/alt/[M]")
var/tram_wall_type = text2path("/obj/structure/tram/alt/[material]")
if(!tram_wall_type)
balloon_alert(user, "need titanium glass or mineral!")
return
balloon_alert(user, "adding plating...")
if (do_after(user, 4 SECONDS, target = src))
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
var/obj/structure/tram/tram_wall
tram_wall = new tram_wall_type(loc)
sheets.use(amount)
stack.use(amount)
transfer_fingerprints_to(tram_wall)
qdel(src)
return
if(state == GIRDER_DISPLACED)
var/falsewall_type = text2path("/obj/structure/falsewall/[M]")
if(sheets.get_amount() < amount)
var/falsewall_type = text2path("/obj/structure/falsewall/[material]")
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "concealing entrance...")
if(do_after(user, 2 SECONDS, target = src))
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/obj/structure/falsewall/falsewall
if(falsewall_type)
falsewall = new falsewall_type (loc)
else
var/obj/structure/falsewall/material/mat_falsewall = new(loc)
var/list/material_list = list()
material_list[GET_MATERIAL_REF(sheets.material_type)] = SHEET_MATERIAL_AMOUNT * 2
material_list[GET_MATERIAL_REF(stack.material_type)] = SHEET_MATERIAL_AMOUNT * 2
if(material_list)
mat_falsewall.set_custom_materials(material_list)
falsewall = mat_falsewall
@@ -285,21 +306,21 @@
qdel(src)
return
else
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
balloon_alert(user, "need [amount] sheets!")
return
balloon_alert(user, "adding plating...")
if (do_after(user, 4 SECONDS, target = src))
if(sheets.get_amount() < amount)
if(stack.get_amount() < amount)
return
sheets.use(amount)
stack.use(amount)
var/turf/T = get_turf(src)
if(sheets.walltype)
T.place_on_top(sheets.walltype)
if(stack.walltype)
T.place_on_top(stack.walltype)
else
var/turf/newturf = T.place_on_top(/turf/closed/wall/material)
var/list/material_list = list()
material_list[GET_MATERIAL_REF(sheets.material_type)] = SHEET_MATERIAL_AMOUNT * 2
material_list[GET_MATERIAL_REF(stack.material_type)] = SHEET_MATERIAL_AMOUNT * 2
if(material_list)
newturf.set_custom_materials(material_list)
@@ -307,17 +328,6 @@
qdel(src)
return
add_hiddenprint(user)
else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
if(!user.transfer_item_to_turf(P, drop_location()))
return
balloon_alert(user, "inserted pipe")
else
return ..()
// Screwdriver behavior for girders
/obj/structure/girder/screwdriver_act(mob/user, obj/item/tool)
if(..())

View File

@@ -248,7 +248,7 @@
on = FALSE
else
var/out = get_step(src, output_dir)
materials.retrieve_sheets(sheets_to_remove, mat, out)
materials.retrieve_stack(sheets_to_remove, mat, out)
/obj/machinery/mineral/processing_unit/proc/smelt_alloy(seconds_per_tick = 2)
var/datum/design/alloy = stored_research.isDesignResearchedID(selected_alloy) //check if it's a valid design

View File

@@ -78,7 +78,7 @@
MATCONTAINER_EXAMINE, \
container_signals = list( \
COMSIG_MATCONTAINER_ITEM_CONSUMED = TYPE_PROC_REF(/obj/machinery/ore_silo, on_item_consumed), \
COMSIG_MATCONTAINER_SHEETS_RETRIEVED = TYPE_PROC_REF(/obj/machinery/ore_silo, log_sheets_ejected), \
COMSIG_MATCONTAINER_STACK_RETRIEVED = TYPE_PROC_REF(/obj/machinery/ore_silo, log_sheets_ejected), \
), \
allowed_items = /obj/item/stack \
)
@@ -330,7 +330,7 @@
if(isnull(amount))
return
materials.retrieve_sheets(amount, ejecting, drop_location(), user_data = ID_DATA(ui.user))
materials.retrieve_stack(amount, ejecting, drop_location(), user_data = ID_DATA(ui.user))
return TRUE
if("toggle_ban")

View File

@@ -112,6 +112,7 @@
w_class = WEIGHT_CLASS_TINY
mine_experience = 0 //its sand
merge_type = /obj/item/stack/ore/glass
usable_for_construction = TRUE
GLOBAL_LIST_INIT(sand_recipes, list(\
new /datum/stack_recipe("pile of dirt", /obj/machinery/hydroponics/soil, 3, time = 1 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_TOOLS), \
@@ -124,7 +125,8 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
AddComponent(/datum/component/storm_hating)
/obj/item/stack/ore/glass/on_orm_collection() //we need to smelt the glass beforehand because the silo and orm don't accept sand mats
var/obj/item/stack/sheet/glass = new refined_type(drop_location(), amount, merge = FALSE) //The newly spawned glass should not merge with other stacks on the turf, else it could cause issues.
//If we spawn the sheet of glass on the turf the ORM is "listening" to, it'll get redeemed before we can use it as return value and weird stuff my happen.
var/obj/item/stack/sheet/glass = new refined_type(null, amount)
qdel(src)
return glass

View File

@@ -846,7 +846,7 @@
50 * SHEET_MATERIAL_AMOUNT, \
MATCONTAINER_EXAMINE | MATCONTAINER_NO_INSERT, \
container_signals = list( \
COMSIG_MATCONTAINER_SHEETS_RETRIEVED = TYPE_PROC_REF(/obj/item/mod/module/recycler, InsertSheets) \
COMSIG_MATCONTAINER_STACK_RETRIEVED = TYPE_PROC_REF(/obj/item/mod/module/recycler, InsertSheets) \
) \
)