Wincent's attempt at making LU into something it isn't supposed to be, an ARPG.
This commit is contained in:
wincent
2023-07-15 10:54:41 +02:00
parent 0d6bd33f9e
commit 5973430720
54 changed files with 2634 additions and 76 deletions

View File

@@ -6,6 +6,7 @@
#include "dLogger.h"
#include "Game.h"
#include "eReplicaComponentType.h"
#include "LevelProgressionComponent.h"
void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_stream, const BehaviorBranchContext branch) {
auto* entity = EntityManager::Instance()->GetEntity(branch.target);
@@ -24,7 +25,18 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_str
return;
}
destroyable->Repair(this->m_armor);
int32_t toApply = this->m_armor * 5;
auto* levelProgressComponent = entity->GetComponent<LevelProgressionComponent>();
if (levelProgressComponent != nullptr) {
toApply *= levelProgressComponent->GetLevel();
}
// Apply a standard deviations of 20%
toApply = static_cast<uint32_t>(toApply * (1.0f + (static_cast<float>(rand() % 40) / 100.0f) - 0.2f));
destroyable->Repair(toApply);
}
void RepairBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bit_stream, const BehaviorBranchContext branch) {