Materials subsystem, material defines instead of strings, structure materials. (#8447)

The shitcode crusade begins.
This commit is contained in:
Matt Atlas
2020-03-18 20:19:11 +01:00
committed by GitHub
parent d952493ca0
commit 82437acd43
127 changed files with 687 additions and 646 deletions
+7 -7
View File
@@ -17,13 +17,13 @@
var/list/resource_field = list()
var/ore_types = list(
"iron" = /obj/item/ore/iron,
"uranium" = /obj/item/ore/uranium,
"gold" = /obj/item/ore/gold,
"silver" = /obj/item/ore/silver,
"diamond" = /obj/item/ore/diamond,
"phoron" = /obj/item/ore/phoron,
"osmium" = /obj/item/ore/osmium,
MATERIAL_IRON = /obj/item/ore/iron,
MATERIAL_URANIUM = /obj/item/ore/uranium,
MATERIAL_GOLD = /obj/item/ore/gold,
MATERIAL_SILVER = /obj/item/ore/silver,
MATERIAL_DIAMOND = /obj/item/ore/diamond,
MATERIAL_PHORON = /obj/item/ore/phoron,
MATERIAL_OSMIUM = /obj/item/ore/osmium,
"hydrogen" = /obj/item/ore/hydrogen,
"silicates" = /obj/item/ore/glass,
"carbonaceous rock" = /obj/item/ore/coal
+2 -2
View File
@@ -396,7 +396,7 @@
if(can_make % 2 > 0)
can_make--
var/material/M = get_material_by_name(O.compresses_to)
var/material/M = SSmaterials.get_material_by_name(O.compresses_to)
if(!istype(M) || !can_make || ores_stored[metal] < 1)
continue
@@ -413,7 +413,7 @@
else if(ores_processing[metal] == 1 && O.smelts_to) //Smelting.
var/can_make = Clamp(ores_stored[metal], 0, sheets_per_tick - sheets)
var/material/M = get_material_by_name(O.smelts_to)
var/material/M = SSmaterials.get_material_by_name(O.smelts_to)
if(!istype(M) || !can_make || ores_stored[metal] < 1)
continue
+11 -11
View File
@@ -27,7 +27,7 @@ var/global/list/ore_data = list()
/ore/uranium
name = ORE_URANIUM
display_name = "pitchblende"
smelts_to = "uranium"
smelts_to = MATERIAL_URANIUM
result_amount = 5
spread_chance = 15
ore = /obj/item/ore/uranium
@@ -42,8 +42,8 @@ var/global/list/ore_data = list()
/ore/hematite
name = ORE_IRON
display_name = "hematite"
smelts_to = "iron"
alloy = TRUE
smelts_to = MATERIAL_IRON
alloy = 1
result_amount = 5
spread_chance = 30
ore = /obj/item/ore/iron
@@ -53,8 +53,8 @@ var/global/list/ore_data = list()
/ore/coal
name = ORE_COAL
display_name = "raw carbon"
smelts_to = "plastic"
alloy = TRUE
smelts_to = MATERIAL_PLASTIC
alloy = 1
result_amount = 5
spread_chance = 35
ore = /obj/item/ore/coal
@@ -63,7 +63,7 @@ var/global/list/ore_data = list()
/ore/glass
name = ORE_SAND
display_name = "sand"
display_name = MATERIAL_GLASS
smelts_to = "glass"
compresses_to = "sandstone"
worth = 1
@@ -71,7 +71,7 @@ var/global/list/ore_data = list()
/ore/phoron
name = ORE_PHORON
display_name = "phoron crystals"
compresses_to = "phoron"
compresses_to = MATERIAL_PHORON
result_amount = 5
spread_chance = 25
ore = /obj/item/ore/phoron
@@ -88,7 +88,7 @@ var/global/list/ore_data = list()
/ore/silver
name = ORE_SILVER
display_name = "native silver"
smelts_to = "silver"
smelts_to = MATERIAL_SILVER
result_amount = 5
spread_chance = 15
ore = /obj/item/ore/silver
@@ -96,8 +96,8 @@ var/global/list/ore_data = list()
worth = 20
/ore/gold
smelts_to = ORE_GOLD
name = "gold"
smelts_to = MATERIAL_GOLD
display_name = "native gold"
result_amount = 5
spread_chance = 10
@@ -112,7 +112,7 @@ var/global/list/ore_data = list()
worth = 30
/ore/diamond
name = ORE_DIAMOND
name = "diamond"
display_name = "diamond"
compresses_to = "diamond"
result_amount = 5
@@ -135,7 +135,7 @@ var/global/list/ore_data = list()
worth = 15
/ore/hydrogen
name = ORE_HYDROGEN
name = "hydrogen"
display_name = "metallic hydrogen"
smelts_to = "tritium"
compresses_to = "mhydrogen"