summaryrefslogtreecommitdiff
path: root/src/elements/O2.c
diff options
context:
space:
mode:
authorAntB <Withheld>2011-03-29 20:35:14 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-04-04 15:18:26 (GMT)
commitdb406494bd32d46cfff71cf387c682c1e32d9601 (patch)
tree9851e5c1c61d8b0aa9c7810cf58445a6e11a1691 /src/elements/O2.c
parent4d80abc399b0694eb602487058d7b5865f9b4eae (diff)
downloadpowder-db406494bd32d46cfff71cf387c682c1e32d9601.zip
powder-db406494bd32d46cfff71cf387c682c1e32d9601.tar.gz
Added H2:
Will reduce DESL to WATR and OIL under pressure Will fuse with O2 under pressure to make WATR
Diffstat (limited to 'src/elements/O2.c')
-rw-r--r--src/elements/O2.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/elements/O2.c b/src/elements/O2.c
index 1413d0a..4c019d3 100644
--- a/src/elements/O2.c
+++ b/src/elements/O2.c
@@ -2,7 +2,7 @@
int update_O2(UPDATE_FUNC_ARGS)
{
- int r,rx,ry;
+ int r,rx,ry,n,nx,ny;
for(rx=-2; rx<3; rx++)
for(ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
@@ -17,7 +17,26 @@ int update_O2(UPDATE_FUNC_ARGS)
parts[r>>8].temp+=(rand()/(RAND_MAX/100));
parts[i].tmp++;
}
+
}
+
+ if(pv[y\CELL][x\CELL] > 8.0f)
+ {
+ for(rx=-2; rx<3; rx++)
+ for(ry=-2; ry<3; ry++)
+ if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ {
+ r = pmap[y+ry][x+rx];
+ if ((r>>8)>=NPART || !r)
+ continue;
+ if((r&0xFF)==PT_H2)
+ if(50<(rand()/(RAND_MAX/100)))
+ part_change_type(i,x,y,PT_WATR)
+ part_change_type(r,rx,rx,PT_WATR)
+ }
+ }
+
+
if(parts[i].tmp>=50)
{
create_part(i,x,y,PT_FIRE);