mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 11:35:19 +01:00
Merge remote-tracking branch 'upstream/dev-freeze' into dev
Conflicts: code/ZAS/Controller.dm code/datums/mind.dm code/game/objects/items/devices/scanners.dm code/game/objects/items/stacks/sheets/glass.dm code/modules/materials/materials.dm code/modules/mob/living/carbon/brain/posibrain.dm code/modules/mob/living/silicon/pai/pai.dm
This commit is contained in:
@@ -47,6 +47,19 @@
|
||||
return 0
|
||||
..(S,tamount,1)
|
||||
|
||||
/obj/item/stack/material/attack_self(var/mob/user)
|
||||
if(!material.build_windows(user, src))
|
||||
..()
|
||||
|
||||
/obj/item/stack/material/attackby(var/obj/item/W, var/mob/user)
|
||||
if(istype(W,/obj/item/stack/cable_coil))
|
||||
material.build_wired_product(user, W, src)
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/rods))
|
||||
material.build_rod_product(user, W, src)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/material/iron
|
||||
name = "iron"
|
||||
icon_state = "sheet-silver"
|
||||
@@ -75,7 +88,7 @@
|
||||
default_type = "phoron"
|
||||
|
||||
/obj/item/stack/material/plastic
|
||||
name = "Plastic"
|
||||
name = "plastic"
|
||||
icon_state = "sheet-plastic"
|
||||
default_type = "plastic"
|
||||
|
||||
@@ -151,3 +164,27 @@
|
||||
singular_name = "leather piece"
|
||||
icon_state = "sheet-leather"
|
||||
default_type = "leather"
|
||||
|
||||
/obj/item/stack/material/glass
|
||||
name = "glass"
|
||||
singular_name = "glass sheet"
|
||||
icon_state = "sheet-glass"
|
||||
default_type = "glass"
|
||||
|
||||
/obj/item/stack/material/glass/reinforced
|
||||
name = "reinforced glass"
|
||||
singular_name = "reinforced glass sheet"
|
||||
icon_state = "sheet-rglass"
|
||||
default_type = "reinforced glass"
|
||||
|
||||
/obj/item/stack/material/glass/phoronglass
|
||||
name = "phoron glass"
|
||||
singular_name = "phoron glass sheet"
|
||||
icon_state = "sheet-phoronglass"
|
||||
default_type = "phoron glass"
|
||||
|
||||
/obj/item/stack/material/glass/phoronrglass
|
||||
name = "reinforced phoron glass"
|
||||
singular_name = "reinforced phoron glass sheet"
|
||||
icon_state = "sheet-phoronrglass"
|
||||
default_type = "reinforced phoron glass"
|
||||
|
||||
@@ -13,20 +13,26 @@
|
||||
matter = null
|
||||
|
||||
/obj/item/stack/material/cyborg/plastic
|
||||
icon_state = "sheet-plastic"
|
||||
default_type = "plastic"
|
||||
|
||||
/obj/item/stack/material/cyborg/steel
|
||||
icon_state = "sheet-metal"
|
||||
default_type = "steel"
|
||||
|
||||
/obj/item/stack/material/cyborg/plasteel
|
||||
icon_state = "sheet-plasteel"
|
||||
default_type = "plasteel"
|
||||
|
||||
/obj/item/stack/material/cyborg/wood
|
||||
icon_state = "sheet-wood"
|
||||
default_type = "wood"
|
||||
|
||||
/obj/item/stack/material/cyborg/glass
|
||||
icon_state = "sheet-glass"
|
||||
default_type = "glass"
|
||||
|
||||
/obj/item/stack/material/cyborg/glass/reinforced
|
||||
icon_state = "sheet-rglass"
|
||||
default_type = "reinforced glass"
|
||||
charge_costs = list(500, 1000)
|
||||
@@ -76,6 +76,12 @@ var/list/name_to_material
|
||||
var/conductive = 1 // Objects with this var add CONDUCTS to flags on spawn.
|
||||
var/list/composite_material // If set, object matter var will be a list containing these values.
|
||||
|
||||
// Placeholder vars for the time being, todo properly integrate windows/light tiles/rods.
|
||||
var/created_window
|
||||
var/rod_product
|
||||
var/wire_product
|
||||
var/list/window_options = list()
|
||||
|
||||
// Damage values.
|
||||
var/hardness = 60 // Prob of wall destruction by hulk, used for edge damage in weapons.
|
||||
var/weight = 20 // Determines blunt damage/throwforce for weapons.
|
||||
@@ -89,6 +95,37 @@ var/list/name_to_material
|
||||
// Wallrot crumble message.
|
||||
var/rotting_touch_message = "crumbles under your touch"
|
||||
|
||||
// Placeholders for light tiles and rglass.
|
||||
/material/proc/build_rod_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack)
|
||||
if(!rod_product)
|
||||
user << "<span class='warning'>You cannot make anything out of \the [target_stack]</span>"
|
||||
return
|
||||
if(used_stack.get_amount() < 1 || target_stack.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one rod and one sheet of [display_name] to make anything useful.</span>"
|
||||
return
|
||||
used_stack.use(1)
|
||||
target_stack.use(1)
|
||||
var/obj/item/stack/S = new rod_product(get_turf(user))
|
||||
S.add_fingerprint(user)
|
||||
S.add_to_stacks(user)
|
||||
if(!(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(S)
|
||||
|
||||
/material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack)
|
||||
if(!wire_product)
|
||||
user << "<span class='warning'>You cannot make anything out of \the [target_stack]</span>"
|
||||
return
|
||||
if(used_stack.get_amount() < 5 || target_stack.get_amount() < 1)
|
||||
user << "<span class='warning'>You need five wires and one sheet of [display_name] to make anything useful.</span>"
|
||||
return
|
||||
|
||||
used_stack.use(5)
|
||||
target_stack.use(1)
|
||||
user << "<span class='notice'>You attach wire to the [name].</span>"
|
||||
var/obj/item/product = new wire_product(get_turf(user))
|
||||
if(!(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(product)
|
||||
|
||||
// Make sure we have a display name and shard icon even if they aren't explicitly set.
|
||||
/material/New()
|
||||
..()
|
||||
@@ -99,6 +136,10 @@ var/list/name_to_material
|
||||
if(!shard_icon)
|
||||
shard_icon = shard_type
|
||||
|
||||
// This is a placeholder for proper integration of windows/windoors into the system.
|
||||
/material/proc/build_windows(var/mob/living/user, var/obj/item/stack/used_stack)
|
||||
return 0
|
||||
|
||||
// Weapons handle applying a divisor for this value locally.
|
||||
/material/proc/get_blunt_damage()
|
||||
return weight //todo
|
||||
@@ -271,7 +312,7 @@ var/list/name_to_material
|
||||
hardness = 80
|
||||
weight = 23
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2)
|
||||
composite_material = list() //todo
|
||||
composite_material = list(DEFAULT_WALL_MATERIAL = 3750, "platinum" = 3750) //todo
|
||||
|
||||
/material/glass
|
||||
name = "glass"
|
||||
@@ -286,21 +327,82 @@ var/list/name_to_material
|
||||
weight = 15
|
||||
door_icon_base = "stone"
|
||||
destruction_desc = "shatters"
|
||||
window_options = list("One Direction", "Full Window")
|
||||
created_window = /obj/structure/window/basic
|
||||
wire_product = /obj/item/stack/light_w
|
||||
rod_product = /obj/item/stack/material/glass/reinforced
|
||||
|
||||
/material/glass/phoron
|
||||
name = "phoron glass"
|
||||
stack_type = /obj/item/stack/material/glass/phoronglass
|
||||
flags = MATERIAL_BRITTLE
|
||||
ignition_point = 300
|
||||
integrity = 200 // idk why but phoron windows are strong, so.
|
||||
icon_colour = "#FC2BC5"
|
||||
stack_origin_tech = list(TECH_MATERIAL = 3, TECH_PHORON = 2)
|
||||
/material/glass/build_windows(var/mob/living/user, var/obj/item/stack/used_stack)
|
||||
|
||||
/material/glass/phoron/reinforced
|
||||
name = "reinforced phoron glass"
|
||||
stack_type = /obj/item/stack/material/glass/phoronrglass
|
||||
stack_origin_tech = list(TECH_MATERIAL = 4, TECH_PHORON = 2)
|
||||
composite_material = list() //todo
|
||||
if(!user || !used_stack || !created_window || !window_options.len)
|
||||
return 0
|
||||
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "<span class='warning'>This task is too complex for your clumsy hands.</span>"
|
||||
return 1
|
||||
|
||||
var/turf/T = user.loc
|
||||
if(!istype(T))
|
||||
user << "<span class='warning'>You must be standing on open flooring to build a window.</span>"
|
||||
return 1
|
||||
|
||||
var/title = "Sheet-[used_stack.name] ([used_stack.get_amount()] sheet\s left)"
|
||||
var/choice = input(title, "What would you like to construct?") as null|anything in window_options
|
||||
|
||||
if(!choice || !used_stack || !user || used_stack.loc != user || user.stat || user.loc != T)
|
||||
return 1
|
||||
|
||||
// Get data for building windows here.
|
||||
var/list/possible_directions = cardinal.Copy()
|
||||
var/window_count = 0
|
||||
for (var/obj/structure/window/check_window in user.loc)
|
||||
window_count++
|
||||
possible_directions -= check_window.dir
|
||||
|
||||
// Get the closest available dir to the user's current facing.
|
||||
var/build_dir = SOUTHWEST //Default to southwest for fulltile windows.
|
||||
var/failed_to_build
|
||||
|
||||
if(window_count >= 4)
|
||||
failed_to_build = 1
|
||||
else
|
||||
if(choice in list("One Direction","Windoor"))
|
||||
if(possible_directions.len)
|
||||
for(var/direction in list(user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) ))
|
||||
if(direction in possible_directions)
|
||||
build_dir = direction
|
||||
break
|
||||
else
|
||||
failed_to_build = 1
|
||||
if(!failed_to_build && choice == "Windoor")
|
||||
if(!is_reinforced())
|
||||
user << "<span class='warning'>This material is not reinforced enough to use for a door.</span>"
|
||||
return
|
||||
if((locate(/obj/structure/windoor_assembly) in T.contents) || (locate(/obj/machinery/door/window) in T.contents))
|
||||
failed_to_build = 1
|
||||
if(failed_to_build)
|
||||
user << "<span class='warning'>There is no room in this location.</span>"
|
||||
return 1
|
||||
|
||||
var/build_path = /obj/structure/windoor_assembly
|
||||
var/sheets_needed = 4
|
||||
if(choice == "Windoor")
|
||||
sheets_needed = 5
|
||||
build_dir = user.dir
|
||||
else
|
||||
build_path = created_window
|
||||
|
||||
if(used_stack.get_amount() < sheets_needed)
|
||||
user << "<span class='warning'>You need at least [sheets_needed] sheets to build this.</span>"
|
||||
return 1
|
||||
|
||||
// Build the structure and update sheet count etc.
|
||||
used_stack.use(sheets_needed)
|
||||
new build_path(T, build_dir, 1)
|
||||
return 1
|
||||
|
||||
/material/glass/proc/is_reinforced()
|
||||
return (hardness > 35) //todo
|
||||
|
||||
/material/glass/reinforced
|
||||
name = "reinforced glass"
|
||||
@@ -313,8 +415,36 @@ var/list/name_to_material
|
||||
tableslam_noise = 'sound/effects/Glasshit.ogg'
|
||||
hardness = 40
|
||||
weight = 30
|
||||
stack_origin_tech = "materials=2"
|
||||
composite_material = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750)
|
||||
window_options = list("One Direction", "Full Window", "Windoor")
|
||||
created_window = /obj/structure/window/reinforced
|
||||
wire_product = null
|
||||
rod_product = null
|
||||
|
||||
/material/glass/phoron
|
||||
name = "phoron glass"
|
||||
stack_type = /obj/item/stack/material/glass/phoronglass
|
||||
flags = MATERIAL_BRITTLE
|
||||
ignition_point = 300
|
||||
integrity = 200 // idk why but phoron windows are strong, so.
|
||||
icon_colour = "#FC2BC5"
|
||||
stack_origin_tech = list(TECH_MATERIAL = 3, TECH_PHORON = 2)
|
||||
created_window = /obj/structure/window/phoronbasic
|
||||
wire_product = null
|
||||
rod_product = /obj/item/stack/material/glass/phoronrglass
|
||||
|
||||
/material/glass/phoron/reinforced
|
||||
name = "reinforced phoron glass"
|
||||
stack_type = /obj/item/stack/material/glass/phoronrglass
|
||||
stack_origin_tech = list(TECH_MATERIAL = 4, TECH_PHORON = 2)
|
||||
composite_material = list() //todo
|
||||
created_window = /obj/structure/window/phoronreinforced
|
||||
hardness = 40
|
||||
weight = 30
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2)
|
||||
composite_material = list() //todo
|
||||
rod_product = null
|
||||
|
||||
/material/plastic
|
||||
name = "plastic"
|
||||
|
||||
Reference in New Issue
Block a user