Changed shield component to track Active, so it and sprint glow full if they are active.
Changed how reflections are calculated with light.
This commit is contained in:
+1
-1
Submodule assets updated: 0ae736570b...52ea74c5d5
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
<ShieldAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ShieldAbility.xsd">
|
<ShieldAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ShieldAbility.xsd">
|
||||||
<CoolDownMaxTimer>2.0</CoolDownMaxTimer>
|
<Active>false</Active>
|
||||||
</ShieldAbility>
|
</ShieldAbility>
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="CoolDownMaxTimer" type="t:double" minOccurs="0">
|
<xs:element name="Active" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>This is the cooldown on shield</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>If the shield is active or not</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ void main()
|
|||||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||||
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||||
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
|
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;
|
color_result = color_result * clamp(1/specularTexel.a, 0, 1) + reflectionTotal;
|
||||||
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ void main()
|
|||||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||||
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||||
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
|
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;
|
color_result = color_result * clamp(1/specularTexel.a, 0, 1) + reflectionTotal;
|
||||||
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
||||||
|
|
||||||
|
|||||||
@@ -47,19 +47,36 @@ void AbilityCooldownHUDSystem::Update(double dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown");
|
EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown");
|
||||||
|
//TODO: Fix so this track correctly for shield and sprint depending on how they work.
|
||||||
|
double maxAbilityCD, currentAbilityCD;
|
||||||
|
|
||||||
double maxAbilityCD = (double)abilityEntity[abilityName]["CoolDownMaxTimer"];
|
if (abilityName == "DashAbility") {
|
||||||
double currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"];
|
maxAbilityCD = (double)abilityEntity[abilityName]["CoolDownMaxTimer"];
|
||||||
currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
|
currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"];
|
||||||
|
currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
|
||||||
|
|
||||||
if (cooldownTextEntity.Valid()) {
|
if (cooldownTextEntity.Valid()) {
|
||||||
if (cooldownTextEntity.HasComponent("Text")) {
|
if (cooldownTextEntity.HasComponent("Text")) {
|
||||||
std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3);
|
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")) {
|
if (entity.HasComponent("Fill")) {
|
||||||
entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD;
|
entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user