mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 09:02:27 +00:00
Implements suggestion https://forums.aurorastation.org/viewtopic.php?f=21&p=78011 in the following fashion: Powersinks explode ~18 minutes after being placed on normal SMES setup. Obviously more input from engineering will make this process go faster. Upon reaching their capacity, they will now cause a larger area power surge. The surge will smash all lights belonging to APCs within close to moderate proximity, and call EMP act on all connected powernet items that are within range (severity depending on distance). All of those items have a small chance to cause a minor explosion as well, primarily because EMP act is fucking whimpy.
46 lines
2.4 KiB
Plaintext
46 lines
2.4 KiB
Plaintext
// Math constants.
|
|
#define M_PI 3.14159265
|
|
|
|
#define R_IDEAL_GAS_EQUATION 8.31 // kPa*L/(K*mol).
|
|
#define ONE_ATMOSPHERE 101.325 // kPa.
|
|
#define IDEAL_GAS_ENTROPY_CONSTANT 1164 // (mol^3 * s^3) / (kg^3 * L).
|
|
|
|
// Radiation constants.
|
|
#define STEFAN_BOLTZMANN_CONSTANT 5.6704e-8 // W/(m^2*K^4).
|
|
#define COSMIC_RADIATION_TEMPERATURE 3.15 // K.
|
|
#define AVERAGE_SOLAR_RADIATION 200 // W/m^2. Kind of arbitrary. Really this should depend on the sun position much like solars.
|
|
#define RADIATOR_OPTIMUM_PRESSURE 3771 // kPa at 20 C. This should be higher as gases aren't great conductors until they are dense. Used the critical pressure for air.
|
|
#define GAS_CRITICAL_TEMPERATURE 132.65 // K. The critical point temperature for air.
|
|
|
|
#define RADIATOR_EXPOSED_SURFACE_AREA_RATIO 0.04 // (3 cm + 100 cm * sin(3deg))/(2*(3+100 cm)). Unitless ratio.
|
|
#define HUMAN_EXPOSED_SURFACE_AREA 5.2 //m^2, surface area of 1.7m (H) x 0.46m (D) cylinder
|
|
|
|
#define T0C 273.15 // 0.0 degrees celcius
|
|
#define T20C 293.15 // 20.0 degrees celcius
|
|
#define TCMB 2.7 // -270.3 degrees celcius
|
|
|
|
#define CLAMP01(x) max(0, min(1, x))
|
|
#define QUANTIZE(variable) (round(variable,0.0001))
|
|
|
|
#define INFINITY 1.#INF
|
|
|
|
#define TICKS_IN_DAY 24*60*60*10
|
|
#define TICKS_IN_SECOND 10
|
|
|
|
// A neat little helper to convert the value X, that's between imin and imax, into a value
|
|
// that's proportionally scaled and in range of omin and omax.
|
|
#define MAP(x, imin, imax, omin, omax) ((x - imin) * (omax - omin) / (imax - imin) + omin)
|
|
|
|
#define RAND_F(LOW, HIGH) (rand()*(HIGH-LOW) + LOW)
|
|
|
|
//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks
|
|
//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio)
|
|
//collapsed to percent_of_tick_used * tick_lag
|
|
#define TICK_DELTA_TO_MS(percent_of_tick_used) ((percent_of_tick_used) * world.tick_lag)
|
|
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(world.tick_usage-starting_tickusage))
|
|
|
|
//time of day but automatically adjusts to the server going into the next day within the same round.
|
|
//for when you need a reliable time number that doesn't depend on byond time.
|
|
#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK))
|
|
#define MIDNIGHT_ROLLOVER_CHECK ( rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : midnight_rollovers )
|