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, 22.06.2019 10:50
Write a 3-4 page apa formatted paper comparing your organization’s it strategy with the best practices outlined in your course text. content should include, but not be limited to: developing and delivering on the it value, developing it strategy for the business value and linking it to business metrics. your paper should include an abstract and a conclusion and a reference page with 3-5 references
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
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
Computers and Technology, 16.02.2021 20:10
question
Mathematics, 16.02.2021 20:10
question
Mathematics, 16.02.2021 20:10
question
Computers and Technology, 16.02.2021 20:10
question
Mathematics, 16.02.2021 20:10
question
Mathematics, 16.02.2021 20:10
question
Mathematics, 16.02.2021 20:10
Questions on the website: 13722361