from what I see it should multiply by 100 the cultural presure received from cities of LEADER_SNACK_JFK if you have a different government than him? is that right?
I am not sure but I think the problem is just that you set the var "DiffGovMultiplier" to local twice just set it on the first it should work, that's the only thing I see.
should look like this :
I am not sure but I think the problem is just that you set the var "DiffGovMultiplier" to local twice just set it on the first it should work, that's the only thing I see.
should look like this :
Code:
function GetCulturePresure(playerID, cityID, cityKey, pCity, divisor)
culturePresure = emptyTable(culturePresure);
if not divisor then
divisor = 3
end
local kPlayers :table = PlayerManager.GetWasEverAlive();
for _, pPlayer in ipairs (kPlayers) do
local pCapitalCity = pPlayer:GetCities():GetCapitalCity();
local CityOwnerID = pCity:GetOwner()
if playerID == pPlayer:GetID() then
playerdivisor = 1
else
playerdivisor = 3 - pPlayer:GetDiplomacy():GetVisibilityOn(playerID)/2 ;
end
for _,pCity2 in pPlayer:GetCities():Members() do
local City2OwnerID = pCity2:GetOwner()
if cityID ~= pCity2:GetID() or playerID ~= pPlayer:GetID() then
local capitalMultiplier = 1;
local DiffGovMultiplier = 1;
if pCapitalCity == pCity2 then
capitalMultiplier = 1.5;
end
if PlayerConfigurations[City2OwnerID]:GetLeaderTypeName() == "LEADER_SNACK_JFK" and (Players[CityOwnerID]:GetCulture():GetCurrentGovernment() ~= Players[City2OwnerID]:GetCulture():GetCurrentGovernment()) then
DiffGovMultiplier = 100;
print("John F. Kennedy multiplier is "..DiffGovMultiplier);
end
local cityKey2 = pCity2:GetX().."."..pCity2:GetY()
local DistancebtweenCities = Map.GetPlotDistance(pCity:GetX(), pCity:GetY(), pCity2:GetX(), pCity2:GetY());
if DistancebtweenCities <= 10 then
local Valuemodifier = Round( (11 - DistancebtweenCities) * GetCityData(pCity2).CulturePerTurn * pCity2:GetPopulation() / divisor / playerdivisor * capitalMultiplier * DiffGovMultiplier, 1 );
local city2Culture = uprisingEmpireData[cityKey2].Culture;
if not culturePresure[city2Culture] then
culturePresure[city2Culture] = {}
culturePresure[city2Culture].TotalPresure = 0;
elseif not culturePresure[city2Culture].TotalPresure then
culturePresure[city2Culture].TotalPresure = 0;
end
culturePresure[city2Culture][cityKey2] = Valuemodifier
culturePresure[city2Culture].TotalPresure = culturePresure[city2Culture].TotalPresure + Valuemodifier;
end
end
end
end