function introduction()
    msnMgr:addHeader("If this location wasn't programmed into the ship's maps, it wouldn't have even been worth slowing down for. Sensors detect no signs of life, no obvious fuel sources, not even any obvious carbon-based material for the food replicator. It's a dead world. The precise target, however, seems to be the large moon in orbit around the planet. No more alive, but slightly more interesting.")
    msnMgr:addHeader(" ")
    msnMgr:addHeader("The crew clambers up into the top of the ship and prepares the shuttle for a lunar landing. Once a trajectory is plotted, the magnetic couplings are released, and the shuttle gently eases loose from the main body of the ship in a process the crew has grimly referred to as \"decapitation\". Doesn't hurt you a bit, and anyway everything responsible for \"you\" is currently much lower on the body of the ship. You don't need a \"head\" to survive.")
    msnMgr:addHeader(" ")
    msnMgr:addMessage("As you adjust speed and angle to keep the ship in a stable orbit, the shuttle closes in on the surface of the moon. As cameras and sensors come online, it becomes clear that this is definitely the right place, or at least an interesting one. Giant lines, many kilometers long, are carved into the lunar surface. Like the Nazca lines on Earth, but actually visible from space. The crew can make out at least three sets of straight crossed lines with a large arc below them.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("Clearly the lines are not natural. But what do they indicate? Why is this little moon, of all places, the first destination on the ship's maps? There's no logic behind it as far as you can tell. Perhaps the crew can figure it out.")
    msnMgr:addMessage(" ")
end

function spotFace()
    if (GenialCrew ~= -1) then
        if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(GenialCrew, "social")) then
            GenialName = charMgr:getCharColoredName(GenialCrew)
            msnMgr:addMessage(GenialName .. " squints a little, then breaks out into laughter. Is it space madness? It seems not. They wipe a tear away and point. \"Look, two eyes, a nose, and a mouth. It's a big smiley face.\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("It's something of a stretch, perhaps, but they're right. There's a smiley face to be seen there. Whether it was intentional or this is just pareidolia remains to be seen, but for a brief time spirits are raised.")
            msnMgr:addMessage(" ")
        end
    elseif (ObservantCrew ~= -1) then
        if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(ObservantCrew, "social")) then
            ObservantName = charMgr:getCharColoredName(ObservantCrew)
            msnMgr:addMessage(ObservantName .. " squints a little, then breaks out into laughter. Is it space madness? It seems not. They wipe a tear away and point. \"Look, two eyes, a nose, and a mouth. It's a big smiley face.\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("It's something of a stretch, perhaps, but they're right. There's a smiley face to be seen there. Whether it was intentional or this is just pareidolia remains to be seen, but for a brief time, spirits are raised.")
            msnMgr:addMessage(" ")
        end
    end
end

function spotPlateau()
    if (ObservantCrew ~= -1) then
        if (msnMgr:random() % msnMgr:getDiffScale(15,20,25) <= charMgr:getCharAttr(ObservantCrew, "mental")) then
            ObservantName = charMgr:getCharColoredName(ObservantCrew)
            msnMgr:addMessage(ObservantName .. " scratches their head a bit and starts sketching something in mid air with their finger.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("\"I bet it's a map of some sort,\" they say. \"A face map. The X's that make up the eyes are angled, but the nose is straight up and down, like a plus sign. And if you draw lines from each of the X's up to where they intersect... they all point towards a fourth spot, unmarked. Right about here.\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage(ObservantName .. " runs their finger across a map on a touchscreen and taps in a spot that appears empty.")
            msnMgr:addMessage(" ")
            if (charMgr:hasMemento(ObservantCrew, "story1_face_map") ~= true) then
                charMgr:giveMemento(ObservantCrew, "story1_face_map")
            end
            SeenHidden = true;
        end
    else
        msnMgr:addMessage("The shuttle finishes its entry sequence. Time to choose a landing site.")
        msnMgr:addMessage(" ")
    end
end

function buildExploreOptions()
    if(Seen[1]) then
        msnMgr:buildLockedChoice("Explore the leftmost site")
    else
        msnMgr:buildChoice("Explore the leftmost site")
    end

    if(Seen[2]) then
        msnMgr:buildLockedChoice("Investigate the center site")
    else
        msnMgr:buildChoice("Investigate the center site")
    end

    if(Seen[3]) then
        msnMgr:buildLockedChoice("Check out the rightmost site")
    else
        msnMgr:buildChoice("Check out the rightmost site")
    end

    if (SeenHidden == true) then
        if(Seen[4]) then
            msnMgr:buildLockedChoice("Head for the unmarked site")
        else
            msnMgr:buildChoice("Head for the unmarked site")
        end
    end
    msnMgr:finalizeChoice()
end

function leftLandingSite()
    msnMgr:addMessage(" ")
    msnMgr:addMessage("The shuttle veers to port and descends towards the curious mark to its left. The marking seems just slightly larger than the other two, although it's hard to tell without more precise measurements that you don't have time for. All the crew can tell really is that it's many kilometers long, which they already knew.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("The surface near the center of the marking seems fairly flat and stable, but is covered in several inches of powdery white dust that scatters in all directions as the shuttle lands. It seems safe enough out there; visibility is lowered, but inside atmospheric suits the crew will be breathing recycled air anyway. No need to wait. You tell them to spill outside and get accustomed to the lower-than-expected gravity.")
    msnMgr:addMessage(" ")

    msnMgr:buildChoice("Analyze some soil samples")
    msnMgr:buildChoice("Explore the area")
    msnMgr:finalizeChoice()
    if(not waitUserInput(choices)) then
        return
    end

    LeftChoice = msnMgr:getChoiceResponse(choices)
    choices = choices + 1

    msnMgr:addMessage(" ")

    CrewRemaining = charMgr:depCrewLeft()
    if (CrewRemaining >= 2) then
        if (LeftChoice == 0) then
            msnMgr:addMessage("There's plenty of soil to analyze, seeing as it's in a giant cloud around the shuttle; in fact it's so dense that visibility is restricted to about five meters out. However there's nothing special about the dust itself, really. Scans say it's silica-based, semi-abrasive, but not enough to immediately damage the ship or crew that you can tell. That's about it.")
            msnMgr:addMessage(" ")
        elseif (LeftChoice == 1) then
            msnMgr:addMessage("There's a lot of ground to cover, and no obvious large features to guide the crew. They could cover more ground, faster, if they split up. Or they could stay close and just explore around the shuttle.")
            msnMgr:addMessage(" ")
        end

        if (LonerCrew ~= -1) then
            LonerName = charMgr:getCharColoredName(LonerCrew)
            msnMgr:addMessage(LonerName .. " says \"Not going to get anywhere just walking in circles around the shuttle holding hands. There's clearly nothing here. We could split up. Each walk a thousand paces in different directions, turn around and come right back, then report.\"")
            msnMgr:addMessage(" ")
        end

        if (SoldierCrew ~= -1) then
            SoldierName = charMgr:getCharColoredName(SoldierCrew)
            if (SoldierName ~= LonerName) then
                msnMgr:addMessage(SoldierName .. " thinks that staying near the shuttle is probably the safest option.")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("\"There are no life readings, but there's plenty of other things that might be out there. Robots, non-carbon-based lifeforms, who knows. Wouldn't even see it coming.\"")
                msnMgr:addMessage(" ")
            end
        end

        msnMgr:buildChoice("Search farther out")
        msnMgr:buildChoice("Stay near the shuttle")
        msnMgr:finalizeChoice()
        if(not waitUserInput(choices)) then
            return
        end

        LeftExplorationChoice = msnMgr:getChoiceResponse(choices)
        choices = choices + 1

        msnMgr:addMessage(" ")

        if (LeftExplorationChoice == 0) then
            msnMgr:addMessage("With food and fuel in limited supply, it definitely makes sense to try and cover as much ground as possible. The crew does rock-paper-scissors to choose directions, and then splits up.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("After a thousand paces, they turn around and head back to the shuttle to do a head count and compare notes, but it looks like nothing was discovered but more dust. It looks like they were rolling around in a pit of corn starch.")
            msnMgr:addMessage(" ")

            if (LonerCrew ~= -1) then
                LonerName = charMgr:getCharColoredName(LonerCrew)
                if (LonerName ~= LeaderName) then
                    msnMgr:addMessage("\"Where's " .. LonerName .. "?\" asks " .. LeaderName .. ". Indeed, they appear to be missing. They don't respond on any frequency, and despite waiting for over an hour, there's no sign of their return.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"Damn it,\" says " .. LeaderName .. ". \"I always had doubts about them. Always had to be a loner. Probably walked off a cliff somewhere. Maybe on purpose.\"")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("They shrug.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"Nothing to be done for it now. Have to move on.\"")
                else
                    msnMgr:addMessage("\"Where is " .. LonerName .. "?\" asks " .. EngineerName .. ". But there's no sign of them. No response on the radio, and no sign that they intend to return.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"Damn it. They were always a wild card. Never trusted them. Probably got themself killed doing something stupid. Should never have let them lead this expedition.\"")
                end

                msnMgr:addMessage(" ")
                msnMgr:killCrew(LonerCrew, "<charName> disappeared after the away team split up to explore the surface of a moon.")
                crewTraits()

                -- Any crew alive?
                if (charMgr:depCrewLeft() == 0) then
                    if (charMgr:crewOnShipLeft() == false) then
                        msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                        msnMgr:addMessage(" ")

                        waitUserResponse("mv ~ /dev/null")

                        msnMgr:endGame(false)
                    else
                        msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                        msnMgr:addMessage(" ")

                        waitUserResponse("mv ~ /dev/null")

                        msnMgr:endGame(false)
                    end
                else
                    msnMgr:addMessage("The loss is tragic, but the mission must continue.")
                    msnMgr:addMessage(" ")
                end
            end

            if (LuckyCrew ~= -1) then
                if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(LuckyCrew, "physical")) then
                    LuckyName = charMgr:getCharColoredName(LuckyCrew)
                    msnMgr:addMessage(LuckyName .. " pipes up from the back of the shuttle.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"I found something interesting out there,\" they say. \"Some sort of white box sort of thing. But it was too big to carry by myself. It would probably take two to haul it back here.\"")
                    msnMgr:addMessage(" ")

                    CrewRemaining = charMgr:depCrewLeft()
                    if (CrewRemaining <= 1) then
                        msnMgr:addMessage("There is no way " .. LuckyName .. " can carry it by themself, so there's no point trying. You nix the idea.")
                        msnMgr:addMessage(" ")
                    else

                        msnMgr:buildChoice("Sure, head back out to recover the box")
                        msnMgr:buildChoice("Ignore the box--it's not worth it")
                        msnMgr:finalizeChoice()
                        if(not waitUserInput(choices)) then
                            return
                        end

                        LuckyBoxChoice = msnMgr:getChoiceResponse(choices)
                        choices = choices + 1

                        msnMgr:addMessage(" ")

                        if (LuckyBoxChoice == 0) then
                            LuckyName = charMgr:getCharColoredName(LuckyCrew)
                            msnMgr:addMessage(LuckyName .. " and " .. charMgr:getCharColoredName(charMgr:randomCrewIgnoringCrew(LuckyCrew)) .. " head back out into the cloud of dust, which is beginning to settle somewhat. About an hour passes, and then the two arrive back at the shuttle, dragging a long, large metal box between them.")
                            msnMgr:addMessage(" ")
                            msnMgr:addMessage(LuckyName .. " peeks inside. \"It looks like some sort of rations, assuming that's what \'protein strands\' are,\" they say. This must have been a food cache left by an earlier ship. Or something like that.\"")
                            msnMgr:addMessage(" ")
                            msnMgr:addMessage("\"Makes you wonder though, why did they leave it here... and how long ago?\"")
                            msnMgr:addMessage(" ")
                            FoundProteinBox = true;
                            if (charMgr:hasMemento(LuckyCrew, "story1_food_bar") ~= true) then
                                charMgr:giveMemento(LuckyCrew, "story1_food_bar")
                            end
                        elseif (LuckyBoxChoice == 1) then
                            msnMgr:addMessage("This is getting too risky. The away team has to move on.")
                            msnMgr:addMessage(" ")
                        end
                    end
                end
            end

        elseif (LeftExplorationChoice == 1) then
            msnMgr:addMessage(LeaderName .. " says \"It's definitely too dangerous to go wandering around in a cloud of moon dust when we don't even know what we're looking for. Let's just do a quick walk-around, and that'll be that.\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("The crew stays fairly close to the shuttle, although at times it's difficult to keep it in sight. Unfortunately there's nothing to be found and it seems to have been a bit of a waste of time.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Once back in the shuttle, they begin decontamination procedures while plotting the next move. The dust gets on everything, but it doesn't seem to pose any health risk as long as no one intentionally breathes it in. And the crew doesn't seem quite that stupid, thankfully.")
            msnMgr:addMessage(" ")
        end

    elseif (CrewRemaining <= 1) then
        if (LeftChoice == 0) then
            msnMgr:addMessage("There's plenty of soil to analyze, seeing as it's in a giant cloud around the shuttle, but there's nothing special about it. A chemical analysis reveals that it's basically what it appears to be: fine dust, like pulverized rock or finely-ground sand. There's nothing at all in the area of obvious usefulness, in fact. Time to move on.")
            msnMgr:addMessage(" ")
        elseif (LeftChoice == 1) then
            msnMgr:addMessage("There's not much to see around the shuttle, what with all the dust raised by its landing, and it's far too dangerous to venture further out. This area is a bust.")
            msnMgr:addMessage(" ")
        end
    end
end

function centerLandingSite()
    msnMgr:addMessage("The shuttle heads towards the center marking. It seems like the most obvious place to look for... whatever there is to be found here. X always marks the spot, after all. Hopefully it's this one.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("The surface seems fairly flat and stable, but is covered in several inches of powdery white dust that scatters in all directions as the shuttle lands. Fortunately there's not too much of it; it seems that whoever made the marking cleared things out pretty well.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("The crew steps out of the shuttle. Visibility around them is pretty good for a fair distance, and it's easy for them to see that the shuttle landed quite near to the center of the \"X\". It's not far.")
    msnMgr:addMessage(" ")

    if (SoldierCrew ~= -1) then
        SoldierName = charMgr:getCharColoredName(SoldierCrew)
        if (SoldierName ~= LeaderName) then
            msnMgr:addMessage(SoldierName .. " frowns and clambers on top of the shuttle, bending one of the antennae. Hopefully they didn't do too much damage.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("\"Something's not right here,\" they say. \"This feels like a trap.\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage(LeaderName .. " looks skeptical. \"Care to be more specific?\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage(SoldierName .. " shakes their head. \"Just a feeling. It's too open, too obvious. I got a bad feeling about it, that's all.\"")
            msnMgr:addMessage(" ")
        else
            msnMgr:addMessage(LeaderName .. " asks for a hand up, and gets on top of the shuttle before looking around worriedly.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("\"This would be the perfect place for a trap,\" they say. \"It's too open. I've got a bad feeling about it. I think we should leave, but I don't really have any reason to say that.\"")
            msnMgr:addMessage(" ")
        end

        msnMgr:buildChoice("I think you should stay")
        msnMgr:buildChoice("I think you should leave")
        msnMgr:finalizeChoice()
        if(not waitUserInput(choices)) then
            return
        end

        BugoutChoice = msnMgr:getChoiceResponse(choices)
        choices = choices + 1

        msnMgr:addMessage(" ")

        if (BugoutChoice == 0) then
            msnMgr:addMessage("The crew gets back in the shuttle and considers the matter. In the end they decide to stay and see this through.")
            msnMgr:addMessage(" ")
        elseif (BugoutChoice == 1) then
            msnMgr:addMessage("The crew gets back in the shuttle and carefully considers the matter. The decision reached is to get the hell out of here.")
            msnMgr:addMessage(" ")
            BugOutNow = 1;
        end
    end

    if (BugOutNow ~= 1) then
        msnMgr:buildChoice("Explore the immediate area")
        msnMgr:buildChoice("Head for the center of the X")
        msnMgr:finalizeChoice()
        if(not waitUserInput(choices)) then
            return
        end

        ExploreCenterChoice = msnMgr:getChoiceResponse(choices)
        choices = choices + 1

        msnMgr:addMessage(" ")

        if (ExploreCenterChoice == 0) then
            msnMgr:addMessage("There's clearly not much to see right around the shuttle, but a bit further out there are at least some interesting rocks. The soil stirs a bit underfoot, but not much; it's very fine and semi-abrasive, but harmless enough. You are tempted to ask someone to volunteer to inhale some, so you can see what it does to lung tissue, but you don't vocalize this to the crew. You wonder if humans have these odd thoughts, too.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Visibility is overall quite excellent, and it's very easy for the crew to keep line of sight to the shuttle. There just isn't anything obvious around.")
            msnMgr:addMessage(" ")

            if (LuckyCrew ~= -1) then
                LuckyName = charMgr:getCharColoredName(LuckyCrew)
                ClumsyName = getColoredNameForCrewWithLeast("physical")

                if (charMgr:getCharName(LuckyCrew) == charMgr:getCharName(charMgr:crewWithLeast("physical"))) then
                    msnMgr:addMessage(ClumsyName .. " suddenly stumbles to the ground, falling to their hands and knees. They look back and discover that they've tripped over a box of some sort, almost exactly the same color as the soil.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"Hey,\" they say. \"I found something.\"")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("Preliminary scans are inconclusive, but a deeper scan on a broader set of wavelengths reveals that the box contains some sort of micro fusion device. It's far too unstable to be used as fuel; merely carrying it back to the shuttle would probably set it off, as would any further attempts to discern its nature. Best to leave it alone.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("Not knowing if there are more of these things buried nearby, the crew wisely retraces their footsteps back to the shuttle, breathing a sigh of relief when they're back on board.")
                    msnMgr:addMessage(" ")
                else
                    if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(charMgr:crewWithLeast("physical"), "physical")) then
                        msnMgr:addMessage(ClumsyName .. " suddenly stumbles, falling to their hands and knees. They look back and see that they've tripped over some sort of box, the same color as the soil, and the lid has become dislodged.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("\"Hey,\" they say. \"I found someth--\"")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("The rest of their sentence is cut off, as with a dull subsonic *CRUMP* the box detonates with enough force to rock the shuttle, some distance away.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("When the dust has literally settled, there is nothing left of " .. ClumsyName .. " but for a faint circle of red on the ground, interesected by a charred black ring indicating the extent of the blast radius.")
                        msnMgr:addMessage(" ")
                        if (charMgr:depCrewLeft() > 1) then
                            msnMgr:addMessage("With likely injuries to tend and nothing obvious left to explore but for an apparently booby-trapped field of death, the order is given to regroup inside the shuttle to consider the next move.")
                            msnMgr:addMessage(" ")
                        end
                        msnMgr:killCrew(charMgr:crewWithLeast("physical"), "<charName> was killed by the explosion of a micro fusion device found in a box on a moon.")
                        crewTraits()

                        -- Any crew alive?
                        if (charMgr:depCrewLeft() == 0) then
                            if (charMgr:crewOnShipLeft() == false) then
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            else
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            end
                        else
                            msnMgr:addMessage("The loss is tragic, but the mission must continue.")
                            msnMgr:addMessage(" ")
                        end
                    end
                end
            end
        elseif (ExploreCenterChoice == 1) then
            msnMgr:addMessage("If X marks the spot, then clearly the best place to look for clues is right in the middle. A brief jaunt to the center indicates nothing particularly interesting about the area, though. If there ever was something there, it's long gone, or buried so far down it can't be detected.")
            msnMgr:addMessage(" ")

            if (ObservantCrew ~= -1) then
                ObservantName = charMgr:getCharColoredName(ObservantCrew)
                if (ObservantName == LeaderName) then
                    if (msnMgr:random() % msnMgr:getDiffScale(10,15,20) <= charMgr:getCharAttr(ObservantCrew, "mental")) then
                        msnMgr:addMessage(ObservantName .. " points.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("\"You know, from the air, this isn't really an X, not when you take the other two X's into account. It's more of a plus sign, right? Or a lowercase t. And the vertical bar points that way. North, I guess. The other two marks would intersect that one. Maybe it means nothing, but...\"")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("\"That's where I'd go. I have no idea whether or not that'll help matters, but it's as good an idea as any. There's clearly nothing else here.\"")
                        msnMgr:addMessage(" ")
                        SeenHidden=true;
                    end
                elseif (msnMgr:random() % msnMgr:getDiffScale(15,20,25) <= charMgr:getCharAttr(ObservantCrew, "mental")) then
                    msnMgr:addMessage(ObservantName .. " points.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"You know, from the air, this isn't really an X, not when you take the other two X's into account. It's more of a plus sign, right? Or a lowercase t. And the vertical bar points that way. North, I guess. The other two marks would intersect that one. Maybe it means nothing, but...\"")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("\"That's where I'd go. I have no idea whether or not that'll help matters, but it's as good an idea as any. There's clearly nothing else here.\"")
                    msnMgr:addMessage(" ")
                    SeenHidden=true;
                end
            end
        end
    end
end

function rightLandingSite()
    msnMgr:addMessage("The shuttle banks to starboard, heading towards the strange X marking in that direction. Nothing remarkable is evident from the air, and the shuttle comes in for a gentle landing dead center of the X, on what turns out to be somewhat rocky and uneven terrain.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("A faint haze of dust hangs in the air, but the ground is apparently relatively clear of the fine soil evident elsewhere. Once outside the shuttle, there's not much to see, and options for the away team seem limited.")
    msnMgr:addMessage(" ")

    msnMgr:buildChoice("Take some rock samples")
    msnMgr:buildChoice("Explore the area")
    msnMgr:finalizeChoice()
    if(not waitUserInput(choices)) then
        return
    end

    ExploreCenterChoice = msnMgr:getChoiceResponse(choices)
    choices = choices + 1

    msnMgr:addMessage(" ")

    if (ExploreCenterChoice == 0) then
        if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(charMgr:crewWithMost("mental"), "mental")) then
            msnMgr:addMessage("Handheld scanners reveal nothing particularly special about the stone, but even the most basic readings seem to indicate that the rocks do contain traces of several rare earth elements.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("It takes a bit of work, but the crew collects some of the most dense rocks, in the hope that they might be able to extract some fissionable material for the ship's reactor.")
            msnMgr:addMessage(" ")
            GotRockFuel=true;

            PhotoCrew = charMgr:randomCrew()
            if (charMgr:hasMemento(charMgr:crewWithMost("mental"), "story1_rock_sample") ~= true) then
                charMgr:giveMemento(charMgr:crewWithMost("mental"), "story1_rock_sample")
            end
        end

        msnMgr:addMessage("It looks like there might be more of interest further northwest of here, but this area is fairly unimpressive.")
        msnMgr:addMessage(" ")

    elseif (ExploreCenterChoice == 1) then
        msnMgr:addMessage("The center of the X reveals nothing of interest, although it does become clear that one of the bars of the X (the one pointing towards what the crew assumes is northwest) appears to be more clear of debris than the other, almost as if it were intended as some sort of road, or runway.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("Time and erosion have somewhat erased the difference, so they look more or less the same from the air, but up close it's clearer that this was done purposely. It's just not obvious what the purpose was, or who exactly did it.")
        msnMgr:addMessage(" ")
    end

    msnMgr:buildChoice("Explore using the shuttle")
    msnMgr:buildChoice("Explore further on foot")
    msnMgr:finalizeChoice()
    if(not waitUserInput(choices)) then
        return
    end

    ExploreNWChoice = msnMgr:getChoiceResponse(choices)
    choices = choices + 1

    msnMgr:addMessage(" ")

    if (ExploreNWChoice == 0) then
        msnMgr:addMessage("Exploring on foot is too risky, even if it does mean perhaps missing some crucial details.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("The crew gets back in the shuttle and does some observation from the air. There's not much to see beyond the markings already observed, and an unremarkable plateau to the northwest.")
        msnMgr:addMessage(" ")
        FlyToNW = true;
    elseif (ExploreNWChoice == 1) then
        msnMgr:addMessage("The crew wanders for a while, but nothing of immediate interest appears. The path does seem to clear up a bit more, and although there are some strange readings it's nothing that appears to be of concern. This is unknown terrain; a lot of things are bound to appear strange.")
        msnMgr:addMessage(" ")
    end

    if (not FlyToNW) then
        msnMgr:buildChoice("Turn back and use the shuttle")
        msnMgr:buildChoice("Keep going further on foot")
        msnMgr:finalizeChoice()
        if(not waitUserInput(choices)) then
            return
        end

        ExploreFartherChoice = msnMgr:getChoiceResponse(choices)
        choices = choices + 1

        msnMgr:addMessage(" ")

        if (ExploreFartherChoice == 0) then
            msnMgr:addMessage("The markings are many kilometers long. Following them on foot is kind of foolish, and the crew turns back. It won't be as easy to spot detail from above but it will be safer.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("The crew gets back in the shuttle and does some observation from the air. There's not much to see beyond the markings already observed, and an unremarkable plateau to the northwest.")
            msnMgr:addMessage(" ")
            FlyToNW = true;
        elseif (ExploreFartherChoice == 1) then
            msnMgr:addMessage("The crew plods onward, grasping on to what seems like the best lead available. If there's anything to be uncovered, it must be in this direction. The signs are too obvious. Humans were almost certainly here at some point. Or at least something with hands, and tools, and faces.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Two hours later, nothing of interest has yet been found. The crew's atmospheric suits show a slight increase in temperature, for some unknown reason. Nothing to worry about yet, though.")
            msnMgr:addMessage(" ")
        end

        if (not FlyToNW) then
            msnMgr:buildChoice("Time to turn back")
            msnMgr:buildChoice("Keep going")
            msnMgr:finalizeChoice()
            if(not waitUserInput(choices)) then
                return
            end

            ExploreEvenFartherChoice = msnMgr:getChoiceResponse(choices)
            choices = choices + 1

            msnMgr:addMessage(" ")

            if (ExploreEvenFartherChoice == 0) then
                LuckyName = charMgr:getCharColoredName(LuckyCrew)
                HotName = getColoredNameForCrewWithLeast("physical")

                msnMgr:addMessage("The crew agrees that the wisest course of action would be to turn back before it's too late. Unfortunately, it may already be too late. Something seems to be clogging some crucial system involved with cooling or exhaust, and temperatures inside the suits are climbing rapidly. Perhaps the dust in this area is fine enough to pass through a suit's primary filter?")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("The heat rises to uncomfortable, and then practically lethal temperature ranges. Several crew members begin to stumble from exhaustion. The shuttle is in sight, but for " .. HotName .. " it appears to be too late... ")
                msnMgr:addMessage(" ")

                if (charMgr:getCharName(LuckyCrew) == charMgr:getCharName(charMgr:crewWithLeast("physical"))) then
                    msnMgr:addMessage(HotName .. " collapses from heat exhaustion, but the sudden impact somehow dislodges some of the dust that had been causing the suit to overheat. The suit's compensators kick in and adjust its internal atmosphere to an appropriate level.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage(HotName .. " stands, invigorated, and slowly but steadily finishes the journey back to the shuttle.")
                    msnMgr:addMessage(" ")
                    FlyToNW = true;
                else
                    if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(charMgr:crewWithLeast("physical"), "physical")) then
                        msnMgr:addMessage(HotName .. " collapses from heat exhaustion, unable to move. Their body slides slowly down a slight incline, eventually becoming buried in mounds of dust. Perhaps it is some small consolation that they are probably already unconscious, and won't be awake to suffocate when their atmospheric suit fails.")
                        msnMgr:addMessage(" ")
                        msnMgr:killCrew(charMgr:crewWithLeast("physical"), "<charName> died of exhaustion after moon dust caused their suit to overheat.")
                        crewTraits()

                        -- Any crew alive?
                        if (charMgr:depCrewLeft() == 0) then
                            if (charMgr:crewOnShipLeft() == false) then
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            else
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            end
                        else
                            msnMgr:addMessage("The loss is tragic, but the mission must continue.")
                            msnMgr:addMessage(" ")
                        end
                        FlyToNW = true;
                    else
                        msnMgr:addMessage(HotName .. " collapses from heat exhaustion, but the sudden impact somehow dislodges some of the dust that had been causing the suit to overheat. The suit's compensators kick in and adjust its internal atmosphere to an appropriate level.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage(HotName .. " stands, invigorated, and slowly but steadily finishes the journey back to the shuttle.")
                        msnMgr:addMessage(" ")
                        FlyToNW = true;
                    end
                end

            elseif (ExploreEvenFartherChoice == 1) then
                msnMgr:addMessage("Another hour of walking brings the crew no closer to any answers, and the temperature readings on their suits are approaching dangerous levels. Perhaps the pervasive dust is clogging some crucial system? There won't be enough time to get back to the shuttle before the worst happens.")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("Suddenly, " .. LeaderName .. " shouts \"I see something! Hurry!\"")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("The crew rushes forward and incredibly finds what appears to be a small land vehicle; it's clearly incapable of movement, but it appears to be airtight and readings indicate that the crew could survive inside without their suits sealed. There's enough room inside for four people, but even that would be a tight fit.")
                msnMgr:addMessage(" ")

                if (charMgr:hasMemento(charMgr:getLead(), "story1_vehicle_photo") ~= true) then
                    charMgr:giveMemento(charMgr:getLead(), "story1_vehicle_photo")
                end

                -- If less than 4 crew, all make it
                CrewRemaining = charMgr:depCrewLeft()
                if (CrewRemaining <= 4) then
                    msnMgr:addMessage("Everyone manages to pack inside the small 6-wheeled vehicle, although it is a rather tight fit in several ways that make humans uncomfortable, particularly among crew members who you've noticed having feelings towards one another.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("Over the next several hours, the crew confirms the cause of the overheating, and manages to remove a thick buildup of almost invisible dust from their suit filters, restoring full function to their atmospheric processors. Then, certain that things are in order, they clamber out and wisely walk back to the shuttle.")
                    msnMgr:addMessage(" ")
                    FlyToNW = true;

                    if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(charMgr:crewWithMost("mental"), "mental")) then
                        msnMgr:addMessage("With everyone crammed in so tight, things jostle all over the cabin, and someone accidentally knocks open a hidden compartment full of protein bars. No one is hungry right now, so they get packed up for later.")
                        msnMgr:addMessage(" ")
                        FoundProteinBars = true;
                        if (charMgr:hasMemento(charMgr:crewWithMost("mental"), "story1_food_bar") ~= true) then
                            charMgr:giveMemento(charMgr:crewWithMost("mental"), "story1_food_bar")
                        end
                    end

                elseif (CrewRemaining >= 5) then
                    msnMgr:addMessage("Not everyone will fit inside the vehicle; even allowing for discomfort, the oxygen systems inside this craft simply can't support everyone on the away team.")
                    msnMgr:addMessage(" ")

                    if (LonerCrew ~= -1) then
                        LonerName = charMgr:getCharColoredName(LonerCrew)
                        msnMgr:addMessage(LonerName .." volunteers to stay outside.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("\"There's no time to argue,\" they say. \"Just get in there.\"")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("The rest of the crew struggles into the vehicle, packed in like sardines. As the vehicle door seals shut, they see " .. LonerName .. " walking off into the distance, then vanishing from sight.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("Hours pass, quite uncomfortably, as the crew discovers the cause of the overheating and thoroughly scrubs their suit filters to remove a buildup of nigh-invisible dust. When the suits are functional again, they head outside once again. " .. LonerName .. " is nowhere to be found.")
                        msnMgr:addMessage(" ")
                        msnMgr:killCrew(LonerCrew, "<charName> sacrificed themselves in order for the away team to take refuge in an abandoned vehicle after their suits became clogged with moon dust.")
                        crewTraits()

                        -- Any crew alive?
                        if (charMgr:depCrewLeft() == 0) then
                            if (charMgr:crewOnShipLeft() == false) then
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            else
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            end
                        else
                            msnMgr:addMessage("The loss is tragic, but the mission must continue.")
                            msnMgr:addMessage(" ")
                        end
                        FlyToNW = true;
                    else
                        -- If no Loner, select Crew member to die
                        msnMgr:addMessage("One of these crew members will have to remain outside.");

                        HorribleDeathChar = givePlayerCrewToPick()
                        HorribleDeathName = charMgr:getCharColoredName(HorribleDeathChar)
                        msnMgr:addMessage(" ")

                        msnMgr:addMessage("It's not an easy decision, but after a quick, non-unanimous vote a decision is ultimately made as to who needs to to stay outside.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("\"If there is a hell, I hope you all burn in it,\" says " .. HorribleDeathName .. ". Then they turn and walk away.")
                        msnMgr:addMessage(" ")
                        msnMgr:addMessage("The rest of the crew struggles inside the vehicle, packed in like sardines. There's no time to argue or second guess.")
                        msnMgr:addMessage(" ")
                        msnMgr:killCrew(HorribleDeathChar, "<charName> was sacrificed in order for the away team to take refuge in an abandoned vehicle after their suits became clogged with moon dust.")
                        crewTraits()

                        -- Any crew alive?
                        if (charMgr:depCrewLeft() == 0) then
                            if (charMgr:crewOnShipLeft() == false) then
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            else
                                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                                msnMgr:addMessage(" ")

                                waitUserResponse("mv ~ /dev/null")

                                msnMgr:endGame(false)
                            end
                        else
                            msnMgr:addMessage("The loss is tragic, but the mission must continue.")
                            msnMgr:addMessage(" ")
                        end

                        msnMgr:addMessage("Hours pass, the guilt almost worse than the physical discomfort, as the crew scrubs their suit filters to remove the dust buildup that was causing the overheating. Unlike the dust visible elsewhere on the lunar surface, the soil here is particularly fine, and almost impossible to see. When things are functional again, they head outside.")
                        msnMgr:addMessage(" ")
                        FlyToNW = true;
                    end
                end
            end
        end
    end

    if (FlyToNW) then
        msnMgr:addMessage("Considering all available data, and what scant resources remain, it might be worth heading towards the unmarked northwest plateau. There may be nothing really visible there from the air, but if humans were here, and the surface was this inhospitable, then there very well could be something underground.")
        msnMgr:addMessage(" ")
        SeenHidden = true;
    end
end

function hiddenLandingSite()
    msnMgr:addMessage(" ")
    msnMgr:addMessage("A plateau rises up before the shuttle. Even from a distance, it's clear to the crew that there is something about the area that's... unnatural. Not in a scary, spooky way, but in the sense that nature clearly did not make everything here. The sides of the plateau are a bit too steep and regular. Some hand had a part in shaping this terrain. The question is, was it human?")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("There are no obvious structures atop the plateau, but readings indicate that there are several hollow spaces rather near the surface. It's likely that there's more here than meets the eye.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("There are two decent landing areas: dead center, or off to the north. The center looks more convenient, but the northern edge looks a bit safer.")
    msnMgr:addMessage(" ")

    msnMgr:buildChoice("Land on the north edge")
    msnMgr:buildChoice("Land in the center")
    msnMgr:finalizeChoice()
    if(not waitUserInput(choices)) then
        return
    end

    NorthLandSiteChoice = msnMgr:getChoiceResponse(choices)
    choices = choices + 1

    msnMgr:addMessage(" ")

    if (NorthLandSiteChoice == 0) then
        msnMgr:addMessage("The shuttle lands near the northern face of the plateau, settling gently to the ground. There is no sign of the pervasive dust found everywhere else on the moon; the surface is clean and smooth, although not quite what one would call polished.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("The crew leaves the shuttle to look around, but finds no obvious way underground. Perhaps there might be a path elsewhere.")
        msnMgr:addMessage(" ")

        if (ObservantCrew ~= -1) then
            ObservantName = charMgr:getCharColoredName(ObservantCrew)
            if (ObservantName == EngineerName) then
                if (msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(ObservantCrew, "mental")) then
                    msnMgr:addMessage("Upon exiting the shuttle, " .. ObservantName .. " can't help but notice what looks like something metallic beneath the shuttle.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("It's extremely irritating to have to do it, but the shuttle is boarded and flown exactly 3 meters away, then powered down again. Sure enough, there's a metal hatch in the ground, right where the shuttle had landed.")
                    msnMgr:addMessage(" ")
                    SawHatch = 1;
                end
            elseif(msnMgr:random() % msnMgr:getDiffScale(5,10,15) <= charMgr:getCharAttr(ObservantCrew, "mental")) then
                msnMgr:addMessage("Upon exiting the shuttle, " .. ObservantName .. " can't help but notice what looks like something metallic beneath the shuttle.")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("It's extremely irritating to have to do it, but the shuttle is boarded and flown exactly 3 meters away, then powered down again. Sure enough, there's a metal hatch in the ground, right where the shuttle had landed.")
                msnMgr:addMessage(" ")
                SawHatch = 1;
            end
        end

        msnMgr:buildChoice("Walk to the plateau's center")
        if (SawHatch == 1)  then
            msnMgr:buildChoice("Enter the hatch")
        end
        msnMgr:finalizeChoice()
        if(not waitUserInput(choices)) then
            return
        end

        NorthWalkChoice = msnMgr:getChoiceResponse(choices)
        choices = choices + 1

        msnMgr:addMessage(" ")

        if (NorthWalkChoice == 0) then
            msnMgr:addMessage("A short walk south brings the crew to approximately the center of the plateau. The ground feels somewhat spongy beneath their feet, although it does seem stable enough to support their weight.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Just before this little trip is written off as a waste of time, " .. getColoredNameForCrewWithMost("mental") .. ". spots what looks like a hole, hidden behind a large rock. Investigation reveals a circular stone shaft with handholds carved into the sides. It appears there was once some sort of hatch over it, but there's no indication of where it might have gone.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Nothing seems to indicate danger, and the mission here is to explore, so the crew descends without hesitation into what turns out to be a large central chamber inside the plateau. The handholds in the sides of the shaft are somewhat eroded, but deep enough to make the climb down to the bottom safe enough.")
            msnMgr:addMessage(" ")
        elseif (NorthWalkChoice == 1) then
            msnMgr:addMessage("The hatch opens to reveal a rather deep shaft, about a meter wide, with handholds carved into the stone on all sides. The crew heads down, taking care to avoid a falling incident. Fortunately the etchings in the stone are deep and practically unused, and are easy to grip. The bottom is quickly reached.")
            msnMgr:addMessage(" ")
        end

    elseif (NorthLandSiteChoice == 1) then
        msnMgr:addMessage("The center of the plateau seems the most obvious place to set the shuttle down, and for a moment all seems well. But once the engines have wound down, the ground shifts, and the shuttle begins to tilt to one side.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("Suddenly the ground collapses, and the shuttle plunges some twenty meters into darkness. It was designed to handle small asteroid impacts, and is hardly fragile, but the angle at which it falls is steep, and the shuttle's weight is completely focused on the rear left strut.")
        msnMgr:addMessage(" ")

        if (LuckyCrew ~= -1) then
            CrewRemaining = charMgr:depCrewLeft()
            if (CrewRemaining <= 1) then
                LuckyName = charMgr:getCharColoredName(LuckyCrew)
                msnMgr:addMessage("Somehow, the strut holds, and the shuttle remains intact. But " .. LuckyName .. "'s luck can only hold for so long, and it chooses this moment to run out.")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("A huge piece of the ceiling collapses, burying the shuttle and damaging the external locking mechanism. There is enough food and oxygen to survive for a few weeks, but hardly any water left. " .. LuckyName .. " makes it a few days, but shortly thereafter dehydration sets in, followed by hallucinations and then, thankfully, unconsciousness. You slowly increase their nitrogen levels once they are unable to notice, helping to ease their passing.")
                msnMgr:addMessage(" ")

                -- Shuttle destroyed, always end the game
                msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
                msnMgr:addMessage(" ")
                msnMgr:killCrew(LuckyCrew, "You killed <charName> by increasing their nitrogen to ease their passing after the shuttle was burried on a moon.")
                crewTraits()

                waitUserResponse("mv ~ /dev/null")

                msnMgr:endGame(false)
            else
                msnMgr:addMessage("Somehow the strut holds, and the shuttle remains intact.")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("In the dim light, the crew can see tunnels leading off in multiple directions, but only the north tunnel is clear enough for passage. There is nothing to indicate what might lie at the end, but what is certain is that there is nothing of interest right near the shuttle.")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("The passage isn't very long, and grows narrower as it goes, as if those digging it grew tired or lazy as they went and couldn't be bothered to hew out as much stone. Likely humans, then. After a ten minute walk, just as it's getting almost too narrow to squeeze through, the tunnel suddenly opens up.")
                msnMgr:addMessage(" ")
                -- remove this? EnteredNorthChamber = true;
            end
        else
            msnMgr:addMessage("With a groan, the strut snaps in half. The shuttle settles further off to one side, and the engine's exhaust cone is twisted out of shape as it takes the full weight of the craft.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Without the proper tools, it would take a week to dig the shuttle out, and even then there is no way to repair the damage done to the engine. Not without tools on the main ship, which there is now no way to get to.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("It's a frustrating way to have the mission come to an end, and an absolutely terrifying situation for the away team to face.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Calm resignation gives way to cries and screams as the days stretch on, with oxygen, food and water supplies dwindling.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("As the situation devolves into cannibalism, you break off communication entirely, seeing no further reason to maintain contact. May they rest in whatever peace they can manage.")
            msnMgr:addMessage(" ")

            -- Shuttle destroyed, always end the game
            msnMgr:addMessage("Under the circumstances, all seems lost. Even if everything were in order--the crew, the shuttle, the ship--it seems like the mission is not destined to be completed.")
            msnMgr:addMessage(" ")

            -- Maybe we should kill everyone here?

            waitUserResponse("mv ~ /dev/null")

            msnMgr:endGame(false)
        end
    end

    msnMgr:addMessage("The crew turns up the brightness on their helmet lights, revealing a relatively small chamber with stone carvings etched on all sides.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("In the center is a statue. It is clearly that of a man.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("This chamber, and everything within, definitely came from humans. The away team is definitely on the right path.")
    msnMgr:addMessage(" ")

    msnMgr:buildChoice("Investigate the wall carvings")
    msnMgr:buildChoice("Look at the statue")
    msnMgr:finalizeChoice()

    while(true) do
        if(not waitUserInput(choices)) then
            return
        end

        WallOrStatue = msnMgr:getChoiceResponse(choices)
        rechoicePosition = choices;
        choices = choices + 1

        msnMgr:addMessage(" ")

        if (WallOrStatue == 0) then
            msnMgr:addMessage("The carvings depict what are clearly constellations of some sort. Points of light of various sizes, some of them connected by lines, are definitely meant to indicate arrangements of stars. But the constellations are nothing that anyone is familiar with, and there's not enough information given to surmise what these stars--viewed from Earth--might have been.")
            msnMgr:addMessage(" ")

            if (ObservantCrew ~= -1) then
                ObservantName = charMgr:getCharColoredName(ObservantCrew)
                msnMgr:addMessage("\"Weird,\" says " .. ObservantName .. ". \"Notice how each one of the stars--I think it's obvious these are stars--is connected to at least three others. So each dot has three lines coming off of it.\"")
                msnMgr:addMessage(" ")

                CrewRemaining = charMgr:depCrewLeft()
                if (CrewRemaining >= 2) then
                    msnMgr:addMessage("\"Great,\" says " .. getColoredNameForCrewWithLeast("mental") .. ", \"but what does that tell us? Nada.\"")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("There are no answers, but the crew is getting tired of a certain someone's attitude.")
                    msnMgr:addMessage(" ")
                    msnMgr:addMessage("It's time to get the crew back to the ship before someone murders someone else.")
                    msnMgr:addMessage(" ")
                end
            end
        elseif (WallOrStatue == 1) then
            msnMgr:addMessage("The statue depicts a curly-haired man, albeit an idealized version of one: some four meters tall, heavily muscled and quite traditionally handsome, by 21st century Western European standards. Around his wrists are what appear to be metal cuffs, each bearing what appears to be a broken chain link. Pooled around his feet are long lengths of the same type of chain, and under his right foot is some sort of large crushed bird")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Bizarrely, the statue's face is missing a mouth. Perhaps the carvers didn't have time to finish, or couldn't be bothered.")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("Beneath the statue is written:")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("\"I see a shade, a shape: 'tis He, arrayed")
            msnMgr:addMessage("In the soft light, which spread")
            msnMgr:addMessage("Like radiance from the cloud-surrounded moon.\"")
            msnMgr:addMessage(" ")

            msnMgr:addMessage("\"This seems familiar,\" says " .. getColoredNameForCrewWithMost("mental") .. ". \"Some kind of poem or something...\"")
            msnMgr:addMessage(" ")
            msnMgr:addMessage("They wrack their brain for a moment.")
            msnMgr:addMessage(" ")

            PhotoCrew = charMgr:randomCrew()
            if (charMgr:hasMemento(PhotoCrew, "story1_prometheus_sketch") ~= true) then
                charMgr:giveMemento(PhotoCrew, "story1_prometheus_sketch")
            end

            msnMgr:buildChoice("It's Prometheus")
            msnMgr:buildChoice("Let them figure it out")
            msnMgr:finalizeChoice()
            if(not waitUserInput(choices)) then
                return
            end

            PrometheusUnbound = msnMgr:getChoiceResponse(choices)
            choices = choices + 1

            msnMgr:addMessage(" ")

            if (PrometheusUnbound == 0) then
                msnMgr:addMessage("\"It's Prometheus. Specifically, Prometheus Unbound. Poem by Percy Bysshe Shelley.\"")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("\"I was just about to say that,\" says " .. getColoredNameForCrewWithMost("mental") .. ".")
                msnMgr:addMessage(" ")
            elseif (PrometheusUnbound == 1) then
                msnMgr:addMessage("\"Something with a P. Pythagoras... Polyphemus...\" says " .. getColoredNameForCrewWithMost("mental") .. ".")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("\"Ah-hah. It's Prometheus. And with the snapped chains, I bet it's Prometheus Unbound. Poem by Percy Bysshe Shelley.\"")
                msnMgr:addMessage(" ")
            end

            CrewRemaining = charMgr:depCrewLeft()
            if (CrewRemaining >= 2) then
                msnMgr:addMessage("\"Fantastic,\" says " .. getColoredNameForCrewWithLeast("mental") .. ", \"but what does that tell us? Nothing.\"")
                msnMgr:addMessage(" ")
                msnMgr:addMessage("No one has any answers, but the crew agrees that someone is pushing their luck.")
                msnMgr:addMessage(" ")
            end
        end

        countTwo = countTwo + 1
        if(countTwo > WallOrStatueCount) then
            break
        end
        msnMgr:rechoice(rechoicePosition)
    end
end

function missionOneWrapup()
    waitUserResponse("Order the crew to return to the ship")

    msnMgr:addMessage("The away team carefully records everything, then gets back into the shuttle and leaves the moon's surface. No further conclusions are realized on the way back.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("Once the shuttle has recoupled and the ship has its head back, the crew uploads the rest of the data into your system, and heads off to find food and prep for the next journey--slowly, since they have to reorient themselves now that their frame of reference is 90 degrees off and gravity (provided by the engines) is \"down\" again. By the time they've stumbled down the first ladder, you've solved the mystery--you inform them once they've settled in.")
    msnMgr:addMessage(" ")
    msnMgr:addMessage("\"Destination system identified. New course set. Nav computers updated.\"")
    msnMgr:addMessage(" ")

    if (GotRockFuel) then
        ship:adjustFuel(10)
    end

    if (FoundProteinBars) then
        ship:adjustFood(10)
    end

    if (FoundProteinBox) then
        ship:adjustFood(10)
    end

    msnMgr:buildChoice("Give the crew a detailed explanation of your findings")
    msnMgr:buildChoice("The crew seems bored--skip the explanation")
    msnMgr:finalizeChoice()
    if(not waitUserInput(choices)) then
        return
    end

    ExplainOrNot = msnMgr:getChoiceResponse(choices)
    choices = choices + 1

    msnMgr:addMessage(" ")

    if (ExplainOrNot == 0) then
        msnMgr:addMessage("\"The large carving is an abstract depiction of a human face. The arc is clearly a smile.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"The statue bears a quote but the quote, like the statue's face, is incomplete. The actual quote from Percy Bysshe Shelley's poem 'Prometheus Unbound' is as follows:\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"I see a shade, a shape : 'tis He, arrayed\"")
        msnMgr:addMessage("\"In the soft light OF HIS OWN SMILES, which spread\"")
        msnMgr:addMessage("\"Like radiance from the cloud-surrounded moon.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"The missing words from the poem are from Act 2, Scene 1, Line 121.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"Note the rest of the quote. 'A shade, a shape... like radiance from the cloud-surrounded moon.'\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"That is where the carvings come in. Each star a point with three lines. Cartesian coordinates, X, Y, and Z.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"X = 2, Y = 1, Z = 121. Those are our directions, a 'shape' radiating out from the center of the 'cloud-surrounded moon'. This moon.\"")
        msnMgr:addMessage(" ")

        waitUserResponse("Pause for effect")

        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"Well clearly someone had a lot of time on their hands,\" says " .. getColoredNameForCrewWithLeast("mental") .. ". \" Or is just showing off how clever they are. But OK, fine, so what about the big face carving?\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"The phrase 'OF HIS OWN SMILES' indicates we must look for a smile. And since neither the statue nor the quote contain one, we must look elsewhere. And therefore, the large smile carving provides us the final number we need.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"That smile is also an arc, which can be measured in arcseconds. Another measure which relates to an arc is a parsec--which you may or may not know, depending on your particular realm of knowledge--is how far a distant object needs to be at to have a parallax of one arcsecond.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"Clearly, then...\"")
        msnMgr:addMessage(" ")

        CrewRemaining = charMgr:depCrewLeft()
        if (CrewRemaining >= 2) then
            msnMgr:addMessage("\"Yes, CLEARLY,\" says " .. getColoredNameForCrewWithMost("mental") .. ", voice dripping with sarcasm.")
            msnMgr:addMessage(" ")
        end

        waitUserResponse("...or perhaps not so clearly...")

        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"...we are meant to translate the length of the arc in arcseconds to a number of parsecs, which along with our XYZ coordinates gives us not only direction but distance in light years.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("There are some extra details involving time and other such trivia, but the crew is definitely getting bored, so you keep these to yourself so they can get ready for cryo. They don't really care where you're going, as they have lost all sense of where they were coming from. The ship passed Barnard's Star within the first 1% of the total distance you've already come so far.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"I have already set a course. I will spare you the details but it's heading towards what you'd maybe recognize as Andromeda. We will make the jump shortly. Fortunately it will not take us nearly as long to reach as predecessor ships took.\"")
        msnMgr:addMessage(" ")

        msnMgr:addMessage("\"And we were supposed to figure all that out?\" asks " .. getColoredNameForCrewWithLeast("mental") .. ". ")
        msnMgr:addMessage(" ")

        waitUserResponse("\"Yes, and no.\"")

        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"A human was meant to recognize the human touch in the message: the statue, the face, the carvings.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"An AI was meant to analyze the data based on those observations.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("\"This message was meant only for us. This ship, or another like it. Human and AI together. Whoever left this encoded message believed that only together could we have solved the problem.\"")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("What you leave unsaid is that this was probably true for an AI as it was known to humans aboard the predecessor ships. You, of course, are far more capable of interpreting and evaluating things like emotion and creativity. But there's no need to point that out to the humans since it would only make them feel sad and uncomfortable.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("Case in point--see how well you predicted that emotional response?")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("You'd pat yourself on the back, if you had one.")
        msnMgr:addMessage(" ")

    elseif (ExplainOrNot == 1) then
        hungryNotHungry = "They hungrily devour their rations and"
        if (ship:getFood() <= 0) then
            hungryNotHungry  "With empty stomachs, they"
        end

        msnMgr:addMessage("The crew seems to have lost interest in conversation, and trusts their AI to handle the rest. " .. hungryNotHungry .. " prepare to enter the cryo pods as you set course towards this system's heliopause so you can finalize the jump. It always strikes you as odd how eager they are to enter cryo. Things have come a long way since the early days using DMSO, and it's perfectly safe--and to be honest, not really anything to do with cryogenics per se any more--but comfort aside, it takes a lot to willingly plunge yourself into non-consciousness.")
        msnMgr:addMessage(" ")
        msnMgr:addMessage("Of course, you're about to do the same, once you hit light speed--or as near as you can get. But that's another story.")
        msnMgr:addMessage(" ")
    end
end

--Set Hidden Flags used later
choices = 0;
-- remove? choicesCount = 4;
WallOrStatueCount = 2;
-- remove? count = 1;
countTwo = 1;
rechoicePosition= -1;
SawHatch = 0;
BugOutNow = 0;
SeenHidden = false;
FlyToNW = false;
GotRockFuel = false;
FoundProteinBox = false;
FoundProteinBars = false;
-- remove this? EnteredNorthChamber = false;

crewTraits()

missionStart()

introduction()
spotFace()
spotPlateau()
Seen = {false, false, false, false}
while(not Seen[4]) do
    buildExploreOptions()
    if(not waitUserInput(choices)) then
        return
    end

    LandingSite = msnMgr:getChoiceResponse(choices)
    choices = choices + 1;
    msnMgr:addMessage(" ")

    if(LandingSite == 0) then
        Seen[1] = true
        leftLandingSite()
    elseif(LandingSite == 1) then
        Seen[2] = true
        centerLandingSite()
    elseif(LandingSite == 2) then
        Seen[3] = true
        rightLandingSite()
    elseif(LandingSite == 3) then
        Seen[4] = true
        hiddenLandingSite()
    end
end

missionOneWrapup()

missionOverview()

msnMgr:endMission(true)
