diff --git a/sources/Component/Bonus/PlayerBonusComponent.hpp b/sources/Component/Bonus/PlayerBonusComponent.hpp index a93b8273..fadcc19d 100644 --- a/sources/Component/Bonus/PlayerBonusComponent.hpp +++ b/sources/Component/Bonus/PlayerBonusComponent.hpp @@ -15,11 +15,6 @@ namespace BBM class PlayerBonusComponent : public WAL::Component { public: - - //! @brief The number of seconds before a speed bonus expire. This variable is used to reset the nextSpeedBonusRate value. - std::chrono::nanoseconds speedBonusRate = 15s; - //! @brief The number of nanosecond before the expiration of a speed bonus. - std::chrono::nanoseconds nextSpeedBonusRate = speedBonusRate; //! @brief The number of seconds before a range bonus expire. This variable is used to reset the nextNoClipBonusRate value. std::chrono::nanoseconds noClipBonusRate = 5s; //! @brief The number of nanosecond before the expiration of a no clip bonus diff --git a/sources/Component/Controllable/ControllableComponent.hpp b/sources/Component/Controllable/ControllableComponent.hpp index 48df8db0..2d62a8e8 100644 --- a/sources/Component/Controllable/ControllableComponent.hpp +++ b/sources/Component/Controllable/ControllableComponent.hpp @@ -26,7 +26,7 @@ namespace BBM //! @brief input value for pause bool pause = false; //! @brief The speed applied to every controllable entities. - float speed = .25f; + float speed = .15f; //! @inherit WAL::Component *clone(WAL::Entity &entity) const override; diff --git a/sources/Items/Bonus.cpp b/sources/Items/Bonus.cpp index f21cf1b4..9c63e266 100644 --- a/sources/Items/Bonus.cpp +++ b/sources/Items/Bonus.cpp @@ -18,6 +18,7 @@ namespace BBM { if (!bombHolder) return; bombHolder->maxBombCount++; + std::cout << "BombHolder : " << bombHolder->maxBombCount << std::endl; } void Bonus::ExplosionRangeBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis) @@ -29,6 +30,7 @@ namespace BBM { if (!bombHolder || !playerBonus) return; bombHolder->explosionRadius++; + std::cout << "BombRadius : " << bombHolder->explosionRadius << std::endl; } void Bonus::SpeedUpBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis) @@ -39,8 +41,8 @@ namespace BBM { auto *playerBonus = player.tryGetComponent(); if (!controllable || !playerBonus) return; - controllable->speed = 0.35f; - playerBonus->nextSpeedBonusRate = playerBonus->speedBonusRate; + controllable->speed += 0.05f; + std::cout << "Speed : " << controllable->speed << std::endl; } void Bonus::NoClipBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis) @@ -50,7 +52,7 @@ namespace BBM { auto *playerBonus = player.tryGetComponent(); if (!playerBonus) return; - playerBonus->nextNoClipRate = playerBonus->nextSpeedBonusRate; + playerBonus->nextNoClipRate = playerBonus->noClipBonusRate; playerBonus->isNoClipOn = true; } @@ -58,7 +60,8 @@ namespace BBM { { double rnd = static_cast(std::rand()) / RAND_MAX; - if (rnd <= 0.8) + std::cout << "Random" << rnd << std::endl; + if (rnd <= 1) return (static_cast((std::rand() % NOCLIP) + 1)); return (NOTHING); } diff --git a/sources/System/Bonus/PlayerBonusSystem.cpp b/sources/System/Bonus/PlayerBonusSystem.cpp index c5990f5b..a0fc8218 100644 --- a/sources/System/Bonus/PlayerBonusSystem.cpp +++ b/sources/System/Bonus/PlayerBonusSystem.cpp @@ -18,11 +18,6 @@ namespace BBM auto &holder = entity.get(); auto &playerBonus = entity.get(); - playerBonus.nextSpeedBonusRate -= dtime; - if (playerBonus.nextSpeedBonusRate <= 0ns) { - playerBonus.nextSpeedBonusRate = playerBonus.speedBonusRate; - controllable.speed = 0.25f; - } playerBonus.nextNoClipRate -= dtime; if (playerBonus.nextNoClipRate <= 0ns) { playerBonus.nextNoClipRate = playerBonus.noClipBonusRate;