summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2011-01-08 18:16:14 (GMT)
committer Cracker64 <cracker642@gmail.com>2011-01-08 18:16:14 (GMT)
commit76304bac8d90370aeed1635352cbaf2cf80573d8 (patch)
tree4ed920f400ef420db5beee784f90d0c6a680e791 /src
parent52573e94f9dcde2cc2a43061b5bcb77c724bb3c5 (diff)
downloadpowder-76304bac8d90370aeed1635352cbaf2cf80573d8.zip
powder-76304bac8d90370aeed1635352cbaf2cf80573d8.tar.gz
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?
Diffstat (limited to 'src')
-rw-r--r--src/powder.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/powder.c b/src/powder.c
index 404d4ac..303ed58 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+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;
@@ -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<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++)