private void LevelUp() { if (level > 0 && initialStatistics != null && UpgradeStatistics != null) { CurrentStatistics = TowerStatistics.Add(initialStatistics, UpgradeStatistics.Multiply(UpgradeStatistics, level)); } }
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); }
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); }
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); }
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); }