JFD
Kathigitarkh
Spring! When a young JFD's fancy turns to love...
It's winter here, but winter is all the better.
http://forums.civfanatics.com/showthread.php?t=547575
If you want to help, look at this lua.
also, compatibility would be sick. I SUCK at it.
Try this (tested and works with stand-in buildings):
Spoiler :
Code:
function CountNumAlliedCSThebes(playerID)
local player = Players[playerID]
local numCS = 0
for otherPlayerID = 0, GameDefines.MAX_MINOR_CIVS - 1 do
local otherPlayer = Players[otherPlayerID]
if otherPlayer:GetMinorCivFriendshipLevelWithMajor(playerID) == 2 then
numCS = numCS + 1
end
end
return numCS
end
local buildingThebesCultureID = GameInfoTypes["BUILDING_THEBES_PEACE_CULTURE"]
local buildingThebesMilitaryProductionID = GameInfoTypes["BUILDING_THEBES_WAR_MILITARY"]
local civilizationID = GameInfoTypes["CIVILIZATION_THEBES"]
local mathMin = math.min
function ThebesTrait(playerID)
local player = Players[playerID]
if (player:IsAlive() and player:GetCapitalCity() and player:GetCivilizationType() == civilizationID) then
local playerTeam = Teams[player:GetTeam()]
local atPeace = true
if playerTeam:GetAtWarCount(true) > 0 then
atPeace = false
end
local numCSAllies = mathMin(CountNumAlliedCSThebes(playerID), 25)
for city in player:Cities() do
if atPeace then
city:SetNumRealBuilding(buildingThebesCultureID, numCSAllies)
if city:IsHasBuilding(buildingThebesMilitaryProductionID) then
city:SetNumRealBuilding(buildingThebesMilitaryProductionID, 0)
end
else
city:SetNumRealBuilding(buildingThebesMilitaryProductionID, numCSAllies)
if city:IsHasBuilding(buildingThebesCultureID) then
city:SetNumRealBuilding(buildingThebesCultureID, 0)
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(ThebesTrait)
function CadmeaExtraCulture(playerID)
local player = Players[playerID]
if player:GetCapitalCity() then
if (player:IsAlive() and player:GetCapitalCity() and player:GetCivilizationType() == civilizationID) then
player:GetCapitalCity():SetNumRealBuilding(GameInfoTypes["BUILDING_CADMEA_EXTRA_CULTURE"], CountNumAlliedCSThebes(playerID))
end
end
end
GameEvents.PlayerDoTurn.Add(CadmeaExtraCulture)
For compatibility, add this file into your project (just in case you don't know, SQL is added just like XML). You'll also need to add the following as references:
Spoiler :
Code:
JFD's Cultural Diversity (Core) 31a31d1c-b9d7-45e1-842c-23232d66cd47
JFD’s Piety eea66053-7579-481a-bb8d-2f3959b59974
Yet (not) Another Earth Map Pack 36e88483-48fe-4545-b85f-bafc50dde315
Map Labels e576894a-ed2b-4033-be14-ed1c8ceb81d3
Ethnic Units 7fdd72a5-d4ae-441c-bc4e-2e3d2a26cff4
R.E.D. Modpack 8670da15-d435-44ea-9758-7438cb321411
Community Balance Patch 8411a7a8-dad3-4622-a18e-fcc18324c799
Civ IV Leader Traits in Civ V 1153b26a-69fd-4cd5-899c-a8ba8e0e5e5d
JFD's Exploration Continued Expanded 6676902b-b907-45f1-8db5-32dcb2135eee
Historical Religions Complete 6010e6f6-918e-48b8-9332-d60783bd8fb5