summaryrefslogtreecommitdiff
path: root/src/elements/yest.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/yest.c
parentfa1868314c1d48de9000c45dc8bcde36d92472cb (diff)
downloadpowder-b69712bbdbaf32fef65e15141458cb27f9f7ec88.zip
powder-b69712bbdbaf32fef65e15141458cb27f9f7ec88.tar.gz
Some more function pointers
Diffstat (limited to 'src/elements/yest.c')
-rw-r--r--src/elements/yest.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/elements/yest.c b/src/elements/yest.c
new file mode 100644
index 0000000..26bbbe9
--- /dev/null
+++ b/src/elements/yest.c
@@ -0,0 +1,22 @@
+#include <powder.h>
+
+int update_YEST(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 ((r&0xFF)==PT_DYST && 1>(rand()%30) && !legacy_enable)
+ {
+ parts[i].type = PT_DYST;
+ }
+ }
+ if (parts[i].temp>303&&parts[i].temp<317) {
+ create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST);
+ }
+ return 0;
+}