I need some LUA for a Civ trait I am working on. I would like it so that buildings bought with faith(mosques, cathedrals, pagodas) produce a golden age point per turn.
local bClassCathedral = GameInfoTypes.BUILDINGCLASS_CATHEDRAL;
local bClassMonastery = GameInfoTypes.BUILDINGCLASS_MONASTERY;
local bClassMosque = GameInfoTypes.BUILDINGCLASS_MOSQUE;
local bClassPagoda = GameInfoTypes.BUILDINGCLASS_PAGODA;
GameEvents.PlayerDoTurn.Add(
function(iPlayer)
local pPlayer = Players[iPlayer];
if (pPlayer:IsAlive()) then
if (pPlayer:GetCivilizationType() == GameInfoTypes.CIVILIZATION_WHATEVER) then
local cCathedral = pPlayer:GetBuildingClassCount(bClassCathedral);
local cMonastery = pPlayer:GetBuildingClassCount(bClassMonastery);
local cMosque = pPlayer:GetBuildingClassCount(bClassMosque);
local cPagoda = pPlayer:GetBuildingClassCount(bClassPagoda);
local cGABonus = cCathedral + cMonastery + cMosque + cPagoda;
if not pPlayer:IsGoldenAge() then
pPlayer:ChangeGoldenAgeProgressMeter(cGABonus);
end
end
end
end)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.