mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-28 02:21:53 +00:00
Sweeps up some rarely used and unbalanced sources of research points (#52012)
About The Pull Request Removes the research point gen modes from tesla coils and rad collectors. Someone is gonna take some flak for removing these at some point, may as well be me. Why It's Good For The Game THE DESIGN DOC DICTACT- Nah powergen should be valid on it's own, it shouldn't need to rely on other econs to make it worth the work. We can try that later, but not now. Changelog cl del: Removed the research modes from tesla coils and radiation collectors. /cl
This commit is contained in:
@@ -146,45 +146,6 @@
|
||||
req_components = list(/obj/item/stock_parts/capacitor = 1)
|
||||
needs_anchored = FALSE
|
||||
|
||||
#define PATH_POWERCOIL /obj/machinery/power/tesla_coil/power
|
||||
#define PATH_RPCOIL /obj/machinery/power/tesla_coil/research
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/Initialize()
|
||||
. = ..()
|
||||
if(build_path)
|
||||
build_path = PATH_POWERCOIL
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/attackby(obj/item/I, mob/user, params)
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
var/obj/item/circuitboard/new_type
|
||||
var/new_setting
|
||||
switch(build_path)
|
||||
if(PATH_POWERCOIL)
|
||||
new_type = /obj/item/circuitboard/machine/tesla_coil/research
|
||||
new_setting = "Research"
|
||||
if(PATH_RPCOIL)
|
||||
new_type = /obj/item/circuitboard/machine/tesla_coil/power
|
||||
new_setting = "Power"
|
||||
name = initial(new_type.name)
|
||||
build_path = initial(new_type.build_path)
|
||||
I.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You change the circuitboard setting to \"[new_setting]\".</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/power
|
||||
name = "Tesla Coil (Machine Board)"
|
||||
build_path = PATH_POWERCOIL
|
||||
|
||||
/obj/item/circuitboard/machine/tesla_coil/research
|
||||
name = "Tesla Corona Researcher (Machine Board)"
|
||||
build_path = PATH_RPCOIL
|
||||
|
||||
#undef PATH_POWERCOIL
|
||||
#undef PATH_RPCOIL
|
||||
|
||||
|
||||
|
||||
/obj/item/circuitboard/machine/cell_charger
|
||||
name = "Cell Charger (Machine Board)"
|
||||
icon_state = "engineering"
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#define RAD_COLLECTOR_STORED_OUT 0.04 // (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.00001 //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_energy, (stored_energy*RAD_COLLECTOR_STORED_OUT)+1000) //Produces at least 1000 watts if it has more than that stored
|
||||
#define PUBLIC_TECHWEB_GAIN 0.6 //how many research points go directly into the main pool
|
||||
#define PRIVATE_TECHWEB_GAIN (1 - PUBLIC_TECHWEB_GAIN) //how many research points go to the user
|
||||
/obj/machinery/power/rad_collector
|
||||
name = "Radiation Collector Array"
|
||||
desc = "A device which uses Hawking Radiation and plasma to produce power."
|
||||
@@ -14,7 +12,6 @@
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
req_access = list(ACCESS_ENGINE_EQUIP)
|
||||
// use_power = NO_POWER_USE
|
||||
max_integrity = 350
|
||||
integrity_failure = 0.2
|
||||
circuit = /obj/item/circuitboard/machine/rad_collector
|
||||
@@ -26,11 +23,6 @@
|
||||
var/drainratio = 1
|
||||
var/powerproduction_drain = 0.001
|
||||
|
||||
var/bitcoinproduction_drain = 0.15
|
||||
var/bitcoinmining = FALSE
|
||||
///research points stored
|
||||
var/stored_research = 0
|
||||
|
||||
/obj/machinery/power/rad_collector/anchored
|
||||
anchored = TRUE
|
||||
|
||||
@@ -47,39 +39,20 @@
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
if(!loaded_tank)
|
||||
return
|
||||
if(!bitcoinmining)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, TRUE)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES])
|
||||
loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES] -= gasdrained
|
||||
loaded_tank.air_contents.assert_gas(/datum/gas/tritium)
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] += gasdrained
|
||||
loaded_tank.air_contents.garbage_collect()
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, TRUE)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES])
|
||||
loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES] -= gasdrained
|
||||
loaded_tank.air_contents.assert_gas(/datum/gas/tritium)
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] += gasdrained
|
||||
loaded_tank.air_contents.garbage_collect()
|
||||
|
||||
var/power_produced = RAD_COLLECTOR_OUTPUT
|
||||
add_avail(power_produced)
|
||||
stored_energy-=power_produced
|
||||
else if(is_station_level(z) && SSresearch.science_tech)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/tritium] || !loaded_tank.air_contents.gases[/datum/gas/oxygen])
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, TRUE)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = bitcoinproduction_drain*drainratio
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/oxygen][MOLES] -= gasdrained
|
||||
loaded_tank.air_contents.assert_gas(/datum/gas/carbon_dioxide)
|
||||
loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide][MOLES] += gasdrained*2
|
||||
loaded_tank.air_contents.garbage_collect()
|
||||
var/bitcoins_mined = RAD_COLLECTOR_OUTPUT
|
||||
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_ENG)
|
||||
if(D)
|
||||
D.adjust_money(bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE)
|
||||
stored_research += bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE*PRIVATE_TECHWEB_GAIN
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE*PUBLIC_TECHWEB_GAIN)
|
||||
stored_energy-=bitcoins_mined
|
||||
var/power_produced = RAD_COLLECTOR_OUTPUT
|
||||
add_avail(power_produced)
|
||||
stored_energy-=power_produced
|
||||
|
||||
/obj/machinery/power/rad_collector/interact(mob/user)
|
||||
if(anchored)
|
||||
@@ -139,12 +112,6 @@
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
/obj/machinery/power/rad_collector/analyzer_act(mob/living/user, obj/item/I)
|
||||
if(stored_research >= 1)
|
||||
new /obj/item/research_notes(user.loc, stored_research, "engineering")
|
||||
stored_research = 0
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/I)
|
||||
..()
|
||||
@@ -172,20 +139,6 @@
|
||||
to_chat(user, "<span class='warning'>There isn't a tank loaded!</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!is_station_level(z) && !SSresearch.science_tech)
|
||||
to_chat(user, "<span class='warning'>[src] isn't linked to a research system!</span>")
|
||||
return TRUE
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>[src] is locked!</span>")
|
||||
return TRUE
|
||||
if(active)
|
||||
to_chat(user, "<span class='warning'>[src] is currently active, producing [bitcoinmining ? "research points":"power"].</span>")
|
||||
return TRUE
|
||||
bitcoinmining = !bitcoinmining
|
||||
to_chat(user, "<span class='warning'>You [bitcoinmining ? "enable":"disable"] the research point production feature of [src].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/return_analyzable_air()
|
||||
if(loaded_tank)
|
||||
return loaded_tank.return_analyzable_air()
|
||||
@@ -195,19 +148,13 @@
|
||||
/obj/machinery/power/rad_collector/examine(mob/user)
|
||||
. = ..()
|
||||
if(active)
|
||||
if(!bitcoinmining)
|
||||
// stored_energy is converted directly to watts every SSmachines.wait * 0.1 seconds.
|
||||
// Therefore, its units are joules per SSmachines.wait * 0.1 seconds.
|
||||
// So joules = stored_energy * SSmachines.wait * 0.1
|
||||
var/joules = stored_energy * SSmachines.wait * 0.1
|
||||
. += "<span class='notice'>[src]'s display states that it has stored <b>[DisplayJoules(joules)]</b>, and is processing <b>[DisplayPower(RAD_COLLECTOR_OUTPUT)]</b>.</span>"
|
||||
else
|
||||
. += "<span class='notice'>[src]'s display states that it has made a total of <b>[stored_research]</b>, and is producing [RAD_COLLECTOR_OUTPUT*RAD_COLLECTOR_MINING_CONVERSION_RATE] research points per minute.</span>"
|
||||
// stored_energy is converted directly to watts every SSmachines.wait * 0.1 seconds.
|
||||
// Therefore, its units are joules per SSmachines.wait * 0.1 seconds.
|
||||
// So joules = stored_energy * SSmachines.wait * 0.1
|
||||
var/joules = stored_energy * SSmachines.wait * 0.1
|
||||
. += "<span class='notice'>[src]'s display states that it has stored <b>[DisplayJoules(joules)]</b>, and is processing <b>[DisplayPower(RAD_COLLECTOR_OUTPUT)]</b>.</span>"
|
||||
else
|
||||
if(!bitcoinmining)
|
||||
. += "<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>"
|
||||
else
|
||||
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Research point production mode. Please insert <b>Tritium</b> and <b>Oxygen</b>. Use a multitool to change production modes.\"</span>"
|
||||
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Power production mode. Please insert <b>Plasma</b>.\"</span>"
|
||||
|
||||
/obj/machinery/power/rad_collector/obj_break(damage_flag)
|
||||
. = ..()
|
||||
@@ -242,7 +189,6 @@
|
||||
if(active)
|
||||
. += "on"
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/toggle_power()
|
||||
active = !active
|
||||
if(active)
|
||||
@@ -259,5 +205,3 @@
|
||||
#undef RAD_COLLECTOR_STORED_OUT
|
||||
#undef RAD_COLLECTOR_MINING_CONVERSION_RATE
|
||||
#undef RAD_COLLECTOR_OUTPUT
|
||||
#undef PUBLIC_TECHWEB_GAIN
|
||||
#undef PRIVATE_TECHWEB_GAIN
|
||||
|
||||
@@ -14,20 +14,13 @@
|
||||
circuit = /obj/item/circuitboard/machine/tesla_coil
|
||||
|
||||
var/zap_flags = ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE
|
||||
var/power_loss = 2
|
||||
var/input_power_multiplier = 1
|
||||
var/zap_cooldown = 100
|
||||
var/last_zap = 0
|
||||
|
||||
var/datum/techweb/linked_techweb
|
||||
|
||||
/obj/machinery/power/tesla_coil/power
|
||||
circuit = /obj/item/circuitboard/machine/tesla_coil/power
|
||||
|
||||
/obj/machinery/power/tesla_coil/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/tesla_coil(src)
|
||||
linked_techweb = SSresearch.science_tech
|
||||
|
||||
/obj/machinery/power/tesla_coil/should_have_node()
|
||||
return anchored
|
||||
@@ -83,14 +76,12 @@
|
||||
obj_flags |= BEING_SHOCKED
|
||||
//don't lose arc power when it's not connected to anything
|
||||
//please place tesla coils all around the station to maximize effectiveness
|
||||
var/power_produced = powernet ? power / power_loss : power
|
||||
var/power_produced = powernet ? power / 2 : power
|
||||
add_avail(power_produced*input_power_multiplier)
|
||||
flick("coilhit", src)
|
||||
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_ENG)
|
||||
if(D)
|
||||
D.adjust_money(min(power_produced, 1))
|
||||
if(istype(linked_techweb))
|
||||
linked_techweb.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min(power_produced, 1)) // x4 coils = ~240/m point bonus for R&D
|
||||
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
||||
zap_buckle_check(power)
|
||||
playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
|
||||
@@ -110,49 +101,6 @@
|
||||
tesla_zap(src, 10, power/(coeff/2), zap_flags)
|
||||
zap_buckle_check(power/(coeff/2))
|
||||
|
||||
// Tesla R&D researcher
|
||||
/obj/machinery/power/tesla_coil/research
|
||||
name = "Tesla Corona Analyzer"
|
||||
desc = "A modified Tesla Coil used to study the effects of Edison's Bane for research."
|
||||
icon_state = "rpcoil0"
|
||||
circuit = /obj/item/circuitboard/machine/tesla_coil/research
|
||||
power_loss = 20 // something something, high voltage + resistance
|
||||
|
||||
/obj/machinery/power/tesla_coil/research/zap_act(power, zap_flags, shocked_targets)
|
||||
if(anchored && !panel_open)
|
||||
obj_flags |= BEING_SHOCKED
|
||||
var/power_produced = powernet ? power / power_loss : power
|
||||
add_avail(power_produced*input_power_multiplier)
|
||||
flick("rpcoilhit", src)
|
||||
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_ENG)
|
||||
if(D)
|
||||
D.adjust_money(min(power_produced, 3))
|
||||
if(istype(linked_techweb))
|
||||
linked_techweb.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min(power_produced, 3)) // x4 coils with a pulse per second or so = ~720/m point bonus for R&D
|
||||
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
||||
zap_buckle_check(power)
|
||||
playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
|
||||
return power_produced
|
||||
else
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/tesla_coil/research/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
if(panel_open)
|
||||
icon_state = "rpcoil_open[anchored]"
|
||||
else
|
||||
icon_state = "rpcoil[anchored]"
|
||||
|
||||
/obj/machinery/power/tesla_coil/research/attackby(obj/item/W, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, "rpcoil_open[anchored]", "rpcoil[anchored]", W))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/tesla_coil/research/on_construction()
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/grounding_rod
|
||||
name = "grounding rod"
|
||||
desc = "Keep an area from being fried from Edison's Bane."
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 10 KiB |
Reference in New Issue
Block a user