Changing tile yields via promotion

Uighur_Caesar

Comandante en Jefe
Joined
Mar 14, 2015
Messages
1,227
Location
Florida
So I've been trying to make a UU that adds culture to luxury resource tiles it's stationed on based on how much gold the tile yields. I currently have this: http://pastebin.com/20yFcz9V (none of civfanatic's text things are working for some odd reason). This successfully adds the culture to the tile, but I want the culture boost to go away once the unit steps off. I thought the else that I have at the end would accomplish this but it doesn't. Any idea how this is possible? I was using Sukritact's Tibet Lua as a reference if that helps.
 
I think the problem is that there is nothing telling the plot to revert back to itself.

Code:
if (pUnit:IsHasPromotion(GameInfoTypes.PROMOTION_UC_GUAJIRO)) then
--blahblah SetMambiYield to something.
else
SetMambiYield(uPlot, iCulture, 0)
end

The else statement will never register unless there is suddenly another unit that does not have the promotion on top of that improvement.

I'm unfamiliar with how LUA saves functions, so I don't know a solution except for probably plot iterating all the city's tiles for unpillaged improved luxury resource tiles and doing something with it.
 
Back
Top Bottom