Ejemplo n.º 1
0
void event::per_turn(game *g)
{
 switch (type) {
  case EVENT_WANTED: {
   if (g->levz >= 0 && one_in(100)) { // About once every 10 minutes
    monster eyebot(g->mtypes[mon_eyebot]);
    eyebot.faction_id = faction_id;
    point place = g->m.random_outdoor_tile();
    if (place.x == -1 && place.y == -1)
     return; // We're safely indoors!
    eyebot.spawn(place.x, place.y);
    g->z.push_back(eyebot);
    int t;
    if (g->u_see(place.x, place.y, t))
     g->add_msg("An eyebot swoops down nearby!");
   }
  } break;

  case EVENT_SPAWN_WYRMS:
   if (g->levz >= 0) {
    turn--;
    return;
   }
   if (int(g->turn) % 3 == 0)
    g->add_msg("You hear screeches from the rock above and around you!");
   break;

  case EVENT_AMIGARA:
   g->add_msg("The entire cavern shakes!");
   break;

  default:
   break; // Nothing happens for other events
 }
}
Ejemplo n.º 2
0
void event::per_turn()
{
    switch (type) {
    case EVENT_WANTED: {
        // About once every 10 minutes. Suppress in classic zombie mode.
        if (g->levz >= 0 && one_in(100) && !ACTIVE_WORLD_OPTIONS["CLASSIC_ZOMBIES"]) {
            monster eyebot(GetMType("mon_eyebot"));
            eyebot.faction_id = faction_id;
            point place = g->m.random_outdoor_tile();
            if (place.x == -1 && place.y == -1)
                return; // We're safely indoors!
            eyebot.spawn(place.x, place.y);
            g->add_zombie(eyebot);
            if (g->u_see(place.x, place.y))
                add_msg(_("An eyebot swoops down nearby!"));
        }
    }
    break;

    case EVENT_SPAWN_WYRMS:
        if (g->levz >= 0) {
            turn--;
            return;
        }
        if (int(calendar::turn) % 3 == 0)
            add_msg(_("You hear screeches from the rock above and around you!"));
        break;

    case EVENT_AMIGARA:
        add_msg(_("The entire cavern shakes!"));
        break;

    case EVENT_TEMPLE_OPEN:
        add_msg(_("The earth rumbles."));
        break;


    default:
        break; // Nothing happens for other events
    }
}