Subsystem change for the SM and TEG and slight QoL

This commit is contained in:
CitadelStationBot
2017-05-01 13:06:07 -05:00
parent 1842665af6
commit 00164a49a7
3 changed files with 44 additions and 10 deletions
+27 -9
View File
@@ -33,6 +33,7 @@
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
if(cold_circ)
switch(cold_dir)
@@ -54,7 +55,10 @@
stat |= BROKEN
update_icon()
/obj/machinery/power/generator/Destroy()
SSair.atmos_machinery -= src
return ..()
/obj/machinery/power/generator/update_icon()
@@ -104,7 +108,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];")
@@ -113,7 +117,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)
//add_avail(lastgen) This is done in process now
// update icon overlays only if displayed level has changed
if(hot_air)
@@ -123,15 +127,23 @@
if(cold_air)
var/datum/gas_mixture/cold_circ_air1 = cold_circ.AIR1
cold_circ_air1.merge(cold_air)
update_icon()
var/genlev = max(0, min( round(11*lastgen / 100000), 11))
var/circ = "[cold_circ && cold_circ.last_pressure_delta > 0 ? "1" : "0"][hot_circ && hot_circ.last_pressure_delta > 0 ? "1" : "0"]"
if((genlev != lastgenlev) || (circ != lastcirc))
lastgenlev = genlev
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/attack_hand(mob/user)
if(..())
@@ -150,9 +162,15 @@
var/datum/gas_mixture/hot_circ_air2 = hot_circ.AIR2
t += "<div class='statusDisplay'>"
t += "Output: [round(lastgen)] W"
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>"
+13
View File
@@ -0,0 +1,13 @@
diff a/code/modules/power/generator.dm b/code/modules/power/generator.dm (rejected hunks)
@@ -64,9 +64,8 @@
else
cut_overlays()
- var/L = min(round(lastgenlev/100000),11)
-
- if(L != 0)
+ 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]")
@@ -129,6 +129,7 @@
/obj/machinery/power/supermatter_shard/New()
. = ..()
SSair.atmos_machinery += src
countdown = new(src)
countdown.start()
GLOB.poi_list |= src
@@ -139,6 +140,7 @@
/obj/machinery/power/supermatter_shard/Destroy()
investigate_log("has been destroyed.", "supermatter")
SSair.atmos_machinery -= src
QDEL_NULL(radio)
GLOB.poi_list -= src
QDEL_NULL(countdown)
@@ -181,7 +183,7 @@
E.energy = power
qdel(src)
/obj/machinery/power/supermatter_shard/process()
/obj/machinery/power/supermatter_shard/process_atmos()
var/turf/T = loc
if(isnull(T)) // We have a null turf...something is wrong, stop processing this entity.
@@ -296,6 +298,7 @@
if(produces_gas)
env.merge(removed)
air_update_turf()
for(var/mob/living/carbon/human/l in view(src, HALLUCINATION_RANGE(power))) // If they can see it without mesons on. Bad on them.
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))