mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-12 18:32:33 +02:00
Fireworks glow in fancy display, fixed some crash errors they could cause.
This commit is contained in:
parent
eb7206aa30
commit
d28edfa6a9
42
graphics.c
42
graphics.c
@ -1403,11 +1403,51 @@ void draw_parts(pixel *vid)
|
||||
y = ny;
|
||||
blendpixel(vid,x,y,17,217,24,255);
|
||||
}
|
||||
else if((t==PT_FWRK && parts[i].life >= 1)&&(cmode == 3||cmode==4 || cmode==6))
|
||||
{
|
||||
x = nx;
|
||||
y = ny;
|
||||
vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors;
|
||||
cg = 10;
|
||||
cb = 10;
|
||||
cr = 10;
|
||||
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 if(t==PT_DUST && parts[i].life >= 1)
|
||||
{
|
||||
x = nx;
|
||||
y = ny;
|
||||
blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255);
|
||||
if(cmode == 3||cmode==4 || cmode==6)
|
||||
{
|
||||
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags);
|
||||
cg = parts[i].tmp/5;
|
||||
cb = parts[i].ctype/5;
|
||||
cr = parts[i].flags/5;
|
||||
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_LNTG&&cmode == 6)
|
||||
{
|
||||
|
21
powder.c
21
powder.c
@ -1911,8 +1911,8 @@ player[23] = 1;
|
||||
|
||||
create_part(-1, x , y-1 , PT_FWRK);
|
||||
r = pmap[y-1][x];
|
||||
parts[r>>8].vy = rand()%10-25;
|
||||
parts[r>>8].vx = rand()%30-rand()%30;
|
||||
parts[r>>8].vy = rand()%8-22;
|
||||
parts[r>>8].vx = rand()%20-rand()%20;
|
||||
parts[r>>8].life=rand()%30+50;
|
||||
parts[i].type=PT_NONE;
|
||||
}
|
||||
@ -1936,13 +1936,16 @@ player[23] = 1;
|
||||
{
|
||||
create_part(-1, x+nx, y+ny , PT_DUST);
|
||||
a= pmap[y+ny][x+nx];
|
||||
parts[a>>8].vy = -(rand()%8+1);
|
||||
parts[a>>8].vx = rand()%8-rand()%8+(parts[i].vx)*2;
|
||||
parts[a>>8].life= rand()%75+175;
|
||||
parts[a>>8].tmp=q;
|
||||
parts[a>>8].flags=w;
|
||||
parts[a>>8].ctype=e;
|
||||
parts[a>>8].temp= rand()%20+600;
|
||||
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()%75+35;
|
||||
parts[a>>8].tmp=q;
|
||||
parts[a>>8].flags=w;
|
||||
parts[a>>8].ctype=e;
|
||||
parts[a>>8].temp= rand()%20+600;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
2
powder.h
2
powder.h
@ -253,7 +253,7 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."},
|
||||
{"GLOW", PIXPACK(0x445544), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow."},
|
||||
{"BRCK", PIXPACK(0x808080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material."},
|
||||
{"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, SC_POWDERS, R_TEMP+0.0f+273.15f, 100, "Fireworks!! in progress"},
|
||||
{"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, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "Fireworks!! Glows in fancy"},
|
||||
|
||||
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user