diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index 00dc476f..8fb8d9f4 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -5019,7 +5019,7 @@ - + @@ -5089,7 +5089,7 @@ - + @@ -5165,7 +5165,7 @@ - + @@ -5184,7 +5184,7 @@ - + @@ -5203,7 +5203,7 @@ - + @@ -5222,7 +5222,7 @@ - + @@ -5241,7 +5241,7 @@ - + @@ -5260,7 +5260,7 @@ - + @@ -5279,7 +5279,7 @@ - + @@ -5298,7 +5298,7 @@ - + diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index 201e4760..b4ea210c 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -30,8 +30,8 @@ bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) ComponentWrapper cHealth = e.Victim["Health"]; double& health = cHealth["Health"]; - if (e.Player.HasComponent("BoostDefender")) { - e.Damage -= (double)e.Player["BoostDefender"]["StrengthOfEffect"]; + if (e.Victim.HasComponent("BoostDefender")) { + e.Damage -= (double)e.Victim["BoostDefender"]["StrengthOfEffect"]; } health -= e.Damage; diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 64216e58..e754252d 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -53,6 +53,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt) float playerMovementSpeed = player["Player"]["MovementSpeed"]; float playerCrouchSpeed = player["Player"]["CrouchSpeed"]; glm::vec3& wishDirection = player["Player"]["CurrentWishDirection"]; + if (player.HasComponent("BoostAssault")) { + playerMovementSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; + playerCrouchSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; + } + if (player.HasComponent("Physics")) { ComponentWrapper cPhysics = player["Physics"]; @@ -104,9 +109,10 @@ void PlayerMovementSystem::updateMovementControllers(double dt) //if doubleTapped do Assault Dash - but only boost maximum 50.0f float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f; accelerationSpeed = glm::min(doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed), 50.0f); + accelerationSpeed = doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed); //if player has Boost from an Assault class, accelerate the player faster if (player.HasComponent("BoostAssault")) { - accelerationSpeed *= (double) player["BoostAssault"]["StrengthOfEffect"]; + accelerationSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; } velocity += accelerationSpeed * wishDirection; ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));