Skip to content

Commit

Permalink
Merge pull request #48 from out-of-phaze/lighthouse-fix/powerconsumption
Browse files Browse the repository at this point in the history
Fix Tether power consumption
  • Loading branch information
out-of-phaze authored Mar 27, 2024
2 parents caa2923 + 6da0fda commit a5cd44d
Show file tree
Hide file tree
Showing 14 changed files with 279 additions and 260 deletions.
4 changes: 2 additions & 2 deletions code/__defines/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
// These balance how easy or hard it is to create huge pressure gradients with pumps and filters.
// Lower values means it takes longer to create large pressures differences.
// Has no effect on pumping gasses from high pressure to low, only from low to high.
#define ATMOS_PUMP_EFFICIENCY 2.5
#define ATMOS_FILTER_EFFICIENCY 2.5
#define ATMOS_PUMP_EFFICIENCY 5
#define ATMOS_FILTER_EFFICIENCY 5

// Will not bother pumping or filtering if the gas source as fewer than this amount of moles, to help with performance.
#define MINIMUM_MOLES_TO_PUMP 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
/obj/item/cell = 1
)

/obj/item/stock_parts/circuitboard/portable_scrubber/huge
name = "circuitboard (huge scrubber)"
board_type = "machine"
build_path = /obj/machinery/portable_atmospherics/powered/scrubber/huge
origin_tech = @'{"engineering":4,"powerstorage":4}'
req_components = list(
/obj/item/stock_parts/capacitor = 2,
/obj/item/stock_parts/matter_bin = 2,
/obj/item/pipe = 2)
additional_spawn_components = list(
/obj/item/stock_parts/console_screen = 1,
/obj/item/stock_parts/keyboard = 1,
/obj/item/stock_parts/power/apc/buildable = 1,
/obj/item/cell = 1
)

/obj/item/stock_parts/circuitboard/portable_scrubber/pump
name = "circuitboard (portable pump)"
board_type = "machine"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
storage_capacity[/decl/material/solid/graphite] - stored_material[/decl/material/solid/graphite])

// STEP 2 - Take the CO2 out of the input!
var/power_draw = scrub_gas(src, list(input_gas), input_mix, internal, moles_to_convert)
var/power_draw = scrub_gas(src, list(input_gas), input_mix, internal, moles_to_convert, power_rating)
if (power_draw > 0)
use_power_oneoff(power_draw)
last_power_draw += power_draw
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use_power = POWER_USE_OFF
idle_power_usage = 150 //internal circuitry, friction losses and stuff
power_rating = 45000 //45000 W ~ 60 HP
power_rating = 22500 //22500 W ~ 30 HP

var/injecting = 0

Expand Down
2 changes: 1 addition & 1 deletion code/modules/atmospherics/components/unary/vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
desc = "Has a valve and pump attached to it."
use_power = POWER_USE_OFF
idle_power_usage = 150 //internal circuitry, friction losses and stuff
power_rating = 30000 // 30000 W ~ 40 HP
power_rating = 15000 // 15000 W ~ 20 HP

connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SUPPLY|CONNECT_TYPE_FUEL //connects to regular, supply pipes, and fuel pipes
level = LEVEL_BELOW_PLATING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
desc = "Has a valve and pump attached to it."
use_power = POWER_USE_OFF
idle_power_usage = 150 //internal circuitry, friction losses and stuff
power_rating = 30000 // 30000 W ~ 40 HP
power_rating = 15000 // 15000 W ~ 20 HP

connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SCRUBBER //connects to regular and scrubber pipes
identifier = "AScr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
// Build list of data from sensor readings.
for(var/obj/machinery/power/sensor/S in grid_sensors)
sensors.Add(list(list(
"name" = S.id_tag,
"name" = html_encode(S.id_tag),
"alarm" = S.check_grid_warning()
)))
if(S.id_tag == active_sensor)
Expand Down Expand Up @@ -167,5 +167,5 @@


else if( href_list["setsensor"] )
active_sensor = href_list["setsensor"]
active_sensor = html_decode(href_list["setsensor"])
. = 1
6 changes: 3 additions & 3 deletions code/modules/organs/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@
var/obj/item/organ/external/parent = GET_EXTERNAL_ORGAN(src, I.parent_organ)
if(parent)
var/pain = 10
var/message = "You feel a dull pain in your [parent.name]"
var/message = "You feel a dull pain in your [parent.name]."
if(I.is_bruised())
pain = 25
message = "You feel a pain in your [parent.name]"
message = "You feel a pain in your [parent.name]."
if(I.is_broken())
pain = 50
message = "You feel a sharp pain in your [parent.name]"
message = "You feel a sharp pain in your [parent.name]."
src.custom_pain(message, pain, affecting = parent)


