Ground Ore Fix (#17486)

This commit is contained in:
Geeves
2023-10-01 12:46:22 +02:00
committed by GitHub
parent 721dfeeeed
commit 08ccbd5f69
7 changed files with 66 additions and 60 deletions
+11 -11
View File
@@ -23,17 +23,17 @@
var/list/resource_field = list()
var/ore_types = list(
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
)
ORE_URANIUM = /obj/item/ore/uranium,
ORE_IRON = /obj/item/ore/iron,
ORE_COAL = /obj/item/ore/coal,
ORE_SAND = /obj/item/ore/glass,
ORE_PHORON = /obj/item/ore/phoron,
ORE_SILVER = /obj/item/ore/silver,
ORE_GOLD = /obj/item/ore/gold,
ORE_DIAMOND = /obj/item/ore/diamond,
ORE_PLATINUM = /obj/item/ore/osmium,
ORE_HYDROGEN = /obj/item/ore/hydrogen
)
//Upgrades
var/harvest_speed
+5 -5
View File
@@ -28,13 +28,13 @@
var/ore_type
switch(metal)
if("silicates", "carbonaceous rock", "iron")
if(ORE_SAND, ORE_COAL, ORE_IRON)
ore_type = "surface minerals"
if("gold", "silver", "diamond")
if(ORE_GOLD, ORE_SILVER, ORE_DIAMOND)
ore_type = "precious metals"
if("uranium")
if(ORE_URANIUM)
ore_type = "nuclear fuel"
if("phoron", "osmium", "hydrogen")
if(ORE_PHORON, ORE_PLATINUM, ORE_HYDROGEN)
ore_type = "exotic matter"
if(ore_type)
@@ -53,4 +53,4 @@
if(76 to INFINITY)
result = "huge quantities"
to_chat(user, SPAN_NOTICE("- [result] of [ore_type]."))
to_chat(user, SPAN_NOTICE("- [result] of [ore_type]."))
+10 -10
View File
@@ -844,25 +844,25 @@ var/list/asteroid_floor_smooth = list(
var/list/ore = list()
for(var/metal in resources)
switch(metal)
if("silicates")
if(ORE_SAND)
ore += /obj/item/ore/glass
if("carbonaceous rock")
if(ORE_COAL)
ore += /obj/item/ore/coal
if("iron")
if(ORE_IRON)
ore += /obj/item/ore/iron
if("gold")
if(ORE_GOLD)
ore += /obj/item/ore/gold
if("silver")
if(ORE_SILVER)
ore += /obj/item/ore/silver
if("diamond")
if(ORE_DIAMOND)
ore += /obj/item/ore/diamond
if("uranium")
if(ORE_URANIUM)
ore += /obj/item/ore/uranium
if("phoron")
if(ORE_PHORON)
ore += /obj/item/ore/phoron
if("osmium")
if(ORE_PLATINUM)
ore += /obj/item/ore/osmium
if("hydrogen")
if(ORE_HYDROGEN)
ore += /obj/item/ore/hydrogen
else
if(prob(25))
@@ -174,9 +174,9 @@
if(!resources)
resources = list()
if(prob(5))
resources[MATERIAL_URANIUM] = rand(1,3)
resources[ORE_URANIUM] = rand(1,3)
if(prob(2))
resources[MATERIAL_DIAMOND] = 1
resources[ORE_DIAMOND] = 1
/turf/simulated/floor/exoplanet/grass/grove
icon_state = "grove_grass1"
@@ -15,9 +15,9 @@
if(!resources)
resources = list()
if(prob(5))
resources[MATERIAL_URANIUM] = rand(1,3)
resources[ORE_URANIUM] = rand(1,3)
if(prob(2))
resources[MATERIAL_DIAMOND] = 1
resources[ORE_DIAMOND] = 1
/turf/simulated/floor/exoplanet/grass/grove
icon_state = "grove_grass1"
+30 -30
View File
@@ -50,47 +50,47 @@
if(!priority_process)
CHECK_TICK
T.resources = list()
T.resources["silicates"] = rand(3,5)
T.resources["carbonaceous rock"] = rand(3,5)
T.resources[ORE_SAND] = rand(3,5)
T.resources[ORE_COAL] = rand(3,5)
var/tmp_cell
TRANSLATE_AND_VERIFY_COORD(x, y)
if(tmp_cell < rare_val) // Surface metals.
T.resources["iron"] = rand(RESOURCE_HIGH_MIN, RESOURCE_HIGH_MAX)
T.resources["gold"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["silver"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["uranium"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["diamond"] = 0
T.resources[ORE_IRON] = rand(RESOURCE_HIGH_MIN, RESOURCE_HIGH_MAX)
T.resources[ORE_GOLD] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_SILVER] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_URANIUM] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_DIAMOND] = 0
if(has_phoron)
T.resources[MATERIAL_PHORON] = 0
T.resources["osmium"] = 0
T.resources["hydrogen"] = 0
T.resources[ORE_PHORON] = 0
T.resources[ORE_PLATINUM] = 0
T.resources[ORE_HYDROGEN] = 0
else if(tmp_cell < deep_val) // Rare metals.
T.resources["gold"] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources["silver"] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources["uranium"] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources[ORE_GOLD] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources[ORE_SILVER] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources[ORE_URANIUM] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
if(has_phoron)
T.resources[MATERIAL_PHORON] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["osmium"] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources["hydrogen"] = 0
T.resources["diamond"] = 0
T.resources["iron"] = 0
T.resources[ORE_PHORON] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_PLATINUM] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources[ORE_HYDROGEN] = 0
T.resources[ORE_DIAMOND] = 0
T.resources[ORE_IRON] = 0
else // Deep metals.
T.resources["uranium"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["diamond"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_URANIUM] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_DIAMOND] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
if(has_phoron)
T.resources[MATERIAL_PHORON] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["osmium"] = rand(RESOURCE_HIGH_MIN, RESOURCE_HIGH_MAX)
T.resources["hydrogen"] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
T.resources[ORE_PHORON] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_PLATINUM] = rand(RESOURCE_HIGH_MIN, RESOURCE_HIGH_MAX)
T.resources[ORE_HYDROGEN] = rand(RESOURCE_MID_MIN, RESOURCE_MID_MAX)
if(prob(40)) // A medium chance for these useful mats to appear in very small quantities
T.resources["iron"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["gold"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources["silver"] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_IRON] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_GOLD] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
T.resources[ORE_SILVER] = rand(RESOURCE_LOW_MIN, RESOURCE_LOW_MAX)
else
T.resources["iron"] = 0
T.resources["gold"] = 0
T.resources["silver"] = 0
T.resources[ORE_IRON] = 0
T.resources[ORE_GOLD] = 0
T.resources[ORE_SILVER] = 0
return
/datum/random_map/noise/ore/get_map_char(var/value)
@@ -109,4 +109,4 @@
has_phoron = TRUE
/datum/random_map/noise/ore/rich/phoron
has_phoron = TRUE
has_phoron = TRUE