subject

Now we want a way to make our monsters fight! before two monsters can fight, we need to give two new class methods that update their stats. implement a method for "win_fight" and "lose_fight". win_fight should add 5 to the monster’s self. exp, and reset their current_hp to their max_hp. lose_fight should also reset their hp, but only adds 1 exp to self. exp. now write a function that takes two instances of the monster class as its input and makes them "fight". a fight goes as follows: the monster entered as the first function parameter always goes first. each monster takes a turn using one attack move. loop over all attacks from most powerful to least powerful attack until there is a winner. if there is a tie in hit points for an attack select using alphabetical order. an attack is always successful and decreases the opponent’s current_hp by the given number of points. monsters continue taking turns until one of them reaches current_hp less than or equal to 0, at which point the win_fight and lose_fight methods should be invoked. once the fight is complete, return the round number in which the fight ended, the monster that won and the list of attacks the winning monster used. if both monsters only have "wait" as an attack, return -1, none, none

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:50
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
question
Computers and Technology, 23.06.2019 20:50
3.11.3 quiz: comparing and analyzing function typesquestion 4 of 102 pointswhat can you say about the y-values of the two functions f(x) = 3x2-3 andg(x)=2* - 3?
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
Answers: 1
question
Computers and Technology, 24.06.2019 05:00
Who is most likely be your target audience if you create a slide presentation that had yellow background and purple text
Answers: 2
You know the right answer?
Now we want a way to make our monsters fight! before two monsters can fight, we need to give two new...
Questions
question
Mathematics, 22.07.2020 01:01
question
Mathematics, 22.07.2020 01:01
question
Mathematics, 22.07.2020 01:01
question
Business, 22.07.2020 01:01