removed ignore walls bonus (sorry clément :( )

This commit is contained in:
HENRY Benjamin
2021-06-09 12:15:01 +02:00
parent 5c357af61d
commit 93a4fa792c
7 changed files with 4 additions and 33 deletions

View File

@@ -20,7 +20,7 @@ namespace BBM {
double rnd = static_cast<double>(std::rand()) / RAND_MAX;
if (rnd < 0.4)
return (static_cast<BonusType>(std::rand() % (IGNOREWALLS - 1) + 1));
return (static_cast<BonusType>(std::rand() % (DAMAGEINC - 1) + 1));
return (NOTHING);
}
}

View File

@@ -21,8 +21,7 @@ namespace BBM
BOMBSTOCK,
SPEEDUP,
EXPLOSIONINC,
DAMAGEINC,
IGNOREWALLS
DAMAGEINC
};
std::chrono::nanoseconds disappearTimer = 5s;

View File

@@ -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;

View File

@@ -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<BombHolderComponent>()) {
auto &playerBonus = player.getComponent<PlayerBonusComponent>();
auto &bombHolder = player.getComponent<BombHolderComponent>();
playerBonus.nextIgnoreWallsBonusRate = playerBonus.ignoreWallsBonusRate;
std::cout << "Explosion is supposed to pass through walls here" << std::endl;
//bombHolder.ignoreWalls = true;
}
}
}

View File

@@ -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);
};
}

View File

@@ -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;

View File

@@ -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<std::function<void (WAL::Entity &, const WAL::Entity &, CollisionComponent::CollidedAxis)>> func = {
&Bonus::BombUpBonus, &Bonus::SpeedUpBonus, //&Bonus::ExplosionRangeBonus,
&Bonus::DamageIncreasedBonus, &Bonus::IgnoreWallsBonus
&Bonus::DamageIncreasedBonus
};
if (bonusType == BonusComponent::BonusType::NOTHING)