Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now that we have Pokemon and can create them and view stats, it's time to group them into a team, in preparation for our battles!

Now that we have Pokemon and can create them and view stats, it's time to group them into a team, in preparation for our battles! You will be working on the file poke_team.py Teams are a bit complicated, and have a few different creation options, so we'll go through all the details here. What is a Team? A team is an ordered collection of Pokemon, with an upper limit on the total number of monsters contained (this is currently set at 6, but you should design your code so that this limit is easily adjustable) Team should have the following instance variable, although you can have more: self.team to store the team that the trainer has Teams have the following methods: __init__, to initialise the team. This SHOULD NOT take any additional arguments. However, if you are adding some arguments, you should provide default values for them so they don't fail the tests. choose_manually, to let the user choose upto 6 Pokemon. Please note that the user should have an option to choose less than 6 Pokemon if they choose to do so choose_randomly, to generate a team randomly chosen Pokemon. This should be equal to the TEAM_LIMT (normally 6). Update: This method has been provided to you in the scaffold. regenerate_team(battle_mode, criterion=None), to heal all of the pokemon to their original HP while preserving their level and evolution. This should also assemble the team according to the battle mode (discussed later) assemble_team, to place your pokemon in the appropriate ADT when a battle mode is selected (you will need to leave this empty right now but you will fill this in later in the next task) special , which takes different effects based on the type of battle, which will be covered in the next task __getitem__, to retrieve a Pokemon at a specific index of the team len(team), should return the current length of the team str(team), should return a string with the current members of the team with each member on a new line In a battle, Pokemon will be retrieved from the team and used in battle. If a Pokemon is swapped out, then it is added back into the team. What is a Trainer? A trainer is the holder of a Pokemon team. The trainer has a name, a team and a Pokedex. A Pokedex registers if a trainer has seen a particular pokemon, whether it be in their own team or during battle. The class Trainer should have the following methods: __init__, which should take the name as an argument and set the Trainer's name, initialise a new PokeTeam and also a Pokedex. pick_team, which should pick a team based on the mode that is supplied to the method as an argument. Pick team can only have the values 'Random' or 'Manual'. You should return an error if one of these options is not chosen get_team, which should return the current PokeTeam register_pokemon, which should register a pokemon (by its PokeType) as seen on the trainer's Pokedex get_pokedex_completion, which should return a rounded float ratio of the number of different TYPES of pokemon seen vs the total number of TYPES of pokemon available rounded to 2 decimal points. For this point, two FIRE type pokemon count as the exact same str(trainer), should return a string of the following format: Trainer Pokedex Completion: % You need to convert your pokedex completion to a percentage here by multiplying it by 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

help please

Answered: 1 week ago