summaryrefslogtreecommitdiff
path: root/src/elements/yest.c
diff options
context:
space:
mode:
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;
+}