Firebug's Civilizations

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
 
I love you.

Don't take Epaminondas, JFD, i need you!



And for those interested:
While i waited i came up with the idea for Sicily. (may still be changed)
Kingdom of Sicily
Roger II
Court of Lords and Emirs - Great People are generated 35% faster in cities that follow more then one religion.
Norman Church (Temple) - +3 Faith and an additional +2 Faith when the city follows more then one religion.
Saracen Archers (Composite Bowman) - Slightly higher combat strength. Can move after firing. Obsoletes at Industrialisation.
 
It's winter here, but winter is all the better.



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

I just looked at this and my burgeoning want to create mods died more than a little.
 
I just looked at this and my burgeoning want to create mods died more than a little.

Never give up, the want will come crawling back.

my modding schedule is comparable to the Marvel Cinematic Universe.
Done in phases. I released LOADS of mods within a week or a few days of each other then stopped for a long time, then came back for more.
 
The only way we could possibly speed the Theban hype train up is if we made Epi's leaderscreen look more like Jeremy Irons :p
 
It's winter here, but winter is all the better.

Southern Hemisphere Master Race!

Is that Sicily design based on any period in particular? Because it feels kinda schizophrenic with norman and sarracen stuff.

Also, any plans for Maffia Events?
 
*Pulls brakes on Hype train*

The hype train needs some fixing:
The code for the Cadmea is wrong.


Code:
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)

It needs to produce +1 culture for each city state ally. Buuut, it only makes one building after one city state ally and stops.

Edit:

and apparently theres no limit on the percentage bonus from city state allies.
I have 45% culture from city state allies right now. (5% each)
 
*Pulls brakes on Hype train*

The hype train needs some fixing:
The code for the Cadmea is wrong.


Code:
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)

It needs to produce +1 culture for each city state ally. Buuut, it only makes one building after one city state ally and stops.

Edit:

and apparently theres no limit on the percentage bonus from city state allies.
I have 45% culture from city state allies right now. (5% each)

Sorry, miscalculated - the cap is 25x5. At the "numCSAllies = mathMin(CountNumAlliedCSThebes(playerID), 25)" line, change the 25 to a 5.

The building one works for me (made 2 CS allies, got 2 Monuments (was testing with Monument)), although it occurs to me you wanted to restrict this to a building, so you'll need to make a slight change:

Code:
function CadmeaExtraCulture(playerID)
	local player = Players[playerID]
	if player:GetCapitalCity() then
		if (player:IsAlive() and player:GetCapitalCity():IsHasBuilding(GameInfoTypes["BUILDING_CADMEA"]) and player:GetCivilizationType() == civilizationID) then
			player:GetCapitalCity():SetNumRealBuilding(GameInfoTypes["BUILDING_CADMEA_EXTRA_CULTURE"], CountNumAlliedCSThebes(playerID))
	    end
	end
end
GameEvents.PlayerDoTurn.Add(CadmeaExtraCulture)
 
Right then. Thanks for that, i'll test it now.


Also, i'm in need of a map. If ANYONE is willing to step forward to help with that it'd be swell.
 
I'm afraid that no matter how many city state allies i have the Cadmea remains at +2 culture. So it reads one city state, then stops.
 
I'm afraid that no matter how many city state allies i have the Cadmea remains at +2 culture. So it reads one city state, then stops.

I thought the Cadmea yields +1 per CS? If it stopped after one, shouldn't be only yielding one?

Regardless, if the UA function is working correctly (or, at least, going past calculating one CS ally), then that Cadmea function must work, as they call upon the same function to calculate the number of CS. I also tested it with the Monument, and this worked correctly. So perhaps there's an issue with the building itself?

PM me with the build if you want me to take a proper look at it.
 
IIRC, TarcisioCM wanted to use the Saracen Archers as a UU for his second Holy Roman Empire civ. There might be an overlap between his plans and your plans.
 
IIRC, TarcisioCM wanted to use the Saracen Archers as a UU for his second Holy Roman Empire civ. There might be an overlap between his plans and your plans.

It's likely the abilities will be different. I'll just code them as
FB_SARACEN_ARCHERS
when the time comes, i might look into different options.
 



In the time it took for me to make this is could of been uploaded!
MUHAHA
 

Unique Unit Sacred Band
Unique Spearman that fights as strong as a Swordsman and gains twice as much experience in battle.

Unique Building Cadmea
Castle replacement at Masonry. yields +2 culture as well as the defensive bonuses.

Images
Spoiler :






Compatibility
JFD's Cultural Diversity (Core)
JFD’s Piety
Yet (not) Another Earth Map Pack
Map Labels
Ethnic Units
R.E.D. Modpack
Community Balance Patch
Civ IV Leader Traits in Civ V
JFD's Exploration Continued Expanded
Historical Religions Complete

Hype trains next stop - Release Station.

Have fun!
 
doesn't piety require E&D?(as in support?)
on other note, this civ rules. that UA and UU.
 
Looks amazing! Certainly your most polished civ yet!!
 
doesn't piety require E&D?(as in support?)
on other note, this civ rules. that UA and UU.

Yes, and every civ is compatible with E&D anyway, even if it doesn't have Events.
 
Top Bottom