diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 63 | ||||
| -rw-r--r-- | src/main.c | 11 | ||||
| -rw-r--r-- | src/powder.c | 437 |
3 files changed, 282 insertions, 229 deletions
diff --git a/src/graphics.c b/src/graphics.c index e4a4a4c..0130465 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1451,13 +1451,13 @@ void draw_parts(pixel *vid) } else { - cr = PIXR(ptypes[t].pcolors); - cg = PIXG(ptypes[t].pcolors); - cb = PIXB(ptypes[t].pcolors); - blendpixel(vid, nx, ny, cr, cg, cb, 255); + 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(cmode==CM_GRAD) + } + else if(cmode==CM_GRAD)//forgot to put else, broke nothing view { float frequency = 0.05; int q = parts[i].temp-40; @@ -1478,7 +1478,12 @@ void draw_parts(pixel *vid) cb = 0; blendpixel(vid, nx, ny, cr, cg, cb, 255); } - else if(cmode==CM_FANCY) + else if(cmode==CM_FANCY && + t!=PT_FIRE && t!=PT_PLSM && t!=PT_WTRV && + t!=PT_HFLM && t!=PT_SPRK && t!=PT_FIRW && + t!=PT_DUST && t!=PT_FIRW && t!=PT_FWRK && + t!=PT_NEUT && t!=PT_LAVA && t!=PT_BOMB && + t!=PT_PHOT && t!=PT_THDR && t!=PT_SMKE) { if(ptypes[parts[i].type].properties&TYPE_LIQUID) { @@ -1934,13 +1939,21 @@ void draw_parts(pixel *vid) } else if(t==PT_ACID) { - if(parts[i].life>255) parts[i].life = 255; - if(parts[i].life<47) parts[i].life = 48; - s = (255/((parts[i].life-46)*28)); + if(parts[i].life>75) parts[i].life = 75; + if(parts[i].life<49) parts[i].life = 49; + s = (parts[i].life-49)*3; if(s==0) s = 1; - cr = PIXR(ptypes[t].pcolors)/s; - cg = PIXG(ptypes[t].pcolors)/s; - cb = PIXB(ptypes[t].pcolors)/s; + cr = 0x86 + s*4; + cg = 0x36 + s*1; + cb = 0x90 + s*2; + + if(cr>=255) + cr = 255; + if(cg>=255) + cg = 255; + if(cb>=255) + cb = 255; + blendpixel(vid, nx, ny, cr, cg, cb, 255); if(cmode==CM_BLOB) @@ -1987,7 +2000,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_FILT) { int temp_bin = (int)((parts[i].temp-273.0f)*0.025f); @@ -3074,12 +3087,12 @@ pixel *prerender_save(void *save, int size, int *width, int *height) if(!(j%2) && !(i%2)) fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0); break; - case 4: - for(j=0; j<CELL; j+=2) - for(i=(j>>1)&1; i<CELL; i+=2) - fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF); - k++; - break; + case 4: + for(j=0; j<CELL; j+=2) + for(i=(j>>1)&1; i<CELL; i+=2) + fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF); + k++; + break; case 6: for(j=0; j<CELL; j+=2) for(i=(j>>1)&1; i<CELL; i+=2) @@ -3373,9 +3386,15 @@ void sdl_open(void) //glFlush (); #else #ifdef PIX16 - sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,16,SDL_SWSURFACE); + if(kiosk_enable) + sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,16,SDL_FULLSCREEN|SDL_SWSURFACE); + else + sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,16,SDL_SWSURFACE); #else - sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_SWSURFACE); + if(kiosk_enable) + sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_FULLSCREEN|SDL_SWSURFACE); + else + sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_SWSURFACE); #endif #endif if(!sdl_scrn) @@ -134,6 +134,7 @@ int core_count() } int mousex = 0, mousey = 0; //They contain mouse position +int kiosk_enable = 0; void sdl_seticon(void) { @@ -1158,6 +1159,12 @@ int main(int argc, char *argv[]) { hud_enable = 0; } + else if(!strncmp(argv[i], "kiosk", 5)) + { + kiosk_enable = 1; + sdl_scale = 2; + hud_enable = 0; + } } save_presets(0); @@ -1233,7 +1240,7 @@ int main(int argc, char *argv[]) if(!sys_pause||framerender) { - update_air(); + update_air(); } #ifdef OpenGL ClearScreen(); @@ -1685,7 +1692,7 @@ int main(int argc, char *argv[]) bsx = 1180; if(bsx<0) bsx = 0; - if(bsy>1180) + if(bsy>1180) bsy = 1180; if(bsy<0) bsy = 0; diff --git a/src/powder.c b/src/powder.c index b999b36..6c2ea34 100644 --- a/src/powder.c +++ b/src/powder.c @@ -547,7 +547,7 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_NBLE && (pmap[y][x]&0xFF)!=PT_IRON && - (pmap[y][x]&0xFF)!=PT_INST && + (pmap[y][x]&0xFF)!=PT_INST && (pmap[y][x]&0xFF)!=PT_INWR) return -1; if(parts[pmap[y][x]>>8].life!=0) @@ -588,7 +588,7 @@ inline int create_part(int p, int x, int y, int t) parts[pmap[y][x]>>8].ctype = t; } return -1; - } + } if(pfree == -1) return -1; i = pfree; @@ -689,118 +689,126 @@ inline int create_part(int p, int x, int y, int t) parts[i].vx = 3.0f*cosf(a); parts[i].vy = 3.0f*sinf(a); } - if(t==PT_BIZR||t==PT_BIZRG) - parts[i].ctype = 0x47FFFF; - if(t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP - pmap[y][x] = t|(i<<8); - else if(t==PT_STKM) + if(t==PT_STKM) { if(isplayer==0) { - if(pmap[y][x]&0xFF==PT_SPAWN) - { - parts[pmap[y][x]>>8].type = PT_STKM; - parts[pmap[y][x]>>8].vx = 0; - parts[pmap[y][x]>>8].vy = 0; - parts[pmap[y][x]>>8].life = 100; - parts[pmap[y][x]>>8].ctype = 0; - parts[pmap[y][x]>>8].temp = ptypes[t].heat; - - } - else - { - parts[i].x = (float)x; - parts[i].y = (float)y; - parts[i].type = PT_STKM; - parts[i].vx = 0; - parts[i].vy = 0; - parts[i].life = 100; - parts[i].ctype = 0; - parts[i].temp = ptypes[t].heat; - } - - - + if(pmap[y][x]&0xFF==PT_SPAWN) + { + parts[pmap[y][x]>>8].type = PT_STKM; + parts[pmap[y][x]>>8].vx = 0; + parts[pmap[y][x]>>8].vy = 0; + parts[pmap[y][x]>>8].life = 100; + parts[pmap[y][x]>>8].ctype = 0; + parts[pmap[y][x]>>8].temp = ptypes[t].heat; + + } + else + { + parts[i].x = (float)x; + parts[i].y = (float)y; + parts[i].type = PT_STKM; + parts[i].vx = 0; + parts[i].vy = 0; + parts[i].life = 100; + parts[i].ctype = 0; + parts[i].temp = ptypes[t].heat; + } + + + player[3] = x-1; //Setting legs positions player[4] = y+6; player[5] = x-1; player[6] = y+6; - + player[7] = x-3; player[8] = y+12; player[9] = x-3; player[10] = y+12; - + player[11] = x+1; player[12] = y+6; player[13] = x+1; player[14] = y+6; - + player[15] = x+3; player[16] = y+12; player[17] = x+3; player[18] = y+12; - + isplayer = 1; } + else + { + return -1; + } //kill_part(playerspawn); create_part(-1,x,y,PT_SPAWN); ISSPAWN1 = 1; } - else if(t==PT_STKM2) + if(t==PT_STKM2) { if(isplayer2==0) { - if(pmap[y][x]&0xFF==PT_SPAWN2) - { - parts[pmap[y][x]>>8].type = PT_STKM2; - parts[pmap[y][x]>>8].vx = 0; - parts[pmap[y][x]>>8].vy = 0; - parts[pmap[y][x]>>8].life = 100; - parts[pmap[y][x]>>8].ctype = 0; - parts[pmap[y][x]>>8].temp = ptypes[t].heat; - - } - else - { - parts[i].x = (float)x; - parts[i].y = (float)y; - parts[i].type = PT_STKM2; - parts[i].vx = 0; - parts[i].vy = 0; - parts[i].life = 100; - parts[i].ctype = 0; - parts[i].temp = ptypes[t].heat; - } - - - + if(pmap[y][x]&0xFF==PT_SPAWN2) + { + parts[pmap[y][x]>>8].type = PT_STKM2; + parts[pmap[y][x]>>8].vx = 0; + parts[pmap[y][x]>>8].vy = 0; + parts[pmap[y][x]>>8].life = 100; + parts[pmap[y][x]>>8].ctype = 0; + parts[pmap[y][x]>>8].temp = ptypes[t].heat; + + } + else + { + parts[i].x = (float)x; + parts[i].y = (float)y; + parts[i].type = PT_STKM2; + parts[i].vx = 0; + parts[i].vy = 0; + parts[i].life = 100; + parts[i].ctype = 0; + parts[i].temp = ptypes[t].heat; + } + + + player2[3] = x-1; //Setting legs positions player2[4] = y+6; player2[5] = x-1; player2[6] = y+6; - + player2[7] = x-3; player2[8] = y+12; player2[9] = x-3; player2[10] = y+12; - + player2[11] = x+1; player2[12] = y+6; player2[13] = x+1; player2[14] = y+6; - + player2[15] = x+3; player2[16] = y+12; player2[17] = x+3; player2[18] = y+12; - + isplayer2 = 1; } + else + { + return -1; + } //kill_part(player2spawn); create_part(-1,x,y,PT_SPAWN2); ISSPAWN2 = 1; } + if(t==PT_BIZR||t==PT_BIZRG) + parts[i].ctype = 0x47FFFF; + if(t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP + pmap[y][x] = t|(i<<8); return i; } @@ -1642,10 +1650,10 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_GAS && pv[y/CELL][x/CELL]<-6.0f) t = parts[i].type = PT_OIL; if(t==PT_DESL && pv[y/CELL][x/CELL]>5.0f) - { // Only way I know to make it - t = parts[i].type = PT_FIRE; // combust under pressure. - parts[i].life = rand()%50+120; - } + { + t = parts[i].type = PT_FIRE; + parts[i].life = rand()%50+120; + } if(t==PT_GAS && pv[y/CELL][x/CELL]>6.0f) t = parts[i].type = PT_OIL; if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f) @@ -1654,21 +1662,21 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_BRMT; if(t==PT_BRCK && pv[y/CELL][x/CELL]>8.8f) t = parts[i].type = PT_STNE; - if(t==PT_PIPE && pv[y/CELL][x/CELL]>10.0f) + if(t==PT_PIPE && pv[y/CELL][x/CELL]>10.0f) t = parts[i].type = PT_BRMT; - if(t==PT_PSTE && pv[y/CELL][x/CELL]>0.5f) + if(t==PT_PSTE && pv[y/CELL][x/CELL]>0.5f) t = parts[i].type = PT_PSTS; - if(t==PT_PSTS && pv[y/CELL][x/CELL]<0.5f) + if(t==PT_PSTS && pv[y/CELL][x/CELL]<0.5f) t = parts[i].type = PT_PSTE; - if(t==PT_SHLD1 && pv[y/CELL][x/CELL]>7.0f) + if(t==PT_SHLD1 && pv[y/CELL][x/CELL]>7.0f) t = parts[i].type = PT_NONE; - if(t==PT_SHLD2 && pv[y/CELL][x/CELL]>15.0f) + if(t==PT_SHLD2 && pv[y/CELL][x/CELL]>15.0f) t = parts[i].type = PT_NONE; - if(t==PT_SHLD3 && pv[y/CELL][x/CELL]>25.0f) + if(t==PT_SHLD3 && pv[y/CELL][x/CELL]>25.0f) t = parts[i].type = PT_NONE; - if(t==PT_SHLD4 && pv[y/CELL][x/CELL]>40.0f) + if(t==PT_SHLD4 && pv[y/CELL][x/CELL]>40.0f) t = parts[i].type = PT_NONE; - if(t==PT_WIFI && pv[y/CELL][x/CELL]>15.0f) + if(t==PT_WIFI && pv[y/CELL][x/CELL]>15.0f) t = parts[i].type = PT_BRMT; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; @@ -1681,7 +1689,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].type = PT_BGLA; } } - if(t==PT_QRTZ) + if(t==PT_QRTZ) { parts[i].pavg[0] = parts[i].pavg[1]; parts[i].pavg[1] = pv[y/CELL][x/CELL]; @@ -1697,20 +1705,20 @@ void update_particles_i(pixel *vid, int start, int inc) t = PT_NEUT; create_part(i, x, y, t); } - if((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000)) + if((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000)) { t = PT_PHOT; - rr = (rand()%228+128)/127.0f; - rrr = (rand()%360)*3.14159f/180.0f; - parts[i].life = 680; - parts[i].ctype = 0x3FFFFFFF; - parts[i].vx = rr*cosf(rrr); - parts[i].vy = rr*sinf(rrr); + rr = (rand()%228+128)/127.0f; + rrr = (rand()%360)*3.14159f/180.0f; + parts[i].life = 680; + parts[i].ctype = 0x3FFFFFFF; + parts[i].vx = rr*cosf(rrr); + parts[i].vy = rr*sinf(rrr); create_part(i, x, y, t); } - if(t==PT_PSTE) - if(parts[i].temp>747.0f) - t = parts[i].type = PT_BRCK; + if(t==PT_PSTE) + if(parts[i].temp>747.0f) + t = parts[i].type = PT_BRCK; if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); @@ -1769,110 +1777,122 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - if(pt>=pstates[t].btemp&&pstates[t].burn) - { - t = parts[i].type = pstates[t].burn; - if(t==PT_FIRE||t==PT_PLSM) - parts[i].life = rand()%50+120; - } - else if((pt<=pstates[t].stemp||(t==PT_LAVA&&(pt<=pstates[parts[i].ctype].ltemp)))&&pstates[t].solid) - { - if(t==PT_LAVA&&parts[i].ctype) - { - parts[i].life = 0; - if(parts[i].ctype==PT_THRM) - { - parts[i].tmp = 0; - parts[i].ctype = PT_BMTL; - } - if(parts[i].ctype==PT_PLUT) - { - parts[i].tmp = 0; - parts[i].ctype = PT_LAVA; - } - t = parts[i].type = parts[i].ctype; - parts[i].ctype = PT_NONE; - } - else if(pstates[t].solid==PT_ICEI&&pt<=pstates[t].stemp) - { - parts[i].ctype = parts[i].type; - t = parts[i].type = PT_ICEI; - } - else - { - parts[i].life = 0; - t = parts[i].type = pstates[t].solid; - } - } - else if((pt>=pstates[t].ltemp&&(pt<=pstates[t].gtemp||!pstates[t].gas)&&pstates[t].state==ST_SOLID&&pstates[t].liquid)||(t==PT_ICEI&&pt>pstates[parts[i].ctype].stemp)) - { - if(pstates[t].liquid==PT_LAVA) - { - parts[i].life = rand()%120+240; - parts[i].ctype = (parts[i].type==PT_BRMT)?PT_BMTL:parts[i].type; - parts[i].ctype = (parts[i].ctype==PT_SAND)?PT_GLAS:parts[i].ctype; - parts[i].ctype = (parts[i].ctype==PT_BGLA)?PT_GLAS:parts[i].ctype; - parts[i].ctype = (parts[i].ctype==PT_PQRT)?PT_QRTZ:parts[i].ctype; - t = parts[i].type = pstates[t].liquid; - } - else if(t==PT_ICEI&&parts[i].ctype) - { - t = parts[i].type = parts[i].ctype; - parts[i].ctype = PT_NONE; - } - else - { - t = parts[i].type = pstates[t].liquid; - } - } - else if(pt-ctemp<=pstates[t].ltemp&&pstates[t].liquid&&pstates[t].state==ST_GAS) - { - t = parts[i].type = pstates[t].liquid; - } - else if(pt-ctemp>=pstates[t].gtemp&&(pstates[t].gas||parts[i].type==PT_LNTG)&&(pstates[t].state==ST_LIQUID||pstates[t].state==ST_SOLID)) - { - if(t==PT_SLTW&&1>rand()%6) - { - t = parts[i].type = PT_SALT; - } - else - { - if((t==PT_BIZR||t==PT_BIZRG||t==PT_BIZRS)&&pt>=pstates[t].gtemp) - { - t = parts[i].type = pstates[t].gas; - } - else{ - t = parts[i].type = pstates[t].gas; - pv[y/CELL][x/CELL] += 0.50f; - } - - if(t==PT_FIRE) - parts[i].life = rand()%50+120; - if(t==PT_HFLM) - parts[i].life = rand()%50+120; - } - } - if(t==PT_URAN && pv[y/CELL][x/CELL]>0.0f) - { - float atemp = parts[i].temp + (-MIN_TEMP); - pt = parts[i].temp = (atemp*(1+(pv[y/CELL][x/CELL]/2000)))+MIN_TEMP; - } - if(t==PT_LAVA) - { - parts[i].life = restrict_flt((pt-700)/7, 0.0f, 400.0f); - if(parts[i].ctype==PT_THRM&&parts[i].tmp>0) - { - parts[i].tmp--; - parts[i].temp = 3500; - } - if(parts[i].ctype==PT_PLUT&&parts[i].tmp>0) - { - parts[i].tmp--; - parts[i].temp = MAX_TEMP; - } - } - pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); - } + if(y-2 >= 0 && y-2 < YRES && ptypes[t].properties&TYPE_LIQUID){ + float swappage; + r = pmap[y-2][x]; + if(!((r>>8)>=NPART || !r || parts[i].type != (r&0xFF))){ + if(parts[i].temp>parts[r>>8].temp){ + swappage = parts[i].temp; + parts[i].temp = parts[r>>8].temp; + parts[r>>8].temp = swappage; + } + } + } + + if(pt>=pstates[t].btemp&&pstates[t].burn) + { + t = parts[i].type = pstates[t].burn; + if(t==PT_FIRE||t==PT_PLSM) + parts[i].life = rand()%50+120; + } + else if((pt<=pstates[t].stemp||(t==PT_LAVA&&(pt<=pstates[parts[i].ctype].ltemp)))&&pstates[t].solid) + { + if(t==PT_LAVA&&parts[i].ctype) + { + parts[i].life = 0; + if(parts[i].ctype==PT_THRM) + { + parts[i].tmp = 0; + parts[i].ctype = PT_BMTL; + } + if(parts[i].ctype==PT_PLUT) + { + parts[i].tmp = 0; + parts[i].ctype = PT_LAVA; + } + t = parts[i].type = parts[i].ctype; + parts[i].ctype = PT_NONE; + } + else if(pstates[t].solid==PT_ICEI&&pt<=pstates[t].stemp) + { + parts[i].ctype = parts[i].type; + t = parts[i].type = PT_ICEI; + } + else + { + parts[i].life = 0; + t = parts[i].type = pstates[t].solid; + } + } + else if((pt>=pstates[t].ltemp&&(pt<=pstates[t].gtemp||!pstates[t].gas)&&pstates[t].state==ST_SOLID&&pstates[t].liquid)||(t==PT_ICEI&&pt>pstates[parts[i].ctype].stemp)) + { + if(pstates[t].liquid==PT_LAVA) + { + parts[i].life = rand()%120+240; + parts[i].ctype = (parts[i].type==PT_BRMT)?PT_BMTL:parts[i].type; + parts[i].ctype = (parts[i].ctype==PT_SAND)?PT_GLAS:parts[i].ctype; + parts[i].ctype = (parts[i].ctype==PT_BGLA)?PT_GLAS:parts[i].ctype; + parts[i].ctype = (parts[i].ctype==PT_PQRT)?PT_QRTZ:parts[i].ctype; + t = parts[i].type = pstates[t].liquid; + } + else if(t==PT_ICEI&&parts[i].ctype) + { + t = parts[i].type = parts[i].ctype; + parts[i].ctype = PT_NONE; + } + else + { + t = parts[i].type = pstates[t].liquid; + } + } + else if(pt-ctemp<=pstates[t].ltemp&&pstates[t].liquid&&pstates[t].state==ST_GAS) + { + t = parts[i].type = pstates[t].liquid; + } + else if(pt-ctemp>=pstates[t].gtemp&&(pstates[t].gas||parts[i].type==PT_LNTG)&&(pstates[t].state==ST_LIQUID||pstates[t].state==ST_SOLID)) + { + if(t==PT_SLTW&&1>rand()%6) + { + t = parts[i].type = PT_SALT; + } + else + { + if((t==PT_BIZR||t==PT_BIZRG||t==PT_BIZRS)&&pt>=pstates[t].gtemp) + { + t = parts[i].type = pstates[t].gas; + } + else{ + t = parts[i].type = pstates[t].gas; + pv[y/CELL][x/CELL] += 0.50f; + } + + if(t==PT_FIRE) + parts[i].life = rand()%50+120; + if(t==PT_HFLM) + parts[i].life = rand()%50+120; + } + } + if(t==PT_URAN && pv[y/CELL][x/CELL]>0.0f) + { + float atemp = parts[i].temp + (-MIN_TEMP); + pt = parts[i].temp = (atemp*(1+(pv[y/CELL][x/CELL]/2000)))+MIN_TEMP; + } + if(t==PT_LAVA) + { + parts[i].life = restrict_flt((pt-700)/7, 0.0f, 400.0f); + if(parts[i].ctype==PT_THRM&&parts[i].tmp>0) + { + parts[i].tmp--; + parts[i].temp = 3500; + } + if(parts[i].ctype==PT_PLUT&&parts[i].tmp>0) + { + parts[i].tmp--; + parts[i].temp = MAX_TEMP; + } + } + pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); + } } if(t==PT_PTCT&&parts[i].temp>295.0f) { @@ -2290,7 +2310,7 @@ void update_particles_i(pixel *vid, int start, int inc) { t = parts[i].type = PT_PLNT; parts[r>>8].type = PT_PLNT; - parts[r>>8].life = 0; + parts[r>>8].life = 0; } else if((r&0xFF)==PT_LAVA && 1>(rand()%250)) { @@ -2516,13 +2536,13 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) { - if(parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS) - { - parts[i].life--; - parts[r>>8].type = PT_NONE; - } + if(parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS) + { + parts[i].life--; + parts[r>>8].type = PT_NONE; + } } - else if (parts[i].life==50) + else if (parts[i].life<=50) { parts[i].life = 0; t = parts[i].type = PT_NONE; @@ -2572,8 +2592,8 @@ void update_particles_i(pixel *vid, int start, int inc) create_n_parts(parts[r>>8].life, x+nx, y+ny, parts[i].vx, parts[i].vy, PT_NEUT); #else create_part(r>>8, x+nx, y+ny, PT_NEUT); - parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; - parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; + parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; + parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; if(parts[r>>8].life>0) { parts[r>>8].life --; @@ -2590,10 +2610,7 @@ void update_particles_i(pixel *vid, int start, int inc) if((r&0xFF)==PT_DYST && 15>(rand()%1000)) parts[r>>8].type = PT_YEST; if((r&0xFF)==PT_YEST) { - if(15>(rand()%100000)&&isplayer==0) - parts[r>>8].type = PT_STKM; - else - parts[r>>8].type = PT_DYST; + parts[r>>8].type = PT_DYST; } if((r&0xFF)==PT_WATR && 15>(rand()%100)) @@ -4117,6 +4134,11 @@ killed: if((parts[i].temp<309.6f) && (parts[i].temp>=243)) parts[i].temp += 1; + if (isplayer) { //Already a stickman in the simulation + death = 1; + parts[i].type = PT_NONE; + } + //Death if(parts[i].life<1 || death == 1 || (pv[y/CELL][x/CELL]>=4.5f && player[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... { @@ -4507,6 +4529,11 @@ killed: if((parts[i].temp<309.6f) && (parts[i].temp>=243)) parts[i].temp += 1; + if (isplayer2) { //Already a stickman2 in the simulation + death2 = 1; + parts[i].type = PT_NONE; + } + //Death if(parts[i].life<1 || death2 == 1 || (pv[y/CELL][x/CELL]>=4.5f && player2[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... { @@ -4518,7 +4545,7 @@ killed: create_part(-1, x+2, y+r, player2[2]); } kill_part(i); //Kill him - goto killed; + continue; } parts[i].vy += -0.7*dt; //Head up! |
