Loading

Revision differences

Old revision #pwcf1wdzfNew revision #psh2zd1js
  1local 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(AICompany.ResolveCompanyID(AICompany.COMPANY_SELF)) == 1 && cvgs.RankingList().Count() > 1) {  4                        if (cvgs.IsCompanyValueGSGame() && cvgs.GetCompanyIDRank(myCID) == 1 && cvgs.RankingList().Count() > 1) {
5                            AILog.Info("Cost of perfoming action: " + TestPerformTownAction().TestCost(town, AITown.TOWN_ACTION_BUILD_STATUE) + " ; Value difference to company behind: " + cvgs.GetCompanyIDDiffToNext(AICompany.ResolveCompanyID(AICompany.COMPANY_SELF), false));  5                            if (TestPerformTownAction().TestCost(town, action) > cvgs.GetCompanyIDDiffToNext(myCID, false)) {
6                            if (TestPerformTownAction().TestCost(town, AITown.TOWN_ACTION_BUILD_STATUE) > cvgs.GetCompanyIDDiffToNext(AICompany.ResolveCompanyID(AICompany.COMPANY_SELF), false)) {    
7                                perform_action = false;  9                                perform_action = false;  
8                            }  10                            }  
9                        }  11                        }  
10                        if (perform_action && AITown.PerformTownAction(town, AITown.TOWN_ACTION_BUILD_STATUE)) {  10                        if (perform_action && AITown.PerformTownAction(town, action)) {
11                            AILog.Warning("Built a statue in " + AITown.GetName(town) + ".");  13                            AILog.Warning("Built a statue in " + AITown.GetName(town) + ".");  
12                        }  14                        }  
13                    } 15                    }