lg->win = lg->dead = lg->unlock = 0;
lg->next_level = NULL;
+ lg->bonus = lg->bonusid = 0;
return demo_play_init(USER_REPLAY_FILE, lg->level, lg);
}
int balls; /* live count */
int times; /* time total */
int bonus; /* is a bonus level message needed? */
- int bonusid; /* which bonus level? */
+ int bonusid; /* which bonus level? */
/* Once a level is finished */
int status; /* status ending */
{
FILE *fin;
- struct level_game *lg = curr_lg();
struct level *l;
char buf[MAXSTR];
}
assert(i == set_v[set].count);
- lg->bonus = lg->bonusid = 0; /* initialize bonus values */
}
void set_goto(int i)
if (lg->status == GAME_GOAL)
{
/* Identify the following level */
+
nl = next_level(ln);
+
if (nl != NULL)
{
- /* skip bonuses if unlocked in any mode */
+ /* Skip bonuses if unlocked in any mode */
+
if (nl->is_bonus)
{
- if(lg->mode == MODE_CHALLENGE && nl->is_locked > 0)
+ if (lg->mode == MODE_CHALLENGE && nl->is_locked)
{
- lg->bonus = 1; /* Show GUI message */
- nl->is_locked = 0; /* Unlock bonus level */
+ lg->bonus = 1;
+ nl->is_locked = 0;
}
+
nl = next_normal_level(nl->number);
- if(nl == NULL && lg->mode == MODE_CHALLENGE)
+
+ if (nl == NULL && lg->mode == MODE_CHALLENGE)
{
lg->win = 1;
}
int id, jd, kd;
- struct level_game *lg = curr_lg(); /* Note: const removed. Is this really needed? */
+ struct level_game *lg = curr_lg();
const struct level *l = lg->level;
int high;
{
int gid;
- if(lg->mode == MODE_CHALLENGE && lg->bonus > 0)
+ if (lg->mode == MODE_CHALLENGE && lg->bonus)
{
- lg->bonus = 0;
- lg->bonusid += 1;
- char *buf = malloc(MAXSTR);
+ char buf[MAXSTR];
const char *roman[] =
{
"XVI", "XVII", "XVIII", "XIX", "XX",
"XXI", "XXII", "XXIII", "XXIV", "XXV"
};
- sprintf(buf, "You Have Unlocked Bonus Level %s!", roman[lg->bonusid]);
+
+ lg->bonus = 0;
+ lg->bonusid += 1;
+
+ sprintf(buf, _("You have unlocked bonus level %s!"),
+ roman[lg->bonusid]);
+
gid = gui_label(id, s3, GUI_MED, GUI_ALL, gui_grn, gui_red);
gid = gui_label(id, buf, GUI_SML, GUI_ALL, gui_blu, gui_grn);
}
if ((ld = gui_hstack(kd)))
{
- if(b == 0)
+ if (b == 0)
{
gui_label(ld, ln, GUI_LRG, GUI_NE,
textcol1, textcol2);
gui_label(ld, _("Level "), GUI_LRG, GUI_NW,
textcol1, textcol2);
}
-
else
{
- gui_label(ld, ln, GUI_MED, GUI_NE,
+ gui_label(ld, ln, GUI_MED, GUI_NE,
textcol1, textcol2);
gui_label(ld, _("Bonus Level "), GUI_MED, GUI_NW,
textcol1, textcol2);
}
-
}
gui_label(kd, mode_to_str(lg->mode, 1), GUI_SML, GUI_BOT,