summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMonsterDruide1 <5958456@gmail.com>2021-06-20 23:11:18 +0200
committerMonsterDruide1 <5958456@gmail.com>2021-06-21 14:20:32 +0200
commit0e4c71bfd8d0230552fa431af768af6bb74bf28e (patch)
treeabc6689db561c0ce4b308385319cc1dac617fa7e /src
parent3c01b50afc653de47761bd9410949593af19abe2 (diff)
Decompiled aoc3/ChampionBalladManager
Change getBlightRematchCount to s8 Fixing review messages Decompiled aoc3/ChampionBalladManager
Diffstat (limited to 'src')
-rw-r--r--src/Game/DLC/CMakeLists.txt2
-rw-r--r--src/Game/DLC/aocChampionBalladManager.cpp32
-rw-r--r--src/Game/DLC/aocChampionBalladManager.h26
3 files changed, 60 insertions, 0 deletions
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 <array>
+#include <container/seadSafeArray.h>
+#include <heap/seadDisposer.h>
+
+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<u8, 4> mBlightCounts;
+};
+
+} // namespace uking