Advertisement
joshuakohut77

Untitled

May 21st, 2022
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.16 KB | None | 0 0
  1.     def __wildPokemonEncounter(self, user: discord.User, pokemon: PokemonClass, active: PokemonClass, descLog: str):
  2.         stats = pokemon.getPokeStats()
  3.         color = getTypeColor(pokemon.type1)
  4.         # Create the embed object
  5.         embed = discord.Embed(
  6.             title=f"Wild {pokemon.pokemonName.capitalize()}",
  7.             # description=descLog,
  8.             color=color
  9.         )
  10.         embed.set_author(name=f"{user.display_name}",
  11.                         icon_url=str(user.avatar_url))
  12.        
  13.         types = pokemon.type1
  14.         # Pokemon are not guaranteed to have a second type.
  15.         # Check that the second type is not set to None and is not an empty string.
  16.         if pokemon.type2 is not None and pokemon.type2:
  17.             types += ', ' + pokemon.type2
  18.  
  19.         activeTypes = active.type1
  20.         # Pokemon are not guaranteed to have a second type.
  21.         # Check that the second type is not set to None and is not an empty string.
  22.         if active.type2 is not None and active.type2:
  23.             activeTypes += ', ' + active.type2
  24.            
  25.         # embed.add_field(
  26.         #     name="Type", value=f"{types}", inline=False)
  27.         # embed.add_field(
  28.         #     name="Level", value=f"{pokemon.currentLevel}", inline=True)
  29.         # embed.add_field(
  30.         #     name="HP", value=f"{pokemon.currentHP} / {stats['hp']}", inline=True)
  31.  
  32.         activeStats = active.getPokeStats()
  33.  
  34.         embed.add_field(
  35.             name=f"{active.pokemonName.capitalize()}",
  36.             value=f'''
  37. Type : {activeTypes}
  38. Level : {active.currentLevel}
  39. HP    : {active.currentHP} / {activeStats['hp']}
  40.            ''',
  41.             inline=True
  42.         )
  43.  
  44.         embed.add_field(
  45.             name=f"{pokemon.pokemonName.capitalize()}",
  46.             value=f'''
  47. Type  : {types}
  48. Level : {pokemon.currentLevel}
  49. HP    : {pokemon.currentHP} / {stats['hp']}
  50.            ''',
  51.             inline=True
  52.         )
  53.  
  54.         embed.set_thumbnail(url=pokemon.frontSpriteURL)
  55.         embed.set_image(url = active.backSpriteURL)
  56.        
  57.         # activeStats = active.getPokeStats()
  58.  
  59.         embed.set_footer(text=descLog)
  60.         return embed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement