diff options
| author | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-15 16:57:37 (GMT) |
|---|---|---|
| committer | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-15 16:57:37 (GMT) |
| commit | 663db5374fcd64afe81235f6646b3112ad5971c1 (patch) | |
| tree | 6482faf1f0c9a8d71aca90c51c2fd8532c02cf22 /src | |
| parent | 02067b1587821349e80cda5a0b98153c332a69ee (diff) | |
| download | powder-663db5374fcd64afe81235f6646b3112ad5971c1.zip powder-663db5374fcd64afe81235f6646b3112ad5971c1.tar.gz | |
Added BCLN LOVE WTF. description on forum post. A fix for loading COAL. made everything use the #defines for cmode (ex. CM_HEAT instead of 5).
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 106 | ||||
| -rw-r--r-- | src/interface.c | 30 | ||||
| -rw-r--r-- | src/main.c | 34 | ||||
| -rw-r--r-- | src/powder.c | 160 |
4 files changed, 253 insertions, 77 deletions
diff --git a/src/graphics.c b/src/graphics.c index 8836b52..9990409 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -21,7 +21,7 @@ #include <misc.h> -unsigned cmode = 3; +unsigned cmode = CM_FIRE; SDL_Surface *sdl_scrn; int sdl_scale = 1; @@ -1107,7 +1107,7 @@ void draw_air(pixel *vid) int x, y, i, j; pixel c; - if(cmode == 2) + if(cmode == CM_PERS) return; for(y=0; y<YRES/CELL; y++) @@ -1270,7 +1270,7 @@ void draw_parts(pixel *vid) float pt = R_TEMP; for(i = 0; i<NPART; i++) { #ifdef OpenGL - if(cmode == 6) //If fire mode + if(cmode == CM_FANCY) //If fancy mode { if(t==PT_MWAX) @@ -1355,14 +1355,14 @@ void draw_parts(pixel *vid) isplayer = 1; //It's a secret. Tssss... } - if(cmode==7)//nothing display + if(cmode==CM_NOTHING)//nothing display { cr = PIXR(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors); cb = PIXB(ptypes[t].pcolors); blendpixel(vid, nx, ny, cr, cg, cb, 255); } - else if(t==PT_MWAX&&cmode == 6) + else if(t==PT_MWAX&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1392,6 +1392,42 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } + else if(t==PT_WTF) + { + + if(parts[i].life>=700&&(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)) + { + x = nx/CELL; + y = ny/CELL; + cr = 20; + cg = 20; + cb = 20; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = PIXR(ptypes[t].pcolors) + parts[i].life*1; + cg = PIXG(ptypes[t].pcolors) + parts[i].life*2; + cb = PIXB(ptypes[t].pcolors) + parts[i].life*4; + if(cr>=255) + cr = 255; + if(cg>=255) + cg = 255; + if(cb>=255) + cb = 255; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + + } + + } else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; @@ -1401,7 +1437,7 @@ void draw_parts(pixel *vid) cr = PIXR(ptypes[t].pcolors)/s; cg = PIXG(ptypes[t].pcolors)/s; cb = PIXB(ptypes[t].pcolors)/s; - if(cmode==6) { + if(cmode==CM_FANCY) { for(x=-1; x<=1; x++) { for(y=-1; y<=1; y++) @@ -1416,7 +1452,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } - if(cmode==4) + if(cmode==CM_BLOB) { blendpixel(vid, nx+1, ny, cr, cg, cb, 223); blendpixel(vid, nx-1, ny, cr, cg, cb, 223); @@ -1429,7 +1465,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny+1, cr, cg, cb, 112); } } - else if(t==PT_OIL&&cmode == 6) + else if(t==PT_OIL&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1444,7 +1480,7 @@ void draw_parts(pixel *vid) } else if(t==PT_NEUT) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; cg = 8; @@ -1473,7 +1509,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } - } else if(t==PT_PLUT&&cmode == 6) + } else if(t==PT_PLUT&&cmode == CM_FANCY) { int tempx; int tempy; @@ -1493,7 +1529,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5); } } - } else if(t==PT_URAN&&cmode == 6) + } else if(t==PT_URAN&&cmode == CM_FANCY) { int tempx; int tempy; @@ -1513,7 +1549,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5); } } - } else if(t==PT_SLTW&&cmode == 6) + } else if(t==PT_SLTW&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1528,7 +1564,7 @@ void draw_parts(pixel *vid) } else if(t==PT_PHOT) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cg = 0; cb = 0; @@ -1595,7 +1631,7 @@ void draw_parts(pixel *vid) y = ny; blendpixel(vid,x,y,17,217,24,255); } - else if(t==PT_LNTG&&cmode == 6) + else if(t==PT_LNTG&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1610,7 +1646,7 @@ void draw_parts(pixel *vid) } else if(t==PT_SMKE) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { x = nx/CELL; y = ny/CELL; @@ -1643,7 +1679,7 @@ void draw_parts(pixel *vid) } } } - else if(t==PT_WATR&&cmode == 6) + else if(t==PT_WATR&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1656,7 +1692,7 @@ void draw_parts(pixel *vid) } } - } else if(t==PT_DSTW&&cmode == 6) + } else if(t==PT_DSTW&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1669,7 +1705,7 @@ void draw_parts(pixel *vid) } } } - else if(t==PT_NITR&&cmode == 6) + else if(t==PT_NITR&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1683,7 +1719,7 @@ void draw_parts(pixel *vid) } } - else if(t==PT_LRBD&&cmode == 6) + else if(t==PT_LRBD&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1698,7 +1734,7 @@ void draw_parts(pixel *vid) } - else if(t==PT_NBLE&&cmode == 6) + else if(t==PT_NBLE&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1714,7 +1750,7 @@ void draw_parts(pixel *vid) } } - else if(t==PT_GAS&&cmode == 6) + else if(t==PT_GAS&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1732,7 +1768,7 @@ void draw_parts(pixel *vid) } else if(t==PT_WTRV) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { x = nx/CELL; y = ny/CELL; @@ -1767,7 +1803,7 @@ void draw_parts(pixel *vid) } else if(t==PT_THDR) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; cg = 16; @@ -1812,7 +1848,7 @@ void draw_parts(pixel *vid) fr = 2 * pv[ny/CELL][nx/CELL]; } vid[ny*(XRES+BARSIZE)+nx] = PIXRGB((int)restrict_flt(0x44 + fr*8, 0, 255), (int)restrict_flt(0x88 + fg*8, 0, 255), (int)restrict_flt(0x44 + fb*8, 0, 255)); - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { x = nx/CELL; y = ny/CELL; @@ -1826,7 +1862,7 @@ void draw_parts(pixel *vid) if(fr > 255) fr = 255; fire_r[y][x] = fr; } - if(cmode == 4) { + if(cmode == CM_BLOB) { uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255); uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255); uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255); @@ -1846,7 +1882,7 @@ void draw_parts(pixel *vid) { uint8 GR = 0x50+(parts[i].life*10); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR); - if(cmode == 4) { + if(cmode == CM_BLOB) { blendpixel(vid, nx+1, ny, GR, GR, GR, 223); blendpixel(vid, nx-1, ny, GR, GR, GR, 223); blendpixel(vid, nx, ny+1, GR, GR, GR, 223); @@ -1862,7 +1898,7 @@ void draw_parts(pixel *vid) { uint8 GR = 0x3B+(parts[i].life*19); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, 10); - if(cmode == 4) { + if(cmode == CM_BLOB) { blendpixel(vid, nx+1, ny, GR, GR, 10, 223); blendpixel(vid, nx-1, ny, GR, GR, 10, 223); blendpixel(vid, nx, ny+1, GR, GR, 10, 223); @@ -1878,7 +1914,7 @@ void draw_parts(pixel *vid) { uint8 GR = 0x3B+(parts[i].life*19); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, 10, 10); - if(cmode == 4) { + if(cmode == CM_BLOB) { blendpixel(vid, nx+1, ny, GR, 10, 10, 223); blendpixel(vid, nx-1, ny, GR, 10, 10, 223); blendpixel(vid, nx, ny+1, GR, 10, 10, 223); @@ -1897,7 +1933,7 @@ void draw_parts(pixel *vid) uint8 R = plasma_data[caddress]; uint8 G = plasma_data[caddress+1]; uint8 B = plasma_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/8; cg = G/8; @@ -1936,7 +1972,7 @@ void draw_parts(pixel *vid) uint8 R = hflm_data[caddress]; uint8 G = hflm_data[caddress+1]; uint8 B = hflm_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/8; cg = G/8; @@ -1975,7 +2011,7 @@ void draw_parts(pixel *vid) uint8 R = firw_data[caddress]; uint8 G = firw_data[caddress+1]; uint8 B = firw_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/2; cg = G/2; @@ -2015,7 +2051,7 @@ void draw_parts(pixel *vid) uint8 R = flm_data[caddress]; uint8 G = flm_data[caddress+1]; uint8 B = flm_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/8; cg = G/8; @@ -2103,7 +2139,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny, cr, cg, cb, 64); blendpixel(vid, nx, ny+1, cr, cg, cb, 64); blendpixel(vid, nx, ny-1, cr, cg, cb, 64); - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr /= 32; cg /= 32; @@ -2124,7 +2160,7 @@ void draw_parts(pixel *vid) else if(t==PT_LAVA || t==PT_SPRK) { vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; - if(cmode == 3 || cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { if(t == PT_LAVA) { @@ -2193,7 +2229,7 @@ void draw_parts(pixel *vid) //blendpixel(vid, nx+1, ny, R, G, B, 255); } } - if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) + if(cmode == CM_BLOB&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) { if(t==PT_PHOT) { cg = 0; diff --git a/src/interface.c b/src/interface.c index 7fae854..8f0a559 100644 --- a/src/interface.c +++ b/src/interface.c @@ -528,29 +528,29 @@ void draw_svf_ui(pixel *vid_buf) switch(cmode) { - case 0: + case CM_VEL: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x98", 128, 160, 255, 255); break; - case 1: + case CM_PRESS: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x99", 255, 212, 32, 255); break; - case 2: + case CM_PERS: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x9A", 212, 212, 212, 255); break; - case 3: + case CM_FIRE: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x9B", 255, 0, 0, 255); drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x9C", 255, 255, 64, 255); break; - case 4: + case CM_BLOB: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBF", 55, 255, 55, 255); break; - case 5: + case CM_HEAT: drawtext(vid_buf, XRES-27+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBE", 255, 0, 0, 255); drawtext(vid_buf, XRES-27+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBD", 255, 255, 255, 255); break; - case 6: + case CM_FANCY: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); - case 7: + case CM_NOTHING: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); break; } @@ -1741,39 +1741,39 @@ void set_cmode(int cm) { cmode = cm; itc = 51; - if(cmode==4) + if(cmode==CM_BLOB) { memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); strcpy(itc_msg, "Blob Display"); } - else if(cmode==5) + else if(cmode==CM_HEAT) { strcpy(itc_msg, "Heat Display"); } - else if(cmode==6) + else if(cmode==CM_FANCY) { memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); strcpy(itc_msg, "Fancy Display"); } - else if(cmode==3) + else if(cmode==CM_FIRE) { memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); strcpy(itc_msg, "Fire Display"); } - else if(cmode==2) + else if(cmode==CM_PERS) { memset(fire_bg, 0, XRES*YRES*PIXELSIZE); strcpy(itc_msg, "Persistent Display"); } - else if(cmode==1) + else if(cmode==CM_PRESS) strcpy(itc_msg, "Pressure Display"); - else if(cmode==7) + else if(cmode==CM_NOTHING) strcpy(itc_msg, "Cracker Display"); else strcpy(itc_msg, "Velocity Display"); @@ -530,6 +530,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) else if(i < nf) { parts[fp[i]].type = j; + if(j == PT_COAL) + parts[fp[i]].tmp = 50; if(j == PT_PHOT) parts[fp[i]].ctype = 0x3fffffff; parts[fp[i]].x = (float)x; @@ -1123,11 +1125,11 @@ int main(int argc, char *argv[]) #ifdef OpenGL ClearScreen(); #else - if(cmode==0 || cmode==1) + if(cmode==CM_VEL || cmode==CM_PRESS) { draw_air(vid_buf); } - else if(cmode==2) + else if(cmode==CM_PERS) { memcpy(vid_buf, fire_bg, XRES*YRES*PIXELSIZE); memset(vid_buf+(XRES*YRES), 0, ((XRES+BARSIZE)*YRES*PIXELSIZE)-(XRES*YRES*PIXELSIZE)); @@ -1140,7 +1142,7 @@ int main(int argc, char *argv[]) update_particles(vid_buf); draw_parts(vid_buf); - if(cmode==2) + if(cmode==CM_PERS) { if(!fire_fc) { @@ -1152,7 +1154,7 @@ int main(int argc, char *argv[]) } fire_fc = (fire_fc+1) % 3; } - if(cmode==3||cmode==4||cmode==6) + if(cmode==CM_FIRE||cmode==CM_BLOB||cmode==CM_FANCY) render_fire(vid_buf); render_signs(vid_buf); @@ -1240,35 +1242,35 @@ int main(int argc, char *argv[]) } if(sdl_key=='1') { - set_cmode(0); + set_cmode(CM_VEL); } if(sdl_key=='2') { - set_cmode(1); + set_cmode(CM_PRESS); } if(sdl_key=='3') { - set_cmode(2); + set_cmode(CM_PERS); } if(sdl_key=='4') { - set_cmode(3); + set_cmode(CM_FIRE); } if(sdl_key=='5') { - set_cmode(4); + set_cmode(CM_BLOB); } if(sdl_key=='6') { - set_cmode(5); + set_cmode(CM_HEAT); } if(sdl_key=='7') { - set_cmode(6); + set_cmode(CM_FANCY); } - if(sdl_key=='8') + if(sdl_key=='8') { - set_cmode(7); + set_cmode(CM_NOTHING); } if(sdl_key==SDLK_LEFTBRACKET) { if(sdl_zoom_trig==1) @@ -1349,7 +1351,7 @@ int main(int argc, char *argv[]) } else if(sdl_key=='c') { - set_cmode((cmode+1) % 8); + set_cmode((cmode+1) % CM_COUNT); if(it > 50) it = 50; } @@ -1786,9 +1788,9 @@ int main(int argc, char *argv[]) if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) { if(b & SDL_BUTTON_LMASK) - set_cmode((cmode+1) % 8); + set_cmode((cmode+1) % CM_COUNT); if(b & SDL_BUTTON_RMASK) - set_cmode((cmode+7) % 8); + set_cmode((cmode+(CM_COUNT-1)) % CM_COUNT); save_presets(0); } if(x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)) && !bq) diff --git a/src/powder.c b/src/powder.c index fa9f02b..714ebcd 100644 --- a/src/powder.c +++ b/src/powder.c @@ -830,6 +830,49 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; + + if(ISLOVE==1) + { + for(ny=4;ny<YRES-4;ny++) + { + for(nx=4;nx<XRES-4;nx++) + { + r=pmap[ny][nx]; + if((r>>8)>=NPART || !r) + { + continue; + } + if(parts[r>>8].type==PT_LOVE) + { + love[nx/9][ny/9] = 1; + } + + } + } + for(nx=0;nx<=XRES-4;nx++) + { + for(ny=0;ny<=YRES-4;ny++) + { + if(love[nx/9][ny/9]==1) + { + for(int nnx=0;nnx<9;nnx++) + for(int nny=0;nny<9;nny++) + { + rt=pmap[ny+nny][nx+nnx]; + if((rt>>8)>=NPART) + { + continue; + } + if(!rt&&loverule[nnx][nny]==1) + create_part(-1,nx+nnx,ny+nny,PT_LOVE); + if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) + parts[rt>>8].type=PT_NONE; + } + } + love[nx/9][ny/9]=0; + } + } + } if(ISGOL==1&&CGOL>=GSPEED)//GSPEED is frames per generation { for(nx=4;nx<XRES-4;nx++) @@ -925,7 +968,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 && t!=PT_CRAC) + 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 && t!=PT_WTF) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; @@ -1017,7 +1060,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].vx *= ptypes[t].loss; parts[i].vy *= ptypes[t].loss; - if(t==PT_GOO && !parts[i].life) + if((t==PT_GOO||t==PT_BCLN) && !parts[i].life) { if(pv[y/CELL][x/CELL]>1.0f) { @@ -1901,16 +1944,18 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp -= 50.0f; ISGOL=1; } + else if(t==PT_LOVE) + ISLOVE=1; else if(t==PT_CRAC) { - if(pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3) - { + 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((r>>8)>=NPART || !r || parts[i].temp>374.0f) + if((r>>8)>=NPART || !r || parts[i].temp>374.0f) continue; if(parts[r>>8].type==PT_WATR&&33>=rand()/(RAND_MAX/100)+1) { @@ -1963,7 +2008,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - for(nx=-1; nx<2; nx++) + 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)) { @@ -1977,8 +2022,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life -= parts[i].life/3; } } - if(parts[i].temp>=374) - for(nx=-1; nx<2; nx++) + if(parts[i].temp>=374) + 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)) { @@ -1997,6 +2042,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_FOG) { + if(parts[i].temp>=373.15) + t = parts[i].type = PT_WTRV; for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && @@ -2008,8 +2055,6 @@ void update_particles_i(pixel *vid, int start, int inc) if(pstates[parts[r>>8].type].state==ST_SOLID&&5>=rand()%50&&parts[i].life==0&&!(parts[r>>8].type==PT_CLNE||parts[r>>8].type==PT_PCLN)) { t = parts[i].type = PT_RIME; - parts[i].vx = 0; - parts[i].vy = 0; } if(parts[r>>8].type==PT_SPRK) { @@ -2019,6 +2064,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_RIME) { + parts[i].vx = 0; + parts[i].vy = 0; for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && @@ -2040,6 +2087,76 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_WTF) + { + int maxlife = ((10000/(parts[i].temp + 1))-1); + if((10000%((int)parts[i].temp+1))>rand()%((int)parts[i].temp+1)) + maxlife ++; + if(parts[i].life < maxlife) + { + 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].life >=maxlife)) + continue; + if(parts[r>>8].type==PT_WTF&&33>=rand()/(RAND_MAX/100)+1) + { + if((parts[i].life + parts[r>>8].life + 1) <= maxlife) + { + parts[i].life += parts[r>>8].life + 1; + 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 || (parts[i].life<=maxlife)) + continue; + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==7||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1|| + bmap[(y+ny)/CELL][(x+nx)/CELL]==9||bmap[(y+ny)/CELL][(x+nx)/CELL]==10||bmap[(y+ny)/CELL][(x+nx)/CELL]==13)) + continue; + if((!r)&&parts[i].life>=1)//if nothing then create wtf + { + create_part(-1,x+nx,y+ny,PT_WTF); + parts[i].life--; + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; + } + } + for(int trade = 0; trade<9;trade ++) + { + nx = rand()%5-2; + ny = rand()%5-2; + 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].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + { + int temp = parts[i].life - parts[r>>8].life; + if(temp ==1) + { + parts[r>>8].life ++; + parts[i].life --; + trade = 9; + } + else if(temp>0) + { + parts[r>>8].life += temp/2; + parts[i].life -= temp/2; + trade = 9; + } + } + } + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) @@ -2901,6 +3018,27 @@ killed: } } + if(t==PT_BCLN) + { + if(!parts[i].ctype) + { + 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 && + pmap[y+ny][x+nx] && + (pmap[y+ny][x+nx]&0xFF)!=PT_CLNE && + (pmap[y+ny][x+nx]&0xFF)!=PT_BCLN && + (pmap[y+ny][x+nx]&0xFF)!=PT_PCLN && + (pmap[y+ny][x+nx]&0xFF)!=PT_STKM && + (pmap[y+ny][x+nx]&0xFF)!=0xFF) + parts[i].ctype = pmap[y+ny][x+nx]&0xFF; + } + else { + create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + } + + } if(parts[i].type==PT_PCLN) { if(!parts[i].ctype) @@ -3247,7 +3385,7 @@ void update_particles(pixel *vid) } } pfree=l; - if(cmode==4) + if(cmode==CM_BLOB) { for(y=0; y<YRES/CELL; y++) { |
