def ending_game(player): print(gascii.knight_art()) opponent_life = 666 while player.life > 0 and opponent_life > 0: if moving.end_game(player) == "Player win": opponent_life -= player.weapon print( f"{player.name} hits Black Knight for {player.weapon} points! Black Knight has {opponent_life} hit points left.") elif moving.end_game(player) == "Black Knight win": player.life -= 10 print(f"{player.name} takes hit for 10 points. You have {player.life} hit points left.") else: print(moving.end_game(player)) if player.life == 0: print(gascii.you_died()) elif opponent_life <= 0: prize = dice.roll_dice() * 666 player.money += prize print(f"{player.name} has killed Black Knight and found {prize} gold coins. " f"Now {player.name} has {player.money} gold coins and {player.life}/100 hit points left.") print(f"{player.name} feeling strong walks away from dead Black Knight.") player.quest = 3 print( f"Exhausted {player.name} goes to tavern to drink to death.") print("You win? I made mistake then it shouldn't be possible!")
def cave_wolf_encounter(player): opponent_life = 5 print(gascii.wolf_view()) input("Just press anything to start fight (and confirm with ENTER).") while player.life > 0 and opponent_life > 0: if moving.encounter(player) == "Player win": opponent_life -= player.weapon print( f"{player.name} hits wolf for {player.weapon} points! Wolf has {opponent_life} hit points left." ) elif moving.encounter(player) == "Opponent win": player.life -= 10 print( f"{player.name} takes hit for 10 points. You have {player.life} hit points left." ) else: print(moving.encounter(player)) if player.life == 0: print(gascii.you_died()) elif opponent_life <= 0: prize = dice.roll_dice() * 11 player.money += prize print(gascii.moneyz()) print( f"{player.name} has killed wolf and found {prize} gold coins. " f"Now {player.name} has {player.money} gold coins and {player.life}/100 hit points left." ) print(f"{player.name} feeling strong walks back towards river bank.") river_cave_02(player)
def river_troll_fight2(player): opponent_life = 10 input("Just press anything to start fight (and confirm with ENTER).") while player.life > 0 and opponent_life > 0: if moving.encounter(player) == "Player win": opponent_life -= player.weapon print( f"{player.name} hits troll for {player.weapon} points! Troll has {opponent_life} hit points left." ) elif moving.encounter(player) == "Opponent win": player.life -= 10 print( f"{player.name} takes hit for 10 points. You have {player.life} hit points left." ) else: print(moving.encounter(player)) if player.life == 0: print(gascii.you_died()) elif opponent_life <= 0: prize = dice.roll_dice() * 20 player.money += prize print(gascii.moneyz()) print( f"{player.name} has killed troll and found {prize} gold coins. " f"Now {player.name} has {player.money} gold coins and {player.life}/100 hit points left." ) print(f"{player.name} feeling strong walks back towards river bank.") player.quest = 2 print( f"Exhausted {player.name} leaves the cave. It's time to go back to the city to get reward from the order, isn't it?" ) river_direction(player)
def game_over(player): print(gascii.you_died()) he_ded = input( f"Well better luck next time {player.name}. Do you want to try again? (yes/no) " ).lower() if he_ded == "yes" or he_ded == "y": return "re_do" elif he_ded == "stats": print( f"Are you kidding me? This is no time to check your stats. Here is one that matters: {player.life} hp left!" ) game_over(player) elif he_ded == "no" or he_ded == "n": return "gg" else: typo() game_over(player)
def river_direction(player): decision = input( "You are near the river bank. You can go north or east. Or travel somewhere else. (north/east/travel) " ).lower() if decision == "north": print("You found cave entrance. You can't see too far inside.") if player.quest == 1: river_cave_01(player) elif player.quest == 0: print( "You hear roar coming from dark cave. You don't feel like going inside!" ) river_direction(player) elif player.quest == 2: print( "You have already dealt with troll living in this cave. No need to go there again." ) river_direction(player) elif decision == "east": print( "On the small green grassland. You see small birds called Scavengers running around." ) print(gascii.scav_view()) encounter_choice = input( f"{player.name} do you want to attack scavenger? Remember you have {player.life} hit points, " f"{player.weapon} attack points. (attack/back) ") if encounter_choice == "attack": print("You jump on the one of the scavengers.") opponent_life = 3 while player.life > 0 and opponent_life > 0: if moving.encounter(player) == "Player win": opponent_life -= player.weapon print( f"{player.name} hits Scavenger for {player.weapon} points! Scavenger has {opponent_life} hit points left." ) elif moving.encounter(player) == "Opponent win": player.life -= 10 print( f"{player.name} takes hit for 10 points. You have {player.life} hit points left." ) else: print(moving.encounter(player)) if player.life == 0: print(gascii.you_died()) elif opponent_life <= 0: prize = dice.roll_dice() * 10 player.money += prize print( f"{player.name} has killed Scavenger and found {prize} gold coins. " f"Now {player.name} has {player.money} gold coins and {player.life}/100 hit points left." ) print( f"{player.name} feeling strong walks back towards river bank." ) river_direction(player) elif encounter_choice == "back": print("You quiletly move back.") river_direction(player) else: print("Please input text according to the bracketed words.") river_direction(player) elif decision == "stats": commands.my_stats(player) river_direction(player) elif decision == "travel": to_travel = moving.where_to_go_river() if to_travel == "city": city.city_direction(player) elif to_travel == "stay": river_direction(player) else: commands.typo() river_direction(player)