(svn r9280) [gamebalance] -Feature: The amount of passengers and mail now depends on the activity of a town. Also note that the general scheme of how passengers (and mail) are generated has been changed: The amount now correlates linearly to the population of a house. gamebalance
authorcelestar
Sun, 18 Mar 2007 17:45:27 +0000
branchgamebalance
changeset 9893 1f207c0b7345
parent 9892 34d6438f08c8
child 9894 70d78ac95d6c
(svn r9280) [gamebalance] -Feature: The amount of passengers and mail now depends on the activity of a town. Also note that the general scheme of how passengers (and mail) are generated has been changed: The amount now correlates linearly to the population of a house.
src/economy_new.h
src/town_cmd.cpp
--- a/src/economy_new.h	Fri Mar 16 12:05:31 2007 +0000
+++ b/src/economy_new.h	Sun Mar 18 17:45:27 2007 +0000
@@ -44,7 +44,7 @@
 /**
  * Handles all the economic data and events
  */
-class CEconomy : EconomicObject {
+class CEconomy : public EconomicObject {
 private:
 	FixedT<int32, 16> m_basic_growth;     ///< Basic growth number, depends solely on difficulty setting
 	byte              m_long_term_cycle;  ///< The period of the long-term cycle suggested by Kondratiev
--- a/src/town_cmd.cpp	Fri Mar 16 12:05:31 2007 +0000
+++ b/src/town_cmd.cpp	Sun Mar 18 17:45:27 2007 +0000
@@ -32,6 +32,7 @@
 #include "date.h"
 #include "table/town_land.h"
 #include "genworld.h"
+#include "economy_new.h"
 
 /**
  * Called if a new block is added to the town-pool
@@ -307,24 +308,18 @@
 
 	r = Random();
 
-	if (GB(r, 0, 8) < _housetype_population[house]) {
-		uint amt = GB(r, 0, 8) / 8 + 1;
-		uint moved;
-
-		if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
+	if (GB(r, 0, 8) < (t->GetActivity() * _eco->GetActivity() * 8)) {
+		int amt = _housetype_population[house] / 8 + 1;
 		t->new_max_pass += amt;
-		moved = MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt);
+		int moved = MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt);
 		t->new_act_pass += moved;
 	}
 
-	if (GB(r, 8, 8) < _housetype_mailamount[house] ) {
-		uint amt = GB(r, 8, 8) / 8 + 1;
-		uint moved;
-
-		if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
-		t->new_max_mail += amt;
-		moved = MoveGoodsToStation(tile, 1, 1, CT_MAIL, amt);
-		t->new_act_mail += moved;
+	if (GB(r, 8, 8) < (t->GetActivity() * _eco->GetActivity() * 8)) {
+		int amt = _housetype_mailamount[house] / 8 + 1;
+		t->new_max_pass += amt;
+		int moved = MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt);
+		t->new_act_pass += moved;
 	}
 
 	if (_house_more_flags[house] & 8 && HASBIT(t->flags12, TOWN_IS_FUNDED) && --t->time_until_rebuild == 0) {