src/economy.h
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6451 7baba06b4b85
child 6303 84c215fc8eb8
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
     3 /** @file economy.h */
     3 /** @file economy.h */
     4 
     4 
     5 #ifndef ECONOMY_H
     5 #ifndef ECONOMY_H
     6 #define ECONOMY_H
     6 #define ECONOMY_H
     7 
     7 
     8 void ResetPriceBaseMultipliers(void);
     8 void ResetPriceBaseMultipliers();
     9 void SetPriceBaseMultiplier(uint price, byte factor);
     9 void SetPriceBaseMultiplier(uint price, byte factor);
    10 
    10 
    11 typedef struct {
    11 struct Economy {
    12 	int32 max_loan;         ///< Maximum possible loan
    12 	int32 max_loan;         ///< Maximum possible loan
    13 	int32 max_loan_unround; ///< Economy fluctuation status
    13 	int32 max_loan_unround; ///< Economy fluctuation status
    14 	int fluct;
    14 	int fluct;
    15 	byte interest_rate;     ///< Interest
    15 	byte interest_rate;     ///< Interest
    16 	byte infl_amount;       ///< inflation amount
    16 	byte infl_amount;       ///< inflation amount
    17 	byte infl_amount_pr;    ///< "floating" portion of inflation
    17 	byte infl_amount_pr;    ///< "floating" portion of inflation
    18 } Economy;
    18 };
    19 
    19 
    20 VARDEF Economy _economy;
    20 VARDEF Economy _economy;
    21 
    21 
    22 typedef struct Subsidy {
    22 struct Subsidy {
    23 	CargoID cargo_type;
    23 	CargoID cargo_type;
    24 	byte age;
    24 	byte age;
    25 	/* from and to can either be TownID, StationID or IndustryID */
    25 	/* from and to can either be TownID, StationID or IndustryID */
    26 	uint16 from;
    26 	uint16 from;
    27 	uint16 to;
    27 	uint16 to;
    28 } Subsidy;
    28 };
    29 
    29 
    30 
    30 
    31 enum ScoreID {
    31 enum ScoreID {
    32 	SCORE_BEGIN      = 0,
    32 	SCORE_BEGIN      = 0,
    33 	SCORE_VEHICLES   = 0,
    33 	SCORE_VEHICLES   = 0,
    46 	/* the scores together of score_info is allowed to be more! */
    46 	/* the scores together of score_info is allowed to be more! */
    47 };
    47 };
    48 
    48 
    49 DECLARE_POSTFIX_INCREMENT(ScoreID);
    49 DECLARE_POSTFIX_INCREMENT(ScoreID);
    50 
    50 
    51 typedef struct ScoreInfo {
    51 struct ScoreInfo {
    52 	byte id;    ///< Unique ID of the score
    52 	byte id;    ///< Unique ID of the score
    53 	int needed; ///< How much you need to get the perfect score
    53 	int needed; ///< How much you need to get the perfect score
    54 	int score;  ///< How much score it will give
    54 	int score;  ///< How much score it will give
    55 } ScoreInfo;
    55 };
    56 
    56 
    57 extern const ScoreInfo _score_info[];
    57 extern const ScoreInfo _score_info[];
    58 extern int _score_part[MAX_PLAYERS][SCORE_END];
    58 extern int _score_part[MAX_PLAYERS][SCORE_END];
    59 
    59 
    60 int UpdateCompanyRatingAndValue(Player *p, bool update);
    60 int UpdateCompanyRatingAndValue(Player *p, bool update);