示例#1
0
 private void LevelUp()
 {
     if (level > 0 && initialStatistics != null && UpgradeStatistics != null)
     {
         CurrentStatistics = TowerStatistics.Add(initialStatistics, UpgradeStatistics.Multiply(UpgradeStatistics, level));
     }
 }
示例#2
0
        public static TowerStatistics Subtract(TowerStatistics a, TowerStatistics b)
        {
            TowerStatistics result = new TowerStatistics();

            result.Health            = a.Health - b.Health;
            result.Damage            = a.Damage - b.Damage;
            result.Speed             = a.Speed - b.Speed;
            result.Accuracy          = a.Accuracy - b.Accuracy;
            result.CriticalChance    = a.CriticalChance - b.CriticalChance;
            result.CriticalHitScalar = a.CriticalHitScalar - b.CriticalHitScalar;
            result.Radius            = a.Radius - b.Radius;

            return(result);
        }
示例#3
0
        public static TowerStatistics Add(TowerStatistics a, TowerStatistics b)
        {
            TowerStatistics result = new TowerStatistics();

            result.Health            = a.Health + b.Health;
            result.Damage            = a.Damage + b.Damage;
            result.Speed             = a.Speed + b.Speed;
            result.Accuracy          = a.Accuracy + b.Accuracy;
            result.CriticalChance    = a.CriticalChance + b.CriticalChance;
            result.CriticalHitScalar = a.CriticalHitScalar + b.CriticalHitScalar;
            result.Radius            = a.Radius + b.Radius;

            return(result);
        }
示例#4
0
        public static TowerStatistics Add(TowerStatistics a, UpgradeStatistics b)
        {
            TowerStatistics result = new TowerStatistics();

            result.Health            = a.Health + b.HealthIncrease;
            result.Damage            = a.Damage + b.DamageIncrease;
            result.Speed             = a.Speed + b.SpeedIncrease;
            result.Accuracy          = a.Accuracy + b.AccuracyIncrease;
            result.CriticalChance    = a.CriticalChance + b.CriticalChanceIncrease;
            result.CriticalHitScalar = a.CriticalHitScalar + b.CriticalHitScalarIncrease;
            result.Radius            = a.Radius + b.RadiusIncrease;

            return(result);
        }
示例#5
0
        public static TowerStatistics Multiply(TowerStatistics a, float b)
        {
            TowerStatistics result = new TowerStatistics();

            result.Health            = (int)(a.Health * b);
            result.Damage            = (int)(a.Damage * b);
            result.Speed             = a.Speed * b;
            result.Accuracy          = a.Accuracy * b;
            result.CriticalChance    = a.CriticalChance * b;
            result.CriticalHitScalar = a.CriticalHitScalar * b;
            result.Radius            = (int)(a.Radius * b);

            return(result);
        }