truelight@0: #ifndef ECONOMY_H truelight@0: #define ECONOMY_H truelight@0: truelight@0: typedef struct { truelight@0: // Maximum possible loan truelight@0: int32 max_loan; truelight@0: int32 max_loan_unround; truelight@0: // Economy fluctuation status truelight@0: int fluct; truelight@0: // Interest truelight@0: byte interest_rate; truelight@0: byte infl_amount; truelight@0: byte infl_amount_pr; truelight@0: } Economy; truelight@0: truelight@0: VARDEF Economy _economy; truelight@0: truelight@0: typedef struct Subsidy { truelight@0: byte cargo_type; truelight@0: byte age; truelight@0: byte from; truelight@0: byte to; truelight@0: } Subsidy; truelight@0: truelight@0: dominik@116: enum { dominik@116: SCORE_VEHICLES = 0, dominik@116: SCORE_STATIONS = 1, dominik@116: SCORE_MIN_PROFIT = 2, dominik@116: SCORE_MIN_INCOME = 3, dominik@116: SCORE_MAX_INCOME = 4, dominik@116: SCORE_DELIVERED = 5, dominik@116: SCORE_CARGO = 6, dominik@116: SCORE_MONEY = 7, dominik@116: SCORE_LOAN = 8, dominik@116: SCORE_TOTAL = 9, // This must always be the last entry dominik@116: dominik@116: NUM_SCORE = 10, // How many scores are there.. dominik@116: dominik@116: SCORE_MAX = 1000, // The max score that can be in the performance history dominik@116: // the scores together of score_info is allowed to be more! dominik@116: }; dominik@116: dominik@116: typedef struct ScoreInfo { dominik@116: byte id; // Unique ID of the score dominik@116: int needed; // How much you need to get the perfect score dominik@116: int score; // How much score it will give dominik@116: } ScoreInfo; dominik@116: dominik@116: static const ScoreInfo score_info[] = { darkvater@179: {SCORE_VEHICLES, 120, 100}, darkvater@179: {SCORE_STATIONS, 80, 100}, darkvater@179: {SCORE_MIN_PROFIT, 10000, 100}, darkvater@179: {SCORE_MIN_INCOME, 50000, 50}, dominik@116: {SCORE_MAX_INCOME, 100000, 100}, darkvater@179: {SCORE_DELIVERED, 40000, 400}, darkvater@179: {SCORE_CARGO, 8, 50}, darkvater@179: {SCORE_MONEY, 10000000, 50}, darkvater@179: {SCORE_LOAN, 250000, 50}, darkvater@179: {SCORE_TOTAL, 0, 0} dominik@116: }; dominik@116: dominik@116: int _score_part[MAX_PLAYERS][NUM_SCORE]; dominik@116: darkvater@147: int UpdateCompanyRatingAndValue(Player *p, bool update); darkvater@147: void UpdatePlayerHouse(Player *p, uint score); dominik@116: dominik@116: truelight@0: VARDEF Subsidy _subsidies[MAX_PLAYERS]; truelight@0: Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode); truelight@0: void DeleteSubsidyWithIndustry(byte index); truelight@0: void DeleteSubsidyWithStation(byte index); truelight@0: truelight@0: int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type); truelight@0: uint MoveGoodsToStation(uint tile, int w, int h, int type, uint amount); truelight@0: truelight@0: #endif /* ECONOMY_H */