I can't seem to know a solution to how my_damage
can create a new random
value.
That's because while
keeps the random.randrange
the same.
So let's say:
my_damage = random.randrange(40, 45)
Then we add the combat formula:
jack_health = (jack_health + jack_defense) - my_damage
print(deskemon + " HAVE INFLICTED " + str(my_damage) + " TO CHIPHEAD")
Then this comes out:
LILWILLY HAVE INFLICTED 41 TO CHIPHEAD
CHIPHEAD HAS 261 HITPOINTS LEFT!
...
...
...
CHIPHEAD HAVE INFLICTED 5 TO LILWILLY
LILWILLY HAS 261 HITPOINTS LEFT!
BATTLE MENU:
(1) ATTACK
(2) SPECIAL ATTACK
> 1
LILWILLY HAVE INFLICTED 41 TO CHIPHEAD
CHIPHEAD HAS 222 HITPOINTS LEFT!
...
...
...
CHIPHEAD HAVE INFLICTED 5 TO LILWILLY
LILWILLY HAS 222 HITPOINTS LEFT!
Everytime, I use the code, the random
value stays the same, it doesn't change.
I know a solution but because my_damage
can be changed via input
to 4 other random
values earlier in my program, I cannot use this:
jack_health = (jack_health + jack_defense) - random.randrange(20, 25)
print(deskemon + " HAVE INFLICTED " + str(random.randrange(20, 25)) + " TO CHIPHEAD")
Notes:
Here's entire code in pastebin.com if you need information: http://pastebin.com/iij5C16z