Set now finishes properly in Challenge mode, Level x renamved to Bonus Level x, Roman...
authorKrabbyKrap <KrabbyKrap@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 29 Dec 2007 20:11:58 +0000 (20:11 +0000)
committerKrabbyKrap <KrabbyKrap@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 29 Dec 2007 20:11:58 +0000 (20:11 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@1320 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/set.c
ball/st_goal.c
ball/st_level.c

index c0836a2..6dc6c7c 100644 (file)
@@ -360,6 +360,9 @@ static void set_load_levels(void)
     }
 
     assert(i == set_v[set].count);
+
+    struct level_game *lg = curr_lg();
+    lg->bonus = lg->bonusid = 0; /* initialize bonus values */
 }
 
 void set_goto(int i)
@@ -502,6 +505,10 @@ void set_finish_level(struct level_game *lg, const char *player)
                     nl->is_locked = 0; /* Unlock bonus level */
                 }
                 nl = next_normal_level(nl->number);
+                if(nl == NULL && lg->mode == MODE_CHALLENGE)
+                {
+                    lg->win = 1;
+                }
             }
         }
         else if (lg->mode == MODE_CHALLENGE)
index 0bdc02e..094a298 100644 (file)
@@ -125,9 +125,20 @@ static int goal_enter(void)
             lg->bonus = 0;
             lg->bonusid += 1;
             char buf[MAXSTR] = {0};
-            sprintf(buf, "You Have Unlocked Bonus Level %i!", 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_grn, gui_blu);
+
+
+            const char *roman[] =
+            {
+                "",
+                "I",   "II",   "III",   "IV",   "V",
+                "VI",  "VII",  "VIII",  "IX",   "X",
+                "XI",  "XII",  "XIII",  "XIV",  "XV",
+                "XVI", "XVII", "XVIII", "XIX",  "XX",
+                "XXI", "XXII", "XXIII", "XXIV", "XXV"
+            };
+            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 (high)
index 63a1c75..0109c72 100644 (file)
@@ -54,10 +54,22 @@ static int level_enter(void)
 
                 if ((ld = gui_hstack(kd)))
                 {
-                    gui_label(ld, ln,          GUI_LRG, GUI_NE,
-                              textcol1, textcol2);
-                    gui_label(ld, _("Level "), GUI_LRG, GUI_NW,
-                              textcol1, textcol2);
+                    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,
+                                  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,