From 419f8f46bb40763d9602e4f975a033194281c5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 28 Sep 2026 03:39:31 +0200 Subject: ksys/act: split IDamageManager out of DamageManagerBase DamageManagerBase's root base class (previously DamageManagerBase_UnknownBase1) holds the damage callback list, and its code is linked among the ActorSystem objects rather than with the Game/Actor/Damage files. It appears to be an engine-side abstract base, so let's move it to KingSystem/ActorSystem as ksys::act::IDamageManager (unofficial name, following the ksys IManager/Manager pattern and Actor::getDamageMgr), together with DamageCallback and Struct20Base, and have Actor::getDamageMgr return it. DamageManagerBase now overrides its getters and inherits addDamageCallback/removeDamageCallback from it. The rest of the damage code stays in Game/Actor/Damage but is regrouped to match link order: Struct20::combineMaybe moves into actDamageManagerBase.cpp, Struct20::reset becomes inline and dmgStruct20.cpp becomes actDamageMgr.cpp. The uking::dmg namespace is merged into uking::act, so the files there take the act prefix too, and dmgInfoManager becomes actDamageInfoMgr after the class it holds. (AI assisted using Claude Fable 5.1 and Claude Opus 5.5) --- src/Game/UI/uiUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Game/UI/uiUtils.cpp') diff --git a/src/Game/UI/uiUtils.cpp b/src/Game/UI/uiUtils.cpp index 3d4e4979..839f3336 100644 --- a/src/Game/UI/uiUtils.cpp +++ b/src/Game/UI/uiUtils.cpp @@ -1,6 +1,6 @@ #include "Game/UI/uiUtils.h" #include "Game/AOC/aocHardModeManager.h" -#include "Game/Actor/Damage/dmgInfoManager.h" +#include "Game/Actor/Damage/actDamageInfoMgr.h" #include "Game/Actor/actPlayerCreateMgr.h" #include "Game/Actor/actWeapon.h" #include "Game/UI/uiPauseMenuDataMgr.h" @@ -56,7 +56,7 @@ void getWeaponStats(const PouchItem& item, WeaponStats* stats) { } else if (isMasterSwordItem(item)) { int power = 0; if (item.getValue() > 0) { - const bool is_true_form = dmg::DamageInfoMgr::instance()->isTrueFormMasterSword(); + const bool is_true_form = act::DamageInfoMgr::instance()->isTrueFormMasterSword(); auto* info_ = ksys::act::InfoData::instance(); const char* name = item.getName().cstr(); if (is_true_form) { @@ -69,7 +69,7 @@ void getWeaponStats(const PouchItem& item, WeaponStats* stats) { stats->power = power; } else if (isOneHitObliteratorActorName(item.getName())) { - stats->power = dmg::DamageInfoMgr::instance()->isOneHitObliteratorActive() ? 99999 : 1; + stats->power = act::DamageInfoMgr::instance()->isOneHitObliteratorActive() ? 99999 : 1; } else { stats->power = ksys::act::getAttackPower(ksys::act::InfoData::instance(), item.getName().cstr()); -- cgit v1.2.3