Example #1
0
    public void TalkCanvasToggle()
    {
        Canvas talkCanvas = GameManager.gm.GetTalkCanvas();

        talkCanvas.gameObject.SetActive(true);

        AnimatedText at = talkCanvas.GetComponentInChildren <AnimatedText>();

        if (questActive && !calledUpon)
        {
            at.SetComponents(this, this.message);

            // TODO: Finding clones will become problematic. How are we gonna handle this?
            GameObject maddieObject = GameObject.Find("Maddie");
            Maddie     maddie       = maddieObject.GetComponent <Maddie>();

            maddie.calledUpon = true;
            maddie.SetMimi(this);
            maddie.DeepTalkBubbleActivate();
        }
        else if (johnny.questActive)
        {
            List <AnimatedText.MessagePacket> survMsgs = new List <AnimatedText.MessagePacket> {
                new AnimatedText.MessagePacket(this, this.firstJohnny),
                new AnimatedText.MessagePacket(johnny, johnny.firstRequest),
                new AnimatedText.MessagePacket(this, this.secondJohnny)
            };

            at.SetComponents(survMsgs);

            johnny.UpdateQuestDesc();
        }
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        // Johnny thinks himself well rounded
        highest = Stats.Build;
        // TODO: This will be unsafe in future builds when we can't assume the same set of characters. Make it general
        GameObject maddieObject = GameObject.Find("Maddie");

        maddie = maddieObject.GetComponent <Maddie>();
    }
Example #3
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);
    }