Player: Implement PlayerJudgeStartRun

This commit is contained in:
MonsterDruide1 2024-06-09 18:28:58 +02:00
parent ce4f31b30d
commit 7e0af32b16
6 changed files with 78 additions and 5 deletions

View File

@ -27974,10 +27974,10 @@ Address,Quality,Size,Name
0x000000710045b6f4,U,000108,_ZNK23PlayerJudgeStartRolling21isTriggerRestartSwingEv
0x000000710045b760,U,000004,_ZN23PlayerJudgeStartRolling5resetEv
0x000000710045b764,U,000004,_ZN23PlayerJudgeStartRolling6updateEv
0x000000710045b768,U,000028,_ZN19PlayerJudgeStartRunC1EPKN2al9LiveActorEPK11PlayerConstPK19IUsePlayerCollisionPK11PlayerInputPK21PlayerCounterForceRunPK6IJudge
0x000000710045b784,U,000124,_ZNK19PlayerJudgeStartRun5judgeEv
0x000000710045b800,U,000004,_ZN19PlayerJudgeStartRun5resetEv
0x000000710045b804,U,000004,_ZN19PlayerJudgeStartRun6updateEv
0x000000710045b768,O,000028,_ZN19PlayerJudgeStartRunC1EPKN2al9LiveActorEPK11PlayerConstPK19IUsePlayerCollisionPK11PlayerInputPK21PlayerCounterForceRunPK6IJudge
0x000000710045b784,M,000124,_ZNK19PlayerJudgeStartRun5judgeEv
0x000000710045b800,O,000004,_ZN19PlayerJudgeStartRun5resetEv
0x000000710045b804,O,000004,_ZN19PlayerJudgeStartRun6updateEv
0x000000710045b808,U,000028,_ZN22PlayerJudgeStartRunOldC1EPKN2al9LiveActorEPK19IUsePlayerCollisionPK11PlayerInput
0x000000710045b824,U,000008,_ZN22PlayerJudgeStartRunOld5resetEv
0x000000710045b82c,U,000084,_ZN22PlayerJudgeStartRunOld6updateEv

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

View File

@ -9,6 +9,7 @@ public:
void setupForceRun(s32 frames, f32 speed);
void update();
bool isForceRun() const { return mCounter > 0; }
s32 getCounter() const { return mCounter; }
f32 getSpeed() const { return mSpeed; }

View File

@ -74,6 +74,8 @@ public:
bool isThrowTypeSpiral(const sead::Vector2f&) const;
bool isThrowTypeRolling(const sead::Vector2f&) const;
bool isMove() const;
private:
const al::LiveActor* mLiveActor;
const IUsePlayerCollision* mPlayerCollision;

View File

@ -0,0 +1,30 @@
#include "Player/PlayerJudgeStartRun.h"
#include "Player/PlayerCounterForceRun.h"
#include "Player/PlayerInput.h"
#include "Util/PlayerCollisionUtil.h"
#include "Util/StageSceneFunction.h"
PlayerJudgeStartRun::PlayerJudgeStartRun(const al::LiveActor* player, const PlayerConst* pConst,
const IUsePlayerCollision* collision,
const PlayerInput* input,
const PlayerCounterForceRun* counterForceRun,
const IJudge* judgeWaterSurfaceRun)
: mPlayer(player), mCollision(collision), mInput(input), mCounterForceRun(counterForceRun),
mJudgeForceLand(judgeWaterSurfaceRun) {}
// NON_MATCHING: Major mismatches for the control flow order
bool PlayerJudgeStartRun::judge() const {
if (!rs::isCollidedGround(mCollision))
return false;
if (mCounterForceRun->isForceRun())
return true;
if (rs::isJudge(mJudgeForceLand))
return false;
if (mInput->isMove())
return true;
return rs::isAutoRunOnGroundSkateCode(mPlayer, mCollision, 0.5f);
}
void PlayerJudgeStartRun::reset() {}
void PlayerJudgeStartRun::update() {}

View File

@ -0,0 +1,32 @@
#pragma once
#include <basis/seadTypes.h>
#include "Player/IJudge.h"
namespace al {
class LiveActor;
}
class IUsePlayerCollision;
class PlayerConst;
class PlayerInput;
class PlayerCounterForceRun;
class PlayerJudgeStartRun : public IJudge {
public:
PlayerJudgeStartRun(const al::LiveActor* player, const PlayerConst* pConst,
const IUsePlayerCollision* collision, const PlayerInput* input,
const PlayerCounterForceRun* counterForceRun,
const IJudge* judgeWaterSurfaceRun);
void reset() override;
void update() override;
bool judge() const override;
private:
const al::LiveActor* mPlayer;
const IUsePlayerCollision* mCollision;
const PlayerInput* mInput;
const PlayerCounterForceRun* mCounterForceRun;
const IJudge* mJudgeForceLand;
};

View File

@ -2,10 +2,18 @@
#include <basis/seadTypes.h>
namespace al {
class LiveActor;
}
class IUsePlayerHeightCheck;
class IUsePlayerCollision;
namespace rs {
f32 getGroundHeight(const IUsePlayerHeightCheck*);
}
bool isCollidedGround(const IUsePlayerCollision*);
bool isAutoRunOnGroundSkateCode(const al::LiveActor*, const IUsePlayerCollision*, float);
} // namespace rs