def Act(enemy, pokemon, enemyHP, enemyType):
num = round(random.uniform(0.95, 1.75), 2)
print(MoveList)
Move1 = input("Choose your attack! Input a number from 1-4, depending on the order of your moves. Input 5 to view everyone's stats! \n")
if Move1 == "1":
Move1 = str(MoveList[0])
attacked = True
dmg = 10 * num
Move1 = MoveList[0]
print(pokemon + " used " + Move1 + "! \n")
enemyHP -= dmg
print("It dealt " + str(dmg) + " damage to " + enemy + "! \n")
print(enemy + " is now at " + str(enemyHP) + " HP!")
return enemyHP
while battling == true:
Act(RivalPKMN, starter, RivalHP, RivalType)
This function takes an input from the player, does a move, and deducts HP from the function parameter enemyHP (similar to Pokemon). However, after doing an input again, the enemyHP value does not update to what it was after the first move.
I tried using return statements but I'm not really sure what or where the problem even is.
Here's an example of how it looks:
Litten used Scratch!
It dealt 10.5 damage to Quaxly!
Quaxly's HP is now 44.5!
The second time I run the function it inputs the exact same thing without updating the HP value to what it was after the first move was done.