From 93a4fa792c919de19c80c302570d6758259e4bcc Mon Sep 17 00:00:00 2001 From: HENRY Benjamin Date: Wed, 9 Jun 2021 12:15:01 +0200 Subject: [PATCH] =?UTF-8?q?removed=20ignore=20walls=20bonus=20(sorry=20cl?= =?UTF-8?q?=C3=A9ment=20:(=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Component/Bonus/BonusComponent.cpp | 2 +- sources/Component/Bonus/BonusComponent.hpp | 3 +-- sources/Component/Bonus/PlayerBonusComponent.hpp | 4 ---- sources/Items/Bonus.cpp | 13 ------------- sources/Items/Bonus.hpp | 5 ----- sources/System/Bonus/PlayerBonusSystem.cpp | 5 ----- sources/System/Health/HealthSystem.cpp | 5 ++--- 7 files changed, 4 insertions(+), 33 deletions(-) diff --git a/sources/Component/Bonus/BonusComponent.cpp b/sources/Component/Bonus/BonusComponent.cpp index 98ed6d95..c56e81e6 100644 --- a/sources/Component/Bonus/BonusComponent.cpp +++ b/sources/Component/Bonus/BonusComponent.cpp @@ -20,7 +20,7 @@ namespace BBM { double rnd = static_cast(std::rand()) / RAND_MAX; if (rnd < 0.4) - return (static_cast(std::rand() % (IGNOREWALLS - 1) + 1)); + return (static_cast(std::rand() % (DAMAGEINC - 1) + 1)); return (NOTHING); } } \ No newline at end of file diff --git a/sources/Component/Bonus/BonusComponent.hpp b/sources/Component/Bonus/BonusComponent.hpp index 75dc79c6..94284c23 100644 --- a/sources/Component/Bonus/BonusComponent.hpp +++ b/sources/Component/Bonus/BonusComponent.hpp @@ -21,8 +21,7 @@ namespace BBM BOMBSTOCK, SPEEDUP, EXPLOSIONINC, - DAMAGEINC, - IGNOREWALLS + DAMAGEINC }; std::chrono::nanoseconds disappearTimer = 5s; diff --git a/sources/Component/Bonus/PlayerBonusComponent.hpp b/sources/Component/Bonus/PlayerBonusComponent.hpp index 3c1adacc..6ce52e42 100644 --- a/sources/Component/Bonus/PlayerBonusComponent.hpp +++ b/sources/Component/Bonus/PlayerBonusComponent.hpp @@ -28,10 +28,6 @@ namespace BBM std::chrono::nanoseconds rangeBonusRate = 10s; //! @brief The number of nanosecond before the expiration of a range bonus. std::chrono::nanoseconds nextRangeBonusRate = rangeBonusRate; - //! @brief The number of seconds before a ignoreWalls expire. This variable is used to reset the nextSpeedBonusRate value. - std::chrono::nanoseconds ignoreWallsBonusRate = 15s; - //! @brief The number of nanosecond before the expiration of a ignoreWalls bonus. - std::chrono::nanoseconds nextIgnoreWallsBonusRate = ignoreWallsBonusRate; //! @inherit WAL::Component *clone(WAL::Entity &entity) const override; diff --git a/sources/Items/Bonus.cpp b/sources/Items/Bonus.cpp index b6af53d1..2dec424c 100644 --- a/sources/Items/Bonus.cpp +++ b/sources/Items/Bonus.cpp @@ -56,17 +56,4 @@ namespace BBM { controllable.speed = 0.35f; playerBonus.nextSpeedBonusRate = playerBonus.speedBonusRate; } - - void Bonus::IgnoreWallsBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis) - { - if (bonus.shouldDelete()) - return; - if (player.hasComponent()) { - auto &playerBonus = player.getComponent(); - auto &bombHolder = player.getComponent(); - playerBonus.nextIgnoreWallsBonusRate = playerBonus.ignoreWallsBonusRate; - std::cout << "Explosion is supposed to pass through walls here" << std::endl; - //bombHolder.ignoreWalls = true; - } - } } \ No newline at end of file diff --git a/sources/Items/Bonus.hpp b/sources/Items/Bonus.hpp index 36a37607..185b5a26 100644 --- a/sources/Items/Bonus.hpp +++ b/sources/Items/Bonus.hpp @@ -29,10 +29,5 @@ namespace BBM { //! @param player the entity on which the effect will be applied //! @brief Apply bonus effect that allows to run faster static void SpeedUpBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis); - - //! @param bonus bonus - //! @param player the entity on which the effect will be applied - //! @brief Apply bonus effect that allows bomb explosion to pass through walls - static void IgnoreWallsBonus(WAL::Entity &player, const WAL::Entity &bonus, CollisionComponent::CollidedAxis axis); }; } \ No newline at end of file diff --git a/sources/System/Bonus/PlayerBonusSystem.cpp b/sources/System/Bonus/PlayerBonusSystem.cpp index f8aa721f..432a6807 100644 --- a/sources/System/Bonus/PlayerBonusSystem.cpp +++ b/sources/System/Bonus/PlayerBonusSystem.cpp @@ -23,11 +23,6 @@ namespace BBM playerBonus.nextSpeedBonusRate = playerBonus.speedBonusRate; controllable.speed = 0.25f; } - playerBonus.nextIgnoreWallsBonusRate -= dtime; - if (playerBonus.nextIgnoreWallsBonusRate <= 0ns) { - playerBonus.nextIgnoreWallsBonusRate = playerBonus.ignoreWallsBonusRate; - //holder.ignoreWalls = false; - } playerBonus.nextDamageBonusRate -= dtime; if (playerBonus.nextDamageBonusRate <= 0ns) { playerBonus.nextDamageBonusRate = playerBonus.damageBonusRate; diff --git a/sources/System/Health/HealthSystem.cpp b/sources/System/Health/HealthSystem.cpp index 01e3f433..195aca97 100644 --- a/sources/System/Health/HealthSystem.cpp +++ b/sources/System/Health/HealthSystem.cpp @@ -30,12 +30,11 @@ namespace BBM {BonusComponent::BonusType::BOMBSTOCK, "assets/items/bombup"}, {BonusComponent::BonusType::SPEEDUP, "assets/items/speedup"}, //{BonusComponent::BonusType::EXPLOSIONINC, "assets/items/explosion"}, - {BonusComponent::BonusType::DAMAGEINC, "assets/items/fireup"}, - {BonusComponent::BonusType::IGNOREWALLS, "assets/items/wallpass"} + {BonusComponent::BonusType::DAMAGEINC, "assets/items/fireup"} }; static std::vector> func = { &Bonus::BombUpBonus, &Bonus::SpeedUpBonus, //&Bonus::ExplosionRangeBonus, - &Bonus::DamageIncreasedBonus, &Bonus::IgnoreWallsBonus + &Bonus::DamageIncreasedBonus }; if (bonusType == BonusComponent::BonusType::NOTHING)