Skip to content

Commit

Permalink
incomplete/non-matching
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterDruide1 committed Jun 9, 2024
1 parent ce4f31b commit fbc2778
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data/odyssey_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,W,000124,_ZNK19PlayerJudgeStartRun5judgeEv
0x000000710045b800,O,000004,_ZN19PlayerJudgeStartRun5resetEv
0x000000710045b804,O,000004,_ZN19PlayerJudgeStartRun6updateEv
0x000000710045b808,U,000028,_ZN22PlayerJudgeStartRunOldC1EPKN2al9LiveActorEPK19IUsePlayerCollisionPK11PlayerInput
0x000000710045b824,U,000008,_ZN22PlayerJudgeStartRunOld5resetEv
0x000000710045b82c,U,000084,_ZN22PlayerJudgeStartRunOld6updateEv
Expand Down
1 change: 1 addition & 0 deletions src/Player/PlayerCounterForceRun.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class PlayerCounterForceRun {
void setupForceRun(s32 frames, f32 speed);
void update();

bool isForceRun() const { return mCounter > 0; }
s32 getCounter() const { return mCounter; }
f32 getSpeed() const { return mSpeed; }

Expand Down
2 changes: 2 additions & 0 deletions src/Player/PlayerInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class PlayerInput {
bool isThrowTypeSpiral(const sead::Vector2f&) const;
bool isThrowTypeRolling(const sead::Vector2f&) const;

bool isMove() const;

private:
const al::LiveActor* mLiveActor;
const IUsePlayerCollision* mPlayerCollision;
Expand Down
29 changes: 29 additions & 0 deletions src/Player/PlayerJudgeStartRun.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#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) {}

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() {}
32 changes: 32 additions & 0 deletions src/Player/PlayerJudgeStartRun.h
Original file line number Diff line number Diff line change
@@ -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;
};
10 changes: 9 additions & 1 deletion src/Util/PlayerCollisionUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fbc2778

Please sign in to comment.