diff options
| author | Léo Lam <leo@leolam.fr> | 2021-01-21 14:01:41 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2021-01-21 18:12:04 +0100 |
| commit | 620eb2b39ea1f5172617b7400239fb77ba59b451 (patch) | |
| tree | 0d540129825e1b283c694b2b0100d62d5edfb189 /src/Game/UI/uiUtils.cpp | |
| parent | 3b996a212cb43b2fe87cb48abff03b5c4ca32b58 (diff) | |
uking/ui: Add even more inventory functions
Diffstat (limited to 'src/Game/UI/uiUtils.cpp')
| -rw-r--r-- | src/Game/UI/uiUtils.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Game/UI/uiUtils.cpp b/src/Game/UI/uiUtils.cpp index fce87fb8..101a00d4 100644 --- a/src/Game/UI/uiUtils.cpp +++ b/src/Game/UI/uiUtils.cpp @@ -1,7 +1,23 @@ #include "Game/UI/uiUtils.h" +#include "Game/Actor/actWeapon.h" +#include "KingSystem/ActorSystem/actInfoCommon.h" +#include "KingSystem/ActorSystem/actInfoData.h" +#include "Game/UI/uiPauseMenuDataMgr.h" namespace uking::ui { +bool isMasterSwordItem(const PouchItem& item) { + return item.getType() == PouchItemType::Sword && isMasterSwordActorName(item.getName()); +} + +int getWeaponInventoryLife(const sead::SafeString& name) { + auto* info = ksys::act::InfoData::instance(); + if (!info) + return 0; + const int life = ksys::act::getGeneralLife(info, name.cstr()); + return act::WeaponModifierInfo::getLifeMultiplier() * life; +} + bool isMasterSwordActorName(const sead::SafeString& name) { return name == "Weapon_Sword_070"; } |
