diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-25 22:06:05 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-25 22:06:05 (GMT) |
| commit | caf0ee76e3c281f82865b773ce8950de22db3cfa (patch) | |
| tree | 186edc5236290882a3f7cd2ff6077ed0ca40e893 /src/elements | |
| parent | 4421a92b59ce572e1eea9fe76295807e9cdd75f8 (diff) | |
| download | powder-caf0ee76e3c281f82865b773ce8950de22db3cfa.zip powder-caf0ee76e3c281f82865b773ce8950de22db3cfa.tar.gz | |
CO2, WIP
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/co2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/elements/co2.c b/src/elements/co2.c new file mode 100644 index 0000000..9c5463a --- /dev/null +++ b/src/elements/co2.c @@ -0,0 +1,19 @@ +#include <element.h> + +int update_CO2(UPDATE_FUNC_ARGS) { + int r, rx, ry; + 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_CNCT && 1>(rand()%500)) Concrete+Water to paste, not very popular + { + part_change_type(i,x,y,PT_PSTE); + kill_part(r>>8); + }*/ + } + return 0; +} |
