summaryrefslogtreecommitdiff
path: root/src/simulation/elements/WTRV.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/WTRV.cpp')
-rw-r--r--src/simulation/elements/WTRV.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/simulation/elements/WTRV.cpp b/src/simulation/elements/WTRV.cpp
new file mode 100644
index 0000000..8850cff
--- /dev/null
+++ b/src/simulation/elements/WTRV.cpp
@@ -0,0 +1,73 @@
+#include "simulation/Elements.h"
+//#TPT-Directive ElementClass Element_WTRV PT_WTRV 23
+Element_WTRV::Element_WTRV()
+{
+ Identifier = "DEFAULT_PT_WTRV";
+ Name = "WTRV";
+ Colour = PIXPACK(0xA0A0FF);
+ MenuVisible = 1;
+ MenuSection = SC_GAS;
+ Enabled = 1;
+
+ Advection = 1.0f;
+ AirDrag = 0.01f * CFDS;
+ AirLoss = 0.99f;
+ Loss = 0.30f;
+ Collision = -0.1f;
+ Gravity = -0.1f;
+ Diffusion = 0.75f;
+ HotAir = 0.0003f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 4;
+
+ Weight = 1;
+
+ Temperature = R_TEMP+100.0f+273.15f;
+ HeatConduct = 48;
+ Description = "Steam, heats up air, produced from hot water.";
+
+ State = ST_GAS;
+ Properties = TYPE_GAS;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = 371.0f;
+ LowTemperatureTransition = ST;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_WTRV::update;
+ Graphics = NULL;
+}
+
+//#TPT-Directive ElementHeader Element_WTRV static int update(UPDATE_FUNC_ARGS)
+int Element_WTRV::update(UPDATE_FUNC_ARGS)
+ {
+ int r, rx, ry;
+ for (rx=-2; rx<3; rx++)
+ for (ry=-2; ry<3; ry++)
+ if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ {
+ r = pmap[y+ry][x+rx];
+ if (!r)
+ continue;
+ if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && !sim->legacy_enable && parts[i].temp>(273.15f+12.0f) && 1>(rand()%500))
+ {
+ sim->part_change_type(i,x,y,PT_FIRE);
+ parts[i].life = 4;
+ parts[i].ctype = PT_WATR;
+ }
+ }
+ if(parts[i].temp>1273&&parts[i].ctype==PT_FIRE)
+ parts[i].temp-=parts[i].temp/1000;
+ return 0;
+}
+
+
+Element_WTRV::~Element_WTRV() {} \ No newline at end of file