diff options
| author | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-10 19:28:05 (GMT) |
|---|---|---|
| committer | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-10 19:28:05 (GMT) |
| commit | bd8a9f49313839cee94513f6c3059fdbdf824dda (patch) | |
| tree | 54d627091ce86091ad3fb644458f40428c26e71a /src | |
| parent | 83cd8c7979614f4164af3c9e3d19ff705e8a5430 (diff) | |
| download | powder-bd8a9f49313839cee94513f6c3059fdbdf824dda.zip powder-bd8a9f49313839cee94513f6c3059fdbdf824dda.tar.gz | |
made myself for AntB because he is a bad coder, here you go
Diffstat (limited to 'src')
| -rw-r--r-- | src/powder.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c index 5f7c669..9a166ca 100644 --- a/src/powder.c +++ b/src/powder.c @@ -919,7 +919,7 @@ void update_particles_i(pixel *vid, int start, int inc) ly = parts[i].y; t = parts[i].type; - if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL) + if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; @@ -1880,6 +1880,49 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp -= 50.0f; ISGOL=1; } + else if(t==PT_CRAC) + { + if(pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx<XRES && y+ny<YRES && (nx || ny)) + { + r = pmap[y+ny][x+nx]; + if(parts[r>>8].type==PT_WATR&&5>=rand()%100) + { + parts[i].tmp++; + parts[r>>8].type=PT_NONE; + } + } + } + else + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; 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 )&&parts[i].tmp>=1)//if nothing then create water + { + create_part(-1,x+nx,y+ny,PT_WATR); + parts[i].tmp --; + } + } + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx<XRES && y+ny<YRES && (nx || ny)) + { + r = pmap[y+ny][x+nx]; + if(parts[r>>8].type==t&&(parts[i].tmp>parts[r>>8].tmp)&&5>=rand()%50&&parts[i].tmp>0)//diffusion + { + parts[r>>8].tmp ++; + parts[i].tmp --; + } + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) |
