mirror of https://github.com/zeldaret/botw.git
Merge pull request #133 from Pistonight/playerinfo
PlayerInfo stuff that doesn't require PlayerBase
This commit is contained in:
commit
d6957d9d2c
|
@ -26,6 +26,7 @@
|
|||
0x00000071024D8D58,_ZTVN4ksys3act2ai10ActionBaseE
|
||||
0x00000071025129E0,_ZTVN4ksys3act2ai6ActionE
|
||||
0x0000007102513268,_ZTVN4ksys3act2ai2AiE
|
||||
0x00000071025CDB60,_ZN4ksys3act10PlayerInfo9sInstanceE
|
||||
0x00000071025F75B0,pfnc_nvnDeviceBuilderSetDefaults
|
||||
0x00000071025F75B8,pfnc_nvnDeviceBuilderSetFlags
|
||||
0x00000071025F75C0,pfnc_nvnDeviceInitialize
|
||||
|
|
|
|
@ -51629,7 +51629,7 @@ Address,Quality,Size,Name
|
|||
0x000000710084b62c,U,000084,Player::setItemVel
|
||||
0x000000710084b680,U,000084,Player::setItemSwimVel
|
||||
0x000000710084b6d4,U,000084,
|
||||
0x000000710084b728,U,000080,Player::addExtraLife
|
||||
0x000000710084b728,U,000080,Player::setExtraLife
|
||||
0x000000710084b778,U,000072,Player::addExtraStamina
|
||||
0x000000710084b7c0,U,000080,
|
||||
0x000000710084b810,U,000080,
|
||||
|
@ -52122,32 +52122,32 @@ Address,Quality,Size,Name
|
|||
0x00000071008525f8,U,000092,
|
||||
0x0000007100852654,U,000072,
|
||||
0x000000710085269c,U,000372,
|
||||
0x0000007100852810,U,000048,PlayerInfo::S1::ctor
|
||||
0x0000007100852840,U,000004,j_nullsub_2594
|
||||
0x0000007100852844,U,000036,
|
||||
0x0000007100852868,U,000020,PlayerInfo::S0::ctor
|
||||
0x000000710085287c,U,000004,nullsub_2594
|
||||
0x0000007100852880,U,000004,j__ZdlPv_369
|
||||
0x0000007100852884,U,000048,PlayerInfo::S2::ctor
|
||||
0x00000071008528b4,U,000004,j_nullsub_2594_0
|
||||
0x00000071008528b8,U,000036,
|
||||
0x0000007100852810,O,000048,_ZN4ksys3act10PlayerInfo5Info1C1Ev
|
||||
0x0000007100852840,O,000004,_ZN4ksys3act10PlayerInfo5Info1D2Ev
|
||||
0x0000007100852844,O,000036,_ZN4ksys3act10PlayerInfo5Info1D0Ev
|
||||
0x0000007100852868,O,000020,_ZN4ksys3act14PlayerInfoBaseC1Ev
|
||||
0x000000710085287c,O,000004,_ZN4ksys3act14PlayerInfoBaseD2Ev
|
||||
0x0000007100852880,O,000004,_ZN4ksys3act14PlayerInfoBaseD0Ev
|
||||
0x0000007100852884,O,000048,_ZN4ksys3act10PlayerInfo5Info2C1Ev
|
||||
0x00000071008528b4,O,000004,_ZN4ksys3act10PlayerInfo5Info2D2Ev
|
||||
0x00000071008528b8,O,000036,_ZN4ksys3act10PlayerInfo5Info2D0Ev
|
||||
0x00000071008528dc,U,000004,nullsub_2595
|
||||
0x00000071008528e0,U,000048,PlayerInfo::S3::ctor
|
||||
0x0000007100852910,U,000004,j_nullsub_2594_1
|
||||
0x0000007100852914,U,000036,
|
||||
0x0000007100852938,U,000048,PlayerInfo::S4::ctor
|
||||
0x0000007100852968,U,000004,j_nullsub_2594_2
|
||||
0x000000710085296c,U,000036,
|
||||
0x0000007100852990,U,000048,PlayerInfo::S5::ctor
|
||||
0x00000071008529c0,U,000004,j_nullsub_2594_3
|
||||
0x00000071008529c4,U,000036,
|
||||
0x00000071008528e0,O,000048,_ZN4ksys3act10PlayerInfo5Info3C1Ev
|
||||
0x0000007100852910,O,000004,_ZN4ksys3act10PlayerInfo5Info3D2Ev
|
||||
0x0000007100852914,O,000036,_ZN4ksys3act10PlayerInfo5Info3D0Ev
|
||||
0x0000007100852938,O,000048,_ZN4ksys3act10PlayerInfo5Info4C1Ev
|
||||
0x0000007100852968,O,000004,_ZN4ksys3act10PlayerInfo5Info4D2Ev
|
||||
0x000000710085296c,O,000036,_ZN4ksys3act10PlayerInfo5Info4D0Ev
|
||||
0x0000007100852990,O,000048,_ZN4ksys3act10PlayerInfo5Info5C1Ev
|
||||
0x00000071008529c0,O,000004,_ZN4ksys3act10PlayerInfo5Info5D2Ev
|
||||
0x00000071008529c4,O,000036,_ZN4ksys3act10PlayerInfo5Info5D0Ev
|
||||
0x00000071008529e8,U,000008,return1_0
|
||||
0x00000071008529f0,U,000048,PlayerInfo::S6::ctor
|
||||
0x0000007100852a20,U,000004,j_nullsub_2594_4
|
||||
0x0000007100852a24,U,000036,
|
||||
0x0000007100852a48,U,000048,PlayerInfo::S7::ctor
|
||||
0x0000007100852a78,U,000004,j_nullsub_2594_5
|
||||
0x0000007100852a7c,U,000036,
|
||||
0x00000071008529f0,O,000048,_ZN4ksys3act10PlayerInfo5Info6C1Ev
|
||||
0x0000007100852a20,O,000004,_ZN4ksys3act10PlayerInfo5Info6D2Ev
|
||||
0x0000007100852a24,O,000036,_ZN4ksys3act10PlayerInfo5Info6D0Ev
|
||||
0x0000007100852a48,O,000048,_ZN4ksys3act10PlayerInfo5Info7C1Ev
|
||||
0x0000007100852a78,O,000004,_ZN4ksys3act10PlayerInfo5Info7D2Ev
|
||||
0x0000007100852a7c,O,000036,_ZN4ksys3act10PlayerInfo5Info7D0Ev
|
||||
0x0000007100852aa0,U,000240,Player::RideInfo::ctor
|
||||
0x0000007100852b90,U,000152,Player::RideInfo::init
|
||||
0x0000007100852c28,U,000044,Player::RideInfo::x_0
|
||||
|
@ -52164,46 +52164,46 @@ Address,Quality,Size,Name
|
|||
0x0000007100854028,U,000036,
|
||||
0x000000710085404c,U,000288,
|
||||
0x000000710085416c,U,000092,
|
||||
0x00000071008541c8,U,000100,
|
||||
0x000000710085422c,U,000108,
|
||||
0x0000007100854298,U,000136,PlayerInfo::createInstance
|
||||
0x0000007100854320,U,000192,PlayerInfo::ctor
|
||||
0x00000071008543e0,U,000124,PlayerInfo::dtor
|
||||
0x000000710085445c,U,000132,PlayerInfo::dtorDelete
|
||||
0x00000071008544e0,U,000008,PlayerInfo::init
|
||||
0x00000071008541c8,O,000100,_ZN4ksys3act10PlayerInfo18SingletonDisposer_D1Ev
|
||||
0x000000710085422c,O,000108,_ZN4ksys3act10PlayerInfo18SingletonDisposer_D0Ev
|
||||
0x0000007100854298,O,000136,_ZN4ksys3act10PlayerInfo14createInstanceEPN4sead4HeapE
|
||||
0x0000007100854320,O,000192,_ZN4ksys3act10PlayerInfoC1Ev
|
||||
0x00000071008543e0,O,000124,_ZN4ksys3act10PlayerInfoD1Ev
|
||||
0x000000710085445c,O,000132,_ZN4ksys3act10PlayerInfoD0Ev
|
||||
0x00000071008544e0,O,000008,_ZN4ksys3act10PlayerInfo4initEv
|
||||
0x00000071008544e8,U,000084,PlayerInfo::setPlayerActor
|
||||
0x000000710085453c,U,000028,PlayerInfo::resetActor
|
||||
0x0000007100854558,U,000012,
|
||||
0x0000007100854564,U,000008,PlayerInfo::__auto2
|
||||
0x000000710085456c,U,000068,PlayerInfo::getActor
|
||||
0x00000071008545b0,U,000068,PlayerInfo::getActor_0
|
||||
0x000000710085453c,O,000028,_ZN4ksys3act10PlayerInfo11resetPlayerEPNS0_10PlayerBaseE
|
||||
0x0000007100854558,O,000012,_ZN4ksys3act10PlayerInfo12acquireHorseEPNS0_8BaseProcE
|
||||
0x0000007100854564,O,000008,_ZN4ksys3act10PlayerInfo12setHorseLinkERKNS0_12BaseProcLinkE
|
||||
0x000000710085456c,O,000068,_ZNK4ksys3act10PlayerInfo9getPlayerEv
|
||||
0x00000071008545b0,O,000068,_ZNK4ksys3act10PlayerInfo10getPlayer_Ev
|
||||
0x00000071008545f4,U,000212,PlayerInfo::getRiddenHorse
|
||||
0x00000071008546c8,U,000016,PlayerInfo::setPlayerActorMaxHeartValue
|
||||
0x00000071008546d8,U,000024,PlayerInfo::getMaxLife
|
||||
0x00000071008546f0,U,000052,PlayerInfo::setMaxHeartValue
|
||||
0x0000007100854724,U,000012,PlayerInfo::getMaxHeartValue
|
||||
0x0000007100854730,U,000044,PlayerInfo::updateMaxHeartValue
|
||||
0x000000710085475c,U,000052,PlayerInfo::setLife
|
||||
0x0000007100854790,U,000052,PlayerInfo::getLife
|
||||
0x00000071008547c4,U,000164,PlayerInfo::updateCurrentHartFlagFromPlayer
|
||||
0x00000071008546c8,U,000016,PlayerInfo::setMaxLifeForPlayerActor
|
||||
0x00000071008546d8,O,000024,_ZNK4ksys3act10PlayerInfo25getMaxLifeFromPlayerActorEv
|
||||
0x00000071008546f0,O,000052,_ZN4ksys3act10PlayerInfo16setMaxHeartValueEi
|
||||
0x0000007100854724,O,000012,_ZNK4ksys3act10PlayerInfo16getMaxHeartValueEv
|
||||
0x0000007100854730,O,000044,_ZN4ksys3act10PlayerInfo31updateMaxHeartValueFromGameDataEv
|
||||
0x000000710085475c,O,000052,_ZN4ksys3act10PlayerInfo21setLifeForPlayerActorEi
|
||||
0x0000007100854790,O,000052,_ZNK4ksys3act10PlayerInfo22getLifeFromPlayerActorEv
|
||||
0x00000071008547c4,U,000164,PlayerInfo::updateCurrentHartFlagFromPlayerActor
|
||||
0x0000007100854868,U,000100,PlayerInfo::updateLifeAfterGameOver
|
||||
0x00000071008548cc,U,000168,PlayerInfo::resetPlayerPullSwordStartLife
|
||||
0x0000007100854974,U,000096,PlayerInfo::saveLifeInfoForPlayerPullSword
|
||||
0x00000071008549d4,U,000076,
|
||||
0x0000007100854a20,U,000052,PlayerInfo::setStamina
|
||||
0x0000007100854a54,U,000008,PlayerInfo::getStaminaCurrentMax_0
|
||||
0x0000007100854a5c,U,000040,PlayerInfo::updateStaminaCurrentMax
|
||||
0x0000007100854a84,U,000052,PlayerInfo::setStaminaMax
|
||||
0x0000007100854ab8,U,000008,PlayerInfo::getStaminaMax
|
||||
0x0000007100854ac0,U,000040,PlayerInfo::updateStaminaMax
|
||||
0x0000007100854ae8,U,000016,PlayerInfo::x_1
|
||||
0x0000007100854af8,U,000024,PlayerInfo::getMaxStamina
|
||||
0x0000007100854b10,U,000072,PlayerInfo::recoverEnergy
|
||||
0x0000007100854b58,U,000072,PlayerInfo::recoverPlayerCondition
|
||||
0x0000007100854ba0,U,000008,PlayerInfo::getActorWithoutAnyChecks
|
||||
0x0000007100854ba8,U,000120,PlayerInfo::getPlayerPos
|
||||
0x0000007100854c20,U,000120,PlayerInfo::getPlayerPosForPostCalc
|
||||
0x0000007100854c98,U,000048,
|
||||
0x00000071008548cc,U,000168,PlayerInfo::resetLifeToBeforeSwordPull
|
||||
0x0000007100854974,U,000096,PlayerInfo::saveLifeInfoForSwordPull
|
||||
0x00000071008549d4,O,000076,_ZN4ksys3act10PlayerInfo11recoverLifeEv
|
||||
0x0000007100854a20,O,000052,_ZN4ksys3act10PlayerInfo20setStaminaCurrentMaxEf
|
||||
0x0000007100854a54,O,000008,_ZNK4ksys3act10PlayerInfo20getStaminaCurrentMaxEv
|
||||
0x0000007100854a5c,O,000040,_ZN4ksys3act10PlayerInfo35updateStaminaCurrentMaxFromGameDataEv
|
||||
0x0000007100854a84,O,000052,_ZN4ksys3act10PlayerInfo13setStaminaMaxEf
|
||||
0x0000007100854ab8,O,000008,_ZNK4ksys3act10PlayerInfo13getStaminaMaxEv
|
||||
0x0000007100854ac0,O,000040,_ZN4ksys3act10PlayerInfo28updateStaminaMaxFromGameDataEv
|
||||
0x0000007100854ae8,U,000016,PlayerInfo::setStaminaMax
|
||||
0x0000007100854af8,U,000024,PlayerInfo::getStaminaMax
|
||||
0x0000007100854b10,U,000072,PlayerInfo::recoverStamina
|
||||
0x0000007100854b58,U,000072,PlayerInfo::recoverCondition
|
||||
0x0000007100854ba0,O,000008,_ZN4ksys3act10PlayerInfo18getPlayerUncheckedEv
|
||||
0x0000007100854ba8,O,000120,_ZN4ksys3act10PlayerInfo12getPlayerPosEv
|
||||
0x0000007100854c20,O,000120,_ZN4ksys3act10PlayerInfo23getPlayerPosForPostCalcEv
|
||||
0x0000007100854c98,U,000048,PlayerInfo::getPlayerM265
|
||||
0x0000007100854cc8,U,001052,Player::x_43
|
||||
0x00000071008550e4,U,000280,
|
||||
0x00000071008551fc,U,000292,Player::x_25
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -13,7 +13,7 @@ int ComparePlayerHeart::doQuery() {
|
|||
if (pi == nullptr)
|
||||
return 0;
|
||||
|
||||
return pi->getLife() >= *mThreshold;
|
||||
return pi->getLifeFromPlayerActor() >= *mThreshold;
|
||||
}
|
||||
|
||||
void ComparePlayerHeart::loadParams(const evfl::QueryArg& arg) {
|
||||
|
|
|
@ -13,7 +13,7 @@ int ComparePlayerMaxHeart::doQuery() {
|
|||
if (pi == nullptr)
|
||||
return 0;
|
||||
|
||||
s32 full_hearts = pi->getMaxHearts() / 4;
|
||||
s32 full_hearts = pi->getMaxHeartValue() / 4;
|
||||
return full_hearts >= *mThreshold;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int ComparePlayerMaxStamina::doQuery() {
|
|||
if (pi == nullptr)
|
||||
return 0;
|
||||
|
||||
s32 stamina = pi->getMaxStamina();
|
||||
s32 stamina = pi->getStaminaMax();
|
||||
if (stamina % 200 <= 0)
|
||||
return stamina / 200 >= *mThreshold;
|
||||
else
|
||||
|
|
|
@ -15,8 +15,8 @@ int ComparePlayerOriginalHeart::doQuery() {
|
|||
if (PlayerInfo::instance() == nullptr)
|
||||
return 0;
|
||||
|
||||
s32 life = PlayerInfo::instance()->getLife();
|
||||
s32 hearts = PlayerInfo::instance()->getMaxHearts();
|
||||
s32 life = PlayerInfo::instance()->getLifeFromPlayerActor();
|
||||
s32 hearts = PlayerInfo::instance()->getMaxHeartValue();
|
||||
s32 compare;
|
||||
if (life <= hearts)
|
||||
compare = life;
|
||||
|
|
|
@ -118,6 +118,8 @@ target_sources(uking PRIVATE
|
|||
actPhysicsUserTag.h
|
||||
actPlayerInfo.cpp
|
||||
actPlayerInfo.h
|
||||
actPlayerInfoBase.cpp
|
||||
actPlayerInfoStub.cpp
|
||||
actTag.h
|
||||
|
||||
actionDummyAction.cpp
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <prim/seadSafeString.h>
|
||||
#include "KingSystem/ActorSystem/actActor.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
// TODO
|
||||
class PlayerBase {
|
||||
class PlayerBase : public Actor {
|
||||
public:
|
||||
// FIXME: name for x and name+type for y
|
||||
void switchEquipment(const sead::SafeString& slot, int frames, int x = -1,
|
||||
const uintptr_t& y = {});
|
||||
|
||||
// FIXME: name for x
|
||||
void setExtraLife(s32 extra_life, f32 x);
|
||||
};
|
||||
|
||||
} // namespace ksys::act
|
||||
|
|
|
@ -1 +1,134 @@
|
|||
#include "KingSystem/ActorSystem/actPlayerInfo.h"
|
||||
#include "KingSystem/ActorSystem/Profiles/actPlayerBase.h"
|
||||
#include "KingSystem/ActorSystem/actActorConstDataAccess.h"
|
||||
#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProc.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcMgr.h"
|
||||
#include "KingSystem/GameData/gdtCommonFlagsUtils.h"
|
||||
#include "KingSystem/ksys.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
SEAD_SINGLETON_DISPOSER_IMPL(PlayerInfo)
|
||||
|
||||
PlayerInfo::PlayerInfo() = default;
|
||||
PlayerInfo::~PlayerInfo() = default;
|
||||
|
||||
bool PlayerInfo::init() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void PlayerInfo::resetPlayer(PlayerBase* player) {
|
||||
if (mPlayerActor == player) {
|
||||
mPlayerActor = nullptr;
|
||||
ksys::setPlayerLink(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
bool PlayerInfo::acquireHorse(BaseProc* horse) {
|
||||
return mHorseLink.acquire(horse, false);
|
||||
}
|
||||
|
||||
void PlayerInfo::setHorseLink(const BaseProcLink& horse_link) {
|
||||
mHorseLink = horse_link;
|
||||
}
|
||||
|
||||
PlayerBase* PlayerInfo::getPlayer() const {
|
||||
if (!mPlayerActor) {
|
||||
return nullptr;
|
||||
}
|
||||
BaseProcMgr::instance()->isAccessingProcSafe(mPlayerActor, nullptr);
|
||||
return mPlayerActor;
|
||||
}
|
||||
|
||||
PlayerBase* PlayerInfo::getPlayer_() const {
|
||||
if (!mPlayerActor) {
|
||||
return nullptr;
|
||||
}
|
||||
BaseProcMgr::instance()->isAccessingProcSafe(mPlayerActor, nullptr);
|
||||
return mPlayerActor;
|
||||
}
|
||||
|
||||
s32 PlayerInfo::getMaxLifeFromPlayerActor() const {
|
||||
return mPlayerActor ? mPlayerActor->getMaxLife() : 0;
|
||||
}
|
||||
|
||||
void PlayerInfo::setMaxHeartValue(s32 quarter_hearts) {
|
||||
gdt::setFlag_MaxHartValue(quarter_hearts);
|
||||
mMaxHeartValue = static_cast<f32>(quarter_hearts);
|
||||
}
|
||||
|
||||
u32 PlayerInfo::getMaxHeartValue() const {
|
||||
// Return type is unsigned, but the conversion is signed
|
||||
return static_cast<s32>(mMaxHeartValue);
|
||||
}
|
||||
|
||||
void PlayerInfo::updateMaxHeartValueFromGameData() {
|
||||
mMaxHeartValue = static_cast<f32>(gdt::getFlag_MaxHartValue());
|
||||
}
|
||||
|
||||
void PlayerInfo::setLifeForPlayerActor(s32 life) {
|
||||
if (mPlayerActor) {
|
||||
*mPlayerActor->getLife() = life;
|
||||
}
|
||||
}
|
||||
|
||||
s32 PlayerInfo::getLifeFromPlayerActor() const {
|
||||
if (!mPlayerActor) {
|
||||
return 0;
|
||||
}
|
||||
auto* life = mPlayerActor->getLife();
|
||||
return life ? *life : 1;
|
||||
}
|
||||
|
||||
void PlayerInfo::recoverLife() {
|
||||
setLifeForPlayerActor(getMaxLifeFromPlayerActor());
|
||||
}
|
||||
|
||||
void PlayerInfo::setStaminaCurrentMax(f32 max_stamina) {
|
||||
gdt::setFlag_StaminaCurrentMax(max_stamina);
|
||||
mStaminaCurrentMax = max_stamina;
|
||||
}
|
||||
|
||||
f32 PlayerInfo::getStaminaCurrentMax() const {
|
||||
return mStaminaCurrentMax;
|
||||
}
|
||||
|
||||
void PlayerInfo::updateStaminaCurrentMaxFromGameData() {
|
||||
mStaminaCurrentMax = gdt::getFlag_StaminaCurrentMax();
|
||||
}
|
||||
|
||||
void PlayerInfo::setStaminaMax(f32 max_stamina) {
|
||||
gdt::setFlag_StaminaMax(max_stamina);
|
||||
mStaminaMax = max_stamina;
|
||||
}
|
||||
|
||||
f32 PlayerInfo::getStaminaMax() const {
|
||||
return mStaminaMax;
|
||||
}
|
||||
|
||||
void PlayerInfo::updateStaminaMaxFromGameData() {
|
||||
mStaminaMax = gdt::getFlag_StaminaMax();
|
||||
}
|
||||
|
||||
PlayerBase* PlayerInfo::getPlayerUnchecked() {
|
||||
return mPlayerActor;
|
||||
}
|
||||
|
||||
sead::Vector3f& PlayerInfo::getPlayerPos() {
|
||||
ActorConstDataAccess accessor;
|
||||
|
||||
acquireActor(&mPlayerLink, &accessor);
|
||||
accessor.debugLog(1, "getPlayerPos");
|
||||
return mPlayerPos;
|
||||
}
|
||||
|
||||
sead::Vector3f& PlayerInfo::getPlayerPosForPostCalc() {
|
||||
ActorConstDataAccess accessor;
|
||||
|
||||
acquireActor(&mPlayerLink, &accessor);
|
||||
accessor.debugLog(0, "getPlayerPosForPostCalc");
|
||||
return mPlayerPosForPostCalc;
|
||||
}
|
||||
|
||||
} // namespace ksys::act
|
||||
|
|
|
@ -1,22 +1,119 @@
|
|||
#pragma once
|
||||
|
||||
#include <heap/seadDisposer.h>
|
||||
#include <math/seadVector.h>
|
||||
#include "KingSystem/ActorSystem/actBaseProcLink.h"
|
||||
#include "container/seadRingBuffer.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
class Actor;
|
||||
class PlayerBase;
|
||||
|
||||
// TODO
|
||||
class PlayerInfo {
|
||||
SEAD_SINGLETON_DISPOSER(PlayerInfo)
|
||||
PlayerInfo();
|
||||
virtual ~PlayerInfo();
|
||||
|
||||
class PlayerInfoBase {
|
||||
public:
|
||||
PlayerBase* getPlayer() const;
|
||||
s32 getLife() const;
|
||||
u32 getMaxHearts() const;
|
||||
f32 getMaxStamina() const;
|
||||
PlayerInfoBase();
|
||||
virtual ~PlayerInfoBase();
|
||||
};
|
||||
|
||||
class PlayerInfo : public PlayerInfoBase {
|
||||
SEAD_SINGLETON_DISPOSER(PlayerInfo)
|
||||
PlayerInfo();
|
||||
~PlayerInfo() override;
|
||||
|
||||
public:
|
||||
bool init();
|
||||
void setAndAcquirePlayer(PlayerBase* player); // requires PlayerOrEnemy and PlayerBase
|
||||
void resetPlayer(PlayerBase* player);
|
||||
bool acquireHorse(BaseProc* horse);
|
||||
void setHorseLink(const BaseProcLink& horse_link);
|
||||
PlayerBase* getPlayer() const;
|
||||
PlayerBase* getPlayer_() const; // possibly duped by compiler?
|
||||
Actor* getRiddenHorse() const; // requires PlayerBase vtable
|
||||
void setMaxLifeForPlayerActor(s32 max_heart); // requires PlayerBase
|
||||
s32 getMaxLifeFromPlayerActor() const;
|
||||
void setMaxHeartValue(s32 quarter_hearts);
|
||||
u32 getMaxHeartValue() const;
|
||||
void updateMaxHeartValueFromGameData();
|
||||
void setLifeForPlayerActor(s32 life);
|
||||
s32 getLifeFromPlayerActor() const;
|
||||
void updateCurrentHartFlagFromPlayerActor(); // TODO
|
||||
void updateLifeAfterGameOver(); // requires a global flag
|
||||
void
|
||||
resetLifeToBeforeSwordPull(); // requires HeartDisplayMgr (0x25D6578) and PlayerBase vtable
|
||||
void saveLifeInfoForSwordPull(); // requires PlayerBase vtable
|
||||
void recoverLife();
|
||||
void setStaminaCurrentMax(f32 max_stamina);
|
||||
f32 getStaminaCurrentMax() const;
|
||||
void updateStaminaCurrentMaxFromGameData();
|
||||
void setStaminaMax(f32 max_stamina);
|
||||
f32 getStaminaMax() const;
|
||||
void updateStaminaMaxFromGameData();
|
||||
void setMaxStaminaForPlayerActor(f32 max_stamina); // requires PlayerBase
|
||||
f32 getMaxStaminaFromPlayerActor() const; // requires PlayerBase
|
||||
void recoverStamina(); // requires PlayerBase
|
||||
void recoverCondition(); // requires PlayerBase
|
||||
|
||||
PlayerBase* getPlayerUnchecked();
|
||||
|
||||
sead::Vector3f& getPlayerPos();
|
||||
sead::Vector3f& getPlayerPosForPostCalc();
|
||||
|
||||
// TODO: name and PlayerBase vtable
|
||||
sead::Vector3f& getPlayerM265();
|
||||
|
||||
private:
|
||||
// These are probably debug stuff that were removed
|
||||
class Info1 : public PlayerInfoBase {
|
||||
public:
|
||||
Info1();
|
||||
~Info1() override;
|
||||
} mInfo1;
|
||||
class Info2 : public PlayerInfoBase {
|
||||
public:
|
||||
Info2();
|
||||
~Info2() override;
|
||||
} mInfo2;
|
||||
class Info3 : public PlayerInfoBase {
|
||||
public:
|
||||
Info3();
|
||||
~Info3() override;
|
||||
} mInfo3;
|
||||
class Info4 : public PlayerInfoBase {
|
||||
public:
|
||||
Info4();
|
||||
~Info4() override;
|
||||
} mInfo4;
|
||||
class Info5 : public PlayerInfoBase {
|
||||
public:
|
||||
Info5();
|
||||
~Info5() override;
|
||||
} mInfo5;
|
||||
class Info6 : public PlayerInfoBase {
|
||||
public:
|
||||
Info6();
|
||||
~Info6() override;
|
||||
} mInfo6;
|
||||
class Info7 : public PlayerInfoBase {
|
||||
public:
|
||||
Info7();
|
||||
~Info7() override;
|
||||
} mInfo7;
|
||||
PlayerBase* mPlayerActor = nullptr;
|
||||
BaseProcLink mPlayerLink;
|
||||
BaseProcLink mHorseLink;
|
||||
sead::Vector3f mPlayerPos{0, 0, 0};
|
||||
sead::Vector3f mPlayerPosForPostCalc{0, 0, 0};
|
||||
f32 mMaxHeartValue = 0;
|
||||
f32 mStaminaCurrentMax = 1000; // 1000 = 1 wheel
|
||||
f32 mStaminaMax = 1000;
|
||||
f32 mLifeBeforeSwordPull = 0;
|
||||
f32 mExtraLifeBeforeSwordPull = 0;
|
||||
sead::FixedRingBuffer<sead::Vector3f, 60> mPreviousPositions;
|
||||
f32 _3a0 = 65535;
|
||||
f32 _3a4 = 65535;
|
||||
f32 _3a8 = -1;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(PlayerInfo, 0x3B0);
|
||||
|
||||
} // namespace ksys::act
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#include "KingSystem/ActorSystem/actPlayerInfo.h"
|
||||
namespace ksys::act {
|
||||
// these are separate from actPlayerInfo.cpp so clang doesn't inline/dedupe them
|
||||
[[gnu::noinline]] PlayerInfoBase::PlayerInfoBase() = default;
|
||||
[[gnu::noinline]] PlayerInfoBase::~PlayerInfoBase() = default;
|
||||
} // namespace ksys::act
|
|
@ -0,0 +1,19 @@
|
|||
#include "KingSystem/ActorSystem/actPlayerInfo.h"
|
||||
namespace ksys::act {
|
||||
// these are separate from actPlayerInfo.cpp so clang doesn't inline/dedupe them
|
||||
PlayerInfo::Info1::Info1() = default;
|
||||
PlayerInfo::Info1::~Info1() = default;
|
||||
PlayerInfo::Info2::Info2() = default;
|
||||
PlayerInfo::Info2::~Info2() = default;
|
||||
PlayerInfo::Info3::Info3() = default;
|
||||
PlayerInfo::Info3::~Info3() = default;
|
||||
PlayerInfo::Info4::Info4() = default;
|
||||
PlayerInfo::Info4::~Info4() = default;
|
||||
PlayerInfo::Info5::Info5() = default;
|
||||
PlayerInfo::Info5::~Info5() = default;
|
||||
PlayerInfo::Info6::Info6() = default;
|
||||
PlayerInfo::Info6::~Info6() = default;
|
||||
PlayerInfo::Info7::Info7() = default;
|
||||
PlayerInfo::Info7::~Info7() = default;
|
||||
|
||||
} // namespace ksys::act
|
|
@ -5,6 +5,9 @@ class Heap;
|
|||
}
|
||||
|
||||
namespace ksys {
|
||||
namespace act {
|
||||
class PlayerLink;
|
||||
}
|
||||
|
||||
struct InitParams {
|
||||
sead::Heap* king_sys_heap;
|
||||
|
@ -20,4 +23,7 @@ void initBaseProcMgr(sead::Heap* heap);
|
|||
// 0x0000007100f3a8d8
|
||||
void preInitializeApp(const InitParams& params);
|
||||
|
||||
// 0x0000007100f40370
|
||||
void setPlayerLink(act::PlayerLink* link);
|
||||
|
||||
} // namespace ksys
|
||||
|
|
Loading…
Reference in New Issue