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:
Tleety
2016-03-07 14:42:50 +01:00
parent 99d663d5a2
commit 47ece6a5bf
6 changed files with 29 additions and 12 deletions
+1 -1
Submodule assets updated: 0ae736570b...52ea74c5d5
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ShieldAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ShieldAbility.xsd">
<CoolDownMaxTimer>2.0</CoolDownMaxTimer>
<Active>false</Active>
</ShieldAbility>
@@ -9,8 +9,8 @@
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="CoolDownMaxTimer" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>This is the cooldown on shield</xs:documentation></xs:annotation>
<xs:element name="Active" type="t:bool" minOccurs="0">
<xs:annotation><xs:documentation>If the shield is active or not</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
+1 -1
View File
@@ -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;
@@ -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;
+23 -6
View File
@@ -47,19 +47,36 @@ void AbilityCooldownHUDSystem::Update(double dt)
}
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"];
double currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"];
currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
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 (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;
}
}
}