def runAction(self):
     act, _, _ = self.getPlace()
     #note: ticks the reactorC counter if enabled.
     status = game.updateCounter(save, "reactorC", -1)
     if status == "death":  #if reactor counter reach 0, and the game ends.
         self.running = False
     else:
         act()
def main(save):
    def newgame():
        #region NEW GAME
        save.setdata("room", "apartment")
        save.setdata("prevroom", "apartment")
        game.rolltext("""
Weeeee.. you are flying through the sky!
Below you is a beautiful forest, as green as anything you could ever imagine!
Deep down you know you are dreaming, but you can't quite get yourself to wake up.
suddenly you are in a vintage open cockpit biplane flying over the same lands...
                            **CRASH**

Your eyes shook open! Out the window you see the landscape you pictured in your dream.
It seems so nice, yet something seems off. Everything seems off.
You even struggle to remember your own name.. What.. was.. what was your name?
    """)

        nameExcuses = [
            "or maybe it was",
            "no why would.. that be my name.. no it must be ",
            "no.. ugh.. why can't I remember my name. Maybe it was",
            "no no no no! That can't be right, so it must be",
            "no, I think that's my best friend's name. wait, I got a best friend?? ugh.. what is my name??"
        ]

        inp = ""
        while True:
            inp = input()
            while len(inp) < 1:
                #while no input, silently re-request input
                inp = input()
            print()
            if game.yesno("ugh.. Was it {0}?".format(inp)):
                break
            print(random.choice(nameExcuses))
        save.setdata("name", inp)
        game.rolltext("""
Yes {0} the.. uhh.. something something title titles..
You are sure you'll remember soon enough. Your head is quite foggy.
You think you might have a headache, but you are not sure.
Looking around you see you are in a small room, an apartment maybe? Maybe a hotel room?
You are sitting on the edge of a large bed. Next to the bed is a small table.
On the table there are some small white spheres, a glass of water and two framed pictures face down
At the head end of the bed there is a window.
Towards the end of the room there is a sink with a mirror.
At the end is a door, probably the exit by the looks of it.

        """.format(save.getdata("name")))
        #endregion NEW GAME
    def sink():
        #region Sink()
        if (save.getdata("apartment:sink")):
            game.showtext("The mirror is still broken.")
        else:
            save.setdata("apartment:sink", True)
            game.rolltext("""
You walk to the sink.
You see glass shards in the sink.
The mirror is broken.
What little of yourself you can see looks like a mess.
You might want to find a proper bathroom and freshen up a bit.
            """)
        #endregion Sink
    def window():
        #region window()
        if save.getdata("apartment:window"):
            game.rolltext("""
You enjoy the holographic nature outside the window.
...
...
a holographic deer just walked past.
....
Time to go.
        """)
        else:
            save.setdata("apartment:window", True)
            game.rolltext("""
You look through the window into the lush forest landscape.
...
The nature seems oddly calming, yet somehow uncanny
...
...
As you move your head around to look form different angles, you notice a subtle lag.
...
You recognize this now.
It is a hologram.
Probably a cheap class 3 eye-tracking laser-holo, you suddenly realize.
Not that you remember what that is, or what it means.
Only that you had a class 5 back..
...
back home...
..had.. back home...
so this isn't home then...?
    """)
        #endregion window()
    def table():
        #region table()
        def glassText():
            g = save.getdata("apartment:glass")
            if g == None or g == 2:
                return "a full glass of water"
            elif g == 1:
                return "a half full glass of water"
            else:
                return "an empty glass"
            #end of glass description
        def pillsText():
            if (save.getdata("apartment:pills")):
                return ""
            else:
                return ", some small white pills"

        #end of pills description
        game.rolltext("""
You look at the nightstand table.
You see {0}{1}
and two framed pictures.
One with a cyan frame, one with a golden frame.
        """.format(glassText(), pillsText()))
        a = game.choose([
            "Glass", "Cyan framed picture", "Golden framed picture", "back off"
        ])
        if a == 0:
            g = save.getdata("apartment:glass")
            if g == None or g == 2:
                save.setdata("apartment:glass", 2)
                if (game.yesno("Take the pills?")):
                    game.showtext(
                        "You take the white pills and drink from the glass.")
                    save.setdata("apartment:pills", True)
                    save.setdata("apartment:glass", 1)
                else:
                    game.showtext("You did not take the pills")
            elif g == 1:
                print("The glass is half empty. Or is it half full?")
                if (game.yesno("Drink from the glass?")):
                    game.showtext(
                        "you drank the rest. The glass is now empty.")
                    save.setdata("apartment:glass", 0)
                else:
                    game.showtext("you left the glass alone")
            else:
                game.showtext("The glass is empty")
        elif a == 1:
            j = save.getdata("jeff")
            if (j == None):
                if (save.getdata("klara") == None):
                    j = "spouse"
                else:
                    j = "sibling"
                save.setdata("jeff", j)
                game.rolltext("""
You stare closely at the man in the cyan framed picture.
He looks familiar. Very familiar.
You seem to remember he insisted you did not need some expensive frame for his picture.
You study his features closely.
Suddenly it clicks in your mind.
You recognize him now. It is Jeff, your {0}.
                """.format(game.getGenderedTerm(j, "male")))
            else:
                game.showtext("It is Jeff, your {0}".format(
                    game.getGenderedTerm(j, "male")))
        elif a == 2:
            k = save.getdata("klara")
            if (k == None):
                if (save.getdata("jeff") == None):
                    k = "spouse"
                else:
                    k = "sibling"
                save.setdata("klara", k)
                game.rolltext("""
You stare closely at the lady in the gold framed picture.
You study her close, trying to remember who she is.
As you are looking in her eyes when you realize who she is.
Her name is Klara, you seem to remember.
Klara.. she is your {0}! 'How could you forget that?', you wonder.
                """.format(game.getGenderedTerm(k, "female")))
            else:
                game.showtext("It is Klara, your {0}".format(
                    game.getGenderedTerm(k, "female")))
        else:
            return
        table()  #repeat
        #endregion table()
    def door():
        pills = save.getdata("apartment:pills", False)
        left = save.getdata("apartment:left", False)
        #region door()
        if left:
            return True
        elif pills:
            game.rolltext("""
You walk to the door.
Your head is starting to clear up.
You open the door, and walk out.
            """)
            save.setdata("apartment:left", True)
            return True
        else:
            game.rolltext("""
You walk towards the door.
Suddenly there is a sharp spike of pain in your head.
When it is over you are back on the bed, panting.
            """)
        return False
        #endregion door()

    if (save.getdata("name") == None):
        newgame()
    choices = [
        "look out the window", "examine the table", "examine the sink",
        "go to the door", "OPEN GAME MENU"
    ]
    end = False
    while not end:
        game.showtext("You are sitting on the side of the bed")
        choice = game.choose(choices)
        if choice == 0:
            window()
        elif choice == 1:
            table()
        elif choice == 2:
            sink()
        elif choice == 3:
            if (door()):
                return save.goto("middle")
            pass
        elif choice == 4:
            if (game.gameMenu(save)):
                break
        #if room is revisited after the reactor counter has been enabled,
        #you will be wasting time here.
        status = game.updateCounter(save, "reactorC", -1)
        if status == "death":
            end = True
