subject
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

ansver
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 19:30, 10040813
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
image
Engineering, 04.07.2019 19:10, nida7864
An engine, weighing 3000 n, is supported on a pedestal mount. it has been observed that the engine induces vibration into the surrounding area through its pedestal at the maximum operating speed. determine the stiffness of the dynamic vibration absorber spring in (n/m) that will reduce the vibration when mounted on the pedestal. the magnitude of the exciting force is 250 n, and the amplitude of motion of the auxiliary mass is to be limited to 2 mm note: in this question type-in right numbers, no decimals, no fractions, no unit. approximate to right number if needed
Answers: 3
image
Engineering, 06.07.2019 02:30, heavenwagner
A12 mm diameter shaft runs in a plain cylindrical bush 30 mm long that is located in an 18 mm diameter hole in a housing. the shaft-inner bush fit is h8 f and the outer bush-housing fit is h7-p6. make a fully cimensioned sketch of the bush with tolerances. find the maximum and minimum clearance or interference for both fits on the inner and outer diameters of the bush
Answers: 3
image
Engineering, 06.07.2019 03:10, tatedason33741
Asolid steel sphere (k=63.9 w m-1 k-1 , ? =7832 kg m-3 , c=0.523 kj kg-1 k-1 ), 100 mm in diameter is initially at a uniform temperature of 500o c and is suddenly quenched in a large oil bath for which t? = 100o c and h = 3200 w m-2 k-1. estimate the time required for the sphere to cool to 200o c and to 110o c
Answers: 1
You know the right answer?
Now we want a way to make our monsters fight!
before two monsters can fight, we need to give...

Questions in other subjects:

Konu
Mathematics, 13.07.2019 12:00