mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-01 09:45:42 +00:00
bonus working, just miss 3 bonuses (cause bombholder isn't finish yet)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#include "BonusComponent.hpp"
|
||||
#include <map>
|
||||
|
||||
namespace BBM {
|
||||
BonusComponent::BonusComponent(WAL::Entity &entity)
|
||||
@@ -16,6 +17,10 @@ namespace BBM {
|
||||
|
||||
BonusComponent::BonusType BonusComponent::getRandomBonusType() const
|
||||
{
|
||||
return (static_cast<BonusType>(std::rand() % IGNOREWALLS));
|
||||
double rnd = static_cast<double>(std::rand()) / RAND_MAX;
|
||||
|
||||
if (rnd < 0.4)
|
||||
return (static_cast<BonusType>(std::rand() % (IGNOREWALLS - 1) + 1));
|
||||
return (NOTHING);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user