Example #1
0
 public void NewMysteryContinue()
 {
     App.View.mysteryView.NewMysteryContinue();
     if (App.Model.mysteryModel.mysteryProgress > 0) // New Mystery has not been drawn
     {
         if (App.Model.mysteryModel.mysteriesSolved == App.Model.ancientOneModel.ancientOne.numMysteries)
         {
             AncientOne ao = App.Model.ancientOneModel.ancientOne;
             if (ao.flipped)
             {
                 ao.AllMysteriesSolved();
                 GameManager.SingleInstance.MysteryChecked();
             }
             else
             {
                 App.Controller.endGameController.EndGame(true);
                 App.Model.ancientOneModel.ancientOne.LeavePlay();
             }
         }
         else
         {
             App.Model.mysteryModel.DrawNewMystery();
         }
     }
     else // New Mystery already drawn
     {
         GameManager.SingleInstance.MysteryChecked();
     }
 }
Example #2
0
    private void SetAncientOneInfo()
    {
        AncientOne ao = App.Model.ancientOneModel.ancientOne;

        ancientOneName.text  = ao.ancientOneName;
        ancientOneTitle.text = ao.title;
        frontDoomText.text   = "" + ao.doom;
        frontFlavorText.text = ao.flavorText;
        foreach (Transform child in frontTextParent.transform)
        {
            Destroy(child.gameObject);
        }
        for (int i = 0; i < ao.ancientOneTexts.Length; i++)
        {
            GameObject go = Instantiate(ancientOneTextBlock, frontTextParent.transform);
            go.GetComponent <Text>().text = ao.ancientOneTexts[i];
            GameObject reckoning = go.transform.GetChild(0).gameObject;
            if (i == ao.frontReckoningTextIndex)
            {
                reckoning.SetActive(true);
            }
            else
            {
                reckoning.SetActive(false);
            }
        }

        if (ao.awakenText == "")
        {
            backAwaken.SetActive(false);
        }
        else
        {
            backAwaken.SetActive(true);
            backAwakenTitle.text = ao.ancientOneName + " Awakens!";
            backAwakenText.text  = ao.awakenText;
        }
        backMysteryTitle.text      = ao.finalMysteryTitle;
        backMysteryFlavorText.text = ao.finalMysteryFlavorText;
        backMysteryText.text       = ao.finalMysteryText;
        backTitle.text             = ao.flipInfoTitle;
        foreach (Transform child in backTextParent.transform)
        {
            Destroy(child.gameObject);
        }
        for (int i = 0; i < ao.flipTexts.Length; i++)
        {
            GameObject go = Instantiate(ancientOneTextBlock, backTextParent.transform);
            go.GetComponent <Text>().text = ao.flipTexts[i];
            GameObject reckoning = go.transform.GetChild(0).gameObject;
            if (i == ao.backReckoningTextIndex)
            {
                reckoning.SetActive(true);
            }
            else
            {
                reckoning.SetActive(false);
            }
        }
    }
Example #3
0
    public void ToggleAncientOneInfo()
    {
        if (ancientOneInfo.activeSelf)
        {
            App.Controller.openMenuController.ClosePopup();
            ancientOneInfo.SetActive(false);
        }
        else
        {
            ancientOneInfo.SetActive(true);
            App.Controller.openMenuController.OpenPopup(ancientOneInfo);

            AncientOne ao = App.Model.ancientOneModel.ancientOne;
            if (ao.flipped)
            {
                frontScreen.SetActive(false);
                backScreen.SetActive(true);
                SetCultistInfo(ao.cultist2);
            }
            else
            {
                frontScreen.SetActive(true);
                backScreen.SetActive(false);
                SetCultistInfo(ao.cultist1);
            }
        }
    }
Example #4
0
 private void FireAncientOneEvent(int value)
 {
     AncientOne?.Invoke(this, new AncientEventArgs
     {
         Age  = value,
         Name = "Fritzle"
     });
 }
Example #5
0
 public void SetSkipSetupData()
 {
     selectedInvestigators.Add(investigatorList[0]);
     selectedInvestigators.Add(investigatorList[1]);
     selectedInvestigators.Add(investigatorList[2]);
     selectedInvestigators.Add(investigatorList[3]);
     previewedAncientOne = new Cthulu();
 }
Example #6
0
    public void Flip()
    {
        AncientOne ao = App.Model.ancientOneModel.ancientOne;

        if (frontScreen.activeSelf)
        {
            frontScreen.SetActive(false);
            backScreen.SetActive(true);
            SetCultistInfo(ao.cultist2);
        }
        else
        {
            frontScreen.SetActive(true);
            backScreen.SetActive(false);
            SetCultistInfo(ao.cultist1);
        }
    }
Example #7
0
 public void SetPreviewedAncientOne(AncientOne ao)
 {
     previewedAncientOne = ao;
     App.View.setupView.AncientOnePreviewUpdated();
 }
