weapon_damage = 10 armor_protection = 10 health = 100 dogde_boost = 1 hit_bonus = 1 import random enemy = random. randint(1, 3) if enemy == 1: enemy_name = 'troll' enemy_health = 200 enemy_damage = 40 elif enemy == 2: enemy_name = 'witch' enemy_health = 100 enemy_damage = 30 elif enemy == 3: enemy_name = 'golem' enemy_health = 400 enemy_damage = 50 print('You have encounterned a', enemy_name, '!') print('') print('The', enemy_name, 'attacks you!') print('') while health > 0: print('Type 1 to dodge (You have a', 33*dogde_boost, 'percent chance to dodge)') print('Type 2 to do nothing (You will take 25 percent less damage)') dogde_action = int(input('Choose action: ')) if dogde_action == 1: if random. randint(1, 100) < 33*dogde_boost: print('You dodged the attack!') else: print('You failed to dodge') health = health-(enemy_damage-armor_protection) print('You took', (enemy_damage-armor_protection), 'damage!') elif dogde_action == 2: health = health-(3*(enemy_damage-armor_protection)/4) print('') print('Type 1 to stab the enemy', '(', 70*hit_bonus, 'percent chance to hit)') print('Type 2 to slash', '(', 50*hit_bonus, 'percent chance to hit)') attack_action = int(input('Choose action: ')) if attack_action == 1: if random. randint(1, 100) < 70*hit_bonus: print('You hit the enemy. You dealt', weapon_damage*attack_action, 'damage') else: print('You failed to hit the enemy!')