diff --git a/data/uking_functions.csv b/data/uking_functions.csv index ffadb7b5..c6f20a31 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -40397,15 +40397,15 @@ 0x000000710067ef10,sub_710067EF10,472, 0x000000710067f0e8,j__ZdlPv_290,4, 0x000000710067f0ec,sub_710067F0EC,8, -0x000000710067f0f4,_ZN3agl6detail9FileIOMgr18SingletonDisposer_D1Ev,100, -0x000000710067f158,sub_710067F158,108, -0x000000710067f1c4,aoc3::createInstance,144, -0x000000710067f254,nullsub_2172,4, -0x000000710067f258,j__ZdlPv_291,4, -0x000000710067f25c,aoc3::init,8, -0x000000710067f264,aoc3::setBlightRematchCount,40, -0x000000710067f28c,aoc3::incrementBlightRematchCount,48, -0x000000710067f2bc,aoc3::getBlightRematchCount,28, +0x000000710067f0f4,aoc3::SingletonDisposer::~SingletonDisposer,100,_ZN5uking21ChampionBalladManager18SingletonDisposer_D1Ev +0x000000710067f158,aoc3::SingletonDisposer::~SingletonDisposer,108,_ZN5uking21ChampionBalladManager18SingletonDisposer_D0Ev +0x000000710067f1c4,aoc3::createInstance,144,_ZN5uking21ChampionBalladManager14createInstanceEPN4sead4HeapE +0x000000710067f254,aoc3::~aoc3,4,_ZN5uking21ChampionBalladManagerD2Ev +0x000000710067f258,aoc3::~aoc3,4,_ZN5uking21ChampionBalladManagerD0Ev +0x000000710067f25c,aoc3::init,8,_ZN5uking21ChampionBalladManager4initEv +0x000000710067f264,aoc3::setBlightRematchCount,40,_ZN5uking21ChampionBalladManager21setBlightRematchCountEaNS_10BlightTypeE +0x000000710067f28c,aoc3::incrementBlightRematchCount,48,_ZN5uking21ChampionBalladManager27incrementBlightRematchCountENS_10BlightTypeE +0x000000710067f2bc,aoc3::getBlightRematchCount,28,_ZNK5uking21ChampionBalladManager21getBlightRematchCountENS_10BlightTypeE 0x000000710067f2d8,StasisMgr::deleteInstance,100, 0x000000710067f33c,StasisMgr::deleteInstanceDelete,108, 0x000000710067f3a8,StasisMgr::createInstance,136, diff --git a/src/Game/DLC/CMakeLists.txt b/src/Game/DLC/CMakeLists.txt index aec47721..0b0579b0 100644 --- a/src/Game/DLC/CMakeLists.txt +++ b/src/Game/DLC/CMakeLists.txt @@ -1,4 +1,6 @@ target_sources(uking PRIVATE + aocChampionBalladManager.cpp + aocChampionBalladManager.h aocHardModeManager.cpp aocHardModeManager.h aocManager.cpp diff --git a/src/Game/DLC/aocChampionBalladManager.cpp b/src/Game/DLC/aocChampionBalladManager.cpp new file mode 100644 index 00000000..0a0833a0 --- /dev/null +++ b/src/Game/DLC/aocChampionBalladManager.cpp @@ -0,0 +1,32 @@ +#include "Game/DLC/aocChampionBalladManager.h" + +namespace uking { + +SEAD_SINGLETON_DISPOSER_IMPL(ChampionBalladManager) + +void ChampionBalladManager::init() { + mBlightCounts = {}; +} + +void ChampionBalladManager::setBlightRematchCount(s8 count, BlightType blight_type) { + if (count >= 0 && blight_type <= BlightType::Water) { + if (count >= 30) { + count = 30; + } + mBlightCounts[u32(blight_type)] = count; + } +} + +void ChampionBalladManager::incrementBlightRematchCount(BlightType blight_type) { + if (blight_type <= BlightType::Water) { + s8 count = mBlightCounts[u32(blight_type)] + 1; + setBlightRematchCount(count, blight_type); + } +} + +s8 ChampionBalladManager::getBlightRematchCount(BlightType blight_type) const { + if (blight_type <= BlightType::Water) + return mBlightCounts[u32(blight_type)]; + return 0; +} +} // namespace uking diff --git a/src/Game/DLC/aocChampionBalladManager.h b/src/Game/DLC/aocChampionBalladManager.h new file mode 100644 index 00000000..22c07b60 --- /dev/null +++ b/src/Game/DLC/aocChampionBalladManager.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include + +namespace uking { + +enum class BlightType : u32 { Wind, Electric, Fire, Water }; + +class ChampionBalladManager { + SEAD_SINGLETON_DISPOSER(ChampionBalladManager) + ChampionBalladManager() = default; + virtual ~ChampionBalladManager() = default; + +public: + void init(); + void setBlightRematchCount(s8 count, BlightType blight_type); + void incrementBlightRematchCount(BlightType blight_type); + s8 getBlightRematchCount(BlightType blight_type) const; + +private: + sead::SafeArray mBlightCounts; +}; + +} // namespace uking