def try_your_luck(): global player_luck if player_hit is True: if menus.random_cube_double() > player1.luck: monster.health += 1 player_luck = False else: monster.health -= 2 player1.luck -= 1 player_luck = True else: if menus.random_cube_double() > player1. luck: player1.health -= 1 player_luck = False else: player1.health += 1 player1.luck -= 1 player_luck = True begin(player1)
def strike(): os.system('clear') global player_hit while True: player1_dexter = menus.random_cube_double() + player1.dexterity monster_dexter = menus.random_cube_double() + monster.dexterity if player1_dexter > monster_dexter: print('\nYou hit the monster') player_hit = True monster.health -= 2 break elif player1_dexter < monster_dexter: print('\nThe monster hit you') player_hit = False player1.health -= 2 break after_fight = Menu(menus.strike_submenu) after_fight.menu_summary()