diff options
| author | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-17 00:47:18 (GMT) |
|---|---|---|
| committer | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-17 00:47:18 (GMT) |
| commit | 9383c1ca4c0b7b1232762fa7511a4179c98caa24 (patch) | |
| tree | 9a9b83d1cb2746b17a47a72ac0f5936415231d3e /src/powder.c | |
| parent | 245628a7fd00422671cc931e258888ddddd7a4c5 (diff) | |
| download | powder-9383c1ca4c0b7b1232762fa7511a4179c98caa24.zip powder-9383c1ca4c0b7b1232762fa7511a4179c98caa24.tar.gz | |
Added a different velocity/pressure display. Added old fireworks i made.
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/powder.c b/src/powder.c index fb564d3..7cdba8c 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1940,6 +1940,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_GAS; if((r&0xFF)==PT_COAL && 5>(rand()%100)) parts[r>>8].type = PT_WOOD; + if((r&0xFF)==PT_DUST && 5>(rand()%100)) + parts[r>>8].type = PT_FWRK; + if((r&0xFF)==PT_FWRK && 5>(rand()%100)) + parts[r>>8].ctype = PT_DUST; /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| @@ -2213,6 +2217,59 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + if(t==PT_FWRK) + { + if((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST) + { + + create_part(-1, x , y-1 , PT_FWRK); + r = pmap[y-1][x]; + if(parts[r>>8].type==PT_FWRK) + { + parts[r>>8].vy = rand()%8-22; + parts[r>>8].vx = rand()%20-rand()%20; + parts[r>>8].life=rand()%15+25; + parts[i].type=PT_NONE; + } + } + if(parts[i].life>1) + { + if(parts[i].life>=45&&parts[i].type==PT_FWRK) + parts[i].life=0; + } + if((parts[i].life<3&&parts[i].life>0)||parts[i].vy>6&&parts[i].life>0) + { + int q = (rand()%255+1); + int w = (rand()%255+1); + int e = (rand()%255+1); + for(nx=-1; nx<2; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx<XRES && y+ny<YRES) + { + if(5>=rand()%8) + { + if(!pmap[y+ny][x+nx]) + { + create_part(-1, x+nx, y+ny , PT_DUST); + pv[y/CELL][x/CELL] += 2.00f*CFDS; + a= pmap[y+ny][x+nx]; + if(parts[a>>8].type==PT_DUST) + { + parts[a>>8].vy = -(rand()%10-1); + parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[a>>8].life= rand()%37+18; + parts[a>>8].tmp=q; + parts[a>>8].flags=w; + parts[a>>8].ctype=e; + parts[a>>8].temp= rand()%20+6000; + } + } + } + } + parts[i].type=PT_NONE; + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) |
