예제 #1
0
        public float getMaxStat(Stat.StatName pStat, CompetitioniTier pTier)
        {
            float max = 0;

            switch (pStat)
            {
            case Stat.StatName.Null:
                break;

            case Stat.StatName.Strength:
                max += pTier.MaxStrength;
                break;

            case Stat.StatName.Agility:
                max += pTier.MaxAgility;
                break;

            case Stat.StatName.Intellect:
                max += pTier.MaxIntellect;
                break;

            case Stat.StatName.Charm:
                max += pTier.MaxCharm;
                break;

            default:
                break;
            }
            return(max);
        }
예제 #2
0
        public float getMinStat(Stat.StatName pStat, CompetitioniTier pTier)
        {
            float min = 0;

            switch (pStat)
            {
            case Stat.StatName.Null:
                break;

            case Stat.StatName.Strength:
                min += pTier.MinStrength;
                break;

            case Stat.StatName.Agility:
                min += pTier.MinAgility;
                break;

            case Stat.StatName.Intellect:
                min += pTier.MinIntellect;
                break;

            case Stat.StatName.Charm:
                min += pTier.MinCharm;
                break;

            default:
                break;
            }
            return(min);
        }
예제 #3
0
 bool SelectTier(int pTier)
 {
     foreach (CompetitioniTier tier in CompetitionTiers)
     {
         if (tier.Tier == pTier)
         {
             CurrentTier = tier;
             return(true);
         }
     }
     CurrentTier      = new CompetitioniTier();
     CurrentTier.Tier = -1;
     return(false);
 }
        public void Open(List <string> pResults, List <string> pBlossoms, int pRank, string pTitle = "", string pPrompt = "")
        {
            BlossomCompetition currentCompetition = BlossomCompetitionManager.Instance.CurrentCompetition;
            CompetitioniTier   currentTier        = BlossomCompetitionManager.Instance.CurrentTier;

            // BlossomColor[] allColors = Resources.LoadAll<BlossomColor>("BlossomColors");


            WinnerText.text = pResults[0];

            BlossomData.BlossomGrowth growth = (BlossomData.BlossomGrowth)System.Enum.Parse(typeof(BlossomData.BlossomGrowth), DialogueLua.GetVariable(pBlossoms[0] + "Growth").asString);
            string color = DialogueLua.GetVariable(pBlossoms[0] + "Color").asString;
            Sprite portrait;

            if (growth == BlossomData.BlossomGrowth.Adult)
            {
                portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).AdultPortrait;
            }
            else
            {
                portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).BabyPortrait;
            }

            WinnerImage.sprite = portrait;



            SecondText.text = pResults[1];

            growth = (BlossomData.BlossomGrowth)System.Enum.Parse(typeof(BlossomData.BlossomGrowth), DialogueLua.GetVariable(pBlossoms[1] + "Growth").asString);
            color  = DialogueLua.GetVariable(pBlossoms[2] + "Color").asString;

            if (growth == BlossomData.BlossomGrowth.Adult)
            {
                portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).AdultPortrait;
            }
            else
            {
                portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).BabyPortrait;
            }


            ThirdText.text = pResults[2];

            growth = (BlossomData.BlossomGrowth)System.Enum.Parse(typeof(BlossomData.BlossomGrowth), DialogueLua.GetVariable(pBlossoms[2] + "Growth").asString);
            color  = DialogueLua.GetVariable(pBlossoms[2] + "Color").asString;

            if (growth == BlossomData.BlossomGrowth.Adult)
            {
                portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).AdultPortrait;
            }
            else
            {
                portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).BabyPortrait;
            }


            for (int i = 3; i < pResults.Count; i++)
            {
                GameObject result = Instantiate(ResultsPrefab, Content);

                growth = (BlossomData.BlossomGrowth)System.Enum.Parse(typeof(BlossomData.BlossomGrowth), DialogueLua.GetVariable(pBlossoms[i] + "Growth").asString);
                color  = DialogueLua.GetVariable(pBlossoms[i] + "Color").asString;

                if (growth == BlossomData.BlossomGrowth.Adult)
                {
                    portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).AdultPortrait;
                }
                else
                {
                    portrait = Resources.Load <BlossomColor>("BlossomColors/" + color).BabyPortrait;
                }

                result.GetComponentInChildren <TextMeshProUGUI>().text = (i + 1) + ": " + pResults[i];
            }

            base.Open(pTitle, pPrompt);
            CloseButton.onClick.AddListener(
                delegate()
            {
                Continue(pRank);
            }
                );
        }