From afcf07ac8a0d5adede1b412600042a9f3b482648 Mon Sep 17 00:00:00 2001 From: truebrain Date: Mon, 19 Dec 2011 20:59:19 +0000 Subject: (svn r23620) -Add: ScriptTown::SetCargoGoal and ScriptTown::SetGrowthRate (GameScript only) --- src/script/api/script_town.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/script/api/script_town.hpp') diff --git a/src/script/api/script_town.hpp b/src/script/api/script_town.hpp index a52932a3c..0cee78694 100644 --- a/src/script/api/script_town.hpp +++ b/src/script/api/script_town.hpp @@ -191,6 +191,18 @@ public: */ static int32 GetLastMonthReceived(TownID town_id, ScriptCargo::TownEffect towneffect_id); + /** + * Set the goal of a cargo for this town. + * @param town_id The index of the town. + * @param towneffect_id The index of the cargo. + * @param goal The new goal. + * @pre IsValidTown(town_id). + * @pre ScriptCargo::IsValidTownEffect(cargo_id). + * @return True if the action succeeded. + * @api -ai + */ + static bool SetCargoGoal(TownID town_id, ScriptCargo::TownEffect towneffect_id, uint32 goal); + /** * Get the amount of cargo that needs to be delivered (per TownEffect) for a * town to grow. All goals need to be reached before a town will grow. @@ -204,6 +216,17 @@ public: */ static uint32 GetCargoGoal(TownID town_id, ScriptCargo::TownEffect towneffect_id); + /** + * Set the amount of days between town growth. + * @param town_id The index of the town. + * @param days_between_town_growth The amont of days between town growth. + * @pre IsValidTown(town_id). + * @return True if the action succeeded. + * @note If 'Fund Building' and 'economy.town_growth_rate' is active, the game will often set a new GrowthRate. + * @api -ai + */ + static bool SetGrowthRate(TownID town_id, uint16 days_between_town_growth); + /** * Get the amount of days between town growth. * @param town_id The index of the town. -- cgit v1.2.3-54-g00ecf