Answered step by step
Verified Expert Solution
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 poketeam.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 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. choosemanually, to let the user choose upto Pokemon. Please note that the user should have an option to choose less than Pokemon if they choose to do so chooserandomly, to generate a team randomly chosen Pokemon. This should be equal to the TEAMLIMT normally Update: This method has been provided to you in the scaffold. regenerateteambattlemode, criterionNone 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 assembleteam, 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 lenteam should return the current length of the team strteam 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. pickteam, 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 getteam, which should return the current PokeTeam registerpokemon, which should register a pokemon by its PokeType as seen on the trainer's Pokedex getpokedexcompletion, 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 decimal points. For this point, two FIRE type pokemon count as the exact same strtrainer 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started