mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
yey
This commit is contained in:
@@ -28,12 +28,12 @@
|
||||
|
||||
|
||||
/obj/machinery/power/generator/Initialize(mapload)
|
||||
. = ..()
|
||||
. = ..()
|
||||
var/obj/machinery/atmospherics/components/binary/circulator/circpath = /obj/machinery/atmospherics/components/binary/circulator
|
||||
cold_circ = locate(circpath) in get_step(src, cold_dir)
|
||||
hot_circ = locate(circpath) in get_step(src, hot_dir)
|
||||
connect_to_network()
|
||||
SSair.atmos_machinery += src
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
if(cold_circ)
|
||||
switch(cold_dir)
|
||||
@@ -55,10 +55,10 @@
|
||||
stat |= BROKEN
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/generator/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/generator/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/generator/update_icon()
|
||||
|
||||
@@ -67,21 +67,20 @@
|
||||
else
|
||||
cut_overlays()
|
||||
|
||||
if(lastgenlev != 0)
|
||||
add_overlay("teg-op[lastgenlev]")
|
||||
var/L = min(round(lastgenlev/100000),11)
|
||||
if(L != 0)
|
||||
add_overlay(image('icons/obj/power.dmi', "teg-op[L]"))
|
||||
|
||||
add_overlay("teg-oc[lastcirc]")
|
||||
add_overlay("teg-oc[lastcirc]")
|
||||
|
||||
|
||||
#define GENRATE 800 // generator output coefficient from Q
|
||||
|
||||
/obj/machinery/power/generator/process()
|
||||
/obj/machinery/power/generator/process_atmos()
|
||||
|
||||
if(!cold_circ || !hot_circ)
|
||||
return
|
||||
|
||||
lastgen = 0
|
||||
|
||||
if(powernet)
|
||||
//to_chat(world, "cold_circ and hot_circ pass")
|
||||
|
||||
@@ -108,7 +107,7 @@
|
||||
var/energy_transfer = delta_temperature*hot_air_heat_capacity*cold_air_heat_capacity/(hot_air_heat_capacity+cold_air_heat_capacity)
|
||||
|
||||
var/heat = energy_transfer*(1-efficiency)
|
||||
lastgen += energy_transfer*efficiency
|
||||
lastgen += energy_transfer*efficiency
|
||||
|
||||
//to_chat(world, "lastgen = [lastgen]; heat = [heat]; delta_temperature = [delta_temperature]; hot_air_heat_capacity = [hot_air_heat_capacity]; cold_air_heat_capacity = [cold_air_heat_capacity];")
|
||||
|
||||
@@ -117,7 +116,7 @@
|
||||
|
||||
//to_chat(world, "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]")
|
||||
|
||||
//add_avail(lastgen) This is done in process now
|
||||
//add_avail(lastgen) This is done in process now
|
||||
// update icon overlays only if displayed level has changed
|
||||
|
||||
if(hot_air)
|
||||
@@ -127,23 +126,23 @@
|
||||
if(cold_air)
|
||||
var/datum/gas_mixture/cold_circ_air1 = cold_circ.AIR1
|
||||
cold_circ_air1.merge(cold_air)
|
||||
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
|
||||
var/circ = "[cold_circ && cold_circ.last_pressure_delta > 0 ? "1" : "0"][hot_circ && hot_circ.last_pressure_delta > 0 ? "1" : "0"]"
|
||||
if(circ != lastcirc)
|
||||
if(circ != lastcirc)
|
||||
lastcirc = circ
|
||||
update_icon()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/power/generator/process()
|
||||
//Setting this number higher just makes the change in power output slower, it doesnt actualy reduce power output cause **math**
|
||||
var/power_output = round(lastgen / 10)
|
||||
add_avail(power_output)
|
||||
lastgenlev = power_output
|
||||
lastgen -= power_output
|
||||
..()
|
||||
|
||||
/obj/machinery/power/generator/process()
|
||||
//Setting this number higher just makes the change in power output slower, it doesnt actualy reduce power output cause **math**
|
||||
var/power_output = round(lastgen / 10)
|
||||
add_avail(power_output)
|
||||
lastgenlev = power_output
|
||||
lastgen -= power_output
|
||||
..()
|
||||
|
||||
/obj/machinery/power/generator/attack_hand(mob/user)
|
||||
if(..())
|
||||
@@ -162,15 +161,15 @@
|
||||
var/datum/gas_mixture/hot_circ_air2 = hot_circ.AIR2
|
||||
|
||||
t += "<div class='statusDisplay'>"
|
||||
|
||||
var/displaygen = lastgenlev
|
||||
if(displaygen < 1000000) //less than a MW
|
||||
displaygen /= 1000
|
||||
t += "Output: [round(displaygen,0.01)] kW"
|
||||
else
|
||||
displaygen /= 1000000
|
||||
t += "Output: [round(displaygen,0.01)] MW"
|
||||
|
||||
|
||||
var/displaygen = lastgenlev
|
||||
if(displaygen < 1000000) //less than a MW
|
||||
displaygen /= 1000
|
||||
t += "Output: [round(displaygen,0.01)] kW"
|
||||
else
|
||||
displaygen /= 1000000
|
||||
t += "Output: [round(displaygen,0.01)] MW"
|
||||
|
||||
t += "<BR>"
|
||||
|
||||
t += "<B><font color='blue'>Cold loop</font></B><BR>"
|
||||
|
||||
Reference in New Issue
Block a user