uking/action: Add actionCurseRRematchCount

This commit is contained in:
MonsterDruide1 2021-06-21 17:26:41 +02:00
parent ae98877a99
commit adcad916b7
3 changed files with 33 additions and 1 deletions

View File

@ -1510,7 +1510,7 @@
0x00000071000547d0,_ZN5uking6action18CurseRRematchCountD1Ev,20,_ZN5uking6action18CurseRRematchCountD1Ev 0x00000071000547d0,_ZN5uking6action18CurseRRematchCountD1Ev,20,_ZN5uking6action18CurseRRematchCountD1Ev
0x00000071000547e4,_ZN5uking6action18CurseRRematchCountD0Ev,52,_ZN5uking6action18CurseRRematchCountD0Ev 0x00000071000547e4,_ZN5uking6action18CurseRRematchCountD0Ev,52,_ZN5uking6action18CurseRRematchCountD0Ev
0x0000007100054818,_ZN5uking6action18CurseRRematchCount5init_EPN4sead4HeapE,8,_ZN5uking6action18CurseRRematchCount5init_EPN4sead4HeapE 0x0000007100054818,_ZN5uking6action18CurseRRematchCount5init_EPN4sead4HeapE,8,_ZN5uking6action18CurseRRematchCount5init_EPN4sead4HeapE
0x0000007100054820,_ZN5uking6action18CurseRRematchCount8oneShot_Ev,208, 0x0000007100054820,_ZN5uking6action18CurseRRematchCount8oneShot_Ev,208,_ZN5uking6action18CurseRRematchCount8oneShot_Ev
0x00000071000548f0,_ZN5uking6action18CurseRRematchCount11loadParams_Ev,220,_ZN5uking6action18CurseRRematchCount11loadParams_Ev 0x00000071000548f0,_ZN5uking6action18CurseRRematchCount11loadParams_Ev,220,_ZN5uking6action18CurseRRematchCount11loadParams_Ev
0x00000071000549cc,_ZNK5uking6action18CurseRRematchCount27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE,288,_ZNK5uking6action18CurseRRematchCount27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071000549cc,_ZNK5uking6action18CurseRRematchCount27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE,288,_ZNK5uking6action18CurseRRematchCount27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x0000007100054aec,_ZNK5uking6action18CurseRRematchCount18getRuntimeTypeInfoEv,92,_ZNK5uking6action18CurseRRematchCount18getRuntimeTypeInfoEv 0x0000007100054aec,_ZNK5uking6action18CurseRRematchCount18getRuntimeTypeInfoEv,92,_ZNK5uking6action18CurseRRematchCount18getRuntimeTypeInfoEv

Can't render this file because it is too large.

View File

@ -1,4 +1,6 @@
#include "Game/AI/Action/actionCurseRRematchCount.h" #include "Game/AI/Action/actionCurseRRematchCount.h"
#include "Game/DLC/aocChampionBalladManager.h"
#include "KingSystem/GameData/gdtManager.h"
namespace uking::action { namespace uking::action {
@ -16,4 +18,32 @@ void CurseRRematchCount::loadParams_() {
getDynamicParam(&mGameDataStringCounterName_d, "GameDataStringCounterName"); getDynamicParam(&mGameDataStringCounterName_d, "GameDataStringCounterName");
} }
bool CurseRRematchCount::oneShot_() {
auto* manager = ChampionBalladManager::instance();
if (!manager)
return false;
auto blight = BlightType(*mCurseRType_d);
if (blight > BlightType::Water)
return false;
if (*mRematchCount_d == 0)
manager->incrementBlightRematchCount(blight);
else if (*mRematchCount_d == 1)
manager->setBlightRematchCount(0, blight);
else
return false;
if (mGameDataStringCounterName_d.isEmpty())
return true;
auto* game_data_manager = ksys::gdt::Manager::instance();
if (game_data_manager) {
s8 rematchCount = manager->getBlightRematchCount(blight);
game_data_manager->setS32(rematchCount, mGameDataStringCounterName_d);
return true;
}
return false;
}
} // namespace uking::action } // namespace uking::action

View File

@ -14,6 +14,8 @@ public:
void loadParams_() override; void loadParams_() override;
protected: protected:
bool oneShot_() override;
// dynamic_param at offset 0x20 // dynamic_param at offset 0x20
int* mRematchCount_d{}; int* mRematchCount_d{};
// dynamic_param at offset 0x28 // dynamic_param at offset 0x28