From ff3a9b443710b591330a32e860152d91fe93d8c7 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Thu, 9 Jun 2022 18:30:10 -0400 Subject: [PATCH] fixes + balancing --- .../configuration/entries/game_options.dm | 2 +- code/controllers/subsystem/job.dm | 10 ++++++---- code/modules/vending/_vending.dm | 2 +- config/game_options.txt | 4 ++-- .../code/controllers/subsystem/economy.dm | 16 +++++++++++++--- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index eff5c7b3e..dfa6f0041 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -386,7 +386,7 @@ /datum/config_entry/flag/dynamic_mode /datum/config_entry/number/economy_base_payment - config_entry_value = 80 + config_entry_value = 60 min_val = 0 /datum/config_entry/number/economy_base_pay_ratio diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 32cd7cd80..e1cc553bd 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -14,20 +14,22 @@ SUBSYSTEM_DEF(job) var/overflow_role = "Assistant" - var/list/economy_multipliers_by_job - var/list/economy_multipliers_by_type + var/static/list/economy_multipliers_by_job + var/static/list/economy_multipliers_by_type /datum/controller/subsystem/job/Initialize(timeofday) SSmapping.HACK_LoadMapConfig() + if(!economy_multipliers_by_job) + economy_multipliers_by_job = CONFIG_GET(keyed_list/economy_job_rate) + if(!economy_multipliers_by_type) + economy_multipliers_by_type = CONFIG_GET(keyed_list/economy_job_rate_area) if(!occupations.len) SetupOccupations() if(CONFIG_GET(flag/load_jobs_from_txt)) LoadJobs() generate_selectable_species() set_overflow_role(CONFIG_GET(string/overflow_job)) - economy_multipliers_by_job = CONFIG_GET(keyed_list/economy_job_rate) - economy_multipliers_by_type = CONFIG_GET(keyed_list/economy_job_rate_area) return ..() /datum/controller/subsystem/job/proc/set_overflow_role(new_overflow_role) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index fed6345ed..b2496308a 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -168,7 +168,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C R.name = initial(temp.name) R.product_path = typepath if(!free) - R.price = baseprice + R.price = FLOOR(baseprice * CONFIG_GET(number/economy_price_multiplier), 1) if(product) //its a item! var/product_price = SSeconomy.GetPrice(product) if(!isnull(product_price)) diff --git a/config/game_options.txt b/config/game_options.txt index 82168de3c..1d4977749 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -593,7 +593,7 @@ BOX_RANDOM_ENGINE Box P.A.C.M.A.N,0 # Bank Accounts are tied to the ID cards that players spawn with. If you have an unset pin, then that means anyone that gets the ID card has access to your money # The base amount of credits, before any math whatsoever gets involved, that paychecks give -ECONOMY_BASE_PAYMENT 40 +ECONOMY_BASE_PAYMENT 60 # The base pay for paychecks get divided by this amount. Useful for slowing down the rate of payment. ECONOMY_BASE_PAY_RATIO 3 @@ -627,4 +627,4 @@ ECONOMY_PRICE_EXPENSIVE_AF 90 # A multiplier to the prices of items inside vendors. Avoid setting this higher than the Assistant's paycheck multiplier if possible # This scales every item found in vendors. If you want to change an individual item, you have to change it through code -ECONOMY_PRICE_MULTIPLIER 1 +ECONOMY_PRICE_MULTIPLIER 1.25 diff --git a/hyperstation/code/controllers/subsystem/economy.dm b/hyperstation/code/controllers/subsystem/economy.dm index 62906fb1c..9627e9ef1 100644 --- a/hyperstation/code/controllers/subsystem/economy.dm +++ b/hyperstation/code/controllers/subsystem/economy.dm @@ -37,13 +37,23 @@ SUBSYSTEM_DEF(economy) * job datums if the respective one is null. You can pass zero arguments here and you'd get the "default" amount of a paycheck. */ /datum/controller/subsystem/economy/proc/GetPaycheck(datum/bank_account/account, datum/job/job, multiplier=1) - return FLOOR((account:base_pay * job:base_paycheck_multiplier * multiplier) / 3, 1) + return FLOOR(account:base_pay * job:base_paycheck_multiplier * multiplier, 1) /** * Returns a price value from a subtype of an /obj/item, assuming it was compiled to use money. * Otherwise, returns null if it does not use economy */ /datum/controller/subsystem/economy/proc/GetPrice(obj/item/costly_item) - if(!costly_item.economy_type) + var/economy_type + var/price_multiplier + + if(istype(costly_item)) + economy_type = costly_item.economy_type + price_multiplier = costly_item.economy_price_mul + else + economy_type = initial(costly_item.economy_type) + price_multiplier = initial(costly_item.economy_price_mul) + + if(!economy_type) return - return FLOOR(prices_by_type[costly_item.economy_type] * costly_item.economy_price_mul, 1) + return FLOOR(prices_by_type[economy_type] * price_multiplier, 1)