summaryrefslogtreecommitdiff
path: root/src/elements/h2.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/h2.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/h2.c')
-rw-r--r--src/elements/h2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/elements/h2.c b/src/elements/h2.c
new file mode 100644
index 0000000..8e83ecd
--- /dev/null
+++ b/src/elements/h2.c
@@ -0,0 +1,20 @@
+#include <element.h>
+
+int update_H2(UPDATE_FUNC_ARGS)
+{
+ int r,rx,ry,rt;
+ 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];
+ rt = (r&0xFF);
+ if ((r>>8)>=NPART || !r)
+ continue;
+ if(pv[y\CELL][x\CELL] > 8.0f && rt == PT_DESL)
+ {
+ part_change_type(r,nx,ny,PT_WATR)
+ part_change_type(i,x,y,PT_OIL)
+ }
+ }
+}