New Element from cracker - BOYL

This commit is contained in:
Simon 2011-01-08 18:51:22 +00:00
commit 548d052018
2 changed files with 47 additions and 1 deletions

View File

@ -189,7 +189,8 @@
#define PT_GNAR 138
#define PT_REPL 139
#define PT_MYST 140
#define PT_NUM 141
#define PT_BOYL 141
#define PT_NUM 142
#define R_TEMP 22
#define MAX_TEMP 9999
@ -426,6 +427,7 @@ static const part_type ptypes[PT_NUM] =
{"GNAR", PIXPACK(0xE5B73B), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B1/S1", TYPE_SOLID|PROP_LIFE, NULL},
{"REPL", PIXPACK(0x259588), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B1357/S1357", TYPE_SOLID|PROP_LIFE, NULL},
{"MYST", PIXPACK(0x0C3C00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B3458/S05678", TYPE_SOLID|PROP_LIFE, NULL},
{"BOYL", PIXPACK(0x0A3200), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.18f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", TYPE_GAS, NULL},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description
};
@ -573,6 +575,7 @@ static part_state pstates[PT_NUM] =
/* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BOYL */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_NONE, 0.0f},
};
static int grule[NGOL][9] =
{

View File

@ -1450,6 +1450,27 @@ void update_particles_i(pixel *vid, int start, int inc)
pv[y/CELL+1][x/CELL+1] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL+1]);
}
}
else if(t==PT_BOYL)
{
if(pv[y/CELL][x/CELL]<(parts[i].temp/100))
pv[y/CELL][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL]);
if(y+CELL<YRES && pv[y/CELL+1][x/CELL]<(parts[i].temp/100))
pv[y/CELL+1][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL+1][x/CELL]);
if(x+CELL<XRES)
{
pv[y/CELL][x/CELL+1] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL+1]);
if(y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.001f*((parts[i].temp/100)-pv[y/CELL+1][x/CELL+1]);
}
if(y+CELL>0 && pv[y/CELL-1][x/CELL]<(parts[i].temp/100))
pv[y/CELL-1][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL-1][x/CELL]);
if(x+CELL>0)
{
pv[y/CELL][x/CELL-1] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL-1]);
if(y+CELL>0)
pv[y/CELL-1][x/CELL-1] += 0.001f*((parts[i].temp/100)-pv[y/CELL-1][x/CELL-1]);
}
}
else if(t==PT_SING)
{
int singularity = -parts[i].life;
@ -3739,6 +3760,28 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
else if(t==PT_BOYL)
{
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)
continue;
if(parts[r>>8].type==PT_WATR && 1>rand()%30)
{
parts[r>>8].type = PT_FOG;
}
if(parts[r>>8].type==PT_O2 && 1>rand()%9)
{
parts[r>>8].type = PT_NONE;
t = parts[i].type = PT_WATR;
pv[y/CELL][x/CELL] += 4.0;
}
}
}
else if(t==PT_FIRW) {
if(parts[i].tmp==0) {
for(nx=-1; nx<2; nx++)