Expand Down
5 changes: 4 additions & 1 deletion code/modules/power/sensors/powernet_sensor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
var/area/A = get_area(src)
if(!A)
return // in nullspace
id_tag = "[A.proper_name] #[sequential_id(A.name + "power/sensor")]"
var/suffix = uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, "[A.proper_name]power/sensor", 1) // unlike sequential_id, starts at 1 instead of 100
if(suffix == 1)
suffix = null
id_tag = "[A.proper_name][suffix ? " #[suffix]" : null]"
name = "[id_tag] - powernet sensor"

// Proc: check_grid_warning()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/shield_generators/floor_diffuser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
icon = 'icons/obj/machines/shielding.dmi'
icon_state = "fdiffuser_on"
use_power = POWER_USE_ACTIVE
idle_power_usage = 100
active_power_usage = 2000
idle_power_usage = 25 // Previously 100.
active_power_usage = 500 // Previously 2000
anchored = TRUE
density = FALSE
level = LEVEL_BELOW_PLATING
Expand Down
4 changes: 4 additions & 0 deletions code/modules/shield_generators/shield_generator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,17 @@

while(HasAbove(T.z))
T = GetAbove(T)
if(T.z_flags & ZM_TERMINATOR) // Do not propagate from the surface to the station.
break
if(istype(T))
turfs.Add(T)

T = get_turf(src)

while(HasBelow(T.z))
T = GetBelow(T)
if(T.z_flags & ZM_TERMINATOR) // Or from the station to the surface.
break
if(istype(T))
turfs.Add(T)

Expand Down
28 changes: 18 additions & 10 deletions maps/tether/atoms/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
holomap_color = HOLOMAP_AREACOLOR_SECURITY

/area/maintenance
name = "\improper Maintenance"
area_flags = AREA_FLAG_RAD_SHIELDED
sound_env = TUNNEL_ENCLOSED
turf_initializer = /decl/turf_initializer/maintenance
Expand All @@ -159,11 +160,11 @@
holomap_color = HOLOMAP_AREACOLOR_MAINTENANCE

/area/maintenance/bar
name = "Bar Maintenance"
name = "\improper Bar Maintenance"
icon_state = "maint_bar"

/area/maintenance/bar/catwalk
name = "Bar Maintenance Catwalk"
name = "\improper Bar Maintenance Catwalk"
icon_state = "maint_bar"

/area/medical/medbay_emt_bay
Expand All @@ -177,7 +178,7 @@
/area/outpost/research
holomap_color = HOLOMAP_AREACOLOR_SCIENCE
/area/outpost/research/longtermstorage
name = "Research Outpost Long-Term Storage"
name = "\improper Research Outpost Long-Term Storage"

/area/outpost/research/toxins_misc_lab
name = "\improper Research Outpost Toxins Miscellaneous Research"
Expand Down Expand Up @@ -274,6 +275,7 @@
icon_state = "shuttle2"

/area/shuttle/large_escape_pod1/station
name = "\improper Large Escape Pod"
icon_state = "shuttle2"
base_turf = /turf/exterior/barren

Expand Down Expand Up @@ -393,7 +395,7 @@


/area/tether/surfacebase/outside
name = "Outside - Surface"
name = "\improper Outside - Surface"
sound_env = MOUNTAINS
area_flags = AREA_FLAG_EXTERNAL | AREA_FLAG_IS_NOT_PERSISTENT | AREA_FLAG_IS_BACKGROUND | AREA_FLAG_HIDE_FROM_HOLOMAP
is_outside = OUTSIDE_YES
Expand Down Expand Up @@ -1341,24 +1343,29 @@
name = "\improper Engineering Maintenance"
icon_state = "maint_engineering"
/area/maintenance/engineering/pumpstation
name = "Engineering Pump Station"
name = "\improper Engineering Pump Station"
icon_state = "maint_pumpstation"
/area/maintenance/evahallway
name = "\improper EVA Maintenance"
icon_state = "maint_eva"
req_access = list(list(access_eva, access_maint_tunnels))
/area/maintenance/substation/cargo
name = "Cargo Substation"
name = "\improper Cargo Substation"

/area/maintenance/substation/civilian
name = "\improper Civilian Substation"

/area/maintenance/substation/command
name = "\improper Command Substation"

/area/maintenance/substation/engineering
name = "Engineering Substation"
name = "\improper Engineering Substation"
/area/maintenance/substation/medical
name = "Medical Substation"
name = "\improper Medical Substation"
/area/maintenance/substation/research
name = "Research Substation"
name = "\improper Research Substation"
/area/maintenance/substation/security
name = "Security Substation"
name = "\improper Security Substation"
/area/medical/biostorage
name = "\improper Secondary Storage"
icon_state = "medbay4"
Expand Down Expand Up @@ -1547,6 +1554,7 @@

// Visitor/crew amenities
/area/bridge
name = "\improper Bridge"
holomap_color = HOLOMAP_AREACOLOR_COMMAND
/area/bridge/secondary
name = "\improper Secondary Command Office"
Expand Down
Loading

0 comments on commit a5cd44d

Please sign in to comment.