diff --git a/assets b/assets
index 0ae73657..52ea74c5 160000
--- a/assets
+++ b/assets
@@ -1 +1 @@
-Subproject commit 0ae736570b5600c2ad05f556ccaec4f5341c2b06
+Subproject commit 52ea74c5d5996ebcd7b064e0a8be469c9f07926e
diff --git a/include/Game/Systems/AbilityCooldownHUDSystem.h b/include/Game/Systems/AbilityCooldownHUDSystem.h
index 610b4dc2..f2710ce3 100644
--- a/include/Game/Systems/AbilityCooldownHUDSystem.h
+++ b/include/Game/Systems/AbilityCooldownHUDSystem.h
@@ -12,6 +12,7 @@ public:
{ }
virtual void Update(double dt) override;
+private:
};
#endif
\ No newline at end of file
diff --git a/resources/Schema/Components/ShieldAbility.xml b/resources/Schema/Components/ShieldAbility.xml
index 49fcf0c0..d66dca31 100644
--- a/resources/Schema/Components/ShieldAbility.xml
+++ b/resources/Schema/Components/ShieldAbility.xml
@@ -1,4 +1,4 @@
- 2.0
+ false
\ No newline at end of file
diff --git a/resources/Schema/Components/ShieldAbility.xsd b/resources/Schema/Components/ShieldAbility.xsd
index 5cf2145c..bbb30c82 100644
--- a/resources/Schema/Components/ShieldAbility.xsd
+++ b/resources/Schema/Components/ShieldAbility.xsd
@@ -9,8 +9,8 @@
-
- This is the cooldown on shield
+
+ If the shield is active or not
diff --git a/resources/Schema/Entities/PlayerHUD.xml b/resources/Schema/Entities/PlayerHUD.xml
index e3e9165b..cf07bc56 100644
--- a/resources/Schema/Entities/PlayerHUD.xml
+++ b/resources/Schema/Entities/PlayerHUD.xml
@@ -31,116 +31,6 @@
-
-
-
-
-
-
-
-
- 1
-
-
-
-
- Textures/HUD/HealthHudTriMain.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Textures/Core/White.png
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Textures/Core/White.png
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Textures/Core/White.png
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1
-
-
-
- 100/100
- Fonts/DroidSans.ttf,64
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -154,40 +44,7 @@
Textures/Core/UnitHexagon.png
-
-
-
-
-
-
-
-
-
-
- 2
-
-
-
-
-
- Textures/Core/UnitHexagon_Rotated.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Textures/Core/UnitHexagon.png
-
+ false
@@ -197,15 +54,16 @@
-
- 3
-
+
+ 3
+
Textures/Core/UnitHexagon_Rotated.png
+ false
@@ -222,6 +80,7 @@
Textures/Core/UnitHexagon.png
+ false
@@ -231,16 +90,17 @@
-
- 4
-
1
+
+ 4
+
Textures/Core/UnitHexagon_Rotated.png
+ false
@@ -257,6 +117,43 @@
Textures/Core/UnitHexagon.png
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+ Textures/Core/UnitHexagon_Rotated.png
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textures/Core/UnitHexagon.png
+
+ false
@@ -266,15 +163,16 @@
-
- 1
-
+
+ 1
+
Textures/Core/UnitHexagon_Rotated.png
+ false
@@ -291,6 +189,7 @@
Textures/Core/UnitHexagon.png
+ false
@@ -300,14 +199,15 @@
-
1
+
Textures/Core/UnitHexagon_Rotated.png
+ false
@@ -377,23 +277,157 @@
-
-
- Models/Widgets/Arrows/Arrow5.mesh
-
+
+
+ Models/Widgets/Arrows/Arrow5.mesh
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+ 100/100
+ Fonts/DroidSans.ttf,64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+ Textures/HealthHUD3.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textures/Icons/Boosts/Assault-01.png
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textures/Icons/Boosts/Defender-01.png
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textures/Icons/Boosts/Sniper-01.png
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textures/Icons/Abilities/Superman-01.png
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/Shaders/ForwardPlus.frag.glsl b/resources/Shaders/ForwardPlus.frag.glsl
index aa45d118..8f0f7deb 100644
--- a/resources/Shaders/ForwardPlus.frag.glsl
+++ b/resources/Shaders/ForwardPlus.frag.glsl
@@ -171,7 +171,7 @@ void main()
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
- vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a;
+ vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
color_result = color_result * clamp(1/specularTexel.a, 0, 1) + reflectionTotal;
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
diff --git a/resources/Shaders/ForwardPlusShieldCheck.frag.glsl b/resources/Shaders/ForwardPlusShieldCheck.frag.glsl
index 35db495b..5995facb 100644
--- a/resources/Shaders/ForwardPlusShieldCheck.frag.glsl
+++ b/resources/Shaders/ForwardPlusShieldCheck.frag.glsl
@@ -178,7 +178,7 @@ void main()
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
- vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a;
+ vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
color_result = color_result * clamp(1/specularTexel.a, 0, 1) + reflectionTotal;
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
diff --git a/src/Game/Systems/AbilityCooldownHUDSystem.cpp b/src/Game/Systems/AbilityCooldownHUDSystem.cpp
index ccb12a97..07461f95 100644
--- a/src/Game/Systems/AbilityCooldownHUDSystem.cpp
+++ b/src/Game/Systems/AbilityCooldownHUDSystem.cpp
@@ -11,23 +11,72 @@ void AbilityCooldownHUDSystem::Update(double dt)
for (auto& abilityHUDC : *abilityHUDs) {
EntityWrapper entity = EntityWrapper(m_World, abilityHUDC.EntityID);
EntityWrapper abilityEntity = entity.FirstParentWithComponent("DashAbility");
- if (!abilityEntity.Valid())
- return;
- EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown");
+ std::string abilityName = "";
- double maxAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"];
- double currentAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownTimer"];
+ if (!abilityEntity.Valid()) {
+ //If we dont have a dash ability on player, we check for Sprint ability
+ abilityEntity = entity.FirstParentWithComponent("SprintAbility");
- currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
+ if (!abilityEntity.Valid()) {
+ //If we dont have a sprint ability on player, we check for shield ability
+ abilityEntity = entity.FirstParentWithComponent("ShieldAbility");
- if(cooldownTextEntity.Valid()) {
- if(cooldownTextEntity.HasComponent("Text"))
- {
- std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3);
+ if (!abilityEntity.Valid()) {
+ //If we dont have a shield ability, we return, since we cannot do anything.
+ return;
+ } else {
+ //If we have a shield ability, we set the right icon
+ abilityName = "ShieldAbility";
+ if (entity.HasComponent("Sprite")) {
+ (std::string&)entity["Sprite"]["DiffuseTexture"] = "Textures\\Icons\\Abilities\\SheildDots-01.png";
+ }
+ }
+ } else {
+ //If we do have a sprint ability, we change the icon
+ abilityName = "SprintAbility";
+ if (entity.HasComponent("Sprite")) {
+ (std::string&)entity["Sprite"]["DiffuseTexture"] = "Textures\\Icons\\Abilities\\Dash-01.png";
+ }
+ }
+ } else {
+ //If we have a dash ability, we set the icon to the correct one.
+ abilityName = "DashAbility";
+ if (entity.HasComponent("Sprite")) {
+ (std::string&)entity["Sprite"]["DiffuseTexture"] = "Textures\\Icons\\Abilities\\Superman-01.png";
}
}
+
+ EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown");
+ //TODO: Fix so this track correctly for shield and sprint depending on how they work.
+ double maxAbilityCD, currentAbilityCD;
+
+ if (abilityName == "DashAbility") {
+ maxAbilityCD = (double)abilityEntity[abilityName]["CoolDownMaxTimer"];
+ currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"];
+ currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
+
+ if (cooldownTextEntity.Valid()) {
+ if (cooldownTextEntity.HasComponent("Text")) {
+ std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3);
+ }
+ }
+ }
+
+ if (abilityName == "ShieldAbility") {
+ maxAbilityCD = 0.0;
+ currentAbilityCD = 1 - (bool)abilityEntity[abilityName]["Active"];
+ }
+
+ if (abilityName == "SprintAbility") {
+ maxAbilityCD = 0.0;
+ currentAbilityCD = 1 - (bool)abilityEntity[abilityName]["Active"];
+ }
+
if (entity.HasComponent("Fill")) {
entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD;
}
+
+
+
}
}