Example #8
0
    public void Flipped()
    {
        flippedMenu.SetActive(true);
        App.Controller.openMenuController.OpenMenu(flippedMenu);


        AncientOne ao = App.Model.ancientOneModel.ancientOne;

        menuTitle.text = ao.ancientOneName + " has Awoken!";
        if (ao.awakenText == "")
        {
            awakenEvent.SetActive(false);
        }
        else
        {
            awakenTitle.text     = ao.ancientOneName + " Awakens!";
            awakenEventText.text = ao.awakenText;
        }
        mysteryTitle.text      = ao.finalMysteryTitle;
        mysteryFlavorText.text = ao.finalMysteryFlavorText;
        mysteryText.text       = ao.finalMysteryText;
        infoTitle.text         = ao.flipInfoTitle;
        foreach (Transform child in infoTexts.transform)
        {
            Destroy(child.gameObject);
        }
        for (int i = 0; i < ao.flipTexts.Length; i++)
        {
            GameObject go = Instantiate(textBlock, infoTexts.transform);
            go.GetComponent <Text>().text = ao.flipTexts[i];
            GameObject reckoning = go.transform.GetChild(0).gameObject;
            if (i == ao.backReckoningTextIndex)
            {
                reckoning.SetActive(true);
            }
            else
            {
                reckoning.SetActive(false);
            }
        }

        Monster c = ao.cultist2;

        cultistToughness.text = "" + c.toughness;
        if (c.tests[0] == TestStat.None)
        {
            cultistTest1Type.sprite   = App.Model.gameSpritesModel.GetTestStatSprite(TestStat.None);
            cultistTest1Mod.text      = "";
            cultistHorror.text        = "";
            cultistDamage1Icon.sprite = App.Model.gameSpritesModel.GetTestStatSprite(TestStat.None);
        }
        else
        {
            cultistTest1Type.sprite = App.Model.gameSpritesModel.GetTestStatSprite(c.tests[0]);
            if (c.testMods[0] == 0)
            {
                cultistTest1Mod.text = "";
            }
            else
            {
                cultistTest1Mod.text = "" + c.testMods[0];
            }
            cultistHorror.text        = "" + c.horror;
            cultistDamage1Icon.sprite = App.Model.gameSpritesModel.sanitySprite;
        }
        if (c.tests[1] == TestStat.None)
        {
            cultistTest2Type.sprite   = App.Model.gameSpritesModel.GetTestStatSprite(TestStat.None);
            cultistTest2Mod.text      = "";
            cultistDamage.text        = "";
            cultistDamage2Icon.sprite = App.Model.gameSpritesModel.GetTestStatSprite(TestStat.None);
        }
        else
        {
            cultistTest2Type.sprite = App.Model.gameSpritesModel.GetTestStatSprite(c.tests[1]);
            if (c.testMods[1] == 0)
            {
                cultistTest2Mod.text = "";
            }
            else
            {
                cultistTest2Mod.text = "" + c.testMods[1];
            }
            cultistDamage.text        = "" + c.damage;
            cultistDamage2Icon.sprite = App.Model.gameSpritesModel.healthSprite;
        }
        cultistText.text = c.monsterText;
    }
Example #9
0
 public void SetAncientOne(AncientOne ao)
 {
     ancientOne = ao;
     ao.EnterPlay();
     App.View.ancientOneView.AncientOneSet();
 }
Example #10
0
 public void SelectAncientOneFromPool(AncientOne ao)
 {
     App.Model.setupModel.SetPreviewedAncientOne(ao);
 }
Example #11
0
    public void AncientOnePreviewUpdated()
    {
        ancientOnePreview.SetActive(true);

        AncientOne ao = App.Model.setupModel.previewedAncientOne;

        ancientOneName.text       = ao.ancientOneName;
        ancientOneTitle.text      = ao.title;
        ancientOnePortrait.sprite = ao.portrait;

        App.Model.setupModel.SetAncientOnePreviewSide(true);
        previewFront.SetActive(true);
        previewBack.SetActive(false);

        ancientOnePreviewBio.text      = ao.flavorText;
        ancientOnePreviewDoomText.text = "" + ao.doom;
        foreach (Transform child in ancientOneTextsParent.transform)
        {
            Destroy(child.gameObject);
        }
        for (int i = 0; i < ao.ancientOneTexts.Length; i++)
        {
            GameObject go = Instantiate(ancientOneTextBlock, ancientOneTextsParent.transform);
            go.GetComponent <Text>().text = ao.ancientOneTexts[i];
            if (i == ao.frontReckoningTextIndex)
            {
                go.transform.GetChild(0).gameObject.SetActive(true);
            }
            else
            {
                go.transform.GetChild(0).gameObject.SetActive(false);
            }
        }

        if (ao.awakenText == "")
        {
            awakenEvent.SetActive(false);
        }
        else
        {
            awakenEvent.SetActive(true);
            awakenEventTitle.text = ao.ancientOneName + " Awakens!";
            awakenEventText.text  = ao.awakenText;
        }

        finalMysteryTitle.text      = ao.finalMysteryTitle;
        finalMysteryFlavorText.text = ao.finalMysteryFlavorText;
        finalMysteryText.text       = ao.finalMysteryText;

        flipInfoTitle.text = ao.flipInfoTitle;
        foreach (Transform child in flipInfoTextParent.transform)
        {
            Destroy(child.gameObject);
        }
        for (int i = 0; i < ao.flipTexts.Length; i++)
        {
            GameObject go = Instantiate(ancientOneTextBlock, flipInfoTextParent.transform);
            go.GetComponent <Text>().text = ao.flipTexts[i];
            if (i == ao.backReckoningTextIndex)
            {
                go.transform.GetChild(0).gameObject.SetActive(true);
            }
            else
            {
                go.transform.GetChild(0).gameObject.SetActive(false);
            }
        }

        SetCultistInfo(ao.cultist1);
    }