Split out Level progression component (#671)

* Split out Level progression component
from Character Component
This is to get to the Player forced movement Comp in a sane way

* move XML to component insted of abusing charComp

* use overrides
should probably make everything that calls that call it correctly

* fix linking issue
This commit is contained in:
Aaron Kimbrell
2022-07-24 13:04:02 -05:00
committed by GitHub
parent ef0a3c6d0b
commit f2d1c5d26d
11 changed files with 185 additions and 117 deletions

View File

@@ -1,10 +1,11 @@
#include "Mission.h"
#include "Mission.h"
#include <ctime>
#include "CDClientManager.h"
#include "Character.h"
#include "CharacterComponent.h"
#include "LevelProgressionComponent.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "Game.h"
@@ -406,6 +407,7 @@ void Mission::YieldRewards() {
auto* character = GetUser()->GetLastUsedChar();
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
auto* levelComponent = entity->GetComponent<LevelProgressionComponent>();
auto* characterComponent = entity->GetComponent<CharacterComponent>();
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
auto* missionComponent = entity->GetComponent<MissionComponent>();
@@ -433,7 +435,7 @@ void Mission::YieldRewards() {
int32_t coinsToSend = 0;
if (info->LegoScore > 0) {
eLootSourceType lootSource = info->isMission ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT;
if(characterComponent->GetLevel() >= dZoneManager::Instance()->GetMaxLevel()) {
if(levelComponent->GetLevel() >= dZoneManager::Instance()->GetMaxLevel()) {
// Since the character is at the level cap we reward them with coins instead of UScore.
coinsToSend += info->LegoScore * dZoneManager::Instance()->GetLevelCapCurrencyConversion();
} else {