Ejemplo n.º 1
0
void new_dungeon(dungeon_t *d)
{
  uint32_t sequence_number;

  sequence_number = d->character_sequence_number;

  delete_dungeon(d);

  init_dungeon(d);
  gen_dungeon(d);
  d->character_sequence_number = sequence_number;

  place_pc(d);
  d->character_map[d->PC->position[dim_y]][d->PC->position[dim_x]] = d->PC;

  gen_monsters(d);
  gen_objects(d);
}
Ejemplo n.º 2
0
void new_dungeon(dungeon_t *d)
{
  uint32_t sequence_number;

  sequence_number = d->character_sequence_number;

  delete_dungeon(d);

  init_dungeon(d);
  gen_dungeon(d);
  d->character_sequence_number = sequence_number;

  place_pc(d);
  d->charmap[character_get_y(d->pc)][character_get_x(d->pc)] = d->pc;

  /* Need to add a mechanism to decide on a number of monsters.  --nummon  *
   * is just for testing, and if we're generating new dungeon levels, then *
   * presumably we've already done that testing.  We'll just put 10 in for *
   * now.                                                                  */
  gen_monsters(d, character_get_next_turn(d->pc));
  gen_objects(d);
}
Ejemplo n.º 3
0
void config_pc(dungeon_t *d)
{
  /* This should be in the PC constructor, now. */
  pc *the_pc;

  the_pc = new pc;
  d->pc = (character *) the_pc;

  the_pc->symbol = '@';

  place_pc(d);

  the_pc->speed = PC_SPEED;
  the_pc->next_turn = 0;
  the_pc->alive = 1;
  the_pc->sequence_number = 0;

  d->charmap[the_pc->position[dim_y]]
            [the_pc->position[dim_x]] = (character *) d->pc;

  dijkstra(d);
  dijkstra_tunnel(d);
}