Engineering
Engineering, 27.11.2019 23:31, keidyhernandezm

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, non

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, caitlynnpatton1208
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
image
Engineering, 04.07.2019 18:10, dval1146
You are making beer. the first step is filling the glass carboy with the liquid wort. the internal diameter of the carboy is 15 in., and you wish to fill it up to a depth of 2 ft. if your wort is drawn from the kettle using a siphon process that flows at 3 gpm, how long will it take to fill?
Answers: 1
image
Engineering, 04.07.2019 18:10, katelynn73
Atmospheric air has a temperature (dry bulb) of 80° f and a wet bulb temperature of 60° f when the barometric pressure is 14.696 psia. determine the specific humidity, grains/lb dry air. a. 11.4 c. 55.8 d. 22.5 b. 44.1
Answers: 1
image
Engineering, 04.07.2019 18:10, QueenLife4869
Awall of 0.5m thickness is to be constructed from a material which has average thermal conductivity of 1.4 w/mk. the wall is to be insulated with a material having an average thermal conductivity of 0.35 w/mk so that heat loss per square meter shall not exceed 1450 w. assume inner wall surface temperature of 1200°c and outer surface temperature of the insulation to be 15°c. calculate the thickness of insulation required.
Answers: 3
Do you know the correct answer?
Now we want a way to make our monsters fight!
before two monsters can fight, we need to give...

Questions in other subjects: