void game_reset()

in procgen/src/games/bossfight.cpp [202:256]


    void game_reset() override {
        BasicAbstractGame::game_reset();

        damaged_until_time = 0;
        last_fire_time = 0;
        boss_bullet_vel = options.distribution_mode == EasyMode ? .5 : .75;
        int max_extra_invulnerable = options.distribution_mode == EasyMode ? 1 : 3;

        options.center_agent = false;

        boss = add_entity(main_width / 2, main_height / 2, 0, 0, BOSS_R, BOSS);
        choose_random_theme(boss);
        match_aspect_ratio(boss);

        shields = add_entity_rxy(boss->x, boss->y, 0, 0, 1.2 * boss->rx, 1.2 * boss->ry, SHIELDS);

        boss_vel_timeout = BOSS_VEL_TIMEOUT;
        base_fire_prob = 0.1f;
        round_health = rand_gen.randn(9) + 1;
        num_rounds = 1 + rand_gen.randn(5);
        invulnerable_duration = 2 + rand_gen.randn(max_extra_invulnerable + 1);
        vulnerable_duration = 500; // essentially infinite

        boss->health = round_health * num_rounds;

        choose_random_theme(agent);

        player_laser_theme = rand_gen.randn(NUM_LASER_THEMES);
        boss_laser_theme = rand_gen.randn(NUM_LASER_THEMES);

        attack_modes.clear();

        for (int i = 0; i < num_rounds; i++) {
            attack_modes.push_back(rand_gen.randn(NUM_ATTACK_MODES));
        }

        round_num = 0;
        prepare_boss();

        agent->rx = .75;
        match_aspect_ratio(agent);
        reposition_agent();
        agent->y = agent->ry;

        barrier_vel = 0.1f;
        barriers_moves_right = rand_gen.randbool();
        barrier_spawn_prob = 0.025f;

        spawn_barriers();

        // for (int i = 0; i < main_width / barrier_vel; i++) {
        //     spawn_barriers();
        //     step_entities(entities);
        // }
    }