mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 15:37:36 +01:00
LINDA -> MILLA (#25328)
* LINDA -> MILLA * Tiles now change their atmos mode properly. * Fixed a bug that made walls generate supercold air when deconstructed/destroyed. * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Begone, var! * MILLA -> milla * Lint. * More lint. * Prevent negative/NaN atmos from spreading. * Made fires start more reliably. * Undef what the rest should not see. * Enums are nice. * Match LINDA better. * Debugging verbs. * Debug verb fixes. * Labelled more lavaland stuff with ATMOS_MODE_LAVALAND * Block superconductivity on a couple more things for Lavaland. * Updated milla.dll * Lavaland map fixes. * Missed a spot. * Begone, var! (again) * Add libmilla_ci.so for continuous integration tests. * Install/contributing instructions for MILLA. * Directional plasmaglass windows on shuttles shouldn't stop protecting from heat after moving. * Banish bad naming. * Better naming and debug stats for SSair. * Apply suggestions from code review Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Magic numbers and formatting. * Don't screw up the temperature during reactions. * Efficiency and readability. * Fix hotspots. * Removed redundant safety (MILLA will already output an error) * Optimizations. * oops * TGS build script update. * Change API of gas_mixture and how you get one from a turf. * Get in there. * so many vars * MILLA binary updates. * Lint * Made MT cost more honest. * Gave MILLA a read-only mode. * More read-only vs synchronized mode work. * Even more. * Synchronize disposals. * Updated a bunch of stuff to use SSair.synchronize or GM.synchronize. * MILLA <3 Tracy * lint * cargo fmt * more lint * Test needed MILLA sync. * Silence atmos machinery that's behaving as intended, but continue objecting to other potential failures to synchronize. * Push new MILLA DLL * Build MILLA * Update PR instructions for MILLA. * Add some fancy plasmaglass windows to the Lifebringers' ship. * The golems remembered that they should insulate *all* their engines. * First round of TM bugfixes. * Build MILLA * fix two lavaland ruin turf types * bunch more maps * fixes milla ci and makes the interesting turf verb better * Solid turfs can no longer conduct heat (for now...) * Made indoor tiles in beach and winter biodomes not lavaland air. * Re-added random IT teleport, adjusted warning message * Fixed a tinted window on Lavaland to be a plasglass window instead. * Made firelocks and holofans heatproof * Made RPD auto-wrench pipes if you have a wrench in your offhand. * Runtime fixes. * Made visuals update more reliably. * Lint * Update .github/CONTRIBUTING.md Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Build MILLA * The Syndicate have installed tiny fans on their research base. * The syndicate have figured out how to make plastitanium windows heatproof. * This is getting out of hand. Now there are two of them. * Un-break the auto-wrenching that I broke before committing. * Build MILLA * Build MILLA * Massive MILLA refactor, assorted bugfixes. * Build MILLA * Explicit typing. * Less sleeping/blocking. * Build MILLA * Yes, yes, this part can sleep. * Build MILLA * SSair reporting improvements. * Build MILLA * Please do not dock twice and splat yourself. * Build MILLA * Pls to not make SM go nuts. * Build MILLA * Build MILLA * Added stricter lower bounds on plasmafire, fixing perpetually-burning SM. * Build MILLA * Lint * Temporary logging, begone. * Build MILLA * Prevent hotspot strobing. * Add in radiate_to_spess behavior. * Build MILLA * progress * Compiling is good. * bugfixes * Progress. * Ruins update. * This one exists. * Fixup temporary hotspots to last longer than one tick. * Add/fix comments. * Cut the slash. * Fix test. * No sleep for you. * Build MILLA * Prevent nested MILLA safety from runtiming. * Build MILLA * Runtime fix. * Build MILLA * Fix canisters not updating icon when gas contents change. * Build MILLA * Build MILLA * Fixed an issue that made mechs very cold on environment air. * Build MILLA * oops * Build MILLA * Walls can make loud noises again. * Build MILLA * Fixes a rare runtime. * Build MILLA * Update .github/DOWNLOADING.md Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Review suggestions * Lint * Build MILLA * bound_mixtures now only contains mixtures that can be written * Build MILLA * Apply suggestions from code review Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Build MILLA * Restore the original async behavior of pyro anomalies. * Build MILLA * Build MILLA * Make the safety assertion in /datum/milla_safe safer. * Build MILLA --------- Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com> Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Co-authored-by: GDN <Roanrichards1@Gmail.com>
This commit is contained in:
co-authored by
Burzah
GDN
AffectedArc07
FunnyMan3595
paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
warriorstar-orion
GDN
parent
56b4da8ffc
commit
d3584b1d1c
@@ -125,10 +125,11 @@
|
||||
Gives traitors more opportunities to sabotage the generator or allows enterprising engineers to build additional
|
||||
cooling in order to get more power out.
|
||||
*/
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/gas_mixture/environment = T.get_readonly_air()
|
||||
if(environment)
|
||||
var/ratio = min(environment.return_pressure() / ONE_ATMOSPHERE, 1)
|
||||
var/ambient = environment.temperature - T20C
|
||||
var/ambient = environment.temperature() - T20C
|
||||
lower_limit += ambient * ratio
|
||||
upper_limit += ambient * ratio
|
||||
|
||||
@@ -154,10 +155,11 @@
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/handle_inactive()
|
||||
var/cooling_temperature = 20
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/gas_mixture/environment = T.get_readonly_air()
|
||||
if(environment)
|
||||
var/ratio = min(environment.return_pressure()/ONE_ATMOSPHERE, 1)
|
||||
var/ambient = environment.temperature - T20C
|
||||
var/ambient = environment.temperature() - T20C
|
||||
cooling_temperature += ambient*ratio
|
||||
|
||||
if(temperature > cooling_temperature)
|
||||
|
||||
@@ -110,13 +110,13 @@
|
||||
|
||||
if(cold_air && hot_air)
|
||||
|
||||
//log_debug("hot_air = [hot_air] temperature = [hot_air.temperature]; cold_air = [cold_air] temperature = [hot_air.temperature];")
|
||||
//log_debug("hot_air = [hot_air] temperature = [hot_air.temperature()]; cold_air = [cold_air] temperature = [hot_air.temperature()];")
|
||||
|
||||
//log_debug("coldair and hotair pass")
|
||||
var/cold_air_heat_capacity = cold_air.heat_capacity()
|
||||
var/hot_air_heat_capacity = hot_air.heat_capacity()
|
||||
|
||||
var/delta_temperature = hot_air.temperature - cold_air.temperature
|
||||
var/delta_temperature = hot_air.temperature() - cold_air.temperature()
|
||||
|
||||
//log_debug("delta_temperature = [delta_temperature]; cold_air_heat_capacity = [cold_air_heat_capacity]; hot_air_heat_capacity = [hot_air_heat_capacity]")
|
||||
|
||||
@@ -130,8 +130,8 @@
|
||||
|
||||
//log_debug("lastgen = [lastgen]; heat = [heat]; delta_temperature = [delta_temperature]; hot_air_heat_capacity = [hot_air_heat_capacity]; cold_air_heat_capacity = [cold_air_heat_capacity];")
|
||||
|
||||
hot_air.temperature = hot_air.temperature - energy_transfer / hot_air_heat_capacity
|
||||
cold_air.temperature = cold_air.temperature + heat / cold_air_heat_capacity
|
||||
hot_air.set_temperature(hot_air.temperature() - energy_transfer / hot_air_heat_capacity)
|
||||
cold_air.set_temperature(cold_air.temperature() + heat / cold_air_heat_capacity)
|
||||
|
||||
//log_debug("POWER: [lastgen] W generated at [efficiency * 100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]")
|
||||
|
||||
@@ -221,10 +221,10 @@
|
||||
data["hot_dir"] = dir2text(hot_dir)
|
||||
data["output_power"] = round(lastgen)
|
||||
// Temps are K, pressures are kPa, power is W
|
||||
data["cold_inlet_temp"] = round(cold_circ_air2.temperature, 0.1)
|
||||
data["hot_inlet_temp"] = round(hot_circ_air2.temperature, 0.1)
|
||||
data["cold_outlet_temp"] = round(cold_circ_air1.temperature, 0.1)
|
||||
data["hot_outlet_temp"] = round(hot_circ_air1.temperature, 0.1)
|
||||
data["cold_inlet_temp"] = round(cold_circ_air2.temperature(), 0.1)
|
||||
data["hot_inlet_temp"] = round(hot_circ_air2.temperature(), 0.1)
|
||||
data["cold_outlet_temp"] = round(cold_circ_air1.temperature(), 0.1)
|
||||
data["hot_outlet_temp"] = round(hot_circ_air1.temperature(), 0.1)
|
||||
data["cold_delta_temp"] = data["cold_outlet_temp"] - data["cold_inlet_temp"]
|
||||
data["cold_inlet_pressure"] = round(cold_circ_air2.return_pressure(), 0.1)
|
||||
data["hot_inlet_pressure"] = round(hot_circ_air2.return_pressure(), 0.1)
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
M.set_multitool_buffer(user, src)
|
||||
|
||||
|
||||
/obj/machinery/power/compressor/CanAtmosPass(turf/T)
|
||||
/obj/machinery/power/compressor/CanAtmosPass(direction)
|
||||
return !density
|
||||
|
||||
/obj/machinery/power/compressor/proc/trigger_overheat()
|
||||
@@ -181,46 +181,46 @@
|
||||
return max(last_overheat + OVERHEAT_TIME - world.time, 0)
|
||||
|
||||
/obj/machinery/power/compressor/process()
|
||||
if(!turbine)
|
||||
stat = BROKEN
|
||||
if(stat & BROKEN || panel_open)
|
||||
var/datum/milla_safe/compressor_process/milla = new()
|
||||
milla.invoke_async(src)
|
||||
|
||||
/datum/milla_safe/compressor_process
|
||||
|
||||
/datum/milla_safe/compressor_process/on_run(obj/machinery/power/compressor/compressor)
|
||||
if(!compressor.turbine)
|
||||
compressor.stat = BROKEN
|
||||
if(compressor.stat & BROKEN || compressor.panel_open)
|
||||
return
|
||||
if(!starter)
|
||||
if(!compressor.starter)
|
||||
return
|
||||
|
||||
if(rpm_threshold == OVERDRIVE)
|
||||
//UI update here
|
||||
overheat += 2
|
||||
if(overheat >= OVERHEAT_THRESHOLD)
|
||||
trigger_overheat()
|
||||
else if(overheat > 0)
|
||||
overheat -= 2
|
||||
rpm = 0.9* rpm + 0.1 * rpmtarget
|
||||
var/datum/gas_mixture/environment = inturf.return_air()
|
||||
|
||||
// It's a simplified version taking only 1/10 of the moles from the turf nearby. It should be later changed into a better version
|
||||
//2023 note: It works, im not touc
|
||||
if(compressor.rpm_threshold == OVERDRIVE)
|
||||
compressor.overheat += 2
|
||||
if(compressor.overheat >= OVERHEAT_THRESHOLD)
|
||||
compressor.trigger_overheat()
|
||||
else if(compressor.overheat > 0)
|
||||
compressor.overheat -= 2
|
||||
compressor.rpm = 0.9 * compressor.rpm + 0.1 * compressor.rpmtarget
|
||||
|
||||
var/datum/gas_mixture/environment = get_turf_air(compressor.inturf)
|
||||
var/transfer_moles = environment.total_moles()/10
|
||||
//var/transfer_moles = rpm/10000*capacity
|
||||
var/datum/gas_mixture/removed = inturf.remove_air(transfer_moles)
|
||||
gas_contained.merge(removed)
|
||||
var/datum/gas_mixture/removed = environment.remove(transfer_moles)
|
||||
compressor.gas_contained.merge(removed)
|
||||
|
||||
// RPM function to include compression friction - be advised that too low/high of a compfriction value can make things screwy
|
||||
|
||||
rpm = max(0, rpm - (rpm*rpm)/(COMPFRICTION*efficiency))
|
||||
compressor.rpm = max(0, compressor.rpm - (compressor.rpm*compressor.rpm)/(COMPFRICTION*compressor.efficiency))
|
||||
|
||||
|
||||
if(starter && !(stat & NOPOWER))
|
||||
use_power(2800)
|
||||
if(rpm<1000)
|
||||
rpmtarget = 1000
|
||||
if(!(compressor.stat & NOPOWER))
|
||||
compressor.use_power(2800)
|
||||
if(compressor.rpm < 1000)
|
||||
compressor.rpmtarget = 1000
|
||||
else
|
||||
if(rpm<1000)
|
||||
rpmtarget = 0
|
||||
if(compressor.rpm < 1000)
|
||||
compressor.rpmtarget = 0
|
||||
|
||||
var/new_rpm_threshold
|
||||
switch(rpm)
|
||||
switch(compressor.rpm)
|
||||
if(50001 to INFINITY)
|
||||
new_rpm_threshold = OVERDRIVE
|
||||
if(10001 to 50000)
|
||||
@@ -232,9 +232,9 @@
|
||||
else
|
||||
new_rpm_threshold = NONE
|
||||
|
||||
if(rpm_threshold != new_rpm_threshold)
|
||||
rpm_threshold = new_rpm_threshold
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
if(compressor.rpm_threshold != new_rpm_threshold)
|
||||
compressor.rpm_threshold = new_rpm_threshold
|
||||
compressor.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/power/compressor/update_overlays()
|
||||
. = ..()
|
||||
@@ -286,44 +286,49 @@
|
||||
return !density
|
||||
|
||||
/obj/machinery/power/turbine/process()
|
||||
var/datum/milla_safe/turbine_process/milla = new()
|
||||
milla.invoke_async(src)
|
||||
|
||||
if(!compressor)
|
||||
stat = BROKEN
|
||||
/datum/milla_safe/turbine_process
|
||||
|
||||
if((stat & BROKEN) || panel_open)
|
||||
/datum/milla_safe/turbine_process/on_run(obj/machinery/power/turbine/turbine)
|
||||
if(!turbine.compressor)
|
||||
turbine.stat = BROKEN
|
||||
|
||||
if((turbine.stat & BROKEN) || turbine.panel_open)
|
||||
return
|
||||
if(!compressor.starter)
|
||||
if(!turbine.compressor.starter)
|
||||
return
|
||||
|
||||
// This is the power generation function. If anything is needed it's good to plot it in EXCEL before modifying
|
||||
// the TURBPOWER and TURBCURVESHAPE values
|
||||
|
||||
if(compressor.gas_contained.temperature < 500)
|
||||
lastgen = 0
|
||||
if(turbine.compressor.gas_contained.temperature() < 500)
|
||||
turbine.lastgen = 0
|
||||
else
|
||||
lastgen = ((compressor.rpm / TURBPOWER) ** TURBCURVESHAPE) * TURBPOWER * productivity * POWER_CURVE_MOD
|
||||
turbine.lastgen = ((turbine.compressor.rpm / TURBPOWER) ** TURBCURVESHAPE) * TURBPOWER * turbine.productivity * POWER_CURVE_MOD
|
||||
|
||||
produce_direct_power(lastgen)
|
||||
turbine.produce_direct_power(turbine.lastgen)
|
||||
|
||||
// Weird function but it works. Should be something else...
|
||||
|
||||
var/newrpm = ((compressor.gas_contained.temperature) * compressor.gas_contained.total_moles())/4
|
||||
var/newrpm = ((turbine.compressor.gas_contained.temperature()) * turbine.compressor.gas_contained.total_moles()) / 4
|
||||
|
||||
newrpm = max(0, newrpm)
|
||||
|
||||
if(!compressor.starter || newrpm > 1000)
|
||||
compressor.rpmtarget = newrpm
|
||||
if(!turbine.compressor.starter || newrpm > 1000)
|
||||
turbine.compressor.rpmtarget = newrpm
|
||||
|
||||
if(compressor.gas_contained.total_moles()>0)
|
||||
var/oamount = min(compressor.gas_contained.total_moles(), (compressor.rpm+100)/35000*compressor.capacity)
|
||||
var/datum/gas_mixture/removed = compressor.gas_contained.remove(oamount)
|
||||
outturf.assume_air(removed)
|
||||
if(turbine.compressor.gas_contained.total_moles()>0)
|
||||
var/oamount = min(turbine.compressor.gas_contained.total_moles(), (turbine.compressor.rpm + 100) / 35000 * turbine.compressor.capacity)
|
||||
var/datum/gas_mixture/removed = turbine.compressor.gas_contained.remove(oamount)
|
||||
turbine.outturf.blind_release_air(removed)
|
||||
|
||||
if((lastgen > 100) != generator_threshold)
|
||||
generator_threshold = !generator_threshold
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
if((turbine.lastgen > 100) != turbine.generator_threshold)
|
||||
turbine.generator_threshold = !turbine.generator_threshold
|
||||
turbine.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
updateDialog()
|
||||
turbine.updateDialog()
|
||||
|
||||
/obj/machinery/power/turbine/update_overlays()
|
||||
. = ..()
|
||||
@@ -378,7 +383,7 @@
|
||||
data["online"] = compressor.starter
|
||||
data["power"] = compressor.turbine.lastgen
|
||||
data["rpm"] = compressor.rpm
|
||||
data["temperature"] = compressor.gas_contained.return_temperature()
|
||||
data["temperature"] = compressor.gas_contained.temperature()
|
||||
return data
|
||||
|
||||
/obj/machinery/power/turbine/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
@@ -446,7 +451,7 @@
|
||||
data["online"] = compressor.starter
|
||||
data["power"] = compressor.turbine.lastgen
|
||||
data["rpm"] = compressor.rpm
|
||||
data["temperature"] = compressor.gas_contained.return_temperature()
|
||||
data["temperature"] = compressor.gas_contained.temperature()
|
||||
data["bearing_heat"] = clamp((compressor.overheat / OVERHEAT_THRESHOLD) * 100, 0, 100)
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user