예제 #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)
예제 #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)
예제 #3
0
def cave_wolf_encounter(player):
    opponent_life = 5
    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("Oh no, you are dead! X_X")
    elif opponent_life <= 0:
        prize = dice.roll_dice() * 11
        player.money += prize
        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)
예제 #4
0
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)