示例#1
0
    private string EvaluateSupport(Survivor helper)
    {
        string output = "";

        Survivor target = helper.GetSupportTarget();

        if (helper is Maddie && target is JohnnyJacket)
        {
            if (target.action == Survivor.Action.None)
            {
                output += "\r\nJohnny settles into his cot for the night as Maddie pulls out her homemade medical pamphlets and voltmeter. "
                          + "\"It'll be fine,\" she says as she gives Johnny an experimental sedative. Maddie pokes, prods, measures and takes notes. "
                          + "Johnny wakes up. \"What's was in that syringe? I had the strangest dreams, some great underwater city.\"\r\n"
                          + "\"Oh nothing too much, just some opiates mixed in with some goo fungus I found the bad rations we have. How do you feel?\"\r\n"
                          + "\"Maddie, if it wasn't for how great I feel I'd be seriously concerned. We gotta talk about your methods sometime.\"\r\n"
                          + "Johnny swears he can feel what people are thinking. Sometimes.\r\n\r\n";
                target.rally += 10;
                helper.rally += 10;

                helper.questActive = false;
                QuestManager.qm.CompleteQuest(helper);
                helper.questComplete = true;

                return(output);
            }
        }

        if (target.GetStatuses().Count > 0)
        {
            if (Random.Range(1, 100) <= helper.rally)
            {
                List <Survivor.Status> statuses = target.GetStatuses();

                int             index  = Random.Range(0, statuses.Count);
                Survivor.Status status = statuses[index];
                target.RemoveStatus(status);

                switch (status)
                {
                case Survivor.Status.Frightened:
                    output += helper.charName + " soothes " + target.charName + "'s frayed nerves. \r\n" +
                              target.charName + " is ready to go out again.\r\n";
                    break;

                case Survivor.Status.Hurt:
                    output += helper.charName + " cleans and sets " + target.charName + "'s wounds. \r\n" +
                              target.charName + " can do heavy work again.\r\n";
                    break;
                }

                if (helper is Maddie)
                {
                    (helper as Maddie).IncreaseQuestCount();
                }
            }
            else
            {
                output += helper.charName + " can't help " + target.charName + "'s wounds. \r\n" +
                          target.charName + " is no better than " + target.pronounSubject.ToLower() + " was before.\r\n";
            }
        }
        else
        {
            output += helper.charName + " takes a moment to comfort " + target.charName + ".\r\n";

            if (Random.Range(1, 100) <= (helper.rally + (target.rally / 2)))
            {
                // TODO: revamp this. Maybe not make it permanent per playthrough.
                output += target.charName + " receives " + helper.charName + " warmly. ";

                switch (helper.GetHighestStat())
                {
                case Survivor.Stats.Build:
                    output += helper.charName + " teaches " + target.charName + " the ins and outs of jury rigging a strong barricade. "
                              + target.charName + " feels a little more confident defending the door!\r\n";
                    target.build += 5;
                    break;

                case Survivor.Stats.Combat:
                    output += helper.charName + " takes " + target.charName + " through the basics of self defense. "
                              + "It's a crazy world out there but " + target.charName + " feels a little more prepared to get through it all unscathed.\r\n";
                    target.combat += 5;
                    break;

                case Survivor.Stats.Loot:
                    output += helper.charName + " takes out a map " + helper.pronounObject.ToLower() + " has been working on. "
                              + "\"These are the good spots,\" " + helper.pronounObject.ToLower() + " says and begins to show "
                              + target.charName + " the paths of least resistance through the wreckage. " + target.charName
                              + " feels ready to loot more rations.\r\n";
                    target.loot += 5;
                    break;

                case Survivor.Stats.Rally:
                    output += helper.charName + " goes over the basics of knitting wounds back together. " + target.charName
                              + " is as impressed with " + helper.charName + "'s steady hands as " + helper.pronounObject.ToLower()
                              + " bed side manner. " + target.charName + " feels more capable of keeping the others healthier.\r\n";
                    target.rally += 5;
                    break;

                default:
                    Debug.LogError("Helper " + helper.charName + " doesn't have a highest stat. Is this intended?");
                    output += helper.charName + " is feeling too insecure to teach " + target.charName + " anything.\r\n";
                    break;
                }

                if (helper is Maddie)
                {
                    (helper as Maddie).IncreaseQuestCount();
                }
            }
            else
            {
                output += "The two don't make much of a connection.\r\n";

                int buildPoints = GetBuildPoints(helper.build);

                if (buildPoints > 0)
                {
                    barrierCount += buildPoints;
                    output       += helper.charName + " restores the barrier by " + buildPoints + " points.\r\n";
                }
                else
                {
                    output += helper.charName + " looks outside nervously.\r\n";
                }
            }
        }

        // TODO: figure out a way to stop checking for this every time instead of just pushing it past 2 for quest count
        if ((helper is Maddie) && (helper as Maddie).GetQuestCount() == 2)
        {
            QuestManager.qm.ActivateQuest(helper as Maddie);
            (helper as Maddie).IncreaseQuestCount();
        }

        return(output);
    }
