Exemplo n.º 1
0
static void npc_next_pos_17(dungeon *d, npc *c, pair_t next)
{
  /* pass wall;     smart;     telepathic;     tunneling; not erratic */
  c->pc_last_known_position[dim_y] = character_get_y(d->PC);
  c->pc_last_known_position[dim_x] = character_get_x(d->PC);
  npc_next_pos_line_of_sight(d, c, next);
}
Exemplo n.º 2
0
static void npc_next_pos_02(dungeon *d, npc *c, pair_t next)
{
  /* not smart;     telepathic; not 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(d, c, next);
}
Exemplo n.º 3
0
static void npc_next_pos_11(dungeon *d, npc *c, pair_t next)
{
  /* pass wall;     smart; not telepathic; not 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] = character_get_y(d->PC);
    c->pc_last_known_position[dim_x] = character_get_x(d->PC);
    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(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;
  }
}
Exemplo n.º 4
0
static void npc_next_pos_14(dungeon *d, npc *c, pair_t next)
{
  /* pass wall; 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] = character_get_y(d->PC);
    c->pc_last_known_position[dim_x] = character_get_x(d->PC);
    npc_next_pos_line_of_sight(d, c, next);
  } else {
    npc_next_pos_rand_pass(d, c, next);
  }
}
Exemplo n.º 5
0
static void npc_next_pos_00(dungeon *d, npc *c, pair_t next)
{
  /* not smart; not telepathic; not 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(d, c, next);
  }
}
Exemplo n.º 6
0
static void npc_next_pos_02(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; not 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(d, c, next);
}
Exemplo n.º 7
0
static void npc_next_pos_01(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; not 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(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;
  }
}
Exemplo n.º 8
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);
  }
}