SHOW:
|
|
- or go back to the newest paste.
1 | function GetVietnameseHonour(player) | |
2 | local numHonourPoliciesAdopted = 0 | |
3 | for row in GameInfo.Policies() do | |
4 | if row.PolicyBranchType == "POLICY_BRANCH_HONOR" then | |
5 | local policyType = row.Type | |
6 | if player:HasPolicy(GameInfoTypes[policyType]) then | |
7 | - | numHonourPolicies = numHonourPolicies + 1 |
7 | + | numHonourPoliciesAdopted = numHonourPoliciesAdopted+ 1 |
8 | end | |
9 | end | |
10 | end | |
11 | ||
12 | return numHonourPoliciesAdopted | |
13 | end | |
14 | ||
15 | function VietnameseHonour(playerID) | |
16 | local player = Players[playerID] | |
17 | if player:IsAlive() and player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_VIETNAM"] then | |
18 | local numHonourPolicies = GetVietnameseHonour(player) | |
19 | for city in player:Cities() do | |
20 | if city:GetNumBuilding(GameInfoTypes["BUILDING_CULTURE_DUMMY") < numHonourPolicies then | |
21 | city:SetNumRealBuildings(GameInfoTypes["BUILDING_CULTURE_DUMMY", numHonourPolicies) | |
22 | city:SetNumRealBuildings(GameInfoTypes["BUILDING_FOOD_DUMMY", numHonourPolicies) | |
23 | end | |
24 | end | |
25 | end | |
26 | end |