mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
[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:
@@ -7,8 +7,8 @@
|
|||||||
#define MATCONTAINER_BLOCK_INSERT (1<<1)
|
#define MATCONTAINER_BLOCK_INSERT (1<<1)
|
||||||
/// Called from datum/component/material_container/proc/insert_item() : (item, primary_mat, mats_consumed, material_amount, context)
|
/// 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"
|
#define COMSIG_MATCONTAINER_ITEM_CONSUMED "matcontainer_item_consumed"
|
||||||
/// Called from datum/component/material_container/proc/retrieve_sheets() : (new_sheets, context)
|
/// Called from datum/component/material_container/proc/retrieve_stack() : (new_stack, context)
|
||||||
#define COMSIG_MATCONTAINER_SHEETS_RETRIEVED "matcontainer_sheets_retrieved"
|
#define COMSIG_MATCONTAINER_STACK_RETRIEVED "matcontainer_stack_retrieved"
|
||||||
|
|
||||||
//mat container signals but from the ore silo's perspective
|
//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)
|
/// Called from /obj/machinery/ore_silo/on_item_consumed() : (container, item_inserted, last_inserted_id, mats_consumed, amount_inserted)
|
||||||
|
|||||||
@@ -673,16 +673,16 @@
|
|||||||
//===========================================HIGH LEVEL=======================================
|
//===========================================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:
|
* 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
|
* [material][datum/material]: type of sheets present in this container to extract
|
||||||
* [target][atom]: drop location
|
* [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)
|
* 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
|
//do we support sheets of this material
|
||||||
if(!material.sheet_type)
|
if(!material.sheet_type)
|
||||||
return 0 //Add greyscale sheet handling here later
|
return 0 //Add greyscale sheet handling here later
|
||||||
@@ -690,8 +690,8 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
//requested amount greater than available amount or just an invalid value
|
//requested amount greater than available amount or just an invalid value
|
||||||
sheet_amt = min(round(materials[material] / SHEET_MATERIAL_AMOUNT), sheet_amt)
|
stack_amt = min(round(materials[material] / SHEET_MATERIAL_AMOUNT), stack_amt)
|
||||||
if(sheet_amt <= 0)
|
if(stack_amt <= 0)
|
||||||
return 0
|
return 0
|
||||||
//auto drop location
|
//auto drop location
|
||||||
if(!target)
|
if(!target)
|
||||||
@@ -702,27 +702,30 @@
|
|||||||
|
|
||||||
//eject sheets based on available amount after each iteration
|
//eject sheets based on available amount after each iteration
|
||||||
var/count = 0
|
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
|
//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)
|
||||||
new_sheets.manufactured = TRUE
|
if(istype(new_stack, /obj/item/stack/sheet))
|
||||||
count += new_sheets.amount
|
var/obj/item/stack/sheet/new_sheets = new_stack
|
||||||
|
new_sheets.manufactured = TRUE
|
||||||
|
count += new_stack.amount
|
||||||
//use material & deduct work needed
|
//use material & deduct work needed
|
||||||
use_amount_mat(new_sheets.amount * SHEET_MATERIAL_AMOUNT, material)
|
use_amount_mat(new_stack.amount * SHEET_MATERIAL_AMOUNT, material)
|
||||||
sheet_amt -= new_sheets.amount
|
stack_amt -= new_stack.amount
|
||||||
//send signal
|
//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
|
//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
|
continue
|
||||||
//now we can merge since we are done with it
|
//now we can merge since we are done with it
|
||||||
for(var/obj/item/stack/item_stack in target)
|
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
|
continue
|
||||||
//speed merge
|
//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)
|
item_stack.use(merge_amount)
|
||||||
new_sheets.add(merge_amount)
|
new_stack.add(merge_amount)
|
||||||
break
|
break
|
||||||
return count
|
return count
|
||||||
|
|
||||||
@@ -736,7 +739,7 @@
|
|||||||
/datum/component/material_container/proc/retrieve_all(target = null, atom/context = parent)
|
/datum/component/material_container/proc/retrieve_all(target = null, atom/context = parent)
|
||||||
var/result = 0
|
var/result = 0
|
||||||
for(var/MAT in materials)
|
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
|
return result
|
||||||
//============================================================================================
|
//============================================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ handles linking back and forth.
|
|||||||
if(isnull(drop_target))
|
if(isnull(drop_target))
|
||||||
drop_target = movable_parent.drop_location()
|
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
|
* Insert an item into the mat container, helper proc to insert items with the correct context
|
||||||
|
|||||||
@@ -373,7 +373,7 @@
|
|||||||
say("No power to dispense sheets")
|
say("No power to dispense sheets")
|
||||||
return
|
return
|
||||||
|
|
||||||
materials.retrieve_sheets(amount, material)
|
materials.retrieve_stack(amount, material)
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ GLOBAL_LIST_INIT(sandstone_recipes, list ( \
|
|||||||
throw_speed = 3
|
throw_speed = 3
|
||||||
throw_range = 5
|
throw_range = 5
|
||||||
mats_per_unit = list(/datum/material/sandstone=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/sandstone=SHEET_MATERIAL_AMOUNT)
|
||||||
sheettype = "sandstone"
|
construction_path_type = "sandstone"
|
||||||
merge_type = /obj/item/stack/sheet/mineral/sandstone
|
merge_type = /obj/item/stack/sheet/mineral/sandstone
|
||||||
walltype = /turf/closed/wall/mineral/sandstone
|
walltype = /turf/closed/wall/mineral/sandstone
|
||||||
material_type = /datum/material/sandstone
|
material_type = /datum/material/sandstone
|
||||||
@@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
|||||||
icon_state = "sheet-diamond"
|
icon_state = "sheet-diamond"
|
||||||
inhand_icon_state = "sheet-diamond"
|
inhand_icon_state = "sheet-diamond"
|
||||||
singular_name = "diamond"
|
singular_name = "diamond"
|
||||||
sheettype = "diamond"
|
construction_path_type = "diamond"
|
||||||
mats_per_unit = list(/datum/material/diamond=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/diamond=SHEET_MATERIAL_AMOUNT)
|
||||||
grind_results = list(/datum/reagent/carbon = 20)
|
grind_results = list(/datum/reagent/carbon = 20)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
@@ -130,7 +130,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \
|
|||||||
icon_state = "sheet-uranium"
|
icon_state = "sheet-uranium"
|
||||||
inhand_icon_state = "sheet-uranium"
|
inhand_icon_state = "sheet-uranium"
|
||||||
singular_name = "uranium sheet"
|
singular_name = "uranium sheet"
|
||||||
sheettype = "uranium"
|
construction_path_type = "uranium"
|
||||||
mats_per_unit = list(/datum/material/uranium=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/uranium=SHEET_MATERIAL_AMOUNT)
|
||||||
grind_results = list(/datum/reagent/uranium = 20)
|
grind_results = list(/datum/reagent/uranium = 20)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
@@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
|
|||||||
icon_state = "sheet-plasma"
|
icon_state = "sheet-plasma"
|
||||||
inhand_icon_state = "sheet-plasma"
|
inhand_icon_state = "sheet-plasma"
|
||||||
singular_name = "plasma sheet"
|
singular_name = "plasma sheet"
|
||||||
sheettype = "plasma"
|
construction_path_type = "plasma"
|
||||||
resistance_flags = FLAMMABLE
|
resistance_flags = FLAMMABLE
|
||||||
max_integrity = 100
|
max_integrity = 100
|
||||||
mats_per_unit = list(/datum/material/plasma=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/plasma=SHEET_MATERIAL_AMOUNT)
|
||||||
@@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \
|
|||||||
icon_state = "sheet-gold"
|
icon_state = "sheet-gold"
|
||||||
inhand_icon_state = "sheet-gold"
|
inhand_icon_state = "sheet-gold"
|
||||||
singular_name = "gold bar"
|
singular_name = "gold bar"
|
||||||
sheettype = "gold"
|
construction_path_type = "gold"
|
||||||
mats_per_unit = list(/datum/material/gold=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/gold=SHEET_MATERIAL_AMOUNT)
|
||||||
grind_results = list(/datum/reagent/gold = 20)
|
grind_results = list(/datum/reagent/gold = 20)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
@@ -236,7 +236,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \
|
|||||||
icon_state = "sheet-silver"
|
icon_state = "sheet-silver"
|
||||||
inhand_icon_state = "sheet-silver"
|
inhand_icon_state = "sheet-silver"
|
||||||
singular_name = "silver bar"
|
singular_name = "silver bar"
|
||||||
sheettype = "silver"
|
construction_path_type = "silver"
|
||||||
mats_per_unit = list(/datum/material/silver=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/silver=SHEET_MATERIAL_AMOUNT)
|
||||||
grind_results = list(/datum/reagent/silver = 20)
|
grind_results = list(/datum/reagent/silver = 20)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
@@ -266,7 +266,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \
|
|||||||
icon_state = "sheet-bananium"
|
icon_state = "sheet-bananium"
|
||||||
inhand_icon_state = null
|
inhand_icon_state = null
|
||||||
singular_name = "bananium sheet"
|
singular_name = "bananium sheet"
|
||||||
sheettype = "bananium"
|
construction_path_type = "bananium"
|
||||||
mats_per_unit = list(/datum/material/bananium=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/bananium=SHEET_MATERIAL_AMOUNT)
|
||||||
grind_results = list(/datum/reagent/consumable/banana = 20)
|
grind_results = list(/datum/reagent/consumable/banana = 20)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
@@ -298,7 +298,7 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \
|
|||||||
w_class = WEIGHT_CLASS_NORMAL
|
w_class = WEIGHT_CLASS_NORMAL
|
||||||
throw_speed = 1
|
throw_speed = 1
|
||||||
throw_range = 3
|
throw_range = 3
|
||||||
sheettype = "titanium"
|
construction_path_type = "titanium"
|
||||||
mats_per_unit = list(/datum/material/titanium=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/titanium=SHEET_MATERIAL_AMOUNT)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
merge_type = /obj/item/stack/sheet/mineral/titanium
|
merge_type = /obj/item/stack/sheet/mineral/titanium
|
||||||
@@ -352,7 +352,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \
|
|||||||
w_class = WEIGHT_CLASS_NORMAL
|
w_class = WEIGHT_CLASS_NORMAL
|
||||||
throw_speed = 1
|
throw_speed = 1
|
||||||
throw_range = 3
|
throw_range = 3
|
||||||
sheettype = "plastitanium"
|
construction_path_type = "plastitanium"
|
||||||
mats_per_unit = list(/datum/material/alloy/plastitanium=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/alloy/plastitanium=SHEET_MATERIAL_AMOUNT)
|
||||||
gulag_valid = TRUE
|
gulag_valid = TRUE
|
||||||
material_type = /datum/material/alloy/plastitanium
|
material_type = /datum/material/alloy/plastitanium
|
||||||
@@ -463,7 +463,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list(
|
|||||||
icon_state = "sheet-abductor"
|
icon_state = "sheet-abductor"
|
||||||
inhand_icon_state = "sheet-abductor"
|
inhand_icon_state = "sheet-abductor"
|
||||||
singular_name = "alien alloy sheet"
|
singular_name = "alien alloy sheet"
|
||||||
sheettype = "abductor"
|
construction_path_type = "abductor"
|
||||||
mats_per_unit = list(/datum/material/alloy/alien=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/alloy/alien=SHEET_MATERIAL_AMOUNT)
|
||||||
merge_type = /obj/item/stack/sheet/mineral/abductor
|
merge_type = /obj/item/stack/sheet/mineral/abductor
|
||||||
material_type = /datum/material/alloy/alien
|
material_type = /datum/material/alloy/alien
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list( \
|
|||||||
inhand_icon_state = "sheet-runed"
|
inhand_icon_state = "sheet-runed"
|
||||||
icon = 'icons/obj/stack_objects.dmi'
|
icon = 'icons/obj/stack_objects.dmi'
|
||||||
mats_per_unit = list(/datum/material/runedmetal = SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/runedmetal = SHEET_MATERIAL_AMOUNT)
|
||||||
sheettype = "runed"
|
construction_path_type = "runed"
|
||||||
merge_type = /obj/item/stack/sheet/runed_metal
|
merge_type = /obj/item/stack/sheet/runed_metal
|
||||||
grind_results = list(/datum/reagent/iron = 5, /datum/reagent/blood = 15)
|
grind_results = list(/datum/reagent/iron = 5, /datum/reagent/blood = 15)
|
||||||
material_type = /datum/material/runedmetal
|
material_type = /datum/material/runedmetal
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
|||||||
inhand_icon_state = "sheet-wood"
|
inhand_icon_state = "sheet-wood"
|
||||||
icon = 'icons/obj/stack_objects.dmi'
|
icon = 'icons/obj/stack_objects.dmi'
|
||||||
mats_per_unit = list(/datum/material/wood=SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/wood=SHEET_MATERIAL_AMOUNT)
|
||||||
sheettype = "wood"
|
construction_path_type = "wood"
|
||||||
armor_type = /datum/armor/mineral_wood
|
armor_type = /datum/armor/mineral_wood
|
||||||
resistance_flags = FLAMMABLE
|
resistance_flags = FLAMMABLE
|
||||||
merge_type = /obj/item/stack/sheet/mineral/wood
|
merge_type = /obj/item/stack/sheet/mineral/wood
|
||||||
@@ -471,7 +471,7 @@ GLOBAL_LIST_INIT(bamboo_recipes, list ( \
|
|||||||
icon_state = "sheet-bamboo"
|
icon_state = "sheet-bamboo"
|
||||||
inhand_icon_state = "sheet-bamboo"
|
inhand_icon_state = "sheet-bamboo"
|
||||||
icon = 'icons/obj/stack_objects.dmi'
|
icon = 'icons/obj/stack_objects.dmi'
|
||||||
sheettype = "bamboo"
|
construction_path_type = "bamboo"
|
||||||
mats_per_unit = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT)
|
mats_per_unit = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT)
|
||||||
throwforce = 15
|
throwforce = 15
|
||||||
armor_type = /datum/armor/mineral_bamboo
|
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'
|
lefthand_file = 'icons/mob/inhands/items/sheets_lefthand.dmi'
|
||||||
righthand_file = 'icons/mob/inhands/items/sheets_righthand.dmi'
|
righthand_file = 'icons/mob/inhands/items/sheets_righthand.dmi'
|
||||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||||
sheettype = "bronze"
|
construction_path_type = "bronze"
|
||||||
force = 5
|
force = 5
|
||||||
throwforce = 10
|
throwforce = 10
|
||||||
max_amount = 50
|
max_amount = 50
|
||||||
|
|||||||
@@ -18,14 +18,13 @@
|
|||||||
pickup_sound = 'sound/items/handling/materials/metal_pick_up.ogg'
|
pickup_sound = 'sound/items/handling/materials/metal_pick_up.ogg'
|
||||||
drop_sound = 'sound/items/handling/materials/metal_drop.ogg'
|
drop_sound = 'sound/items/handling/materials/metal_drop.ogg'
|
||||||
sound_vary = TRUE
|
sound_vary = TRUE
|
||||||
/// this is used for girders in the creation of walls/false walls
|
usable_for_construction = TRUE
|
||||||
var/sheettype = null
|
/// 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
|
///If true, this is worth points in the gulag labour stacker
|
||||||
var/gulag_valid = FALSE
|
var/gulag_valid = FALSE
|
||||||
///Set to true if this is vended from a material storage
|
///Set to true if this is vended from a material storage
|
||||||
var/manufactured = FALSE
|
var/manufactured = FALSE
|
||||||
///What type of wall does this sheet spawn
|
|
||||||
var/walltype
|
|
||||||
/// whether this sheet can be sniffed by the material sniffer
|
/// whether this sheet can be sniffed by the material sniffer
|
||||||
var/sniffable = FALSE
|
var/sniffable = FALSE
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,6 @@
|
|||||||
// these amounts will be multiplied by the stack size in on_grind()
|
// these amounts will be multiplied by the stack size in on_grind()
|
||||||
/// Amount of matter given back to RCDs
|
/// Amount of matter given back to RCDs
|
||||||
var/matter_amount = 0
|
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
|
/// What typepath table we create from this stack
|
||||||
var/obj/structure/table/table_type
|
var/obj/structure/table/table_type
|
||||||
/// What typepath stairs do we create from this stack
|
/// What typepath stairs do we create from this stack
|
||||||
@@ -73,6 +71,13 @@
|
|||||||
/// or until the cut heals, whichever comes first
|
/// or until the cut heals, whichever comes first
|
||||||
var/absorption_rate
|
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)
|
/obj/item/stack/Initialize(mapload, new_amount = amount, merge = TRUE, list/mat_override=null, mat_amt=1)
|
||||||
amount = new_amount
|
amount = new_amount
|
||||||
if(amount <= 0)
|
if(amount <= 0)
|
||||||
|
|||||||
@@ -212,63 +212,63 @@
|
|||||||
electronics = null
|
electronics = null
|
||||||
ae.forceMove(src.loc)
|
ae.forceMove(src.loc)
|
||||||
|
|
||||||
else if(istype(W, /obj/item/stack/sheet) && (!glass || !mineral))
|
else if(istype(W, /obj/item/stack/sheet))
|
||||||
var/obj/item/stack/sheet/G = W
|
var/obj/item/stack/sheet/sheet = W
|
||||||
if(G)
|
if(!glass && (istype(sheet, /obj/item/stack/sheet/rglass) || istype(sheet, /obj/item/stack/sheet/glass)))
|
||||||
if(G.get_amount() >= 1)
|
if(noglass)
|
||||||
if(!noglass)
|
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
|
||||||
if(!glass)
|
return
|
||||||
if(istype(G, /obj/item/stack/sheet/rglass) || istype(G, /obj/item/stack/sheet/glass))
|
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
|
||||||
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
|
user.visible_message(span_notice("[user] adds [sheet.name] to the airlock assembly."), \
|
||||||
user.visible_message(span_notice("[user] adds [G.name] to the airlock assembly."), \
|
span_notice("You start to install [sheet.name] into the airlock assembly..."))
|
||||||
span_notice("You start to install [G.name] into the airlock assembly..."))
|
if(do_after(user, 4 SECONDS, target = src))
|
||||||
if(do_after(user, 4 SECONDS, target = src))
|
if(sheet.get_amount() < 1 || glass)
|
||||||
if(G.get_amount() < 1 || glass)
|
return
|
||||||
return
|
if(sheet.type == /obj/item/stack/sheet/rglass)
|
||||||
if(G.type == /obj/item/stack/sheet/rglass)
|
to_chat(user, span_notice("You install [sheet.name] windows into the airlock assembly."))
|
||||||
to_chat(user, span_notice("You install [G.name] windows into the airlock assembly."))
|
heat_proof_finished = 1 //reinforced glass makes the airlock heat-proof
|
||||||
heat_proof_finished = 1 //reinforced glass makes the airlock heat-proof
|
name = "near finished heat-proofed window airlock assembly"
|
||||||
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)
|
|
||||||
glass = TRUE
|
|
||||||
if(!nomineral && !mineral)
|
|
||||||
if(istype(G, /obj/item/stack/sheet/mineral) && G.sheettype)
|
|
||||||
var/M = G.sheettype
|
|
||||||
var/mineralassembly = text2path("/obj/structure/door_assembly/door_assembly_[M]")
|
|
||||||
if(!ispath(mineralassembly))
|
|
||||||
to_chat(user, span_warning("You cannot add [G] to [src]!"))
|
|
||||||
return
|
|
||||||
if(G.get_amount() >= 2)
|
|
||||||
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)
|
|
||||||
return
|
|
||||||
to_chat(user, span_notice("You install [M] plating into the airlock assembly."))
|
|
||||||
G.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.
|
|
||||||
var/obj/item/stack/sheet/dropped_glass
|
|
||||||
if(heat_proof_finished)
|
|
||||||
dropped_glass = new /obj/item/stack/sheet/rglass(drop_location())
|
|
||||||
heat_proof_finished = FALSE
|
|
||||||
else
|
|
||||||
dropped_glass = new /obj/item/stack/sheet/glass(drop_location())
|
|
||||||
glass = FALSE
|
|
||||||
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
|
else
|
||||||
to_chat(user, span_warning("You cannot add [G] to [src]!"))
|
to_chat(user, span_notice("You install regular glass windows into the airlock assembly."))
|
||||||
|
name = "near finished window airlock assembly"
|
||||||
|
sheet.use(1)
|
||||||
|
glass = TRUE
|
||||||
|
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 [sheet] to [src]!"))
|
||||||
|
return
|
||||||
|
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 [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."))
|
||||||
|
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.
|
||||||
|
var/obj/item/stack/sheet/dropped_glass
|
||||||
|
if(heat_proof_finished)
|
||||||
|
dropped_glass = new /obj/item/stack/sheet/rglass(drop_location())
|
||||||
|
heat_proof_finished = FALSE
|
||||||
|
else
|
||||||
|
dropped_glass = new /obj/item/stack/sheet/glass(drop_location())
|
||||||
|
glass = FALSE
|
||||||
|
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 if((W.tool_behaviour == TOOL_SCREWDRIVER) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
|
else if((W.tool_behaviour == TOOL_SCREWDRIVER) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
|
||||||
user.visible_message(span_notice("[user] finishes the airlock."), \
|
user.visible_message(span_notice("[user] finishes the airlock."), \
|
||||||
|
|||||||
@@ -44,12 +44,7 @@
|
|||||||
. += span_notice("[src] is designed for tram usage. Deconstructed with a screwdriver!")
|
. += 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)
|
/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)
|
add_fingerprint(user)
|
||||||
|
|
||||||
if(istype(W, /obj/item/gun/energy/plasmacutter))
|
if(istype(W, /obj/item/gun/energy/plasmacutter))
|
||||||
@@ -64,9 +59,14 @@
|
|||||||
if(!QDELETED(M))
|
if(!QDELETED(M))
|
||||||
M.add_fingerprint(user)
|
M.add_fingerprint(user)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(isstack(W))
|
||||||
|
var/obj/item/stack/stack = W
|
||||||
|
if(!stack.usable_for_construction)
|
||||||
|
balloon_alert(user, "can't make walls with it!")
|
||||||
return
|
return
|
||||||
|
|
||||||
else if(isstack(W))
|
|
||||||
if(iswallturf(loc) || (locate(/obj/structure/falsewall) in src.loc.contents))
|
if(iswallturf(loc) || (locate(/obj/structure/falsewall) in src.loc.contents))
|
||||||
balloon_alert(user, "wall already present!")
|
balloon_alert(user, "wall already present!")
|
||||||
return
|
return
|
||||||
@@ -78,245 +78,255 @@
|
|||||||
balloon_alert(user, "need tram floors!")
|
balloon_alert(user, "need tram floors!")
|
||||||
return
|
return
|
||||||
|
|
||||||
if(istype(W, /obj/item/stack/rods))
|
make_wall(stack, user)
|
||||||
var/obj/item/stack/rods/rod = W
|
return
|
||||||
var/amount = construction_cost[rod.type]
|
|
||||||
if(state == GIRDER_DISPLACED)
|
|
||||||
if(rod.get_amount() < amount)
|
|
||||||
balloon_alert(user, "need [amount] rods!")
|
|
||||||
return
|
|
||||||
balloon_alert(user, "concealing entrance...")
|
|
||||||
if(do_after(user, 2 SECONDS, target = src))
|
|
||||||
if(rod.get_amount() < amount)
|
|
||||||
return
|
|
||||||
rod.use(amount)
|
|
||||||
var/obj/structure/falsewall/iron/FW = new (loc)
|
|
||||||
transfer_fingerprints_to(FW)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
else if(state == GIRDER_REINF)
|
|
||||||
balloon_alert(user, "need plasteel sheet!")
|
|
||||||
return
|
|
||||||
else
|
|
||||||
if(rod.get_amount() < amount)
|
|
||||||
balloon_alert(user, "need [amount] rods!")
|
|
||||||
return
|
|
||||||
balloon_alert(user, "adding rods...")
|
|
||||||
if(do_after(user, 4 SECONDS, target = src))
|
|
||||||
if(rod.get_amount() < amount)
|
|
||||||
return
|
|
||||||
rod.use(amount)
|
|
||||||
var/turf/T = get_turf(src)
|
|
||||||
T.place_on_top(/turf/closed/wall/mineral/iron)
|
|
||||||
transfer_fingerprints_to(T)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
|
|
||||||
if(!istype(W, /obj/item/stack/sheet))
|
if(istype(W, /obj/item/pipe))
|
||||||
return
|
|
||||||
|
|
||||||
var/obj/item/stack/sheet/sheets = W
|
|
||||||
if(istype(sheets, /obj/item/stack/sheet/iron))
|
|
||||||
var/amount = construction_cost[/obj/item/stack/sheet/iron]
|
|
||||||
if(state == GIRDER_DISPLACED)
|
|
||||||
if(sheets.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)
|
|
||||||
return
|
|
||||||
sheets.use(amount)
|
|
||||||
var/obj/structure/falsewall/F = new (loc)
|
|
||||||
transfer_fingerprints_to(F)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
else if(state == GIRDER_REINF)
|
|
||||||
balloon_alert(user, "need plasteel sheet!")
|
|
||||||
return
|
|
||||||
else if(state == GIRDER_TRAM)
|
|
||||||
if(sheets.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)
|
|
||||||
return
|
|
||||||
sheets.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)
|
|
||||||
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)
|
|
||||||
return
|
|
||||||
sheets.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)
|
|
||||||
var/amount = construction_cost[/obj/item/stack/sheet/titaniumglass]
|
|
||||||
if(sheets.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)
|
|
||||||
return
|
|
||||||
sheets.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))
|
|
||||||
var/amount = construction_cost[/obj/item/stack/sheet/plasteel]
|
|
||||||
if(state == GIRDER_DISPLACED)
|
|
||||||
if(sheets.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)
|
|
||||||
return
|
|
||||||
sheets.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)
|
|
||||||
return
|
|
||||||
balloon_alert(user, "adding plating...")
|
|
||||||
if(do_after(user, 50*platingmodifier, target = src))
|
|
||||||
if(sheets.get_amount() < amount)
|
|
||||||
return
|
|
||||||
sheets.use(amount)
|
|
||||||
var/turf/T = get_turf(src)
|
|
||||||
T.place_on_top(/turf/closed/wall/r_wall)
|
|
||||||
transfer_fingerprints_to(T)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
else
|
|
||||||
amount = 1 // hur dur x2
|
|
||||||
if(sheets.get_amount() < amount)
|
|
||||||
return
|
|
||||||
balloon_alert(user, "reinforcing frame...")
|
|
||||||
if(do_after(user, 60*platingmodifier, target = src))
|
|
||||||
if(sheets.get_amount() < amount)
|
|
||||||
return
|
|
||||||
sheets.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(state == GIRDER_REINF)
|
|
||||||
if(sheets.get_amount() < 1)
|
|
||||||
return
|
|
||||||
balloon_alert(user, "adding plating...")
|
|
||||||
if(do_after(user, 50*platingmodifier, target = src))
|
|
||||||
if(sheets.get_amount() < 1)
|
|
||||||
return
|
|
||||||
sheets.use(1)
|
|
||||||
var/turf/T = get_turf(src)
|
|
||||||
T.place_on_top(/turf/closed/wall/r_wall/plastitanium)
|
|
||||||
transfer_fingerprints_to(T)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
// No return here because generic material construction handles making normal plastitanium walls
|
|
||||||
|
|
||||||
if(!sheets.has_unique_girder && sheets.material_type)
|
|
||||||
if(istype(src, /obj/structure/girder/reinforced))
|
|
||||||
balloon_alert(user, "need plasteel or plastitanium!")
|
|
||||||
return
|
|
||||||
|
|
||||||
var/M = sheets.sheettype
|
|
||||||
var/amount = construction_cost["exotic_material"]
|
|
||||||
if(state == GIRDER_TRAM)
|
|
||||||
if(sheets.get_amount() < amount)
|
|
||||||
balloon_alert(user, "need [amount] sheets!")
|
|
||||||
return
|
|
||||||
var/tram_wall_type = text2path("/obj/structure/tram/alt/[M]")
|
|
||||||
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)
|
|
||||||
return
|
|
||||||
var/obj/structure/tram/tram_wall
|
|
||||||
tram_wall = new tram_wall_type(loc)
|
|
||||||
sheets.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)
|
|
||||||
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)
|
|
||||||
return
|
|
||||||
sheets.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
|
|
||||||
if(material_list)
|
|
||||||
mat_falsewall.set_custom_materials(material_list)
|
|
||||||
falsewall = mat_falsewall
|
|
||||||
transfer_fingerprints_to(falsewall)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
else
|
|
||||||
if(sheets.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)
|
|
||||||
return
|
|
||||||
sheets.use(amount)
|
|
||||||
var/turf/T = get_turf(src)
|
|
||||||
if(sheets.walltype)
|
|
||||||
T.place_on_top(sheets.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
|
|
||||||
if(material_list)
|
|
||||||
newturf.set_custom_materials(material_list)
|
|
||||||
|
|
||||||
transfer_fingerprints_to(T)
|
|
||||||
qdel(src)
|
|
||||||
return
|
|
||||||
|
|
||||||
add_hiddenprint(user)
|
|
||||||
|
|
||||||
else if(istype(W, /obj/item/pipe))
|
|
||||||
var/obj/item/pipe/P = W
|
var/obj/item/pipe/P = W
|
||||||
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
|
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()))
|
if(!user.transfer_item_to_turf(P, drop_location()))
|
||||||
return
|
return
|
||||||
balloon_alert(user, "inserted pipe")
|
balloon_alert(user, "inserted pipe")
|
||||||
else
|
return
|
||||||
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)
|
||||||
|
balloon_alert(user, "need [amount] rods!")
|
||||||
|
return
|
||||||
|
balloon_alert(user, "concealing entrance...")
|
||||||
|
if(do_after(user, 2 SECONDS, target = src))
|
||||||
|
if(rod.get_amount() < amount)
|
||||||
|
return
|
||||||
|
rod.use(amount)
|
||||||
|
var/obj/structure/falsewall/iron/FW = new (loc)
|
||||||
|
transfer_fingerprints_to(FW)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(state == GIRDER_REINF)
|
||||||
|
balloon_alert(user, "need plasteel sheet!")
|
||||||
|
return
|
||||||
|
|
||||||
|
if(rod.get_amount() < amount)
|
||||||
|
balloon_alert(user, "need [amount] rods!")
|
||||||
|
return
|
||||||
|
balloon_alert(user, "adding rods...")
|
||||||
|
if(do_after(user, 4 SECONDS, target = src))
|
||||||
|
if(rod.get_amount() < amount)
|
||||||
|
return
|
||||||
|
rod.use(amount)
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
T.place_on_top(/turf/closed/wall/mineral/iron)
|
||||||
|
transfer_fingerprints_to(T)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(istype(stack, /obj/item/stack/sheet/iron))
|
||||||
|
var/amount = construction_cost[/obj/item/stack/sheet/iron]
|
||||||
|
if(state == GIRDER_DISPLACED)
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
balloon_alert(user, "need [amount] sheets!")
|
||||||
|
return
|
||||||
|
balloon_alert(user, "concealing entrance...")
|
||||||
|
if(do_after(user, 20 * speed_modifier, target = src))
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
stack.use(amount)
|
||||||
|
var/obj/structure/falsewall/F = new (loc)
|
||||||
|
transfer_fingerprints_to(F)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
else if(state == GIRDER_REINF)
|
||||||
|
balloon_alert(user, "need plasteel sheet!")
|
||||||
|
return
|
||||||
|
else if(state == GIRDER_TRAM)
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
stack.use(amount)
|
||||||
|
var/obj/structure/tram/alt/iron/tram_wall = new(loc)
|
||||||
|
transfer_fingerprints_to(tram_wall)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
balloon_alert(user, "need [amount] sheets!")
|
||||||
|
return
|
||||||
|
balloon_alert(user, "adding plating...")
|
||||||
|
if (do_after(user, 40 * speed_modifier, target = src))
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
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(stack, /obj/item/stack/sheet/titaniumglass) && state == GIRDER_TRAM)
|
||||||
|
var/amount = construction_cost[/obj/item/stack/sheet/titaniumglass]
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
stack.use(amount)
|
||||||
|
var/obj/structure/tram/tram_wall = new(loc)
|
||||||
|
transfer_fingerprints_to(tram_wall)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(istype(stack, /obj/item/stack/sheet/plasteel))
|
||||||
|
var/amount = construction_cost[/obj/item/stack/sheet/plasteel]
|
||||||
|
if(state == GIRDER_DISPLACED)
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
balloon_alert(user, "adding plating...")
|
||||||
|
if(do_after(user, 50 * speed_modifier, target = src))
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
stack.use(amount)
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
T.place_on_top(/turf/closed/wall/r_wall)
|
||||||
|
transfer_fingerprints_to(T)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
amount = 1 // hur dur x2
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
balloon_alert(user, "reinforcing frame...")
|
||||||
|
if(do_after(user, 60 * speed_modifier, target = src))
|
||||||
|
if(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
stack.use(amount)
|
||||||
|
var/obj/structure/girder/reinforced/R = new (loc)
|
||||||
|
transfer_fingerprints_to(R)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(istype(stack, /obj/item/stack/sheet/mineral/plastitanium))
|
||||||
|
if(state == GIRDER_REINF)
|
||||||
|
if(stack.get_amount() < 1)
|
||||||
|
return
|
||||||
|
balloon_alert(user, "adding plating...")
|
||||||
|
if(do_after(user, 50 * speed_modifier, target = src))
|
||||||
|
if(stack.get_amount() < 1)
|
||||||
|
return
|
||||||
|
stack.use(1)
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
T.place_on_top(/turf/closed/wall/r_wall/plastitanium)
|
||||||
|
transfer_fingerprints_to(T)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
// No return here because generic material construction handles making normal plastitanium walls
|
||||||
|
|
||||||
|
if(!stack.has_unique_girder && stack.material_type)
|
||||||
|
if(istype(src, /obj/structure/girder/reinforced))
|
||||||
|
balloon_alert(user, "need plasteel or plastitanium!")
|
||||||
|
return
|
||||||
|
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
balloon_alert(user, "need [amount] sheets!")
|
||||||
|
return
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
var/obj/structure/tram/tram_wall
|
||||||
|
tram_wall = new tram_wall_type(loc)
|
||||||
|
stack.use(amount)
|
||||||
|
transfer_fingerprints_to(tram_wall)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
if(state == GIRDER_DISPLACED)
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
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(stack.material_type)] = SHEET_MATERIAL_AMOUNT * 2
|
||||||
|
if(material_list)
|
||||||
|
mat_falsewall.set_custom_materials(material_list)
|
||||||
|
falsewall = mat_falsewall
|
||||||
|
transfer_fingerprints_to(falsewall)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
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(stack.get_amount() < amount)
|
||||||
|
return
|
||||||
|
stack.use(amount)
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
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(stack.material_type)] = SHEET_MATERIAL_AMOUNT * 2
|
||||||
|
if(material_list)
|
||||||
|
newturf.set_custom_materials(material_list)
|
||||||
|
|
||||||
|
transfer_fingerprints_to(T)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
// Screwdriver behavior for girders
|
// Screwdriver behavior for girders
|
||||||
/obj/structure/girder/screwdriver_act(mob/user, obj/item/tool)
|
/obj/structure/girder/screwdriver_act(mob/user, obj/item/tool)
|
||||||
|
|||||||
@@ -248,7 +248,7 @@
|
|||||||
on = FALSE
|
on = FALSE
|
||||||
else
|
else
|
||||||
var/out = get_step(src, output_dir)
|
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)
|
/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
|
var/datum/design/alloy = stored_research.isDesignResearchedID(selected_alloy) //check if it's a valid design
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
MATCONTAINER_EXAMINE, \
|
MATCONTAINER_EXAMINE, \
|
||||||
container_signals = list( \
|
container_signals = list( \
|
||||||
COMSIG_MATCONTAINER_ITEM_CONSUMED = TYPE_PROC_REF(/obj/machinery/ore_silo, on_item_consumed), \
|
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 \
|
allowed_items = /obj/item/stack \
|
||||||
)
|
)
|
||||||
@@ -330,7 +330,7 @@
|
|||||||
if(isnull(amount))
|
if(isnull(amount))
|
||||||
return
|
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
|
return TRUE
|
||||||
|
|
||||||
if("toggle_ban")
|
if("toggle_ban")
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
w_class = WEIGHT_CLASS_TINY
|
w_class = WEIGHT_CLASS_TINY
|
||||||
mine_experience = 0 //its sand
|
mine_experience = 0 //its sand
|
||||||
merge_type = /obj/item/stack/ore/glass
|
merge_type = /obj/item/stack/ore/glass
|
||||||
|
usable_for_construction = TRUE
|
||||||
|
|
||||||
GLOBAL_LIST_INIT(sand_recipes, list(\
|
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), \
|
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)
|
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
|
/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)
|
qdel(src)
|
||||||
return glass
|
return glass
|
||||||
|
|
||||||
|
|||||||
@@ -846,7 +846,7 @@
|
|||||||
50 * SHEET_MATERIAL_AMOUNT, \
|
50 * SHEET_MATERIAL_AMOUNT, \
|
||||||
MATCONTAINER_EXAMINE | MATCONTAINER_NO_INSERT, \
|
MATCONTAINER_EXAMINE | MATCONTAINER_NO_INSERT, \
|
||||||
container_signals = list( \
|
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) \
|
||||||
) \
|
) \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user