Exemple #3
0
    def bathrooms2(subroom):
        gender = None
        visited = save.getdata(
            "bathroom:visited",
            False)  # if the Player Character has visited the bathrooms beofore
        showered = save.getdata("bathroom:showered",
                                False)  # whatever the PC has showered
        relived = save.getdata(
            "bathroom:relived",
            False)  # whatever the PC has had the chance to relive themself
        keepsake = save.getdata(
            "spouse:keepsake", False
        )  # potential use in later chapters. Only unlockable if you have remembered who your spouse is.

        relationKlara = save.getdata(
            "klara", None
        )  #if spouse, unlocks retrival of keepsake in ladies locker-room
        relationJeff = save.getdata(
            "jeff",
            None)  #if spouse, unlocks retrival of keepsake in mens locker-room

        choices = None

        wrongroom = ""  #if the PC enters the wrong bathroom, this extra nerrative is added.
        facedesc = ""  #describes what the PC sees in the mirror (male or female)
        areadesc = ""  #describes the facilities in the room (mens or ladies)

        #This section determines PC's gender if not already set.
        if subroom == "mens":
            gender = save.getdata("gender", "male")
            if gender != "male":
                wrongroom = """
You're not exacly sure why you went into the men's room, and not the ladies' room.
Though you suppose it doesn't really matter. There is nobody here anyways."""
            areadesc = """ a line of toilet stalls, a large urinal, a few changing rooms, a locker room,
showers, couple of them private, and a dispenser of hygine products."""
            choices = (("SINK", "Spash water in your face"),
                       ("TOILET", "Visit a toilet booth"),
                       ("URINAL", "Visit the urinal"),
                       ("HYGINE_MENS", "open the hygine dispenser"),
                       ("SHOWER", "Go the the showers"),
                       ("LOCKERS", "Go to the locker room"), ("EXIT", "leave"))
        elif subroom == "ladies":
            gender = save.getdata("gender", "female")
            if gender != "female":
                wrongroom = """
A man going inside the ladies room would normally be seen as quite perverted.
But as it is, the ladies is as vacant of people as the rest of this place."""
            areadesc = """ a line of toilet stalls, a few changing rooms, a looker room, showers, couple of them private
and a hygine despenser with varius.. products..."""
            choices = (("SINK", "Spash water in your face"),
                       ("TOILET", "Visit a toilet booth"),
                       ("HYGINE_LADIES", "open the hygine dispenser"),
                       ("SHOWER", "Go the the showers"),
                       ("LOCKERS", "Go to the locker room"), ("EXIT", "leave"))
        if gender == "male":
            facedesc = "a rugged man with a stubby beard."
        if gender == "female":
            facedesc = "a tired looking woman with clear bags under they eyes."
        if not visited:
            game.rolltext("""
You enter the {0} room.{1}
Finding yourself in front of the large array of sinks and mirrors.
Some of the mirrors are broken, but you found one that was relativly intact.
You have a look at yourself.
What you see is {2}
You look about as shitty as you feel, yet it does look familiar.
That's a good thing, right?
Looking around, you see {3}
            """.format(subroom, wrongroom, facedesc, areadesc))
        else:
            game.showtext("PLACEHOLDER text for return visit to bathrooms.")
        visited = True
        save.setdata("bathroom:visited", True)
        while True:
            _, choice = game.choose2(choices, "What do you want to do?")
            if choice == "EXIT":
                game.showtext("You leave the {0} room".format(subroom))
                return
            elif choice == "SINK":
                game.showtext(
                    "You splash some water on your face. It feels refreshing.")
            elif choice == "TOILET":
                act = ""
                if (relived
                    ):  #relived = save.getdata("bathroom:relived", False)
                    act = "You sit for a bit, resting. You don't feel the need to 'do' anything."
                else:
                    act = "You relieve yourself right there and then. You must have held it in for a while without thinking about it."
                    save.setdata("bathroom:relived", True)
                    relived = True
                game.rolltext(
                    """You locate a nice toilet booth, and sit down on a porcelain throne.
                Well, ok, not porcelain, these toilets are made of metal.
                {0}
                After a while you decide it is time to get back up""".format(
                        act))
            elif choice == "URINAL":
                if relived:
                    game.showtext(
                        "you stand over by the urinal for a bit, but you don't feel any need to use it."
                    )
                elif gender == "female":
                    game.showtext(
                        "As you approach the urinal, you wondered how it was like for men to use contraptions like this."
                    )
                    if (game.yesno("Try to piss in it?")):
                        game.rolltext("""You awkwardly posision yourself,
and partially relive youself down the urinal.
It was kinda fun.
And you mostly hit the target.
mostly..

Still, having done that, you realize you have 'other' needs to relive youself of."""
                                      )
                        if (game.yesno("Take a dump in the uninal?")):
                            game.showtext(
                                "You did the deed in the urinal. you slowly back off, giggling a bit as your inner girl got her wicked wish."
                            )
                            save.setdata("bathroom:relived", True)
                            relived = True
                    else:
                        game.showtext("You left the uninal alone.")
                else:
                    game.rolltext(
                        """You instinctively unzip and relive youself down the uninal.
 it was quickly done.
 But soon you realize you have 'other' needs to relive youself of.""")
                    if (game.yesno("Take a dump in the uninal?")):
                        game.showtext(
                            "You did the deed in the urinal. you slowly back off, giggling a bit as your inner child got his very childish wish."
                        )
                        save.setdata("bathroom:relived", True)
                        relived = True
            elif choice == "HYGINE_LADIES":
                game.showtext(
                    "You examine the dispenser. You find some soaps, tampons, manual razor blades, a few female condoms. Nothing you really need right now"
                )
            elif choice == "HYGINE_MENS":
                game.showtext(
                    "You examine the dispenser. You find some soaps, condoms, razor blades. Nothing you really need right now."
                )
            elif choice == "SHOWER":
                if showered:
                    game.showtext(
                        "You go over to the showers. But you already feel clean, so you go back."
                    )
                else:
                    game.rolltext("""You enter one of the private show stalls.
You undress, and turn on the shower
You note as all the grime washes off you.
you feel a lot better now.
...
...
you dry up, dress yourself and again, and leave the shower.""")
                    showered = True
                    showered = save.setdata("bathroom:showered", True)
            elif choice == "LOCKERS":
                text = "You take a walk along the lockers."
                if keepsake:
                    text += "\nThere was not much more to see."
                elif subroom == "mens" and relationJeff == "spouse":
                    text += """
You stumble upon a familiar locker. Jeff's locker.
Your hands move on their own, it seems his locker combination is deep in your subconsius.
Inside you find a small box.
It feels important.
You take it with you."""
                    keepsake = True
                elif subroom == "ladies" and relationKlara == "spouse":
                    text += """
You stumble upon a familiar locker. Klara's locker.
Your hands move on their own, it seems her locker combination is deep in your subconsius.
Inside you find a small box.
It feels important.
You take it with you."""
                    keepsake = True
                else:
                    text += "\nThere was not much to see."
                save.setdata("spouse:keepsake", keepsake)
                game.rolltext(text)
            status = game.updateCounter(save, "reactorC", -1)
            if status == "death":  #if reactor counter reach 0, and the game ends.
                break
