예제 #1
0
def beer_encounter(user):
    response_list = [
        "You take a drink of sumptuous sorghum whiskey, the finest you've ever tasted.",
        "You drink some more, it's been quite a day after all.",
        "You feel at one with all of humanity, but you're also losing fine motor control.",
        "You're getting a little woozy. Are you sure this is a good idea?",
        "Your vision is starting to blur and it's hard to see the cask anymore.",
        "You can't stand.",
        "You go into a catatonic stupor. You aren't conscious for your death, but rest assured it was embarrassing."
    ]
    drink_query = "yes"
    extra_drinks = 0
    while drink_query == "yes":
        print_s(response_list[extra_drinks])
        user.attack -= 1
        if extra_drinks < 6:
            print_s("Your attack ability has been reduced to " +
                    str(user.attack) + ".")
        if extra_drinks % 2 == 1:
            user.intelligence -= 1
            print_s("Your intelligence has been reduced to " +
                    str(user.intelligence) + ".")
        if extra_drinks > 1 and extra_drinks < 6:
            user.hp -= 1
            print("Your health points have been reduced to " + str(user.hp) +
                  ".")
        if extra_drinks >= 6:
            user.hp = 0
            break
        drink_query = input_ss("Do you want to keep drinking? [yes] or [no]",
                               user)
        extra_drinks += 1
예제 #2
0
def oyster_encounter(player):
    oyster_query = input_ss(
        "As you enter the sewers...an interesting smell looms in the air that makes your stomach rumble. A giant oyster lies the on the side, but who knows how long it has been there? Do you [eat] the oyster or [keep moving]?\n\n",
        player)
    print(oys.art())

    if oyster_query == "eat":
        oyster = random.randint(-5, 5)

        player.hp += oyster

        if oyster > 0:
            print_s(
                "\nThe oyster was still good! Your hunger is sated. You gain "
                + str(oyster) + ' hp. Your total hp is ' + str(player.hp) +
                '.')
        elif oyster == 0:
            print_s(
                '\nThe oyster seemed to do very little, but at least nothing bad has happened...yet.'
            )
        else:
            print_s(
                "\nThe oyster was foul, and your stomach lurches. You lose " +
                str(abs(oyster)) + ' hp. Your total hp is ' + str(player.hp) +
                '.')

    elif oyster_query == "keep moving":
        print_s(
            "\nYou continue onward, ignoring the pang of hunger. Better not to risk it."
        )
예제 #3
0
def attempt_climb(user, climb_query):
    success = 0
    while user.hp > 0 and success == 0 and climb_query == "climb":
        success_rate = random.randrange(0, 10)
        if success_rate < 6:
            user.hp -= 2
            climb_query = input_ss(
                "You were unsuccessful scaling the wall and your health points are reduced to "
                + str(user.hp) +
                ". Do you want to attempt the [climb] again or [walk] in the door?\n",
                secrets="rope",
                user=user)
        else:
            success = 1
            print_s("You've successfully climbed through the window!")
    if user.hp <= 0:
        print_s("You really should have tried the door.")
    elif climb_query == "rope":
        print_s(
            "You deftly swing the rope over a gargoyle flanking the window and scamper up the wall like a white-faced capuchin."
        )
        success = 1
    elif climb_query == "walk":
        success = 2
    return (success)
예제 #4
0
def zookeeper_encounter(player):
    zookeeper_query = input_ss(
        "As you walk around the courtyard, you notice a menagerie of wild animals trapped in cages. A figure dressed in a ringmaster outfit hears you approach and turns around. As he faces you, you realize it's a bipedal lion! He growls at you and demands to know what you are doing in his zoo. How do you respond? [Say nothing], [run] towards the castle, [tell the truth], [lie], or make a lion [pun]?\n",
        player)
    lion = creatures.Zookeeper()
    print(lion.art())
    if zookeeper_query == "say nothing" or zookeeper_query == "Say nothing" or zookeeper_query == "run" or zookeeper_query == "tell the truth":
        monster = creatures.Animals()
        print_s(
            "The lion tells you that you do not belong here. He walks away and unlocks a dark cage...revealing a "
            + monster.name + ".")
        print(monster.art())
        player.combat(monster)
        if player.hp > 0:
            player.attack += 2
            input_s(
                "After killing a " + monster.name +
                ", you are able to fashion a weapon from its remains. Your attack has increased to "
                + str(player.attack) + ".", player)
    elif zookeeper_query == "pun":
        print_s("You tell the lion that the wizard is your 'mane' man.")
        time.sleep(5)
        print_s("an awkward 'paws' happens as the lion stares at you....")
        time.sleep(5)
        chance = random.randint(1, 20)
        if chance > 10:
            print_s(
                "The lion eventually cracks, letting out a hearty chuckle and lets you pass. As you pass he gives you a potion of lion's strength. As you drink it, you feel your muscles growing."
            )
            player.attack += 2
            input_s("Your attack has increased to " + str(player.attack) + ".",
                    player)
        else:
            monster = creatures.Animals()
            print_s(
                'The lions stares angrily at you, clearly not appreciating your pun. He walks away and unlocks a dark cage revealing...a '
                + monster.name + ".")
            print(monster.art())
            player.combat(monster)
            if player.hp > 0:
                player.attack += 2
                input_s(
                    "After killing a " + monster.name +
                    ", you are able to fashion a weapon from its remains. Your attack has increased to "
                    + str(player.attack) + ".", player)
    elif zookeeper_query == 'lie':
        monster = creatures.Animals()
        print_s(
            "You 'lion' to me? You do not belong here! He walks away and unlocks a dark cage...revealing a "
            + monster.name + ".")
        print(monster.art())
        player.combat(monster)
        if player.hp > 0:
            player.attack += 2
            input_s(
                "After killing a " + monster.name +
                ", you are able to fashion a weapon from its remains. Your attack has increased to "
                + str(player.attack) + ".", player)
    else:
        print_s('edit me')
