Ejemplo n.º 1
0
bool defense_game::init(game *g)
{
 g->turn = HOURS(12); // Start at noon
 g->temperature = 65;
 if (!g->u.create(g, PLTYPE_CUSTOM))
  return false;
 g->u.str_cur = g->u.str_max;
 g->u.per_cur = g->u.per_max;
 g->u.int_cur = g->u.int_max;
 g->u.dex_cur = g->u.dex_max;
 init_itypes(g);
 init_mtypes(g);
 init_constructions(g);
 init_recipes(g);
 current_wave = 0;
 hunger = false;
 thirst = false;
 sleep  = false;
 zombies = false;
 specials = false;
 spiders = false;
 triffids = false;
 robots = false;
 subspace = false;
 mercenaries = false;
 init_to_style(DEFENSE_EASY);
 setup();
 g->u.cash = initial_cash;
 popup_nowait("Please wait as the map generates [ 0%]");
 // TODO: support multiple defence games? clean up old defence game
 g->cur_om = &overmap_buffer.get(g, 0, 0);
 init_map(g);
 caravan(g);
 return true;
}
Ejemplo n.º 2
0
void defense_game::init(game *g)
{
 g->turn = HOURS(12); // Start at noon
 g->temperature = 65;
 g->u.create(g, PLTYPE_CUSTOM);
 g->u.str_cur = g->u.str_max;
 g->u.per_cur = g->u.per_max;
 g->u.int_cur = g->u.int_max;
 g->u.dex_cur = g->u.dex_max;
 init_itypes(g);
 init_mtypes(g);
 init_constructions(g);
 init_recipes(g);
 current_wave = 0;
 hunger = false;
 thirst = false;
 sleep  = false;
 zombies = false;
 specials = false;
 spiders = false;
 triffids = false;
 robots = false;
 subspace = false;
 mercenaries = false;
 init_to_style(DEFENSE_EASY);
 setup();
 g->u.cash = initial_cash;
 popup_nowait("Please wait as the map generates [ 0%]");
 init_map(g);
 caravan(g);
}
Ejemplo n.º 3
0
void defense_game::per_turn(game *g)
{
 if (!thirst)
  g->u.thirst = 0;
 if (!hunger)
  g->u.hunger = 0;
 if (!sleep)
  g->u.fatigue = 0;
 if (int(g->turn) % (time_between_waves * 10) == 0) {
  current_wave++;
  if (current_wave > 1 && current_wave % waves_between_caravans == 0) {
   popup("A caravan approaches!  Press spacebar...");
   caravan(g);
  }
  spawn_wave(g);
 }
}