Fix acid drawing and 'purple acid'

This commit is contained in:
Simon 2011-01-05 20:36:09 +00:00
parent e2d4ae5763
commit a46a484f2e
2 changed files with 20 additions and 12 deletions

View File

@ -1934,13 +1934,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)

View File

@ -2495,13 +2495,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;