Skip to content

Commit

Permalink
Power related fixes for flatpacked stirlings, ore thumpers and both s…
Browse files Browse the repository at this point in the history
…izes of station batteries (#2668)

* Update stirling_generator.dm

* reeee

Co-authored-by: Iajret <[email protected]>
  • Loading branch information
Steals-The-PRs and Iajret authored Mar 30, 2024
1 parent 981fe22 commit 320afe2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<b>higher maximum output</b> than some larger units. Most commonly seen being used not for their ability to store \
power, but rather for use in regulating power input and output."
icon = 'modular_nova/modules/colony_fabricator/icons/power_storage_unit/small_battery.dmi'
capacity = 750 * 1000
input_level_max = 400 * 1000
output_level_max = 400 * 1000
capacity = 7.5 * STANDARD_CELL_CHARGE
input_level_max = 400 KILO WATTS
output_level_max = 400 KILO WATTS
circuit = null
obj_flags = CAN_BE_HIT | NO_DECONSTRUCTION
/// The item we turn into when repacked
Expand Down Expand Up @@ -71,9 +71,9 @@
<b>low maximum output</b> compared to smaller units. Most commonly seen as large backup batteries, or simply \
for large power storage where throughput is not a concern."
icon = 'modular_nova/modules/colony_fabricator/icons/power_storage_unit/large_battery.dmi'
capacity = 10000 * 1000
input_level_max = 50 * 1000
output_level_max = 50 * 1000
capacity = 100 * STANDARD_CELL_CHARGE
input_level_max = 50 KILO WATTS
output_level_max = 50 KILO WATTS
repacked_type = /obj/item/flatpacked_machine/large_station_battery

// Automatically set themselves to be completely charged on init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
icon = 'modular_nova/modules/colony_fabricator/icons/machines.dmi'
circuit = null
obj_flags = CAN_BE_HIT | NO_DECONSTRUCTION
power_gen = 7500
power_gen = 7.5 KILO WATTS
/// What we turn into when we are repacked
var/repacked_type = /obj/item/flatpacked_machine/rtg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// Maximum efficient heat difference, at what heat difference does more difference stop meaning anything for power?
var/max_efficient_heat_difference = 8000
/// Maximum power output from this machine
var/max_power_output = 100 * 1000
var/max_power_output = 100 KILO WATTS
/// How much power the generator is currently making
var/current_power_generation
/// Our looping fan sound that we play when turned on
Expand All @@ -39,13 +39,12 @@
// This is just to make sure our atmos connection spawns facing the right way
setDir(dir)


/obj/machinery/power/stirling_generator/examine(mob/user)
. = ..()
. += span_notice("You can use a <b>wrench</b> with <b>Left-Click</b> to rotate the generator.")
. += span_notice("It will not work in a <b>vacuum</b> as it must be cooled by the gas around it.")
. += span_notice("It is currently generating <b>[current_power_generation / 1000] kW</b> of power.")
. += span_notice("It has a maximum power output of <b>[max_power_output / 1000] kW</b> at a temperature difference of <b>[max_efficient_heat_difference] K</b>.")
. += span_notice("It is currently generating <b>[display_power(current_power_generation, convert = FALSE)]</b> of power.")
. += span_notice("It has a maximum power output of <b>[display_power(max_power_output, convert = FALSE)]</b> at a temperature difference of <b>[max_efficient_heat_difference] K</b>.")


/obj/machinery/power/stirling_generator/Destroy()
Expand Down Expand Up @@ -85,7 +84,7 @@

/obj/machinery/power/stirling_generator/process()
var/power_output = round(current_power_generation)
add_avail(power_output)
add_avail(power_to_energy(power_output))
var/new_icon_state = (power_output ? "stirling_on" : "stirling")
icon_state = new_icon_state
if(soundloop.is_active() && !power_output)
Expand Down
7 changes: 4 additions & 3 deletions modular_nova/modules/kahraman_equipment/code/ore_thumper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
. += span_notice("Its must be constructed <b>outdoors</b> to function.")
if(!istype(get_turf(src), /turf/open/misc))
. += span_notice("It must be constructed on <b>suitable terrain</b>, like ash, snow, or sand.")
. += span_notice("It must have a powered, <b>wired connection</b> running beneath it with <b>[active_power_usage / BASE_MACHINE_ACTIVE_CONSUMPTION] kW</b> of excess power to function.")
. += span_notice("It must have a powered, <b>wired connection</b> running beneath it with <b>[display_power(active_power_usage, convert = FALSE)]</b> of excess power to function.")
. += span_notice("It will produce a box of materials after it has slammed [slam_jams_needed] times.")
. += span_notice("Currently, it has slammed [slam_jams] / [slam_jams_needed] times needed.")
. += span_notice("It will stop producing resources if there are <b>too many piles of ore</b> near it.")
Expand All @@ -98,6 +98,7 @@
/obj/machinery/power/colony_ore_thumper/process()
var/turf/our_turf = get_turf(src)
var/obj/structure/cable/cable_under_us = locate() in our_turf
var/energy_needed = power_to_energy(active_power_usage)
if(!cable_under_us && powernet)
disconnect_from_network()
else if(cable_under_us && !powernet)
Expand All @@ -107,8 +108,8 @@
balloon_alert_to_viewers("invalid location!")
cut_that_out()
return
if(avail(active_power_usage))
add_load(active_power_usage)
if(avail(energy_needed))
add_load(energy_needed)
else
balloon_alert_to_viewers("not enough power!")
cut_that_out()
Expand Down

0 comments on commit 320afe2

Please sign in to comment.