Guest User

Extended Diplomacy Ribbon (Tourism Addon)

a guest
Apr 25th, 2019
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.65 KB | None | 0 0
  1. local NumRequiredTourists = 0;
  2.  
  3.   for i, player in ipairs(Players) do
  4.     if i ~= playerID and IsAliveAndMajor(i)  and player:GetTeam() ~= teamID then
  5.         local iStaycationers = player:GetCulture():GetStaycationers();
  6.         if iStaycationers >= NumRequiredTourists then
  7.             NumRequiredTourists = iStaycationers + 1;
  8.         end
  9.     end
  10.   end
  11.  
  12.   function tableLength(T)
  13.     local count = 0
  14.     for _ in pairs(T) do count = count + 1 end
  15.     return count
  16.   end
  17.  
  18.  
  19.   -- Stats
  20.   local civData:string = sEras
  21.     .."[NEWLINE]"..Locale.Lookup("LOC_DIPLOMACY_INTEL_GOVERNMENT").." "..govType
  22.     .."[NEWLINE]"..Locale.Lookup("LOC_PEDIA_CONCEPTS_PAGEGROUP_CITIES_NAME").. ": " .. "[COLOR_FLOAT_PRODUCTION]" .. numCities .. "[ENDCOLOR] [ICON_Housing]    "
  23.         .. Locale.Lookup("LOC_DEAL_CITY_POPULATION_TOOLTIP", ERD_Total_Population) .. " [ICON_Citizen]"
  24.     ..((m_isGatheringStorm and playerID ~= Game.GetLocalPlayer() and iGrievancesOnThem ~= 0) and "[NEWLINE]"..relationshipString or "")
  25.     .."[NEWLINE]-----------------------------------------------"
  26.     .."[NEWLINE][ICON_Capital] "..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_DOMINATION_SCORE", Players[playerID]:GetScore())
  27.     ..(m_isGatheringStorm and "[NEWLINE] [ICON_Favor]  "..Locale.Lookup("LOC_DIPLOMATIC_FAVOR_NAME") .. ": [COLOR_Red]" .. Players[playerID]:GetFavor().."[ENDCOLOR]" or "")
  28.     .."[NEWLINE][ICON_Gold] "..Locale.Lookup("LOC_YIELD_GOLD_NAME")..": "..goldBalance.."   ( " .. "[COLOR_GoldMetalDark]" .. (goldYield>0 and "+" or "") .. (goldYield>0 and goldYield or "-?") .. "[ENDCOLOR]  )"
  29.     .."[NEWLINE]"..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_SCIENCE_SCIENCE_RATE", "[COLOR_FLOAT_SCIENCE]" .. Round(Players[playerID]:GetTechs():GetScienceYield(),1) .. "[ENDCOLOR]")
  30.     .."[NEWLINE][ICON_Science] "..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_SCIENCE_NUM_TECHS", "[COLOR_Blue]" .. Players[playerID]:GetStats():GetNumTechsResearched() .. "[ENDCOLOR]")
  31.     .."[NEWLINE]"..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_CULTURE_CULTURE_RATE", "[COLOR_FLOAT_CULTURE]" .. Round(Players[playerID]:GetCulture():GetCultureYield(),1) .. "[ENDCOLOR]")
  32.     .."[NEWLINE]"..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_RELIGION_FAITH_RATE", Round(Players[playerID]:GetReligion():GetFaithYield(),1))
  33.     .."[NEWLINE][ICON_Strength] "..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_DOMINATION_MILITARY_STRENGTH", "[COLOR_FLOAT_MILITARY]" .. Players[playerID]:GetStats():GetMilitaryStrengthWithoutTreasury() .. "[ENDCOLOR]")
  34.     .."[NEWLINE]"..Locale.Lookup("LOC_WORLD_RANKINGS_OVERVIEW_CULTURE_TOURISM_RATE", "[COLOR_Tourism]" .. Round(Players[playerID]:GetStats():GetTourism(),1) .. "[ENDCOLOR]")
  35.     .."[NEWLINE][ICON_Tourism] Domestic Tourists: [COLOR_Tourism]" .. Players[playerID]:GetCulture():GetStaycationers() .. "[ENDCOLOR]"
  36.     .."[NEWLINE][ICON_Tourism] Total Visiting Tourists: " .. Players[playerID]:GetCulture():GetTouristsTo(Game.GetLocalPlayer()) .. "/" .. NumRequiredTourists
  37.     .."[NEWLINE][ICON_Tourism] FT Equation: round down(civ lifetime tourism / (# of civs in the game x 200))"
  38.     -- vanillla Civ 6 modifier was 150. Increased to 200 in R&F
  39.     .."[NEWLINE][ICON_Tourism] FT Equation: round down(civ lifetime tourism / (" .. tableLength(PlayerManager.GetAliveMajors())*200 .. "))"
  40.     .."[NEWLINE][ICON_Tourism] Foreign Tourists To: [COLOR_Tourism]" .. Players[playerID]:GetCulture():GetTouristsTo(playerID) .. "[ENDCOLOR]"
  41.     .."[NEWLINE][ICON_Tourism] Foreign Tourists From: [COLOR_Tourism]" .. Players[Game.GetLocalPlayer()]:GetCulture():GetTouristsFrom(playerID) .. "[ENDCOLOR]"
  42.     .."[NEWLINE][COLOR_Tourism]".. Players[Game.GetLocalPlayer()]:GetCulture():GetTouristsFromTooltip(playerID) .. "[ENDCOLOR]"
  43.     .."[NEWLINE]-----------------------------------------------"
  44.     ;
Advertisement
Add Comment
Please, Sign In to add comment