diff options
Diffstat (limited to 'src/elements/thrm.c')
| -rw-r--r-- | src/elements/thrm.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/elements/thrm.c b/src/elements/thrm.c new file mode 100644 index 0000000..3d82d46 --- /dev/null +++ b/src/elements/thrm.c @@ -0,0 +1,31 @@ +#include <powder.h> + +int update_THRM(UPDATE_FUNC_ARGS) { + int r; + for (nx=-2; nx<3; nx++) + for (ny=-2; ny<3; ny++) + if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny)) + { + r = pmap[y+ny][x+nx]; + if ((r>>8)>=NPART || !r) + continue; + if (((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_LAVA)) + { + if (1>(rand()%500)) { + parts[i].type = PT_LAVA; + parts[i].ctype = PT_BMTL; + parts[i].temp = 3500.0f; + pv[y/CELL][x/CELL] += 50.0f; + } else { + parts[i].type = PT_LAVA; + parts[i].life = 400; + parts[i].ctype = PT_THRM; + parts[i].temp = 3500.0f; + parts[i].tmp = 20; + } + } + //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) + //t = parts[i].type = PT_WATR; + } + return 0; +} |
