diff options
| author | jacksonmj <jacksonmj@jacksonmj.none> | 2011-01-07 16:18:22 (GMT) |
|---|---|---|
| committer | jacksonmj <jacksonmj@jacksonmj.none> | 2011-01-07 16:18:22 (GMT) |
| commit | f3ded5f08c0bbb3523a0ab2ee6e07538fabd79c2 (patch) | |
| tree | 804bfff0e558daf780b4330db417e93e2ef695a2 /src/elements/thrm.c | |
| parent | b661418d7ecd44960f0e24eb7abd79cfc5eb5f0e (diff) | |
| download | powder-f3ded5f08c0bbb3523a0ab2ee6e07538fabd79c2.zip powder-f3ded5f08c0bbb3523a0ab2ee6e07538fabd79c2.tar.gz | |
More function pointers.
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; +} |