예제 #5
0
def walk_in(player):
    opponent=creatures.Magic()
    print_s("You strut confidently through the main castle door. You enter an impressively portioned entrance hall lit by sunlight streaming through the tall mullioned windows. You briefly admire the marble statues and tapestries lining the walls.")
    input_s("You see a " + opponent.name + " taking a fighting stance ten meters in front of you.", player)
    print(opponent.art())
    player.combat(opponent)
    if player.hp>0:
        player.mana+=1
        input_s("Bomb diggity. You emerge victorious from your latest escapade. Defeating this magical creature increases your mana to " + str(player.mana)+ ".\n", player)
        print_s("At the end of the entrance hall is a magnificent pair of staircases sweeping up to the next level. ")
        stair_query=input_ss("Do you go up the stairs?[yes] or [no]\n", player)
        if stair_query=="no":
            while(stair_query=="no"):
                passive_actions=["A breeze blows gently through the windows.", "You hear the sound of birds chirping outside.", "A mouse scurrying along the wall rustles gently.", "You check your watch.", "All remains quiet in the entrance hall.", "You think about how long it must take to chisel a sculpture.", "You watch an ant crawl by on the floor.", "You contemplate what your life could have been if you hadn't gone to prison.", "You spy a new oil painting on an eas\
el and watch it dry. " ]
                index=random.randrange(len(passive_actions))
                print_s(passive_actions[index])
                time.sleep(5)
                stair_query=input_ss("Do you go up the staircase yet? [yes] or [no]\n", player)
        brownie_encounter(player)
        input_s("At the top of the stairs you enter a luxuriously decorated hallway. The thick carpet muffles th\
e sound of your footsteps. You pass several creepy old paintings and notice a door cracked to your left.", player)
예제 #6
0
def brownie_encounter(player):
    brownie_query = input_ss(
        "As you ascend the palatial stairway...an interesting smell looms in the air that makes your stomach rumble. A giant brownie lies to one side, but you have some concerning recent memories of a dodgy oyster. Do you [eat] the brownie or [keep moving]?\n",
        player)
    brownie = random.randrange(1, 5)
    if brownie_query == "eat":
        player.hp += brownie
        print_s("The brownie was still good! Your hunger is sated. You gain " +
                str(brownie) + ' hp. Your total hp is ' + str(player.hp) + ".")

    elif brownie_query == "keep moving":
        print_s(
            "You continue onward, ignoring the pang of hunger. Better not to risk it."
        )
예제 #7
0
def first_combat(player):
    first_combat_query = input_ss("You hear the heavy footfalls of an approaching hulking guard.\
 The only way to avoid confronting it is to go down the stairs. Do you [stay and fight] or [go down the stairs]?\n", player)

    if first_combat_query == "go down the stairs":
        print_s("Darwin would be proud.\n")
        decision_counter=0
        
    elif first_combat_query == "stay and fight":
        print(opponent.art())
        player.combat(opponent)
        decision_counter=2

    return(decision_counter)
