Пример #1
0
static void npc_next_pos_0f(dungeon *d, npc *c, pair_t next)
{
  /*     smart;     telepathic;     tunneling;     erratic */
  if (rand() & 1) {
    npc_next_pos_rand_tunnel(d, c, next);
  } else {
    npc_next_pos_07(d, c, next);
  }
}
Пример #2
0
static void npc_next_pos_0e(dungeon_t *d, character *c, pair_t next)
{
  /* not smart;     telepathic;     tunneling;     erratic */
  if (rand() & 1) {
    npc_next_pos_rand_tunnel(d, c, next);
  } else {
    npc_next_pos_06(d, c, next);
  }
}
Пример #3
0
static void npc_next_pos_04(dungeon *d, npc *c, pair_t next)
{
  /* not smart; not telepathic;     tunneling; not erratic */
  if (can_see(d, character_get_pos(c), character_get_pos(d->PC), 0, 0)) {
    c->pc_last_known_position[dim_y] = d->PC->position[dim_y];
    c->pc_last_known_position[dim_x] = d->PC->position[dim_x];
    npc_next_pos_line_of_sight(d, c, next);
  } else {
    npc_next_pos_rand_tunnel(d, c, next);
  }
}
Пример #4
0
static void npc_next_pos_04(dungeon_t *d, character *c, pair_t next)
{
  pc *the_pc;
  npc *the_npc;

  the_pc = (pc *) d->the_pc;
  the_npc = (npc *) c;

  /* not smart; not telepathic;     tunneling; not erratic */
  if (can_see(d, character_get_pos(c), character_get_pos(d->the_pc), 0)) {
    the_npc->pc_last_known_position[dim_y] = the_pc->position[dim_y];
    the_npc->pc_last_known_position[dim_x] = the_pc->position[dim_x];
    npc_next_pos_line_of_sight(d, c, next);
  } else {
    npc_next_pos_rand_tunnel(d, c, next);
  }
}