Add Sandstorm balance config (#279)

* Add Sandstorm balance config

Allows changing settings for the Cryptominer, Autodoc, and Bluespace Miner.

* Update server config with real-time values

Sandstorm balance configurations have been updated to read values in real time whenever possible.

Values are now set using defines, and any that could not use them have been disabled.

A new configuration has been added to control when the bluespace mining machine can produce bluespace crystals.

* Fixes a critical cryptominer issue

Fixes a tremendous coding oversight that added two additional whitespace characters to the cryptominer machine file.

* Fix incorrect config value for BSMs

Fixes a mistaken definition for BLUESPACE_MINER_CRYSTAL_TIER pointing to a previously used value.

* Undefine balance config defines

Adds an undefine statement for all balance config value defines.

* Properly undefine definitions

Fixes incorrect term usage for undefining a value.
This commit is contained in:
Darius
2023-01-29 22:29:33 -03:00
committed by GitHub
parent 8ae64b1bd8
commit eb0b27889b
7 changed files with 239 additions and 34 deletions
@@ -1,3 +1,7 @@
// Configuration defines
#define BLUESPACE_MINER_BONUS_MULT CONFIG_GET(number/bluespaceminer_mult_output)
#define BLUESPACE_MINER_CRYSTAL_TIER CONFIG_GET(number/bluespaceminer_crystal_tier)
/obj/machinery/mineral/bluespace_miner
name = "bluespace mining machine"
desc = "A machine that uses the magic of Bluespace to slowly generate materials and add them to a linked ore silo."
@@ -8,7 +12,16 @@
circuit = /obj/item/circuitboard/machine/bluespace_miner
layer = BELOW_OBJ_LAYER
init_process = TRUE
var/list/ore_rates = list(/datum/material/iron = 0.3, /datum/material/glass = 0.3, /datum/material/plasma = 0.1, /datum/material/silver = 0.1, /datum/material/gold = 0.05, /datum/material/titanium = 0.05, /datum/material/uranium = 0.05, /datum/material/diamond = 0.02)
var/list/ore_rates = list(
/datum/material/iron = 0.3,
/datum/material/glass = 0.3,
/datum/material/plasma = 0.1,
/datum/material/silver = 0.1,
/datum/material/gold = 0.05,
/datum/material/titanium = 0.05,
/datum/material/uranium = 0.05,
/datum/material/diamond = 0.02
)
var/datum/component/remote_materials/materials
var/multiplier = 0 //Multiplier by tier, has been made fair and everything
@@ -16,11 +29,14 @@
. = ..()
materials = AddComponent(/datum/component/remote_materials, "bsm", mapload)
// Set initial multiplier based on config
multiplier *= BLUESPACE_MINER_BONUS_MULT
/obj/machinery/mineral/bluespace_miner/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += span_notice("A small screen on the machine reads, \"Efficiency at [multiplier * 100]%\"")
if(multiplier >= 5)
if(multiplier >= BLUESPACE_MINER_CRYSTAL_TIER)
. += span_notice("Bluespace generation is active.")
if(!anchored)
. += span_warning("The machine won't work while not firmly secured to the ground.")
@@ -38,11 +54,14 @@
multiplier += L.rating
stock_amt++
multiplier /= stock_amt
if(multiplier >= 5)
if(multiplier >= BLUESPACE_MINER_CRYSTAL_TIER)
ore_rates[/datum/material/bluespace] = 0.01
else
ore_rates -= /datum/material/bluespace
// Apply config multiplier here to not interfere with bluespace material check
multiplier *= BLUESPACE_MINER_BONUS_MULT
/obj/machinery/mineral/bluespace_miner/Destroy()
materials = null
return ..()
@@ -108,3 +127,6 @@
if(default_unfasten_wrench(user, I))
return TRUE
return FALSE
#undef BLUESPACE_MINER_BONUS_MULT
#undef BLUESPACE_MINER_CRYSTAL_TIER