diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-11-17 19:44:09 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-11-17 19:44:09 (GMT) |
| commit | 058a2edd75debbd0297f92572316daa704bd379f (patch) | |
| tree | ad303f091f9a08b209b91eb34a9fcad996a3de69 /src/simulation/elements/RIME.cpp | |
| parent | e3594aba9e05c6865d396418c028049cda92c2f3 (diff) | |
| parent | 7a21ae192fe19868539956f3fe28e62b2c7c4429 (diff) | |
| download | powder-058a2edd75debbd0297f92572316daa704bd379f.zip powder-058a2edd75debbd0297f92572316daa704bd379f.tar.gz | |
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/simulation/elements/RIME.cpp')
| -rw-r--r-- | src/simulation/elements/RIME.cpp | 77 |
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..1ff2fad --- /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; + +} + +//#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 |
