nation['cities'] to nation.cities

This commit is contained in:
karan committed 2025-05-25 21:52:45 +05:30
1 parent 675873b3e2
commit 073dec2be0
1 file changed
+6 -7
+6 -7
View File
@@ -1023,7 +1023,6 @@ class Banking(commands.Cog):
treasure_text = "" treasure_text = ""
footer = "" footer = ""
city = city.to_dict()
if nation['iron_works'] == True: if nation['iron_works'] == True:
ste_mod = 1.36 ste_mod = 1.36
@@ -1073,7 +1072,7 @@ class Banking(commands.Cog):
await message.edit(content="Something is wrong with the build you sent!") await message.edit(content="Something is wrong with the build you sent!")
return return
land = 0 land = 0
for city in nation['cities']: for city in nation.cities:
land += city['land'] land += city['land']
city = {} city = {}
for key, value in build.items(): for key, value in build.items():
@@ -1081,11 +1080,11 @@ class Banking(commands.Cog):
city['infrastructure'] = city.pop('a_needed') city['infrastructure'] = city.pop('a_needed')
city['land'] = round(land/nation['num_cities']) city['land'] = round(land/nation['num_cities'])
city['powered'] = True city['powered'] = True
city['date'] = nation['cities'][math.ceil(nation['num_cities']/2)]['date'] city['date'] = nation.cities[math.ceil(nation['num_cities']/2)]['date']
nation['cities'] = [city] nation.cities = [city]
#print(city) #print(city)
for city in nation['cities']: for city in nation.cities:
total_infra += city['infrastructure'] total_infra += city['infrastructure']
base_pop = city['infrastructure'] * 100 base_pop = city['infrastructure'] * 100
pollution = 0 pollution = 0
@@ -1297,10 +1296,10 @@ class Banking(commands.Cog):
starve_net_text = f" (${round(money_income * policy_bonus * new_player_bonus * 0.67 + color_bonus - power_upkeep - rss_upkeep - military_upkeep * mil_cost - civil_upkeep + coal * prices['coal'] + oil * prices['oil'] + uranium * prices['uranium'] + lead * prices['lead'] + iron * prices['iron'] + bauxite * prices['bauxite'] + gasoline * prices['gasoline'] + munitions * prices['munitions'] + steel * prices['steel'] + aluminum * prices['aluminum'] + food * prices['food']):,}*)" starve_net_text = f" (${round(money_income * policy_bonus * new_player_bonus * 0.67 + color_bonus - power_upkeep - rss_upkeep - military_upkeep * mil_cost - civil_upkeep + coal * prices['coal'] + oil * prices['oil'] + uranium * prices['uranium'] + lead * prices['lead'] + iron * prices['iron'] + bauxite * prices['bauxite'] + gasoline * prices['gasoline'] + munitions * prices['munitions'] + steel * prices['steel'] + aluminum * prices['aluminum'] + food * prices['food']):,}*)"
footer = "* The income if the nation is suffering from a starvation penalty" footer = "* The income if the nation is suffering from a starvation penalty"
max_infra = sorted(nation['cities'], key=lambda k: k['infrastructure'], reverse=True)[0]['infrastructure'] max_infra = sorted(nation.cities, key=lambda k: k['infrastructure'], reverse=True)[0]['infrastructure']
if single_city: if single_city:
rev_obj = nation['cities'][0] rev_obj = nation.cities[0]
else: else:
rev_obj = {} rev_obj = {}
rev_obj['monetary_net_num'] = round(money_income * policy_bonus * new_player_bonus * nation_treasure_bonus + color_bonus - power_upkeep - rss_upkeep - military_upkeep * mil_cost - civil_upkeep + coal * prices['coal'] + oil * prices['oil'] + uranium * prices['uranium'] + lead * prices['lead'] + iron * prices['iron'] + bauxite * prices['bauxite'] + gasoline * prices['gasoline'] + munitions * prices['munitions'] + steel * prices['steel'] + aluminum * prices['aluminum'] + food * prices['food']) rev_obj['monetary_net_num'] = round(money_income * policy_bonus * new_player_bonus * nation_treasure_bonus + color_bonus - power_upkeep - rss_upkeep - military_upkeep * mil_cost - civil_upkeep + coal * prices['coal'] + oil * prices['oil'] + uranium * prices['uranium'] + lead * prices['lead'] + iron * prices['iron'] + bauxite * prices['bauxite'] + gasoline * prices['gasoline'] + munitions * prices['munitions'] + steel * prices['steel'] + aluminum * prices['aluminum'] + food * prices['food'])