Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
def tavern_play(player):
    print("\nShady looking guy sits at the table.")
    if player.money >= 10:
        choice = input("Do you want to play traveler? (yes/no): ").lower()
        if choice == 'y' or choice == 'yes':
            print("Let's play then!")
            print(gascii.dice_art())
            npc_roll = dice.roll_dice()
            player_roll = dice.roll_dice()
            if player_roll > npc_roll:
                print("Shady guy: Not bad. Lucky bastard.")
                print(gascii.moneyz())
                player.money += 10
                enter_the_tavern(player)
            elif player_roll < npc_roll:
                print("Too bad!")
                print(gascii.sad_smiley())
                player.money -= 10
                enter_the_tavern(player)
            else:
                print("Shady guy: Draw? What a pity. \n  ¯\_(ツ)_/¯")
                enter_the_tavern(player)
        elif choice == 'n' or choice == "no":
            print("Shady guy makes angry face and screams 'don't bother me then' and hits you in the face")
            print(gascii.sword_art())
            player.life -= 10
            print(f"{player.name} lost 10 hit points.")
            enter_the_tavern(player)
        elif choice == "stats":
            commands.my_stats(player)
            tavern_play(player)
        else:
            commands.typo()
            tavern_play(player)
    else:
        print(f"Shady guy: You need at least 10 gold coins to play with me and you have only {player.money}. Go away!")
        enter_the_tavern(player)
    enter_the_tavern(player)
Beispiel #4
0
def starting_path(player):
    print(gascii.start_loc_view())
    print(
        "You wake up in the forest. It isn't dense. Small sign nearby shows three routes:\n"
        "'city', 'river' and 'mines'. However under is another sign with information that mines are closed."
    )
    choose = input(
        "Where ya go? Or maybe do you wanna look around? (city/river/look): "
    ).lower()
    if choose == 'city':
        return 'city'
    elif choose == 'river':
        return 'river'
    elif choose == 'stats':
        commands.my_stats(player)
        starting_path(player)
    elif choose == 'look':
        print(
            "You look around. Notice small hut. Inside you meet weird gobling wearing medical smock. He wants to play a game."
        )
        print("""
               ,      ,
              /(.-""-.)\ 
          |\  \/      \/  /|
          | \ / =.  .= \ / |
          \( \   o\/o   / )/ 
           \_, '-/  \-' ,_/
             /   \__/   \ 
             \ \__/\__/ / 
           ___\ \|--|/ /___
         /`    \      /    `\ 
        /       '----'       \ \n       
        """)
        print(
            "Goblin: Oh interesting creature stumbled by my study. Tell you what bud! Wanna get easy money?"
        )
        print(f"{player.name}: Free money! Yaaay!")
        print(
            "Goblin: Hold ya horses pal. If you wanna this money ya have to play dice with me. If ya win ya get 50 gold coins, if ya lose I'll take ya kidney. And after wards you will go to city."
        )
        goblin_choice = input(
            f"Goblin: So will you play with me {player.name}?\nThis time you can't use 'stats' to check what ya got. (yes/no) "
        )
        if goblin_choice == "yes" or goblin_choice == "y":
            goblin_roll = dice.roll_dice()
            player_roll = dice.roll_dice()
            if goblin_roll > player_roll:
                print(
                    f"Oh you loose {player.name}. I'm taking your kidney then!"
                )
                print("""
                 ______________________________ ______________________
                |                              | (_)     (_)    (_)   \ 
                |                              |  __________________   }
                |..........................____|_(                  )_/              
                """)
                player.life = 50
                return "city"
            elif goblin_roll < player_roll:
                print(
                    f"Damn you {player.name}. You win this time, here's your money!"
                )
                print(gascii.moneyz())
                player.money = 100
                return "city"
            else:
                print(
                    "Draw. What a shame. I'll take some of your hairs and have some money"
                )
                print(gascii.moneyz())
                player.money = 60
                player.life = 90
                return "city"
        else:
            print("I see you are a coward! Scared of little, weak goblin?")
            print(
                "That hits your morale, but you proceed to the city scared of green psycho"
            )
            player.life -= 10
            return "city"
    else:
        commands.typo()
        starting_path(player)