コード例 #1
0
        private void AssignContent(MedalDisplay medalDisplay, MedalAbility medalAbility)
        {
            AssignPlayerEnemy(medalAbility);
            AssignEffects(medalAbility);

            AssignStats(medalDisplay, medalAbility);
            //AssignSlots(medalDisplay);
        }
コード例 #2
0
        private void AssignSupernova(MedalDisplay medalDisplay, MedalAbility medalAbility)
        {
            //SupernovaName.text = medalDisplay.SupernovaName;
            //SupernovaDescription.text = medalDisplay.SupernovaDescription;
            SupernovaDamage.text = medalDisplay.SupernovaDamage;

            SupernovaTarget.texture = Resources.Load($"Target/{medalDisplay.SupernovaTarget}") as Texture2D;

            AssignSupernovaPlayerEnemy(medalAbility);
            AssignSupernovaEffects(medalAbility);
        }
コード例 #3
0
        private void AssignSupernovaEffects(MedalAbility medalAbility)
        {
            var effectCounter = 0;

            foreach (var effect in medalAbility.MiscImages)
            {
                if (effect.Value == null)
                {
                    continue;
                }

                SupernovaEffectImages[effectCounter].enabled   = true;
                SupernovaEffectImages[effectCounter++].texture = effect.Value;
            }

            //if (CheckSupernovaEffects())
            //SupernovaEffects.SetCanvasGroupInactive();
        }
コード例 #4
0
        public IEnumerator Display(GameObject medalObject, MedalDisplay medal = null)
        {
            while (LoadManager.IsLoading)
            {
                yield return(null);
            }
            LoadManager.StartLoading();
            ResetDisplay();

            isDisplayingMedal = true;

            MedalDisplay medalDisplay = null;

            if (medalObject != null)
            {
                medalDisplay = medalObject.GetComponent <MedalDisplay>();
            }
            else if (medal != null)
            {
                medalDisplay = medal;
            }

            MedalAbility medalAbility          = null;
            MedalAbility medalAbilitySupernova = null;

            try
            {
                medalAbility = MedalAbilityParser.Instance.Parser(medalDisplay.AbilityDescription);

                if (medalDisplay.IsSupernova)
                {
                    medalAbilitySupernova = MedalAbilityParser.Instance.Parser(medalDisplay.SupernovaDescription);
                }
            }
            catch
            {
                print(medalDisplay.Name.Split(':')[0] + " " + medalDisplay.AbilityDescription);
            }

            #region Display Assignment

            AssignIcons(medalDisplay);
            AssignMedalName(medalDisplay);
            AssignMedalInfo(medalDisplay);

            if (medalAbility != null)
            {
                medalAbility.SetUpDisplayAbility();

                AssignContent(medalDisplay, medalAbility);
            }

            if (medalAbilitySupernova != null)
            {
                medalAbilitySupernova.SetUpDisplayAbility();

                //AssignSupernova(medalDisplay, medalAbilitySupernova);
            }

            #endregion

            isTransition = true;
            elapsedTime  = 0.0f;

            //StartCoroutine(ShowDisplay(MedalHighlight));
            MedalHighlight.SetCanvasGroupActive();
            ButtonCanvasGroup.SetCanvasGroupInactive();
        }
