X-Git-Url: https://plomlompom.com/repos/test.html?a=blobdiff_plain;ds=sidebyside;f=libplomrogue.c;h=9a4e69a7cdd2158374b16a77102a41b46b69798e;hb=e1576f40cfa7cba4bb6950c87d21fe5e79bb4243;hp=4002dedefea35a17ffecb8f584b47493c9bd8984;hpb=879f49462f91269c1b058eeb10da5a2878c4a01f;p=plomrogue
diff --git a/libplomrogue.c b/libplomrogue.c
index 4002ded..9a4e69a 100644
--- a/libplomrogue.c
+++ b/libplomrogue.c
@@ -1,3 +1,4 @@
+#include /* pow() */
#include /* NULL */
#include /* ?(u)int(8|16|32)_t, ?(U)INT8_(MIN|MAX) */
#include /* free, malloc */
@@ -559,3 +560,40 @@ extern uint8_t dijkstra_map()
}
return 0;
}
+
+extern uint8_t zero_score_map_where_char_on_memdepthmap(char c,
+ char * memdepthmap)
+{
+ if (!score_map)
+ {
+ return 1;
+ }
+ uint32_t map_size = maplength * maplength;
+ uint16_t pos;
+ for (pos = 0; pos < map_size; pos++)
+ {
+ if (c == memdepthmap[pos])
+ {
+ score_map[pos] = 0;
+ }
+ }
+ return 0;
+}
+
+extern void age_some_memdepthmap_on_nonfov_cells(char * memdepthmap,
+ char * fovmap)
+{
+ uint32_t map_size = maplength * maplength;
+ uint16_t pos;
+ for (pos = 0; pos < map_size; pos++)
+ {
+ if ('v' != fovmap[pos])
+ {
+ char c = memdepthmap[pos];
+ if( '0' <= c && '9' > c && !(rrand() % (uint16_t) pow(2, c - 48)))
+ {
+ memdepthmap[pos]++;
+ }
+ }
+ }
+}