more progress on fighting
import asyncio
import functools
+import itertools
import math
import random
from collections import defaultdict
@@ -1901,6 +1902,9 @@ class Econ(commands.Cog):
db_user_1 = await self.db.fetch_user(user_1.id)
db_user_2 = await self.db.fetch_user(user_2.id)
+ user_1_health = db_user_1.health
+ user_2_health = db_user_2.health
+
user_1_bees = getattr(await self.db.fetch_item(user_1.id, "Jar Of Bees"), "amount", 0)
user_2_bees = getattr(await self.db.fetch_item(user_2.id, "Jar Of Bees"), "amount", 0)
@@ -1985,9 +1989,17 @@ class Econ(commands.Cog):
await asyncio.wait(bet_tasks)
del bet_tasks
+ cur_user = random.choice([user_1, user_2])
+
# fight loop
- while True:
- embed = disnake.Embed(color=self.d.cc, title="")
+ for i in itertools.count():
+ embed = disnake.Embed(color=self.d.cc, title=f"{cur_user.display_name}, attack!")
+ embed.add_field(name=user_1.display_name, value=make_health_bar(
+ db_user_1.health, 20, self.d.emojis.heart_full, self.d.emojis.heart_half, self.d.emojis.heart_empty
+ ))
+ embed.add_field(name=user_2.display_name, value=make_health_bar(
+ db_user_1.health, 20, self.d.emojis.heart_full, self.d.emojis.heart_half, self.d.emojis.heart_empty
+ ))
# end fight loop
finally:
