function MainClass::SetTownEffectGoals() {
local cargoList = GSCargoList();
cargoList.Sort(GSList.SORT_BY_ITEM, GSList.SORT_ASCENDING);
local passengers = false;
local mail = false;
local goods = false;
local water = false;
local food = false;
for (local cargo_type = cargoList.Begin(); !cargoList.IsEnd(); cargo_type = cargoList.Next()) {
local town_effect = GSCargo.GetTownEffect(cargo_type);
if (town_effect != GSCargo.TE_NONE) {
switch(town_effect) {
case GSCargo.TE_PASSENGERS: passengers = true; break;
case GSCargo.TE_MAIL: mail = true; break;
case GSCargo.TE_GOODS: goods = true; break;
case GSCargo.TE_WATER: water = true; break;
case GSCargo.TE_FOOD: food = true; break;
}
}
}
local townList = GSTownList();
local landscape = GSGame.GetLandscape();
for (local town = townList.Begin(); !townList.IsEnd(); town = townList.Next()) {
if (passengers) {
switch(landscape) {
case GSGame.LT_ARCTIC: GSTown.SetCargoGoal(town, GSCargo.TE_PASSENGERS, 0xFFFFFFFE); break;
case GSGame.LT_TROPIC: GSTown.SetCargoGoal(town, GSCargo.TE_PASSENGERS, 0xFFFFFFFF); break;
default: GSTown.SetCargoGoal(town, GSCargo.TE_PASSENGERS, 1); break;
}
}
if (mail) {
switch(landscape) {
case GSGame.LT_ARCTIC: GSTown.SetCargoGoal(town, GSCargo.TE_MAIL, 0xFFFFFFFE); break;
case GSGame.LT_TROPIC: GSTown.SetCargoGoal(town, GSCargo.TE_MAIL, 0xFFFFFFFF); break;
default: GSTown.SetCargoGoal(town, GSCargo.TE_MAIL, 1); break;
}
}
if (goods) {
switch(landscape) {
case GSGame.LT_ARCTIC: GSTown.SetCargoGoal(town, GSCargo.TE_GOODS, 0xFFFFFFFE); break;
case GSGame.LT_TROPIC: GSTown.SetCargoGoal(town, GSCargo.TE_GOODS, 0xFFFFFFFF); break;
default: GSTown.SetCargoGoal(town, GSCargo.TE_GOODS, 1); break;
}
}
if (water) {
switch(landscape) {
case GSGame.LT_ARCTIC: GSTown.SetCargoGoal(town, GSCargo.TE_WATER, 0xFFFFFFFE); break;
case GSGame.LT_TROPIC: GSTown.SetCargoGoal(town, GSCargo.TE_WATER, 0xFFFFFFFF); break;
default: GSTown.SetCargoGoal(town, GSCargo.TE_WATER, 1); break;
}
}
if (food) {
switch(landscape) {
case GSGame.LT_ARCTIC: GSTown.SetCargoGoal(town, GSCargo.TE_FOOD, 0xFFFFFFFE); break;
case GSGame.LT_TROPIC: GSTown.SetCargoGoal(town, GSCargo.TE_FOOD, 0xFFFFFFFF); break;
default: GSTown.SetCargoGoal(town, GSCargo.TE_FOOD, 1); break;
}
}
}
}