mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 12:13:06 +00:00
519 lines
15 KiB
Plaintext
519 lines
15 KiB
Plaintext
/*
|
|
MATERIAL DATUMS
|
|
This data is used by various parts of the game for basic physical properties and behaviors
|
|
of the metals/materials used for constructing many objects. Each var is commented and should be pretty
|
|
self-explanatory but the various object types may have their own documentation. ~Z
|
|
|
|
PATHS THAT USE DATUMS
|
|
/turf/simulated/wall
|
|
/obj/item/weapon/material
|
|
/obj/structure/barricade
|
|
/obj/item/stack/material
|
|
/obj/structure/table
|
|
|
|
VALID ICONS
|
|
WALLS
|
|
stone
|
|
metal
|
|
solid
|
|
cult
|
|
DOORS
|
|
stone
|
|
metal
|
|
resin
|
|
wood
|
|
*/
|
|
|
|
// Assoc list containing all material datums indexed by name.
|
|
var/list/name_to_material
|
|
|
|
// Builds the datum list above.
|
|
/proc/populate_material_list(force_remake=0)
|
|
if(name_to_material && !force_remake) return // Already set up!
|
|
name_to_material = list()
|
|
for(var/type in typesof(/material) - /material)
|
|
var/material/new_mineral = new type
|
|
if(!new_mineral.name)
|
|
continue
|
|
name_to_material[lowertext(new_mineral.name)] = new_mineral
|
|
return 1
|
|
|
|
// Safety proc to make sure the material list exists before trying to grab from it.
|
|
/proc/get_material_by_name(name)
|
|
if(!name_to_material)
|
|
populate_material_list()
|
|
return name_to_material[name]
|
|
|
|
// Material definition and procs follow.
|
|
/material
|
|
var/name // Unique name for use in indexing the list.
|
|
var/display_name // Prettier name for display.
|
|
var/use_name
|
|
var/flags = 0 // Various status modifiers.
|
|
|
|
// Shards/tables/structures
|
|
var/shard_type = SHARD_SHRAPNEL // Path of debris object.
|
|
var/shard_icon // Related to above.
|
|
var/shard_can_repair = 1 // Can shards be turned into sheets with a welder?
|
|
var/list/recipes // Holder for all recipes usable with a sheet of this material.
|
|
var/destruction_desc = "breaks apart" // Fancy string for barricades/tables/objects exploding.
|
|
|
|
// Icons
|
|
var/icon_colour // Colour applied to products of this material.
|
|
var/icon_base = "metal" // Wall and table base icon tag. See header.
|
|
var/door_icon_base = "metal" // Door base icon tag. See header.
|
|
var/icon_reinf = "reinf_metal" // Overlay used
|
|
var/stack_origin_tech = "materials=1" // Research level for stacks.
|
|
var/stack_per_sheet = 2000 // perunit value for stacks.
|
|
|
|
// Attributes
|
|
var/cut_delay = 0 // Delay in ticks when cutting through this wall.
|
|
var/radioactivity // Radiation var. Used in wall and object processing to irradiate surroundings.
|
|
var/ignition_point // Point at which the material catches on fire.
|
|
var/melting_point = 1800 // K, walls will take damage if they're next to a fire hotter than this
|
|
var/integrity = 150 // General-use HP value for products.
|
|
var/opacity = 1 // Is the material transparent? 0.5< makes transparent walls/doors.
|
|
var/explosion_resistance = 5 // Only used by walls currently.
|
|
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.
|
|
|
|
// 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.
|
|
|
|
// Noise when someone is faceplanted onto a table made of this material.
|
|
var/tableslam_noise = 'sound/weapons/tablehit1.ogg'
|
|
// Noise made when a simple door made of this material opens or closes.
|
|
var/dooropen_noise = 'sound/effects/stonedoor_openclose.ogg'
|
|
// Path to resulting stacktype. Todo remove need for this.
|
|
var/stack_type
|
|
// Wallrot crumble message.
|
|
var/rotting_touch_message = "crumbles under your touch"
|
|
|
|
// Make sure we have a display name and shard icon even if they aren't explicitly set.
|
|
/material/New()
|
|
..()
|
|
if(!display_name)
|
|
display_name = name
|
|
if(!use_name)
|
|
use_name = display_name
|
|
if(!shard_icon)
|
|
shard_icon = shard_type
|
|
|
|
// Weapons handle applying a divisor for this value locally.
|
|
/material/proc/get_blunt_damage()
|
|
return weight //todo
|
|
|
|
// Return the matter comprising this material.
|
|
/material/proc/get_matter()
|
|
var/list/temp_matter = list()
|
|
if(islist(composite_material))
|
|
for(var/material_string in composite_material)
|
|
temp_matter[material_string] = composite_material[material_string]
|
|
else if(stack_per_sheet)
|
|
temp_matter[name] = stack_per_sheet
|
|
return temp_matter
|
|
|
|
// As above.
|
|
/material/proc/get_edge_damage()
|
|
return hardness //todo
|
|
|
|
// Snowflakey, only checked for alien doors at the moment.
|
|
/material/proc/can_open_material_door(var/mob/living/user)
|
|
return 1
|
|
|
|
// Currently used for weapons and objects made of uranium to irradiate things.
|
|
/material/proc/products_need_process()
|
|
return (radioactivity>0) //todo
|
|
|
|
// Used by walls when qdel()ing to avoid neighbor merging.
|
|
/material/placeholder
|
|
name = "placeholder"
|
|
|
|
// Places a girder object when a wall is dismantled, also applies reinforced material.
|
|
/material/proc/place_dismantled_girder(var/turf/target, var/material/reinf_material)
|
|
var/obj/structure/girder/G = new(target)
|
|
if(reinf_material)
|
|
G.reinf_material = reinf_material
|
|
G.reinforce_girder()
|
|
|
|
// General wall debris product placement.
|
|
// Not particularly necessary aside from snowflakey cult girders.
|
|
/material/proc/place_dismantled_product(var/turf/target,var/is_devastated)
|
|
for(var/x=1;x<(is_devastated?2:3);x++)
|
|
place_sheet(target)
|
|
|
|
// Debris product. Used ALL THE TIME.
|
|
/material/proc/place_sheet(var/turf/target)
|
|
if(stack_type)
|
|
return new stack_type(target)
|
|
|
|
// As above.
|
|
/material/proc/place_shard(var/turf/target)
|
|
if(shard_type)
|
|
return new /obj/item/weapon/material/shard(target, src.name)
|
|
|
|
// Used by walls and weapons to determine if they break or not.
|
|
/material/proc/is_brittle()
|
|
return !!(flags & MATERIAL_BRITTLE)
|
|
|
|
/material/proc/combustion_effect(var/turf/T, var/temperature)
|
|
return
|
|
|
|
// Datum definitions follow.
|
|
/material/uranium
|
|
name = "uranium"
|
|
stack_type = /obj/item/stack/material/uranium
|
|
radioactivity = 12
|
|
icon_base = "stone"
|
|
icon_reinf = "reinf_stone"
|
|
icon_colour = "#007A00"
|
|
weight = 22
|
|
stack_origin_tech = "materials=5"
|
|
door_icon_base = "stone"
|
|
|
|
/material/diamond
|
|
name = "diamond"
|
|
stack_type = /obj/item/stack/material/diamond
|
|
flags = MATERIAL_UNMELTABLE
|
|
cut_delay = 60
|
|
icon_colour = "#00FFE1"
|
|
opacity = 0.4
|
|
shard_type = SHARD_SHARD
|
|
tableslam_noise = 'sound/effects/Glasshit.ogg'
|
|
hardness = 100
|
|
stack_origin_tech = "materials=6"
|
|
stack_per_sheet = 3750
|
|
|
|
/material/gold
|
|
name = "gold"
|
|
stack_type = /obj/item/stack/material/gold
|
|
icon_colour = "#EDD12F"
|
|
weight = 24
|
|
hardness = 40
|
|
stack_origin_tech = "materials=4"
|
|
|
|
/material/gold/bronze //placeholder for ashtrays
|
|
name = "bronze"
|
|
icon_colour = "#EDD12F"
|
|
|
|
/material/silver
|
|
name = "silver"
|
|
stack_type = /obj/item/stack/material/silver
|
|
icon_colour = "#D1E6E3"
|
|
weight = 22
|
|
hardness = 50
|
|
stack_origin_tech = "materials=3"
|
|
|
|
/material/phoron
|
|
name = "phoron"
|
|
stack_type = /obj/item/stack/material/phoron
|
|
ignition_point = 100
|
|
icon_base = "stone"
|
|
icon_colour = "#FC2BC5"
|
|
shard_type = SHARD_SHARD
|
|
hardness = 30
|
|
stack_origin_tech = "phorontech=2;materials=2"
|
|
door_icon_base = "stone"
|
|
|
|
/material/phoron/combustion_effect(var/turf/T, var/temperature, var/effect_multiplier)
|
|
if(isnull(ignition_point))
|
|
return 0
|
|
if(temperature < ignition_point)
|
|
return 0
|
|
var/totalPhoron = 0
|
|
for(var/turf/simulated/floor/target_tile in range(2,T))
|
|
var/phoronToDeduce = (temperature/30) * effect_multiplier
|
|
totalPhoron += phoronToDeduce
|
|
target_tile.assume_gas("phoron", phoronToDeduce, 200+T0C)
|
|
spawn (0)
|
|
target_tile.hotspot_expose(temperature, 400)
|
|
return round(totalPhoron/100)
|
|
|
|
/material/stone
|
|
name = "sandstone"
|
|
stack_type = /obj/item/stack/material/sandstone
|
|
icon_base = "stone"
|
|
icon_reinf = "reinf_stone"
|
|
icon_colour = "#D9C179"
|
|
shard_type = SHARD_STONE_PIECE
|
|
weight = 22
|
|
hardness = 55
|
|
door_icon_base = "stone"
|
|
|
|
/material/stone/marble
|
|
name = "marble"
|
|
icon_colour = "#AAAAAA"
|
|
weight = 26
|
|
hardness = 100
|
|
integrity = 201 //hack to stop kitchen benches being flippable, todo: refactor into weight system
|
|
|
|
/material/steel
|
|
name = DEFAULT_WALL_MATERIAL
|
|
stack_type = /obj/item/stack/material/steel
|
|
icon_base = "solid"
|
|
icon_reinf = "reinf_over"
|
|
icon_colour = "#666666"
|
|
|
|
/material/steel/holographic
|
|
name = "holographic " + DEFAULT_WALL_MATERIAL
|
|
display_name = DEFAULT_WALL_MATERIAL
|
|
stack_type = null
|
|
shard_type = SHARD_NONE
|
|
|
|
/material/plasteel
|
|
name = "plasteel"
|
|
stack_type = /obj/item/stack/material/plasteel
|
|
integrity = 800
|
|
melting_point = 6000
|
|
icon_base = "solid"
|
|
icon_reinf = "reinf_over"
|
|
icon_colour = "#777777"
|
|
explosion_resistance = 25
|
|
hardness = 80
|
|
weight = 23
|
|
stack_origin_tech = "materials=2"
|
|
composite_material = list() //todo
|
|
|
|
/material/glass
|
|
name = "glass"
|
|
stack_type = /obj/item/stack/material/glass
|
|
flags = MATERIAL_BRITTLE
|
|
icon_colour = "#00E1FF"
|
|
opacity = 0.3
|
|
integrity = 100
|
|
shard_type = SHARD_SHARD
|
|
tableslam_noise = 'sound/effects/Glasshit.ogg'
|
|
hardness = 30
|
|
weight = 15
|
|
door_icon_base = "stone"
|
|
destruction_desc = "shatters"
|
|
|
|
/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 = "materials=3;phorontech=2"
|
|
|
|
/material/glass/phoron/reinforced
|
|
name = "reinforced phoron glass"
|
|
stack_type = /obj/item/stack/material/glass/phoronrglass
|
|
stack_origin_tech = "materials=4;phorontech=2"
|
|
composite_material = list() //todo
|
|
|
|
/material/glass/reinforced
|
|
name = "reinforced glass"
|
|
stack_type = /obj/item/stack/material/glass/reinforced
|
|
flags = MATERIAL_BRITTLE
|
|
icon_colour = "#00E1FF"
|
|
opacity = 0.3
|
|
integrity = 100
|
|
shard_type = SHARD_SHARD
|
|
tableslam_noise = 'sound/effects/Glasshit.ogg'
|
|
hardness = 40
|
|
weight = 30
|
|
stack_origin_tech = "materials=2"
|
|
composite_material = list() //todo
|
|
|
|
/material/plastic
|
|
name = "plastic"
|
|
stack_type = /obj/item/stack/material/plastic
|
|
flags = MATERIAL_BRITTLE
|
|
icon_base = "solid"
|
|
icon_reinf = "reinf_over"
|
|
icon_colour = "#CCCCCC"
|
|
hardness = 10
|
|
weight = 12
|
|
stack_origin_tech = "materials=3"
|
|
|
|
/material/osmium
|
|
name = "osmium"
|
|
stack_type = /obj/item/stack/material/osmium
|
|
icon_colour = "#9999FF"
|
|
stack_origin_tech = "materials=5"
|
|
|
|
/material/tritium
|
|
name = "tritium"
|
|
stack_type = /obj/item/stack/material/tritium
|
|
icon_colour = "#777777"
|
|
stack_origin_tech = "materials=5"
|
|
|
|
/material/mhydrogen
|
|
name = "mhydrogen"
|
|
stack_type = /obj/item/stack/material/mhydrogen
|
|
icon_colour = "#E6C5DE"
|
|
stack_origin_tech = "materials=6;powerstorage=5;magnets=5"
|
|
|
|
/material/platinum
|
|
name = "platinum"
|
|
stack_type = /obj/item/stack/material/platinum
|
|
icon_colour = "#9999FF"
|
|
weight = 27
|
|
stack_origin_tech = "materials=2"
|
|
|
|
/material/iron
|
|
name = "iron"
|
|
stack_type = /obj/item/stack/material/iron
|
|
icon_colour = "#5C5454"
|
|
weight = 22
|
|
stack_per_sheet = 3750
|
|
|
|
// Adminspawn only, do not let anyone get this.
|
|
/material/voxalloy
|
|
name = "voxalloy"
|
|
display_name = "durable alloy"
|
|
stack_type = null
|
|
icon_colour = "#6C7364"
|
|
integrity = 1200
|
|
melting_point = 6000 // Hull plating.
|
|
explosion_resistance = 200 // Hull plating.
|
|
hardness = 500
|
|
weight = 500
|
|
|
|
/material/wood
|
|
name = "wood"
|
|
stack_type = /obj/item/stack/material/wood
|
|
icon_colour = "#824B28"
|
|
integrity = 25
|
|
icon_base = "solid"
|
|
explosion_resistance = 2
|
|
shard_type = SHARD_SPLINTER
|
|
shard_can_repair = 0 // you can't weld splinters back into planks
|
|
hardness = 15
|
|
weight = 18
|
|
stack_origin_tech = "materials=1;biotech=1"
|
|
dooropen_noise = 'sound/effects/doorcreaky.ogg'
|
|
door_icon_base = "wood"
|
|
destruction_desc = "splinters"
|
|
|
|
/material/wood/holographic
|
|
name = "holographic wood"
|
|
display_name = "wood"
|
|
stack_type = null
|
|
shard_type = SHARD_NONE
|
|
|
|
/material/cardboard
|
|
name = "cardboard"
|
|
stack_type = /obj/item/stack/material/cardboard
|
|
flags = MATERIAL_BRITTLE
|
|
integrity = 10
|
|
icon_base = "solid"
|
|
icon_reinf = "reinf_over"
|
|
icon_colour = "#AAAAAA"
|
|
hardness = 1
|
|
weight = 1
|
|
stack_origin_tech = "materials=1"
|
|
door_icon_base = "wood"
|
|
destruction_desc = "crumples"
|
|
|
|
/material/cloth //todo
|
|
name = "cloth"
|
|
stack_origin_tech = "materials=2"
|
|
door_icon_base = "wood"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cult
|
|
name = "cult"
|
|
display_name = "disturbing stone"
|
|
icon_base = "cult"
|
|
icon_colour = "#402821"
|
|
icon_reinf = "reinf_cult"
|
|
shard_type = SHARD_STONE_PIECE
|
|
|
|
/material/cult/place_dismantled_girder(var/turf/target)
|
|
new /obj/structure/girder/cult(target)
|
|
|
|
/material/cult/place_dismantled_product(var/turf/target)
|
|
new /obj/effect/decal/cleanable/blood(target)
|
|
|
|
/material/cult/reinf
|
|
name = "cult2"
|
|
display_name = "human remains"
|
|
|
|
/material/cult/reinf/place_dismantled_product(var/turf/target)
|
|
new /obj/effect/decal/remains/human(target)
|
|
|
|
/material/resin
|
|
name = "resin"
|
|
icon_colour = "#E85DD8"
|
|
dooropen_noise = 'sound/effects/attackblob.ogg'
|
|
door_icon_base = "resin"
|
|
|
|
/material/resin/can_open_material_door(var/mob/living/user)
|
|
var/mob/living/carbon/M = user
|
|
if(istype(M) && locate(/obj/item/organ/xenos/hivenode) in M.internal_organs)
|
|
return 1
|
|
return 0
|
|
|
|
//TODO PLACEHOLDERS:
|
|
/material/leather
|
|
name = "leather"
|
|
icon_colour = "#5C4831"
|
|
stack_origin_tech = "materials=2"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/carpet
|
|
name = "carpet"
|
|
display_name = "comfy"
|
|
use_name = "red upholstery"
|
|
icon_colour = "#DA020A"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cotton
|
|
name = "cotton"
|
|
display_name ="cotton"
|
|
icon_colour = "#FFFFFF"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_teal
|
|
name = "teal"
|
|
display_name ="teal"
|
|
use_name = "teal cloth"
|
|
icon_colour = "#00EAFA"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_black
|
|
name = "black"
|
|
display_name = "black"
|
|
use_name = "black cloth"
|
|
icon_colour = "#505050"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_green
|
|
name = "green"
|
|
display_name = "green"
|
|
use_name = "green cloth"
|
|
icon_colour = "#01C608"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_puple
|
|
name = "purple"
|
|
display_name = "purple"
|
|
use_name = "purple cloth"
|
|
icon_colour = "#9C56C4"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_blue
|
|
name = "blue"
|
|
display_name = "blue"
|
|
use_name = "blue cloth"
|
|
icon_colour = "#6B6FE3"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_beige
|
|
name = "beige"
|
|
display_name = "beige"
|
|
use_name = "beige cloth"
|
|
icon_colour = "#E8E7C8"
|
|
flags = MATERIAL_PADDING
|
|
|
|
/material/cloth_lime
|
|
name = "lime"
|
|
display_name = "lime"
|
|
use_name = "lime cloth"
|
|
icon_colour = "#62E36C"
|
|
flags = MATERIAL_PADDING
|