summaryrefslogtreecommitdiff
path: root/src/elements/c5.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-07 20:03:58 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-07 20:03:58 (GMT)
commitb69712bbdbaf32fef65e15141458cb27f9f7ec88 (patch)
tree622d2d413fe4edbe683c729d500206c447624b8d /src/elements/c5.c
parentfa1868314c1d48de9000c45dc8bcde36d92472cb (diff)
downloadpowder-b69712bbdbaf32fef65e15141458cb27f9f7ec88.zip
powder-b69712bbdbaf32fef65e15141458cb27f9f7ec88.tar.gz
Some more function pointers
Diffstat (limited to 'src/elements/c5.c')
-rw-r--r--src/elements/c5.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/elements/c5.c b/src/elements/c5.c
new file mode 100644
index 0000000..afa7382
--- /dev/null
+++ b/src/elements/c5.c
@@ -0,0 +1,24 @@
+#include <powder.h>
+
+int update_C5(UPDATE_FUNC_ARGS) {
+ int r;
+ for (nx=-2; nx<3; nx++)
+ for (ny=-2; ny<3; 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].temp<100 && parts[r>>8].type!=PT_C5)||parts[r>>8].type==PT_HFLM)
+ {
+ if (1>rand()%6)
+ {
+ parts[i].type = PT_HFLM;
+ parts[r>>8].temp = parts[i].temp = 0;
+ parts[i].life = rand()%150+50;
+ pv[y/CELL][x/CELL] += 1.5;
+ }
+ }
+ }
+ return 0;
+}