示例#2
0
    private string EvaluateLooting(Survivor survivor)
    {
        string output = "";

        // Johnny Quest Completion
        if ((survivor is JohnnyJacket) && survivor.questActive)
        {
            Mimi         mimi   = null;
            JohnnyJacket johnny = null;
            if (survivor is Mimi)
            {
                mimi = survivor as Mimi;
                foreach (Survivor surv in survivors)
                {
                    if (surv is JohnnyJacket)
                    {
                        johnny = surv as JohnnyJacket;
                        break;
                    }
                }
            }
            else if (survivor is JohnnyJacket)
            {
                johnny = survivor as JohnnyJacket;
                foreach (Survivor surv in survivors)
                {
                    if (surv is Mimi)
                    {
                        mimi = surv as Mimi;
                        break;
                    }
                }
            }

            if ((mimi.action == Survivor.Action.Loot) && (johnny.action == Survivor.Action.Loot))
            {
                output += "\r\nMimi takes lead as she and Johnny go looting for the night. They find themselves at an junkyard near the library. "
                          + "\"This is my spot!\" says Mimi, handing Johnny a spiked bat. It's not long before creatures come over the heaps of junk and "
                          + "the two are bashing away. Johnny is a quick study. \"Radical,\" he remarks as they return with plenty of rations.\r\n\r\n";

                foodCount += 6;

                johnny.loot   += 20;
                johnny.combat += 25;

                mimi.combat += 5;

                johnny.questActive = false;
                QuestManager.qm.CompleteQuest(johnny);
                johnny.questComplete = true;

                return(output);
            }
        }

        // Mimi Quest Completion
        if ((survivor is Mimi) && survivor.questActive)
        {
            Mimi   mimi   = null;
            Maddie maddie = null;
            if (survivor is Mimi)
            {
                mimi = survivor as Mimi;
                foreach (Survivor surv in survivors)
                {
                    if (surv is Maddie)
                    {
                        maddie = surv as Maddie;
                        break;
                    }
                }
            }
            else if (survivor is Maddie)
            {
                maddie = survivor as Maddie;
                foreach (Survivor surv in survivors)
                {
                    if (surv is Mimi)
                    {
                        mimi = surv as Mimi;
                        break;
                    }
                }
            }

            if ((mimi.action == Survivor.Action.Loot) && (maddie.action == Survivor.Action.Loot))
            {
                output += "\r\nMimi and Maddie approach a warehouse that looks like it's hosting a rave. It's surrounded by tentacled monstrosities. "
                          + "\"Bottoms up,\" says Maddie, handing Mimi a beaker of black ichor. Mimi is already elbow deep in squid bits when Maddie feels "
                          + "the strength roll through her body. The two make it inside. \"No headache!,\" Mimi exclaims and pushes past empty boxes and "
                          + "turned over metal storage shelves. The rainbow lights at the gate threaten to engulf the pair. \"Let's bring Johnny,\" the say in unison.\r\n\r\n";

                foodCount += 10;

                mimi.questActive = false;
                QuestManager.qm.CompleteQuest(mimi);
                mimi.questComplete = true;

                return(output);
            }
        }

        // Normal looting
        if (Random.Range(1, 100) <= survivor.loot)
        {
            // Good Stuff
            int foodFound = Random.Range(2, 5);
            foodCount += foodFound;
            output    += survivor.charName + " braves the outside world and finds " + foodFound + " ration's worth of food.\r\n";

            // TODO: Add more survivors to the list
            // TODO: Add ability to select slot to add survivor to
            if (survivorsToBeFound.Count > 0 && Random.Range(1, 100) <= survivor.loot)
            {
                int        index       = Random.Range(0, survivorsToBeFound.Count);
                GameObject additionObj = survivorsToBeFound[index];
                survivorsToBeFound.Remove(additionObj);

                output += "\r\n" + survivor.charName + " stumbles upon someone wielding a spiked bat with ease. " +
                          "In between giant swings she introduces herself as Mimi Necrosynth, Dread Queen. " +
                          "Mimi accompanies " + survivor.charName + " back to the library.\r\n";

                Instantiate(additionObj, slots[1]);
                survivors     = survivorSlots.GetComponentsInChildren <Survivor>();
                survivorCount = survivors.Length;

                GameObject mimiObj = GameObject.Find("Mimi(Clone)");
                mimi = mimiObj.GetComponent <Mimi>();

                // TODO: Can I do this loop better? Also it assumes the survivor is Mimi. Bad for the future.
                foreach (Survivor surv in survivors)
                {
                    if (surv is JohnnyJacket)
                    {
                        QuestManager.qm.ActivateQuest(surv);
                        break;
                    }
                }
            }
        }
        else
        {
            // Bad Stuff
            List <Survivor.Status> allStatusesCopy = new List <Survivor.Status>(allStatuses);
            foreach (Survivor.Status status in survivor.GetStatuses())
            {
                allStatusesCopy.Remove(status);
            }

            int             index      = Random.Range(0, allStatusesCopy.Count);
            Survivor.Status affliction = allStatusesCopy[index];

            switch (affliction)
            {
            case Survivor.Status.Frightened:
                survivor.AddStatus(Survivor.Status.Frightened);
                output += survivor.charName + " sees something beyond comprehension.\r\n" + survivor.pronounSubject + " returns to the library jumping at every bump and screech.\r\n";
                break;

            case Survivor.Status.Hurt:
                survivor.AddStatus(Survivor.Status.Hurt);
                output += survivor.charName + " gets clipped by something sharp.\r\n" + survivor.pronounSubject + " returns to the library bleeding and weak.\r\n";
                break;
            }
        }
        return(output);
    }