diff options
| author | Simon <simon@hardwired.org.uk> | 2010-12-27 23:21:26 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2010-12-27 23:21:26 (GMT) |
| commit | 713034ed619378aa0abc6b38b69604e1aba8821c (patch) | |
| tree | 8ee79915fd21a9eed3c3776b3fbfaa93a41fb21c /src/powder.c | |
| parent | 16f7cdaef61dd7ff57a20e96984db91f04ec30b2 (diff) | |
| parent | 761ea03882fd779cc77ac7cb49ff59bbfe94b51e (diff) | |
| download | powder-713034ed619378aa0abc6b38b69604e1aba8821c.zip powder-713034ed619378aa0abc6b38b69604e1aba8821c.tar.gz | |
Cracker Merge
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/src/powder.c b/src/powder.c index b6e843f..8b76216 100644 --- a/src/powder.c +++ b/src/powder.c @@ -2792,8 +2792,30 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - else if(t==PT_BOMB) + else if(t==PT_C5) + { + 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((parts[r>>8].temp<100 && parts[r>>8].type!=PT_C5)||parts[r>>8].type==PT_HFLM) + { + if(1>rand()%6) + { + t = parts[i].type = PT_HFLM; + parts[r>>8].temp = parts[i].temp = 0; + parts[i].life = rand()%150+50; + pv[y/CELL][x/CELL] += 1.5; + } + } + } + } + else if(t==PT_BOMB) { + int nb; if(parts[i].tmp==1){ for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) @@ -2815,7 +2837,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB){ + if(parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB && parts[r>>8].type!=PT_DMND && parts[r>>8].type!=PT_CLNE && parts[r>>8].type!=PT_PCLN && parts[r>>8].type!=PT_BCLN){ int rad = 8; int nxi; int nxj; @@ -2823,7 +2845,7 @@ void update_particles_i(pixel *vid, int start, int inc) for(nxj=-(rad+1); nxj<=(rad+1); nxj++) for(nxi=-(rad+1); nxi<=(rad+1); nxi++) if((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1){ - int nb = create_part(-1, x+nxi, y+nxj, PT_BOMB); + nb = create_part(-1, x+nxi, y+nxj, PT_BOMB); if(nb!=-1){ parts[nb].tmp = 1; parts[nb].life = 50; @@ -2834,16 +2856,17 @@ void update_particles_i(pixel *vid, int start, int inc) } for(nxj=-rad; nxj<=rad; nxj++) for(nxi=-rad; nxi<=rad; nxi++) - if((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1){ - delete_part(x+nxi, y+nxj); - pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f; - int nb = create_part(-1, x+nxi, y+nxj, PT_BOMB); - if(nb!=-1){ - parts[nb].tmp = 2; - parts[nb].life = 2; - parts[nb].temp = MAX_TEMP; + if((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1) + if((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN){ + delete_part(x+nxi, y+nxj); + pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f; + nb = create_part(-1, x+nxi, y+nxj, PT_BOMB); + if(nb!=-1){ + parts[nb].tmp = 2; + parts[nb].life = 2; + parts[nb].temp = MAX_TEMP; + } } - } //create_parts(x, y, 9, 9, PT_BOMB); //create_parts(x, y, 8, 8, PT_NONE); parts[i].type = PT_NONE; @@ -3118,10 +3141,10 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0&&parts_avg(i,r>>8,PT_INSL)!=PT_INSL) + else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life==0&&parts_avg(i,r>>8,PT_INSL)!=PT_INSL) { - flood_parts(x,y,PT_SPRK,PT_INST,-1);//add life - parts[r>>8].type==parts[r>>8].ctype; + flood_parts(x,y,PT_SPRK,PT_INST,-1);//spark the wire + //parts[r>>8].type=parts[r>>8].ctype; } } } |
