FortKnoxClass = GameInfoTypes.BUILDINGCLASS_FORT_KNOX
FortKnoxBuilding = GameInfoTypes.BUILDING_FORT_KNOX
BuildingGold = YieldTypes.YIELD_GOLD
MajorPlayers = GameDefines.MAX_MAJOR_CIVS
function FortKnoxGoldBonus(playerId)
--if you are not a CS or Barb
if playerId < MajorPlayers then
local pPlayer = Players[playerId];
-- If you have the wonder do the following
if pPlayer:GetBuildingClassCount(FortKnoxClass) > 0 then
local iGoldLuxury = pPlayer:GetNumResourceTotal(15, true);
local iGoldBonus = (iGoldLuxury * 10);
for pCity in pPlayer:Cities() do
if pCity:IsHasBuilding(FortKnoxBuilding) then
pCity:SetBuildingYieldChange(FortKnoxClass, BuildingGold, iGoldBonus);
break
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(FortKnoxGoldBonus);