def core(save):
    intro = ""
    proom = save.getdata("prevroom")
    if (proom == "ladder"):
        intro = """
As you push off from the laddershaft, you fly upwards in the low gravity.
You reach the center, finding yourself entierly weightless.
You take hold on a rotating pole. Soon the pole seemed to stop rotating, and the room started rotating around you.
You see the ladder you came out from now no longer as "down", but as part of the wall.
From your perspective, "up" has become a set of reinforced windows at one end of the sphere.
"Down" has become a large open doorway, with a sign lableing it "airlock".
That being said, had you turned yourself the other way, it would be the other way around.

As the room spins around you, you take note of the clearly labled entry points around you.
        """
    else:
        intro = """
You float mindlessly around in the huge sphere untill you get a hold on a spinning pole in center.
Soon the pole seemed to stop rotating, and the room started rotating around you.
As the room spins around you, you take note of the clearly labled entry points around you.
        """
    game.rolltext(intro)
    choices = (("WINDOW", "Core window"), ("ELEVATOR_SEC_A",
                                           "Section A transport elevator"),
               ("LADDER_SEC_B", "Section B emergency access ladder"),
               ("ELEVATOR_SEC_C", "Section C transport elevator"),
               ("LADDER_SEC_D", "Section D emergency access ladder"),
               ("AIRLOCK", "Module primary airlock and dock"),
               ("GAMEMENU", "OPEN GAME MENU"))
    running = True
    while running:
        _, choice = game.choose2(choices)
        if choice == "GAMEMENU":
            if (game.gameMenu(save)):
                break
        elif choice == "WINDOW":
            if save.getdata("core:window", False):
                text = """
You look back at the window area. The window is closed by the huge metal shutter.
You still hear the occational clang and bang.
You decide not to get closer, just in case.
                """
            else:
                text = """
You climb, or rather push and drag your way to the window at one end of the pole.
The pole connected to a set of handrails, rotating with the wall.
It was a awkward transision, but you are now looking out a solid thick window."""
                if (save.getdata("apartment:window")):
                    text += """
Unlike the 'window' in the room you woke up in, this window was at least not holographic.
You could tell by the lack of lag when you moved your head, the large solid sliding shutters on both sides of the window
uh and the fact you are looking out into space, and not an idyllic forest."""
                else:
                    text += """
The window gives you a great view into space, it is quite impressive view.
You take note of the large solid sliding shutters on both sides of the window."""
                text += """
You took some time to enjoy the view.
...
.....
... ...
Some debris hit the solid window.
You figure this was your cue to leave and focus on the imminent threat on hand.
...
As you push and drag your way back, you hear a odd bang.
Then an alarm starts howling.
You look back, and see the shutters close.
You hear more bangs, debris hitting the shutters.
Might be a good idea to get out of there.
                """
                save.setdata("core:window", True)
            game.rolltext(text)
        elif choice == "ELEVATOR_SEC_A":
            game.rolltext("""
You look at the elevator access rotating around.
A huge A is painted on it.""")
            if (game.yesno("Float over to it?")):
                dialoges.elevator(save)
        elif choice == "ELEVATOR_SEC_C":
            game.rolltext("""
You look at the elevator access rotating around.
A huge C is painted on it.""")
            if (game.yesno("Float over to it?")):
                game.rolltext("""
You push off and float to the elevator.
When you got there, you noticed a flashing electoric board flashing a read light and the text:
BRECH DETECTED! NO ACCESS!
You took off back to the pole.""")
        elif choice == "LADDER_SEC_B":
            game.rolltext("""
You look over to the ladder access rotating around.
It has a huge B painted on it.
float over to it?""")
            if (game.yesno("Float over to it?")):
                save.goto("ladder")
                running = False
        elif choice == "LADDER_SEC_D":
            game.rolltext("""
You look over to the ladder access rotating around.
It has a huge D painted on it.
float over to it?""")
            if (game.yesno("Float over to it?")):
                game.rolltext("""
You push off and float to the ladder.
When you got there, you noticed a flashing electoric board flashing a read light and the text:
BRECH DETECTED! NO ACCESS!
You took off back to the pole.""")
        elif choice == "AIRLOCK":
            game.rolltext("""
You look "down" towards the huge door "below".
Taking in the details, you see the pole ending a bit before it, splitting into 4 aches around the doorway.
Like the pole itself, the doorway was fixed, and not rotating with the room.
On a closer look, there is a secund doorway past it, and two more again, with only some small gap of room between them.
The inner-most door are closed, but has some large windows where you can see the area past it, clearly.
            """)
            if not game.yesno("Take off towards the doorway?"):
                continue
            game.rolltext("""
You rotate yourself so the doorway was now "above" you.
You take off, pushing and dragging along the pole untill you reach the doorway.
            """)
            if not game.yesno("enter the doorway?"):
                game.rolltext("""
For whatever reason, you decide to drag yourself back to the pole.
As you turned around, you noticed some people float into view on the, with confused looks.
                """)
                continue
            game.rolltext("""
You enter through the first two doorways.
you note the middle section between the doors were diffrent than the other two.
It was shorter and had a seam down the middle.
As you were floating though, you were greeted by someone who suddenly floated into view.
            """)
            save.goto("cargobay")
            running = False
            return

        status = game.updateCounter(save, "reactorC", -1)
        if status == "death":  #if reactor counter reach 0, and the game ends.
            running = False
