Happiness per City-State Ally?

JFD

Kathigitarkh
Joined
Oct 19, 2010
Messages
9,132
Location
The Kingdom of New Zealand
Basically, I would like to grant happiness for every City-State Ally a player has, but there doesn't seem to be anything to directly count the number of City-States a player is allied with. Is there a way that I can do this anyway?
 
Code:
JFDallyCount = 0;
for i, player in pairs(Players) do
	if player:IsAlive() then
		if player:IsMinorCiv() then
			if player:GetMinorCivFriendshipLevelWithMajor(iPlayer) == integer then
[COLOR="Green"]-- iPlayer is ID number of Major Civ your are checking. Integer, you have to check which number is Allied, because I've never used it (i assume it will be 2)[/COLOR]
                                print(player:GetName())
				JFDallyCount = JFDallyCount + 1;
			end
		end
	end
end
 
Back
Top Bottom