+static uint8_t score_map_filter_attack(uint8_t filter, uint16_t * score_map,
+ struct Thing * t_eye)
+{
+ if ('a' != filter)
+ {
+ return 0;
+ }
+ struct Thing * t = world.things;
+ for (; t; t = t->next)
+ {
+ if ( t != t_eye && t->lifepoints && t->type != t_eye->type
+ && 'v' == t_eye->fov_map[t->pos.y*world.map.length + t->pos.x]
+ && get_thing_type(t->type)->lifepoints < t_eye->lifepoints)
+ {
+ score_map[t->pos.y * world.map.length + t->pos.x] = 0;
+ }
+ else if (t->type == t_eye->type)
+ {
+ score_map[t->pos.y * world.map.length + t->pos.x] = UINT16_MAX;
+ }
+ }
+ return 1;
+}
+
+
+
+static uint8_t score_map_filter_flee(uint8_t filter, uint16_t * score_map,
+ struct Thing * t_eye)
+{
+ if ('f' != filter)
+ {
+ return 0;
+ }
+ struct Thing * t = world.things;
+ for (; t; t = t->next)
+ {
+ if ( t->lifepoints && t->type != t_eye->type
+ && 'v' == t_eye->fov_map[t->pos.y*world.map.length + t->pos.x]
+ && get_thing_type(t->type)->lifepoints >= t_eye->lifepoints)
+ {
+ score_map[t->pos.y * world.map.length + t->pos.x] = 0;
+ }
+ }
+ return 1;
+}
+
+
+
+static uint8_t score_map_filter_consume(uint8_t filter, uint16_t * score_map,
+ struct Thing * t_eye)
+{
+ if ('c' != filter)
+ {
+ return 0;
+ }
+ struct ThingInMemory * tm = t_eye->t_mem;
+ for (; tm; tm = tm->next)
+ {
+ if ( ' ' != t_eye->mem_map[tm->pos.y * world.map.length + tm->pos.x]
+ && get_thing_type(tm->type)->consumable)
+ {
+ score_map[tm->pos.y * world.map.length + tm->pos.x] = 0;
+ }
+ }
+ return 1;
+}
+
+
+
+static uint8_t score_map_filter_search(uint8_t filter, uint16_t * score_map,
+ struct Thing * t_eye)
+{
+ if (!(('0' < filter && '9' >= filter) || ' ' == filter))
+ {
+ return 0;
+ }
+ uint32_t i;
+ for (i = 0; i < (uint32_t) (world.map.length * world.map.length); i++)
+ {
+ score_map[i] = filter == t_eye->mem_depth_map[i] ? 0 : score_map[i];
+ }
+ return 1;
+}
+
+
+