예제 #8
0
def shark_game(player):
    dice = random.randint(1, 10)
    input_s(
        "As you run up the stairs toward the elusive Wizard and onto the balcony, you encounter an escaped 'mythical' creature from the menagerie - the famous talking LandShark.",
        player)
    print(shark.art())
    time.sleep(2)
    print_s(
        "The *clever* LandShark, having been on land for so long, has grown lungs and developed consumption (in addition to liver cirrhosis, for other reasons)."
    )
    decision = input_ss(
        "Do you [jump over the shark] and risk infection or [go the long way] on your quest to the wizard?",
        secrets="riddle me",
        user=player)

    if decision == "jump over the shark":
        if dice > 3:
            print_s(
                "Damn, you just signed up for a lifetime of pain and suffering, lose 3 HP."
            )
            player.hp -= 3
        elif dice <= 3:
            print_s(
                "You narrowly escaped, but why were you so foolish in the first place? Dumbass."
            )
            player.intelligence -= 2
            player.hp += 2

    elif decision == "go the long way":
        print_s("Someone knows what they're doing! Good job!")
        player.intelligence += 3
        input_s(
            "Now you have to double back to the stairs to find an alternative route and encounter the legendary, award winning Milwaukee's Best (Monster)",
            player)
        beer = creatures.Beer()
        print(beer.art())
        time.sleep(2)
        input_s(
            "To get past this monster, you must fight one of his (somewhat drunken) creatures",
            player)
        animal = creatures.Animals()
        print(animal.art())
        print_s("A wobbly " + animal.name +
                " stumbles down the stairs and attacks!\n")
        player.combat(animal)

        if player.hp > 0:
            print_s(
                "I hope you're proud of yourself, defeating a drunken " +
                animal.name +
                ". But you get to pass on to your greatest challenge yet. \n")
            fake_query = input_s("", player)

    elif decision == "riddle me":
        print_s(
            "Congrats! *coughs violently* You have uncovered my hidden riddle!"
        )
        my_puzzle = puzzles.Puzzles()
        puzzle_success = my_puzzle.do_puzzle(user=player)

        if puzzle_success == True:
            print_s(
                "Great work! You completed my riddle and are richly rewarded.")
            player.intelligence += 3
            player.attack += 2

        elif puzzle_success == False:
            print_s("Drats, you failed. But (cough) have a free pass anyway.")
예제 #9
0
파일: easter_egg.py 프로젝트: mlcenzer/PnP
def easter_egg(player):
    shelf = '''
 _________________________________________________________
||-------------------------------------------------------||
||.--.    .-._                        .----.             ||
|||==|____| |H|___            .---.___|""""|_____.--.___ ||
|||  |====|P| |xxx|_          |+++|=-=|_  _|-=+=-|==|---|||
|||==|    |E| |   | \         |   |   |_\/_|Black|  | ^ |||
|||  |    |R| | R |\ \   .--. |   |=-=|_/\_|-=+=-|  | ^ |||
|||  |    |L| |   |_\ \_( oo )|   |   |    |Magic|  | ^ |||
|||==|====| |H|xxx|  \ \ |''| |+++|=-=|""""|-=+=-|==|---|||
||`--^----'-^-^---'   `-' ""  '---^---^----^-----^--^---^||
||-------------------------------------------------------||
||-------------------------------------------------------||
||               ___                   .-.__.-===-. .---.||
||              |===| .---.   __   .---| |XX|  P  |_|^^^|||
||            /(|   |_|III|__|''|__|:x:|=|  |  Y  |=| = |||
||           / (|===|+|   |++|  |==|   | |  |  T  | |   |||
||       /\\\/ _(|===|-|   |  |''|  |:x:|=|  |  H  | |   |||
||_____  -\{___(|   |-|   |  |  |  |   | |  |  O  | | = |||
||       _(____)|===|+|[I]|DK|''|==|:x:|=|XX|  N  |=|^^^|||
||              `---^-^---^--^--'--^---^-^--^-===-^-^---^||
||-------------------------------------------------------||
||            \033[8mChoose [read] for secret room\033[8m\033[0m              ||
||_______________________________________________________||

'''

    print_s(
        "You scan the room. It appears mostly empty apart from a dusty bookshelf that seems to contain questionably old and outdated textbooks."
    )
    time.sleep(2)
    decision = input_ss(
        'You may not have time for assing about with useless scholarly nonsense, but it may prove fruitful. Do you [leave] or stay and [search]?',
        player)

    if decision == 'search':
        print(shelf)
        input_s(
            "You begin scanning the bookshelf for something entertaining and/or educational. An ancient text, bound in thousand year old embossed centaur leather, briefly catches your eye. Its title, 'Mastery of Python and Complex Systems', reminds you of an ancient teaching you once received. The effects of amnesia are taking their toll, and the memory fades.",
            player)
        book_decision = input_ss(
            'You question your existence and past life before the prison. Before you break down into an existential crisis, you [leave] the room. Or do you?\n',
            secrets="read",
            user=player)
        if book_decision == 'read':
            input_s(
                'You impulsively decide to read the book about Pythons. Perhaps in some attempt of mastering creature control? However, pulling the book from the shelf, you realise the book is no book at all. Instead, the bookshelf swings open to reveal a secret room.\n',
                player,
                color='green')
            print_s(
                "Inside, you find ancient texts and writings in languages you barely know the name of (assembly, java, and visual basic??). You study them for some time in an attempt to gain some knowledge."
            )
            hidden_room = puzzles.Puzzles()
            room_puzzle = hidden_room.do_puzzle(user=player)

            if room_puzzle == True:
                input_s(
                    "After a few hours your hard work pays off and you gain 1 intelligence, and leave the room.",
                    player)
                player.intelligence += 1

            else:
                input_s(
                    'Unfortunately your mental capacity is restricted by inactivity from your time in the cell, and you do not solve the mysteries of the ancient texts. You leave the room.',
                    player)