Skip to content

Commit

Permalink
Caps Softcap for Rad Collector Attempt 2 - Making 115k Credits per co…
Browse files Browse the repository at this point in the history
…llector is NOT intended. (#17495)

* Update collector.dm

* Update collector.dm

Co-authored-by: Byemoh <baiomurang@gmail.com>
  • Loading branch information
JamieD1 and ToasterBiome committed Jan 17, 2023
1 parent 3a85b7e commit 52f19bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions code/modules/power/singularity/collector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define RAD_COLLECTOR_STORED_OUT 0.1 // (this*100)% of stored power outputted per tick. Doesn't actualy change output total, lower numbers just means collectors output for longer in absence of a source
#define RAD_COLLECTOR_MINING_CONVERSION_RATE 0.000125 //This is gonna need a lot of tweaking to get right. This is the number used to calculate the conversion of watts to research points per process()
#define RAD_COLLECTOR_OUTPUT min(stored_power, (stored_power*RAD_COLLECTOR_STORED_OUT)+1000) //Produces at least 1000 watts if it has more than that stored
#define RAD_COLLECTOR_PAYOUT_SCALE 300

/obj/machinery/power/rad_collector
name = "Radiation Collector Array"
Expand Down Expand Up @@ -45,7 +46,7 @@
// Higher power bonus will give more power
var/power_bonus = 0
// Balance amount of money given to crew
var/balancevalue = 0.05
var/creditpayout = 0

var/obj/item/radio/radio
var/obj/item/tank/internals/plasma/loaded_tank = null
Expand Down Expand Up @@ -106,9 +107,9 @@
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR)
if(D)
var/payout = output/8000
stored_power -= min(payout*200, stored_power)
payout = payout * balancevalue
D.adjust_money(payout)
stored_power -= min(payout*20000, stored_power)
creditpayout = log(1 + (payout / RAD_COLLECTOR_PAYOUT_SCALE)) * (RAD_COLLECTOR_PAYOUT_SCALE / log(2))
D.adjust_money(creditpayout)
last_output = payout

/obj/machinery/power/rad_collector/interact(mob/user)
Expand Down Expand Up @@ -267,7 +268,7 @@
else if(mode == SCIENCE)
. += "<span class='notice'>[src]'s display states that it has stored a total of <b>[stored_power*RAD_COLLECTOR_MINING_CONVERSION_RATE]</b>, and producing [last_output*60] research points per minute.</span>"
else if(mode == MONEY)
. += "<span class='notice'>[src]'s display states that it has stored a total of <b>[stored_power*RAD_COLLECTOR_MINING_CONVERSION_RATE] credits</b>, and producing [last_output*60] credits per minute.</span>"
. += "<span class='notice'>[src]'s display states that it has stored a total of <b>[stored_power*RAD_COLLECTOR_MINING_CONVERSION_RATE] credits</b>, and producing [creditpayout] credits per minute.</span>"
else
if(mode == POWER)
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Power production mode. Please insert <b>Plasma</b>. Use a multitool to change production modes.\"</span>"
Expand Down

0 comments on commit 52f19bf

Please sign in to comment.