Merge pull request #7283 from MistakeNot4892/supmat

Generalizes supply points per material sheet to the material datum.
This commit is contained in:
Atermonera
2020-06-16 00:28:49 -07:00
committed by VirgoBot
parent bf5d9f1fc8
commit 9957da080d
2 changed files with 18 additions and 20 deletions

View File

@@ -23,23 +23,6 @@ SUBSYSTEM_DEF(supply)
//shuttle movement //shuttle movement
var/movetime = 1200 var/movetime = 1200
var/datum/shuttle/autodock/ferry/supply/shuttle var/datum/shuttle/autodock/ferry/supply/shuttle
var/list/material_points_conversion = list( // Any materials not named in this list are worth 0 points
"silver" = 2,
"marble" = 2,
"gold" = 2,
"uranium" = 2,
"lead" = 2,
"platinum" = 5,
"phoron" = 5,
"titanium" = 6,
"plasteel" = 6,
"osmium" = 6,
"mhydrogen" = 6,
"verdantium" = 8,
"diamond" = 8,
"durasteel" = 9,
"morphium" = 13
)//SPOOKY number!
/datum/controller/subsystem/supply/Initialize() /datum/controller/subsystem/supply/Initialize()
ordernum = rand(1,9000) ordernum = rand(1,9000)
@@ -52,7 +35,6 @@ SUBSYSTEM_DEF(supply)
else else
qdel(P) qdel(P)
// TODO - Auto-build material_points_conversion from material datums
. = ..() . = ..()
// Supply shuttle ticker - handles supply point regeneration. Just add points over time. // Supply shuttle ticker - handles supply point regeneration. Just add points over time.
@@ -123,8 +105,9 @@ SUBSYSTEM_DEF(supply)
// Sell phoron and platinum // Sell phoron and platinum
if(istype(A, /obj/item/stack)) if(istype(A, /obj/item/stack))
var/obj/item/stack/P = A var/obj/item/stack/P = A
if(material_points_conversion[P.get_material_name()]) var/material/mat = P.get_material()
EC.contents[EC.contents.len]["value"] = P.get_amount() * material_points_conversion[P.get_material_name()] if(mat?.supply_conversion_value)
EC.contents[EC.contents.len]["value"] = P.get_amount() * mat.supply_conversion_value
EC.contents[EC.contents.len]["quantity"] = P.get_amount() EC.contents[EC.contents.len]["quantity"] = P.get_amount()
EC.value += EC.contents[EC.contents.len]["value"] EC.value += EC.contents[EC.contents.len]["value"]

View File

