From c94e3ce07faa3927dd80ddd3d39de2c4ed17417e Mon Sep 17 00:00:00 2001
From: Ny Bruker <robinhs@stud.ntnu.no>
Date: Tue, 4 Oct 2022 12:10:45 +0200
Subject: [PATCH] Added projectile speed to character stats.

---
 MrBigsock/Assets/Code/Core/CharacterStats.cs  | 5 +++++
 MrBigsock/Assets/Code/Core/IAttackStats.cs    | 4 ++--
 MrBigsock/Assets/Code/Core/ICharacterStats.cs | 9 +++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/MrBigsock/Assets/Code/Core/CharacterStats.cs b/MrBigsock/Assets/Code/Core/CharacterStats.cs
index 597fa8da..f9e6e247 100644
--- a/MrBigsock/Assets/Code/Core/CharacterStats.cs
+++ b/MrBigsock/Assets/Code/Core/CharacterStats.cs
@@ -25,6 +25,11 @@ namespace BigSock {
 			The movement speed of the character.
 		*/
 		public float MoveSpeed { get; set; }
+		
+		/*
+			The projectile speed of the attack.
+		*/
+		public float ProjectileSpeed { get; set; }
 
 		/*
 			The knockback of the character.
diff --git a/MrBigsock/Assets/Code/Core/IAttackStats.cs b/MrBigsock/Assets/Code/Core/IAttackStats.cs
index 7b074246..27936bc5 100644
--- a/MrBigsock/Assets/Code/Core/IAttackStats.cs
+++ b/MrBigsock/Assets/Code/Core/IAttackStats.cs
@@ -97,14 +97,14 @@ namespace BigSock {
 				Damage = a.Damage * b.Damage,
 				Knockback = a.Knockback * b.Knockback,
 				Range = a.Range * b.Range,
-				ProjectileSpeed = a.ProjectileSpeed,
+				ProjectileSpeed = a.ProjectileSpeed * b.ProjectileSpeed,
 				AttackSpeed = a.AttackSpeed * b.AttackSpeed,
 				CritChance = a.CritChance * b.CritChance,
 				CritDamageModifier = a.CritDamageModifier * b.CritDamageModifier,
 				
 				Source = a.Source,
 				Actor = a.Actor,
-				
+
 				DamageVariance = a.DamageVariance,
 				IsCalculated = a.IsCalculated,
 				IsCrit = a.IsCrit,
diff --git a/MrBigsock/Assets/Code/Core/ICharacterStats.cs b/MrBigsock/Assets/Code/Core/ICharacterStats.cs
index 371a7b14..d18f091c 100644
--- a/MrBigsock/Assets/Code/Core/ICharacterStats.cs
+++ b/MrBigsock/Assets/Code/Core/ICharacterStats.cs
@@ -50,6 +50,11 @@ namespace BigSock {
 			The how much to modify damage by when critting.
 		*/
 		float CritDamageModifier { get; }
+		
+		/*
+			The projectile speed of the attack.
+		*/
+		float ProjectileSpeed { get; }
 
 	}
 
@@ -69,6 +74,7 @@ namespace BigSock {
 			AttackSpeed = 1,
 			CritChance = 1,
 			CritDamageModifier = 1,
+			ProjectileSpeed = 1,
 		};
 
 		/*
@@ -84,6 +90,7 @@ namespace BigSock {
 				AttackSpeed = a.AttackSpeed + b.AttackSpeed,
 				CritChance = a.CritChance + b.CritChance,
 				CritDamageModifier = a.CritDamageModifier + b.CritDamageModifier,
+				ProjectileSpeed = a.ProjectileSpeed + b.ProjectileSpeed,
 			};
 		}
 		
@@ -101,6 +108,7 @@ namespace BigSock {
 				AttackSpeed = a.AttackSpeed - b.AttackSpeed,
 				CritChance = a.CritChance - b.CritChance,
 				CritDamageModifier = a.CritDamageModifier - b.CritDamageModifier,
+				ProjectileSpeed = a.ProjectileSpeed - b.ProjectileSpeed,
 			};
 		}
 
@@ -117,6 +125,7 @@ namespace BigSock {
 				AttackSpeed = a.AttackSpeed * b.AttackSpeed,
 				CritChance = a.CritChance * b.CritChance,
 				CritDamageModifier = a.CritDamageModifier * b.CritDamageModifier,
+				ProjectileSpeed = a.ProjectileSpeed * b.ProjectileSpeed,
 			};
 		}
 
-- 
GitLab