summaryrefslogtreecommitdiff
path: root/src/simulation/elements/RIME.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/RIME.cpp')
-rw-r--r--src/simulation/elements/RIME.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/simulation/elements/RIME.cpp b/src/simulation/elements/RIME.cpp
new file mode 100644
index 0000000..e993862
--- /dev/null
+++ b/src/simulation/elements/RIME.cpp
@@ -0,0 +1,77 @@
+#include "simulation/Elements.h"
+//#TPT-Directive ElementClass Element_RIME PT_RIME 91
+Element_RIME::Element_RIME()
+{
+ Identifier = "DEFAULT_PT_RIME";
+ Name = "RIME";
+ Colour = PIXPACK(0xCCCCCC);
+ MenuVisible = 1;
+ MenuSection = SC_CRACKER2;
+ Enabled = 1;
+
+ Advection = 0.00f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.00f;
+ Loss = 1.00f;
+ Collision = 0.00f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.000f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 30;
+
+ Weight = 100;
+
+ Temperature = 243.15f;
+ HeatConduct = 100;
+ Description = "Not quite Ice";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = 273.15f;
+ HighTemperatureTransition = PT_WATR;
+
+ Update = &Element_RIME::update;
+ Graphics = NULL;
+}
+
+//#TPT-Directive ElementHeader Element_RIME static int update(UPDATE_FUNC_ARGS)
+int Element_RIME::update(UPDATE_FUNC_ARGS)
+ {
+ int r, rx, ry;
+ parts[i].vx = 0;
+ parts[i].vy = 0;
+ for (rx=-1; rx<2; rx++)
+ for (ry=-1; ry<2; 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_SPRK)
+ {
+ sim->part_change_type(i,x,y,PT_FOG);
+ parts[i].life = rand()%50 + 60;
+ }
+ else if ((r&0xFF)==PT_FOG&&parts[r>>8].life>0)
+ {
+ sim->part_change_type(i,x,y,PT_FOG);
+ parts[i].life = parts[r>>8].life;
+ }
+ }
+ return 0;
+}
+
+
+Element_RIME::~Element_RIME() {} \ No newline at end of file