4 #include "base_config.h"
7 /*---------------------------------------------------------------------------*/
9 /* A score structure */
13 char player[NSCORE + 1][MAXNAM]; /* player name */
14 int timer[NSCORE + 1]; /* time elapsed */
15 int coins[NSCORE + 1]; /* coins collected */
18 void score_init_hs(struct score *, int, int);
20 /*---------------------------------------------------------------------------*/
28 char file[MAXSTR]; /* sol main file */
29 char name[MAXSTR]; /* the level name */
30 int version; /* the level version */
31 char author[MAXSTR]; /* the author */
33 /* Time and goal information */
35 int time; /* time limit */
36 int goal; /* coins needed */
38 struct score time_score; /* "best time" score */
39 struct score goal_score; /* "unlock goal" score */
40 struct score coin_score; /* "most coin" score */
42 /* Regarding set information */
44 struct set *set; /* set (NULL in single mode) */
45 int number; /* level number in the set */
46 char numbername[3]; /* string representation of the number (eg. B1) */
47 int is_locked; /* Is the level unplayable */
48 int is_bonus; /* Is the level an extra-bonus level? */
49 int is_completed; /* Is the level goal terminated? */
50 int is_last; /* Is the level the last of the set? */
52 /* Other metadata (files are relative the data file) */
54 char message[MAXSTR]; /* intro message */
55 char back[MAXSTR]; /* sol background file */
56 char grad[MAXSTR]; /* gradiant backgound image */
57 char shot[MAXSTR]; /* screenshot image */
58 char song[MAXSTR]; /* song file */
61 int level_load(const char *, struct level *);
63 void level_dump_info(const struct level *);
65 /*---------------------------------------------------------------------------*/
67 /* A level for the playing */
71 int mode; /* game mode */
72 const struct level *level; /* the level played */
74 int goal; /* coins needed */
75 int time; /* time limit */
77 /* MODE_CHALLENGE only */
78 int score; /* coin total */
79 int balls; /* live count */
80 int times; /* time total */
82 /* Once a level is finished */
83 int state; /* state ending */
84 int coins; /* coins collected */
85 int timer; /* time elapsed */
86 int state_value; /* more precision about the state: skip for goal */
88 /* rank = 3 => unclassed */
89 int coin_rank; /* rank in the level high-scores */
90 int goal_rank; /* rank in the level high-scores */
91 int time_rank; /* rank in the level high-scores */
92 int score_rank; /* rank in the set high-scores */
93 int times_rank; /* rank in the set high-scores */
95 /* What about the game and the set? */
96 int dead; /* Is the game over and lost? */
97 int win; /* Is the game over and win? */
98 int unlock; /* Is the next level newly unlocked */
99 const struct level *next_level; /* next level (NULL no next level) */
102 /*---------------------------------------------------------------------------*/
104 #define MODE_CHALLENGE 1
105 #define MODE_NORMAL 2
106 #define MODE_PRACTICE 3
107 #define MODE_SINGLE 4
109 const char *mode_to_str(int);
111 /*---------------------------------------------------------------------------*/
113 #define GAME_NONE 0 /* No event (or aborted) */
114 #define GAME_TIME 1 /* Time's up */
115 #define GAME_GOAL 2 /* Goal reached */
116 #define GAME_FALL 3 /* Fall out */
117 #define GAME_SPEC 4 /* Special goal reached */
119 const char *state_to_str(int);