Exemple #5
0
        def chamberRoom():
            key = save.getdata("auxcom:stasispasskey", False)
            visited = save.getdata("inner:stasisroom:" + str(num), False)
            peopleSaved = save.getdata("stasis:peopleSaved", 0)
            if key == False:
                game.rolltext("""
A panel of the door indicates the chamber is closed down by emergency lockdown.
You would need an override key to open it.""")
                game.updateCounter(save, "reactorC", 1)  #refunded time cost.
                return
            elif visited:
                game.showtext("You have already cleared this chamber.")
                game.updateCounter(save, "reactorC", 1)  #refunded time cost.
            else:
                if num == 0:
                    game.rolltext("""
You enter the chamber, checking each of the stasis tubes.
Most of them are empty. But not all.
So many dead people.
Dead..
Empty, empty, dead,
empty, empty..
You were about to give up when one chamber your almost passed as empty had someone inside it.
You activated the emergency defrost, and resuced a small child.
You told the kid to evacuate.
                    """)
                    peopleSaved += 1
                elif num == 1 or num == 7 or num == 11:
                    game.rolltext("""
You enter the chamber, checking each of the stasis tubes.
Only some of them are empty.
So many people are dead.
You found 17 people alive.
As you retrived them, none of them were in any condition to help you out.
You just told them to evacuate as you hurried on with your business.
                    """)
                    peopleSaved += 17
                elif num == 2 or num == 6:
                    game.rolltext("""
You enter the chamber, checking each of the statis tubes.
All of them are empty!
Well, that's good news.
                    """)
                    peopleSaved += 0
                elif num == 3:
                    game.rolltext("""
You enter the chamber, you were about the check the tubes when you stumbed on someone.
A man. He is unconscious, but alive.
You decide to ingore him for now, to check on the stasis tubes.
In this chamber, it seems a number of the people died during the emergency wakeup.
You found 4 people still alive in stasis.
You brought them out. It took a moment, but you them to help the unconscious man to evacuate.
                    """)
                    peopleSaved += 5
                elif num == 4 or num == 9:
                    game.rolltext("""
You enter the chamber, checking each of the chambers.
What you saw almost mad.. scatch that. it did make you puke.
All of them were dead. All of them.
                    """)
                    peopleSaved += 0
                elif num == 5:
                    game.rolltext("""
The room is chamber with smoke! You fight your way though taking longer
than normal to check all the tubes.
It seems the automatic system that was supposed to wake this group shut itself down
due to the smoke. This smoke would likly kill anyone coming out of stasis unasisted.
That might have been a mixed blessing, as you found most of the occupants still alive.

You took care to help everyone out of stasis, and on their way out to evacuate.
                    """)
                status = game.updateCounter(save, "reactorC", -1)
                peopleSaved += 45
                if status == "death":  #if reactor counter reach 0, and the game ends.
                    nav.running = False
                    return
                elif num == 8 or num == 10:
                    game.rolltext("""
You enter the chamber checking each tube.
A found a uneasy number of dead people.
But 12 people were still alive to be revived from stasis.
                    """)
                    peopleSaved += 12

            save.setdata("inner:stasisroom:" + str(num), True)
            save.setdata("stasis:peopleSaved", peopleSaved)