mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-26 11:18:16 +00:00
Grim LU
Wincent's attempt at making LU into something it isn't supposed to be, an ARPG.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user