Пример #1
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < stats.Length; i++)
     {
         stats[i] = new CharacterStat(stats[i].baseValue);
     }
 }
Пример #2
0
        void Start()
        {
            InitializeComponents();

            strengthStat  = new CharacterStat(strengthValue);
            dexterityStat = new CharacterStat(dexterityValue);

            //RegisterObservers();
        }
Пример #3
0
 public AbilityUseParams(GameObject target, float baseDamage, GameObject projectilePrefab, Ability ability, CharacterStat reliantStat, float statMultiplier, string hitAnimationName)
 {
     this.target           = target;
     this.baseDamage       = baseDamage;
     this.projectilePrefab = projectilePrefab;
     this.ability          = ability;
     this.reliantStat      = reliantStat;
     this.statMultiplier   = statMultiplier;
     this.hitAnimationName = hitAnimationName;
 }
Пример #4
0
        AbilityUseParams GetUseParams(GameObject target)
        {
            float         damage           = (ability as FireballConfig).Damage.Value;
            GameObject    projectilePrefab = (ability as FireballConfig).ProjectilePrefab;
            string        animationName    = (ability as FireballConfig).AnimationName;
            CharacterStat reliantStat      = (ability as FireballConfig).ReliantStat;
            float         statMultiplier   = (ability as FireballConfig).StatMultiplier;
            var           hitAnimationName = (ability as FireballConfig).HitAnimationName;

            AbilityUseParams useParams = new AbilityUseParams(target, damage, projectilePrefab, ability, reliantStat, statMultiplier, hitAnimationName);

            return(useParams);
        }
Пример #5
0
        float CalculatePrimaryStatMultiplier()
        {
            var player     = abilityUseParams.ability.Behaviour.Character.GetComponent <PlayerControl>();
            var finalValue = 0f;

            if (player)
            {
                float         baseDamage       = abilityUseParams.baseDamage;
                CharacterStat reliantStat      = abilityUseParams.reliantStat;
                float         statMultiplier   = abilityUseParams.statMultiplier;
                var           reliantStatValue = Array.Find(characterManager.CharacterrStats, x => x.name == reliantStat.name).Value;
                finalValue = (reliantStatValue * statMultiplier) + baseDamage;
            }
            else
            {
                finalValue = abilityUseParams.baseDamage;
            }

            return(finalValue);
        }