local report = function(player,tile,...) if chat then chat.msg(...) else notify.event(player,tile,E.BROADCAST_REPORT,...) end log.normal(...) end local home = setmetatable( {},{__call=function(t,k) if k then t[k]=t[k]+1 end end;} ) local MF = math.floor local function comp (c1, c2) return home[c1] > home[c2] end for player in players_iterate() do if player.ai_controlled then else local cities, c = {}, 0 report(player, nil, "Nett city upkeep costs") for city in player:cities_iterate() do home[city] = - MF(city.size) c= c+1; cities[c] = city end for unit in player:units_iterate() do -- local utype = unit.utype -- if not utype:has_flag("NoVeteran") or utype:has_flag("Settlers") local uts =unit.utype:rule_name() if uts ~= "Caravan" and uts ~= "Diplomat" then home(unit:get_homecity()) end end table.sort(cities, comp) for c, city in ipairs(cities) do report(player, city.tile, "%3s".. (city:is_happy() and "+" or city:is_celebrating() and "*" or city:is_unhappy() and "-" or " ").. city.name..(city:is_capital() and "*" or ""), home[city], nil) end end end