From 76304bac8d90370aeed1635352cbaf2cf80573d8 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Sat, 8 Jan 2011 13:16:14 -0500 Subject: [PATCH] BOYL, a gas that evens out pressure related to its temp, kind of a gas PUMP, but not really, BOYL+WATR=FOG BOYL+O2=WATR, possibly hydrogen in the future? --- includes/powder.h | 5 ++++- src/powder.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/includes/powder.h b/includes/powder.h index 5c3218e19..123ca455e 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -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 @@ -425,6 +426,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, "Rawr", TYPE_GAS, NULL}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description }; @@ -572,6 +574,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] = diff --git a/src/powder.c b/src/powder.c index 404d4ac5c..303ed5892 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1442,6 +1442,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+CELL0 && 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; @@ -3722,6 +3743,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>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++)