diff options
| author | Cracker64 <cracker642@gmail.com> | 2011-04-25 19:00:27 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-05-05 19:38:30 (GMT) |
| commit | 59bd280fad8ede2ab81d26156dcb7da81c3b0e7d (patch) | |
| tree | 6b368a7819b1628557e308a54ba069ebd8cf386b /src | |
| parent | b5a334c2afbfbe0f03b1f18380d2eb93eaa32675 (diff) | |
| download | powder-59bd280fad8ede2ab81d26156dcb7da81c3b0e7d.zip powder-59bd280fad8ede2ab81d26156dcb7da81c3b0e7d.tar.gz | |
ANAR changes, WHOL absorbs ANAR and gets colder. ANAR burns with CFLM strangely.
Diffstat (limited to 'src')
| -rw-r--r-- | src/elements/anar.c | 27 | ||||
| -rw-r--r-- | src/powder.c | 15 |
2 files changed, 41 insertions, 1 deletions
diff --git a/src/elements/anar.c b/src/elements/anar.c new file mode 100644 index 0000000..4a30cc2 --- /dev/null +++ b/src/elements/anar.c @@ -0,0 +1,27 @@ +#include <element.h> + +int update_ANAR(UPDATE_FUNC_ARGS) { + int r, rx, ry; + + //if (parts[i].temp >= 0.23) + // parts[i].temp --; + 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>>8)>=NPART || !r) + continue; + if ((r&0xFF)==PT_HFLM) + { + if (1>rand()%22) + { + part_change_type(i,x,y,PT_HFLM); + parts[i].life = rand()%150+50; + parts[r>>8].temp = parts[i].temp = 0; + pv[y/CELL][x/CELL] -= 0.5; + } + } + } + return 0; +} diff --git a/src/powder.c b/src/powder.c index 84845c2..f31e115 100644 --- a/src/powder.c +++ b/src/powder.c @@ -79,6 +79,9 @@ int eval_move(int pt, int nx, int ny, unsigned *rr) if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) return 1; + if ((r&0xFF)==PT_WHOL && pt==PT_ANAR) + return 1; + if (pt==PT_SPRK)//spark shouldn't move return 0; @@ -237,7 +240,17 @@ int try_move(int i, int x, int y, int nx, int ny) return 0; } - if ((pmap[ny][nx]&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles + if ((r&0xFF)==PT_WHOL && parts[i].type==PT_ANAR) //whitehole eats anar + { + parts[i].type=PT_NONE; + if (!legacy_enable) + { + parts[r>>8].temp = restrict_flt(parts[r>>8].temp- (MAX_TEMP-parts[i].temp)/2, MIN_TEMP, MAX_TEMP); + } + + return 0; + } + if ((r&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles return 0; if (parts[i].type==PT_CNCT && y<ny && (pmap[y+1][x]&0xFF)==PT_CNCT)//check below CNCT for another CNCT return 0; |
