Makes telecoms heat production and power usage...

...less ridiculous. Now obeys something resembling the laws of physics.
This commit is contained in:
mwerezak
2014-07-11 15:07:31 -04:00
parent 96983fe8b8
commit 1db729e90c
2 changed files with 20 additions and 22 deletions

View File

@@ -141,7 +141,6 @@ What are the archived variables for?
return max(MINIMUM_HEAT_CAPACITY,heat_capacity_archived) return max(MINIMUM_HEAT_CAPACITY,heat_capacity_archived)
//this seems like such a common thing to do I can't believe this hasn't been made into it's own proc yet.
/datum/gas_mixture/proc/add_thermal_energy(var/thermal_energy) /datum/gas_mixture/proc/add_thermal_energy(var/thermal_energy)
//Purpose: Adjusting temperature based on thermal energy transfer //Purpose: Adjusting temperature based on thermal energy transfer
//Called by: Anyone who wants to add or remove energy from the gas mix //Called by: Anyone who wants to add or remove energy from the gas mix

View File

@@ -29,7 +29,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/toggled = 1 // Is it toggled on var/toggled = 1 // Is it toggled on
var/on = 1 var/on = 1
var/integrity = 100 // basically HP, loses integrity by heat var/integrity = 100 // basically HP, loses integrity by heat
var/heatgen = 20 // how much heat to transfer to the environment var/operating_temperature = 20 + T0C // the temperature that the machine will raise the environment to, null for no heat production
var/delay = 10 // how many process() ticks to delay per heat var/delay = 10 // how many process() ticks to delay per heat
var/heating_power = 40000 var/heating_power = 40000
var/long_range_link = 0 // Can you link it across Z levels or on the otherside of the map? (Relay & Hub) var/long_range_link = 0 // Can you link it across Z levels or on the otherside of the map? (Relay & Hub)
@@ -227,15 +227,16 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
produce_heat(heatgen) produce_heat(heatgen)
delay = initial(delay) delay = initial(delay)
/obj/machinery/telecomms/proc/produce_heat(heat_amt) /obj/machinery/telecomms/proc/produce_heat(new_temperature)
if(heatgen == 0) if(isnull(new_temperature))
return return
if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater. if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater.
var/turf/simulated/L = loc var/turf/simulated/L = loc
if(istype(L)) if(istype(L))
var/datum/gas_mixture/env = L.return_air() var/datum/gas_mixture/env = L.return_air()
if(env.temperature < (heat_amt+T0C))
if(env.temperature < new_temperature)
var/transfer_moles = 0.25 * env.total_moles() var/transfer_moles = 0.25 * env.total_moles()
@@ -243,10 +244,8 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(removed) if(removed)
var/heat_capacity = removed.heat_capacity() var/heat_produced = min(removed.get_thermal_energy_change(new_temperature), idle_power_usage) //obviously can't produce more heat than the machine draws from it's power source
if(heat_capacity == 0 || heat_capacity == null) removed.add_thermal_energy(heat_produced)
heat_capacity = 1
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000)
env.merge(removed) env.merge(removed)
/* /*
@@ -265,9 +264,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 30 idle_power_usage = 600
machinetype = 1 machinetype = 1
heatgen = 0 operating_temperature = null
circuitboard = "/obj/item/weapon/circuitboard/telecomms/receiver" circuitboard = "/obj/item/weapon/circuitboard/telecomms/receiver"
/obj/machinery/telecomms/receiver/receive_signal(datum/signal/signal) /obj/machinery/telecomms/receiver/receive_signal(datum/signal/signal)
@@ -322,9 +321,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 80 idle_power_usage = 1600
machinetype = 7 machinetype = 7
heatgen = 40 operating_temperature = 40 + T0C
circuitboard = "/obj/item/weapon/circuitboard/telecomms/hub" circuitboard = "/obj/item/weapon/circuitboard/telecomms/hub"
long_range_link = 1 long_range_link = 1
netspeed = 40 netspeed = 40
@@ -357,9 +356,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 30 idle_power_usage = 600
machinetype = 8 machinetype = 8
heatgen = 0 operating_temperature = null
circuitboard = "/obj/item/weapon/circuitboard/telecomms/relay" circuitboard = "/obj/item/weapon/circuitboard/telecomms/relay"
netspeed = 5 netspeed = 5
long_range_link = 1 long_range_link = 1
@@ -409,9 +408,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 50 idle_power_usage = 1000
machinetype = 2 machinetype = 2
heatgen = 20 operating_temperature = 20 + T0C
circuitboard = "/obj/item/weapon/circuitboard/telecomms/bus" circuitboard = "/obj/item/weapon/circuitboard/telecomms/bus"
netspeed = 40 netspeed = 40
var/change_frequency = 0 var/change_frequency = 0
@@ -462,9 +461,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 30 idle_power_usage = 600
machinetype = 3 machinetype = 3
heatgen = 100 operating_temperature = 100 + T0C
delay = 5 delay = 5
circuitboard = "/obj/item/weapon/circuitboard/telecomms/processor" circuitboard = "/obj/item/weapon/circuitboard/telecomms/processor"
var/process_mode = 1 // 1 = Uncompress Signals, 0 = Compress Signals var/process_mode = 1 // 1 = Uncompress Signals, 0 = Compress Signals
@@ -501,9 +500,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 15 idle_power_usage = 300
machinetype = 4 machinetype = 4
heatgen = 50 operating_temperature = 50 + T0C
circuitboard = "/obj/item/weapon/circuitboard/telecomms/server" circuitboard = "/obj/item/weapon/circuitboard/telecomms/server"
var/list/log_entries = list() var/list/log_entries = list()
var/list/stored_names = list() var/list/stored_names = list()