I have been trying to make a game with combat speed enemy dodging crit and misses, I first made the crit, miss and general attack I managed to create some code for the dodge that does work, but my set basic damage (for every attack that isn’t a crit/miss/dodge) (15) won’t work it will either not give damage except for crit, or it will give an int that isn’t 15 I have tried to reposition the code to see if it made a difference or changed whether or not the code would actually work, last time I checked it worked without speed being in: else but I am really trying to keep speed as a stat in the game.
code below:
health = 250
energy = 100
h_potion = 10
e_potion = 10
easy_enemy_1_health = 50
easy_fight_1 = True
while easy_fight_1 == True:
print(" <(__)> I I I")
print(" I / I _I_/")
print(" ^ ^/ I")
print(" /–/\ /I")
print("/ / / I")
print("Health: " + str(health))
print("Energy: " + str(energy))
print("Health potion(s): " + str(h_potion))
print(“Energy potion(s): " + str(e_potion))
print(“Minor Demon health: " + str(easy_enemy_1_health))
print(”#1: attack[1 energy], 2#: special attack[5 energy], 3#: health potion[30 health], 4#: energy potion[15 energy]”)
easy_action_1 = input("what shall you do: ")
if easy_enemy_1_health > 0:
print(“He lunges forward and strikes at you for 15 damage”)
health = health - 15
if easy_action_1 == "1" or "attack" in easy_action_1 or "fight" in easy_action_1:
energy = energy - 1
normal_damage = randint(0, 50)
speed = 50
if normal_damage == 50:
normal_damage = 30
print("Wow I'm surprised that you could land a critical hit!")
elif normal_damage == 0:
normal_damage = 0
print("They are standing right infront of you and you missed ... HOW!")
elif speed == 50:
dodge = randint(0,50)
if dodge >= 30:
print("you attack for " + str(normal_damage) + " damage!")
easy_enemy_1_health = easy_enemy_1_health - normal_damage
elif dodge <= 20:
hit = randint(0,25)
if hit >= 15:
print("you attack for " + str(normal_damage) + " damage!")
easy_enemy_1_health = easy_enemy_1_health - normal_damage
elif hit < 15:
normal_damage = 0
print("He dodged your attack, speed it up a little.")
elif dodge == 0:
normal_damage = 0
print("He dodged your attack, speed it up a little.")
else:
normal_damage = 15
it would be great if you could help, thanks in advance, Venus.