Esempio n. 1
0
        public static float GetBaseSecondaryStatForCharacter(SecondaryStatType secondaryStatType, CharacterStats characterStats)
        {
            //Debug.Log("LevelEquations.GetSecondaryStatForCharacter(" + secondaryStatType.ToString() + ", " + sourceCharacter.AbilityManager.CharacterName + ")");
            float returnValue = 0f;

            foreach (IStatProvider statProvider in characterStats.BaseCharacter.StatProviders)
            {
                if (statProvider != null)
                {
                    foreach (StatScalingNode statScalingNode in statProvider.PrimaryStats)
                    {
                        foreach (PrimaryToSecondaryStatNode primaryToSecondaryStatNode in statScalingNode.PrimaryToSecondaryConversion)
                        {
                            if (primaryToSecondaryStatNode.SecondaryStatType == secondaryStatType)
                            {
                                if (primaryToSecondaryStatNode.RatedConversion == true)
                                {
                                    returnValue += primaryToSecondaryStatNode.ConversionRatio * (characterStats.PrimaryStats[statScalingNode.StatName].CurrentValue / characterStats.Level);
                                }
                                else
                                {
                                    returnValue += primaryToSecondaryStatNode.ConversionRatio * characterStats.PrimaryStats[statScalingNode.StatName].CurrentValue;
                                }
                            }
                        }
                    }
                }
            }

            returnValue += characterStats.SecondaryStats[secondaryStatType].DefaultAddValue;
            return(returnValue);
        }
Esempio n. 2
0
        public static float GetSecondaryStatForCharacter(SecondaryStatType secondaryStatType, CharacterStats characterStats)
        {
            //Debug.Log("LevelEquations.GetSecondaryStatForCharacter(" + sourceCharacter.AbilityManager.CharacterName + ")");
            float returnValue = GetBaseSecondaryStatForCharacter(secondaryStatType, characterStats);

            returnValue += characterStats.GetSecondaryAddModifiers(secondaryStatType);
            returnValue *= characterStats.GetSecondaryMultiplyModifiers(secondaryStatType);
            return(returnValue);
        }
 public void PlayerDeathHandler(CharacterStats characterStats)
 {
     //Debug.Log("PopupWindowManager.PlayerDeathHandler()");
     StartCoroutine(PerformDeathWindowDelay());
 }