diff --git a/includes/powder.h b/includes/powder.h index 901f0b347..9924440c0 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -5,7 +5,8 @@ #include "defines.h" #include "interface.h" -#define CM_COUNT 8 +#define CM_COUNT 9 +#define CM_CRACK 8 #define CM_NOTHING 7 #define CM_FANCY 6 #define CM_HEAT 5 @@ -137,7 +138,8 @@ #define PT_WTF 95 #define PT_WARP 96 #define PT_PUMP 97 -#define PT_NUM 98 +#define PT_FWRK 98 +#define PT_NUM 99 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -326,6 +328,7 @@ static const part_type ptypes[PT_NUM] = {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 251, "WTF for catelite, volume changes with temp", TYPE_LIQUID}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, + {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -427,8 +430,10 @@ static part_state pstates[PT_NUM] = /* FOG */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LOVE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* WARP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WARP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PUMP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FWRK */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/graphics.c b/src/graphics.c index 999040903..797ca747d 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1113,17 +1113,50 @@ void draw_air(pixel *vid) for(y=0; y 0.0f) c = PIXRGB(clamp_flt(pv[y][x], 0.0f, 8.0f), 0, 0); else c = PIXRGB(0, 0, clamp_flt(-pv[y][x], 0.0f, 8.0f)); } - else + else if(cmode == CM_VEL) + { c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f), clamp_flt(pv[y][x], 0.0f, 8.0f), clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f)); + } + else if(cmode == CM_CRACK) + { + int r; + int g; + int b; + r = clamp_flt(fabsf(vx[y][x]), 0.0f, 24.0f) + clamp_flt(fabsf(vy[y][x]), 0.0f, 20.0f); + g = clamp_flt(fabsf(vx[y][x]), 0.0f, 20.0f) + clamp_flt(fabsf(vy[y][x]), 0.0f, 24.0f); + b = clamp_flt(fabsf(vx[y][x]), 0.0f, 24.0f) + clamp_flt(fabsf(vy[y][x]), 0.0f, 20.0f); + if(pv[y][x] > 0.0f) + { + r += clamp_flt(pv[y][x], 0.0f, 16.0f); + if(r>255) + r=255; + if(g>255) + g=255; + if(b>255) + b=255; + c = PIXRGB(r, g, b); + } + else + { + b += clamp_flt(-pv[y][x], 0.0f, 16.0f); + if(r>255) + r=255; + if(g>255) + g=255; + if(b>255) + b=255; + c = PIXRGB(r, g, b); + } + } for(j=0; j= 1) + { + x = nx; + y = ny; + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) + { + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags); + cg = parts[i].tmp/4; + cb = parts[i].ctype/4; + cr = parts[i].flags/4; + x = nx/CELL; + y = ny/CELL; + 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 + blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); + } else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; diff --git a/src/interface.c b/src/interface.c index 8f0a5590e..e22a9c42a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -552,6 +552,8 @@ void draw_svf_ui(pixel *vid_buf) drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); case CM_NOTHING: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); + case CM_CRACK: + drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); break; } drawrect(vid_buf, XRES-32+BARSIZE/*478*/, YRES+(MENUSIZE-16), 14, 14, 255, 255, 255, 255); @@ -1774,7 +1776,9 @@ void set_cmode(int cm) else if(cmode==CM_PRESS) strcpy(itc_msg, "Pressure Display"); else if(cmode==CM_NOTHING) - strcpy(itc_msg, "Cracker Display"); + strcpy(itc_msg, "Nothing Display"); + else if(cmode==CM_CRACK) + strcpy(itc_msg, "Alternate Velocity Display"); else strcpy(itc_msg, "Velocity Display"); } diff --git a/src/main.c b/src/main.c index 4aff502be..506e97621 100644 --- a/src/main.c +++ b/src/main.c @@ -1125,7 +1125,7 @@ int main(int argc, char *argv[]) #ifdef OpenGL ClearScreen(); #else - if(cmode==CM_VEL || cmode==CM_PRESS) + if(cmode==CM_VEL || cmode==CM_PRESS || cmode==CM_CRACK) { draw_air(vid_buf); } @@ -1268,10 +1268,14 @@ int main(int argc, char *argv[]) { set_cmode(CM_FANCY); } - if(sdl_key=='8') + if(sdl_key=='8') { set_cmode(CM_NOTHING); } + if(sdl_key=='9') + { + set_cmode(CM_CRACK); + } if(sdl_key==SDLK_LEFTBRACKET) { if(sdl_zoom_trig==1) { diff --git a/src/powder.c b/src/powder.c index fb564d3e1..7cdba8c2b 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=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++)