コード例 #5
0
        private void AssignSupernovaPlayerEnemy(MedalAbility medalAbility)
        {
            var ability = medalAbility.STR.FirstOrDefault() != null?medalAbility.STR.FirstOrDefault() :
                              medalAbility.DEF.FirstOrDefault() != null?medalAbility.DEF.FirstOrDefault() : null;

            var strPlayerCounter = 0;
            var defPlayerCounter = 0;
            var strEnemyCounter  = 0;
            var defEnemyCounter  = 0;

            var counterSTR = 0;
            var counterDEF = 0;

            foreach (var strDef in medalAbility.CombatImages)
            {
                foreach (var raiseLower in strDef.Value)
                {
                    if (raiseLower.Key == "Raises")
                    {
                        if (strDef.Key == "STR")
                        {
                            foreach (var strRaise in raiseLower.Value)
                            {
                                SupernovaPlayerAttack[strPlayerCounter].texture     = strRaise;
                                SupernovaPlayerAttack[strPlayerCounter].color       = visible;
                                SupernovaPlayerAttackMults[strPlayerCounter++].text = "x" + medalAbility.STR[counterSTR++].Tier;
                            }
                        }
                        else if (strDef.Key == "DEF")
                        {
                            foreach (var defRaise in raiseLower.Value)
                            {
                                SupernovaPlayerDefense[defPlayerCounter].texture     = defRaise;
                                SupernovaPlayerDefense[defPlayerCounter].color       = visible;
                                SupernovaPlayerDefenseMults[defPlayerCounter++].text = "x" + medalAbility.DEF[counterDEF++].Tier;
                            }
                        }
                    }
                    else if (raiseLower.Key == "Lowers")
                    {
                        if (strDef.Key == "STR")
                        {
                            foreach (var strLower in raiseLower.Value)
                            {
                                SupernovaEnemyAttack[strEnemyCounter].texture     = strLower;
                                SupernovaEnemyAttack[strEnemyCounter].color       = visible;
                                SupernovaEnemyAttackMults[strEnemyCounter++].text = "x" + medalAbility.STR[counterSTR++].Tier;
                            }
                        }
                        else if (strDef.Key == "DEF")
                        {
                            foreach (var defLower in raiseLower.Value)
                            {
                                SupernovaEnemyDefense[defEnemyCounter].texture     = defLower;
                                SupernovaEnemyDefense[defEnemyCounter].color       = visible;
                                SupernovaEnemyDefenseMults[defEnemyCounter++].text = "x" + medalAbility.DEF[counterDEF++].Tier;
                            }
                        }
                    }
                }
            }

            // TODO Account for player saps

            if (CheckSupernovaPlayer())
            {
                //SupernovaPlayer.SetCanvasGroupInactive();
                if (ability != null)
                {
                    SupernovaPlayerTurns.text = ability.Duration;
                }
            }

            if (CheckSupernovaEnemy())
            {
                //SupernovaEnemy.SetCanvasGroupInactive();
                if (ability != null)
                {
                    SupernovaEnemyTurns.text = ability.Duration;
                }
            }
        }
コード例 #6
0
        private void AssignStats(MedalDisplay medalDisplay, MedalAbility medalAbility)
        {
            var BaseMultiplierLow   = medalDisplay.BaseMultiplierLow;
            var BaseMultiplierHigh  = medalDisplay.BaseMultiplierHigh;
            var MaxMultiplierLow    = medalDisplay.MaxMultiplierLow;
            var MaxMultiplierHigh   = medalDisplay.MaxMultiplierHigh;
            var GuiltMultiplierLow  = medalDisplay.GuiltMultiplierLow;
            var GuiltMultiplierHigh = medalDisplay.GuiltMultiplierHigh;

            var Tier = medalDisplay.Tier;

            switch (medalDisplay.Star)
            {
            case 1:
            case 2:
                Multiplier.text = "x" + (BaseMultiplierHigh != "" ? BaseMultiplierHigh :
                                         BaseMultiplierLow);

                break;

            case 3:
                Multiplier.text = "x" + (MaxMultiplierHigh != "" ? MaxMultiplierHigh :
                                         MaxMultiplierLow != "" ? MaxMultiplierLow :
                                         BaseMultiplierHigh != "" ? BaseMultiplierHigh :
                                         BaseMultiplierLow);

                break;

            case 4:
                Multiplier.text = "x" + (MaxMultiplierHigh != "" ? MaxMultiplierHigh :
                                         MaxMultiplierLow != "" ? MaxMultiplierLow :
                                         BaseMultiplierHigh != "" ? BaseMultiplierHigh :
                                         BaseMultiplierLow);

                break;

            case 5:
                Multiplier.text = "x" + (MaxMultiplierHigh != "" ? MaxMultiplierHigh :
                                         MaxMultiplierLow != "" ? MaxMultiplierLow :
                                         BaseMultiplierHigh != "" ? BaseMultiplierHigh :
                                         BaseMultiplierLow);

                break;

            case 6:
                Multiplier.text = "x" + (GuiltMultiplierHigh != "" ? GuiltMultiplierHigh :
                                         GuiltMultiplierLow != "" ? GuiltMultiplierLow :
                                         MaxMultiplierHigh != "" ? MaxMultiplierHigh :
                                         MaxMultiplierLow != "" ? MaxMultiplierLow :
                                         BaseMultiplierHigh != "" ? BaseMultiplierHigh :
                                         BaseMultiplierLow);

                break;

            case 7:
                Multiplier.text = "x" + (GuiltMultiplierHigh != "" && GuiltMultiplierHigh != "0" ? GuiltMultiplierHigh :
                                         GuiltMultiplierLow != "" ? GuiltMultiplierLow :
                                         MaxMultiplierHigh != "" ? MaxMultiplierHigh :
                                         MaxMultiplierLow);

                break;

            default:
                break;
            }
        }