Old revision #ptjsvzrdg | New revision #psh2zd1js | ||
---|---|---|---|
1 | local myCID = Utils.MyCID(); | ||
2 | |||
1 | if (!AITown.HasStatue(town)) { | 3 | if (!AITown.HasStatue(town)) { |
2 | if (AITown.IsActionAvailable(town, AITown.TOWN_ACTION_BUILD_STATUE)) { | 4 | local action = AITown.TOWN_ACTION_BUILD_STATUE; |
5 | if (AITown.IsActionAvailable(town, action)) { | ||
3 | local perform_action = true; | 6 | local perform_action = true; |
4 | if (cvgs.IsCompanyValueGSGame() && cvgs.GetCompanyIDRank( | 4 | if (cvgs.IsCompanyValueGSGame() && cvgs.GetCompanyIDRank(myCID) == 1 && cvgs.RankingList().Count() > 1) { |
5 | if (TestPerformTownAction().TestCost(town, | 5 | if (TestPerformTownAction().TestCost(town, action) > cvgs.GetCompanyIDDiffToNext(myCID, false)) { |
6 | perform_action = false; | 9 | perform_action = false; |
7 | } | 10 | } |
8 | } | 11 | } |
9 | if (perform_action && AITown.PerformTownAction(town, | 9 | if (perform_action && AITown.PerformTownAction(town, action)) { |
10 | AILog.Warning("Built a statue in " + AITown.GetName(town) + "."); | 13 | AILog.Warning("Built a statue in " + AITown.GetName(town) + "."); |
11 | } | 14 | } |
12 | } | 15 | } |