TheLunarArmy
Chieftain
Hi guys, it's been a while since I lurked but I'm in the process of making a new civ for my friend.
The civ in question will be Diplomacy based so I would like to make a unique Caravansary that will cause any City-State trading with that City to have a bonus positive influence of 1 each turn (this stacks if you have multiple cities trading with that city state, up to +3).
My CIV5 API is a little rusty, so if anyone has experience in either Trade Routes or Changing city-state influence I would greatly appreciate input from you.
Here is what I have so far:
Thanks
The civ in question will be Diplomacy based so I would like to make a unique Caravansary that will cause any City-State trading with that City to have a bonus positive influence of 1 each turn (this stacks if you have multiple cities trading with that city state, up to +3).
My CIV5 API is a little rusty, so if anyone has experience in either Trade Routes or Changing city-state influence I would greatly appreciate input from you.
Here is what I have so far:
Code:
-- Establish all the trade routes by player
local myRoutes = Players[player]:GetTradeRoutes();
-- Step through every Route that is deconstructed in an ipair
for me,target in ipairs(myRoutes) do
if target.ToCity:GetOwner().IsMinorCiv() then
--Found a connected citystate!
target.ToCity:GetOwner():ChangeMinorCivFriendshipWithMajor(player, 1.0)
end
end
Thanks