Exemple #1
0
static void npc_next_pos_06(dungeon *d, npc *c, pair_t next)
{
  /* not smart;     telepathic;     tunneling; not erratic */
  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_tunnel(d, c, next);
}
Exemple #2
0
static void npc_next_pos_06(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;     telepathic;     tunneling; not erratic */
  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_tunnel(d, c, next);
}
Exemple #3
0
static void npc_next_pos_05(dungeon *d, npc *c, pair_t next)
{
  /*     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];
    c->have_seen_pc = 1;
    npc_next_pos_line_of_sight(d, c, next);
  } else if (c->have_seen_pc) {
    npc_next_pos_line_of_sight_tunnel(d, c, next);
  }

  if ((next[dim_x] == c->pc_last_known_position[dim_x]) &&
      (next[dim_y] == c->pc_last_known_position[dim_y])) {
    c->have_seen_pc = 0;
  }
}
Exemple #4
0
static void npc_next_pos_05(dungeon_t *d, character *c, pair_t next)
{
  pc *the_pc;
  npc *the_npc;

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

  /*     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];
    the_npc->have_seen_pc = 1;
    npc_next_pos_line_of_sight(d, c, next);
  } else if (the_npc->have_seen_pc) {
    npc_next_pos_line_of_sight_tunnel(d, c, next);
  }

  if ((next[dim_x] == the_npc->pc_last_known_position[dim_x]) &&
      (next[dim_y] == the_npc->pc_last_known_position[dim_y])) {
    the_npc->have_seen_pc = 0;
  }
}