27 uint16 from; |
27 uint16 from; |
28 uint16 to; |
28 uint16 to; |
29 } Subsidy; |
29 } Subsidy; |
30 |
30 |
31 |
31 |
32 enum { |
32 enum ScoreID { |
|
33 SCORE_BEGIN = 0, |
33 SCORE_VEHICLES = 0, |
34 SCORE_VEHICLES = 0, |
34 SCORE_STATIONS = 1, |
35 SCORE_STATIONS = 1, |
35 SCORE_MIN_PROFIT = 2, |
36 SCORE_MIN_PROFIT = 2, |
36 SCORE_MIN_INCOME = 3, |
37 SCORE_MIN_INCOME = 3, |
37 SCORE_MAX_INCOME = 4, |
38 SCORE_MAX_INCOME = 4, |
38 SCORE_DELIVERED = 5, |
39 SCORE_DELIVERED = 5, |
39 SCORE_CARGO = 6, |
40 SCORE_CARGO = 6, |
40 SCORE_MONEY = 7, |
41 SCORE_MONEY = 7, |
41 SCORE_LOAN = 8, |
42 SCORE_LOAN = 8, |
42 SCORE_TOTAL = 9, // This must always be the last entry |
43 SCORE_TOTAL = 9, // This must always be the last entry |
43 |
44 SCORE_END = 10, // How many scores are there.. |
44 NUM_SCORE = 10, // How many scores are there.. |
|
45 |
45 |
46 SCORE_MAX = 1000 // The max score that can be in the performance history |
46 SCORE_MAX = 1000 // The max score that can be in the performance history |
47 // the scores together of score_info is allowed to be more! |
47 // the scores together of score_info is allowed to be more! |
48 }; |
48 }; |
|
49 |
|
50 DECLARE_POSTFIX_INCREMENT(ScoreID); |
49 |
51 |
50 typedef struct ScoreInfo { |
52 typedef struct ScoreInfo { |
51 byte id; // Unique ID of the score |
53 byte id; // Unique ID of the score |
52 int needed; // How much you need to get the perfect score |
54 int needed; // How much you need to get the perfect score |
53 int score; // How much score it will give |
55 int score; // How much score it will give |
54 } ScoreInfo; |
56 } ScoreInfo; |
55 |
57 |
56 extern const ScoreInfo _score_info[]; |
58 extern const ScoreInfo _score_info[]; |
57 extern int _score_part[MAX_PLAYERS][NUM_SCORE]; |
59 extern int _score_part[MAX_PLAYERS][SCORE_END]; |
58 |
60 |
59 int UpdateCompanyRatingAndValue(Player *p, bool update); |
61 int UpdateCompanyRatingAndValue(Player *p, bool update); |
60 |
62 |
61 VARDEF Subsidy _subsidies[MAX_PLAYERS]; |
63 VARDEF Subsidy _subsidies[MAX_PLAYERS]; |
62 Pair SetupSubsidyDecodeParam(const Subsidy* s, bool mode); |
64 Pair SetupSubsidyDecodeParam(const Subsidy* s, bool mode); |