@@ -114,6 +114,7 @@ var/list/name_to_material
var/list/composite_material // If set, object matter var will be a list containing these values. var/list/composite_material // If set, object matter var will be a list containing these values.
var/luminescence var/luminescence
var/radiation_resistance = 0 // Radiation resistance, which is added on top of a material's weight for blocking radiation. Needed to make lead special without superrobust weapons. var/radiation_resistance = 0 // Radiation resistance, which is added on top of a material's weight for blocking radiation. Needed to make lead special without superrobust weapons.
var/supply_conversion_value // Supply points per sheet that this material sells for.
// Placeholder vars for the time being, todo properly integrate windows/light tiles/rods. // Placeholder vars for the time being, todo properly integrate windows/light tiles/rods.
var/created_window var/created_window
@@ -256,6 +257,7 @@ var/list/name_to_material
weight = 22 weight = 22
stack_origin_tech = list(TECH_MATERIAL = 5) stack_origin_tech = list(TECH_MATERIAL = 5)
door_icon_base = "stone" door_icon_base = "stone"
supply_conversion_value = 2
/material/diamond /material/diamond
name = "diamond" name = "diamond"
@@ -271,6 +273,7 @@ var/list/name_to_material
tableslam_noise = 'sound/effects/Glasshit.ogg' tableslam_noise = 'sound/effects/Glasshit.ogg'
hardness = 100 hardness = 100
stack_origin_tech = list(TECH_MATERIAL = 6) stack_origin_tech = list(TECH_MATERIAL = 6)
supply_conversion_value = 8
/material/gold /material/gold
name = "gold" name = "gold"
@@ -282,6 +285,7 @@ var/list/name_to_material
stack_origin_tech = list(TECH_MATERIAL = 4) stack_origin_tech = list(TECH_MATERIAL = 4)
sheet_singular_name = "ingot" sheet_singular_name = "ingot"
sheet_plural_name = "ingots" sheet_plural_name = "ingots"
supply_conversion_value = 2
/material/gold/bronze //placeholder for ashtrays /material/gold/bronze //placeholder for ashtrays
name = "bronze" name = "bronze"
@@ -297,6 +301,7 @@ var/list/name_to_material
stack_origin_tech = list(TECH_MATERIAL = 3) stack_origin_tech = list(TECH_MATERIAL = 3)
sheet_singular_name = "ingot" sheet_singular_name = "ingot"
sheet_plural_name = "ingots" sheet_plural_name = "ingots"
supply_conversion_value = 2
//R-UST port //R-UST port
/material/supermatter /material/supermatter
@@ -329,6 +334,7 @@ var/list/name_to_material
door_icon_base = "stone" door_icon_base = "stone"
sheet_singular_name = "crystal" sheet_singular_name = "crystal"
sheet_plural_name = "crystals" sheet_plural_name = "crystals"
supply_conversion_value = 5
/* /*
// Commenting this out while fires are so spectacularly lethal, as I can't seem to get this balanced appropriately. // Commenting this out while fires are so spectacularly lethal, as I can't seem to get this balanced appropriately.
@@ -370,6 +376,7 @@ var/list/name_to_material
hardness = 30 //VOREStation Edit - Please. hardness = 30 //VOREStation Edit - Please.
integrity = 201 //hack to stop kitchen benches being flippable, todo: refactor into weight system integrity = 201 //hack to stop kitchen benches being flippable, todo: refactor into weight system
stack_type = /obj/item/stack/material/marble stack_type = /obj/item/stack/material/marble
supply_conversion_value = 2
/material/steel /material/steel
name = DEFAULT_WALL_MATERIAL name = DEFAULT_WALL_MATERIAL
@@ -428,6 +435,7 @@ var/list/name_to_material
conductivity = 13 // For the purposes of balance. conductivity = 13 // For the purposes of balance.
stack_origin_tech = list(TECH_MATERIAL = 2) stack_origin_tech = list(TECH_MATERIAL = 2)
composite_material = list(DEFAULT_WALL_MATERIAL = SHEET_MATERIAL_AMOUNT, "platinum" = SHEET_MATERIAL_AMOUNT) //todo composite_material = list(DEFAULT_WALL_MATERIAL = SHEET_MATERIAL_AMOUNT, "platinum" = SHEET_MATERIAL_AMOUNT) //todo
supply_conversion_value = 6
/material/plasteel/hull /material/plasteel/hull
name = MAT_PLASTEELHULL name = MAT_PLASTEELHULL
@@ -457,6 +465,7 @@ var/list/name_to_material
reflectivity = 0.7 // Not a perfect mirror, but close. reflectivity = 0.7 // Not a perfect mirror, but close.
stack_origin_tech = list(TECH_MATERIAL = 8) stack_origin_tech = list(TECH_MATERIAL = 8)
composite_material = list("plasteel" = SHEET_MATERIAL_AMOUNT, "diamond" = SHEET_MATERIAL_AMOUNT) //shrug composite_material = list("plasteel" = SHEET_MATERIAL_AMOUNT, "diamond" = SHEET_MATERIAL_AMOUNT) //shrug
supply_conversion_value = 9
/material/durasteel/hull //The 'Hardball' of starship hulls. /material/durasteel/hull //The 'Hardball' of starship hulls.
name = MAT_DURASTEELHULL name = MAT_DURASTEELHULL
@@ -676,6 +685,7 @@ var/list/name_to_material
sheet_singular_name = "ingot" sheet_singular_name = "ingot"
sheet_plural_name = "ingots" sheet_plural_name = "ingots"
conductivity = 100 conductivity = 100
supply_conversion_value = 6
/material/tritium /material/tritium
name = "tritium" name = "tritium"
@@ -704,6 +714,7 @@ var/list/name_to_material
stack_origin_tech = list(TECH_MATERIAL = 6, TECH_POWER = 6, TECH_MAGNET = 5) stack_origin_tech = list(TECH_MATERIAL = 6, TECH_POWER = 6, TECH_MAGNET = 5)
conductivity = 100 conductivity = 100
is_fusion_fuel = 1 is_fusion_fuel = 1
supply_conversion_value = 6
/material/platinum /material/platinum
name = "platinum" name = "platinum"
@@ -714,6 +725,7 @@ var/list/name_to_material
stack_origin_tech = list(TECH_MATERIAL = 2) stack_origin_tech = list(TECH_MATERIAL = 2)
sheet_singular_name = "ingot" sheet_singular_name = "ingot"
sheet_plural_name = "ingots" sheet_plural_name = "ingots"
supply_conversion_value = 5
/material/iron /material/iron
name = "iron" name = "iron"
@@ -733,6 +745,7 @@ var/list/name_to_material
sheet_singular_name = "ingot" sheet_singular_name = "ingot"
sheet_plural_name = "ingots" sheet_plural_name = "ingots"
radiation_resistance = 25 // Lead is Special and so gets to block more radiation than it normally would with just weight, totalling in 48 protection. radiation_resistance = 25 // Lead is Special and so gets to block more radiation than it normally would with just weight, totalling in 48 protection.
supply_conversion_value = 2
// Particle Smasher and other exotic materials. // Particle Smasher and other exotic materials.
@@ -755,6 +768,7 @@ var/list/name_to_material
stack_origin_tech = list(TECH_MATERIAL = 6, TECH_POWER = 5, TECH_BIO = 4) stack_origin_tech = list(TECH_MATERIAL = 6, TECH_POWER = 5, TECH_BIO = 4)
sheet_singular_name = "sheet" sheet_singular_name = "sheet"
sheet_plural_name = "sheets" sheet_plural_name = "sheets"
supply_conversion_value = 8
/material/morphium /material/morphium
name = MAT_MORPHIUM name = MAT_MORPHIUM
@@ -775,6 +789,7 @@ var/list/name_to_material
reflectivity = 0.2 reflectivity = 0.2
radiation_resistance = 10 radiation_resistance = 10
stack_origin_tech = list(TECH_MATERIAL = 8, TECH_ILLEGAL = 1, TECH_PHORON = 4, TECH_BLUESPACE = 4, TECH_ARCANE = 1) stack_origin_tech = list(TECH_MATERIAL = 8, TECH_ILLEGAL = 1, TECH_PHORON = 4, TECH_BLUESPACE = 4, TECH_ARCANE = 1)
supply_conversion_value = 13
/material/morphium/hull /material/morphium/hull
name = MAT_MORPHIUMHULL name = MAT_MORPHIUMHULL