Skip to content

Commit

Permalink
Player: Implement PlayerJudgeStartSquat (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterDruide1 authored Jun 15, 2024
1 parent e32c4b6 commit 20c7664
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/odyssey_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27982,10 +27982,10 @@ Address,Quality,Size,Name
0x000000710045b824,U,000008,_ZN22PlayerJudgeStartRunOld5resetEv
0x000000710045b82c,U,000084,_ZN22PlayerJudgeStartRunOld6updateEv
0x000000710045b880,U,000008,_ZNK22PlayerJudgeStartRunOld5judgeEv
0x000000710045b888,U,000024,_ZN21PlayerJudgeStartSquatC1EPK11PlayerInputPK21PlayerCounterForceRunPK17PlayerCarryKeeper
0x000000710045b8a0,U,000076,_ZNK21PlayerJudgeStartSquat5judgeEv
0x000000710045b8ec,U,000004,_ZN21PlayerJudgeStartSquat5resetEv
0x000000710045b8f0,U,000004,_ZN21PlayerJudgeStartSquat6updateEv
0x000000710045b888,O,000024,_ZN21PlayerJudgeStartSquatC1EPK11PlayerInputPK21PlayerCounterForceRunPK17PlayerCarryKeeper
0x000000710045b8a0,O,000076,_ZNK21PlayerJudgeStartSquat5judgeEv
0x000000710045b8ec,O,000004,_ZN21PlayerJudgeStartSquat5resetEv
0x000000710045b8f0,O,000004,_ZN21PlayerJudgeStartSquat6updateEv
0x000000710045b8f4,U,000028,_ZN24PlayerJudgeStartSwimJumpC1EPK11PlayerInputPK11PlayerConstPKN2al18WaterSurfaceFinderE
0x000000710045b910,U,000008,_ZN24PlayerJudgeStartSwimJump5resetEv
0x000000710045b918,U,000084,_ZN24PlayerJudgeStartSwimJump6updateEv
Expand Down
1 change: 1 addition & 0 deletions src/Player/PlayerCarryKeeper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class PlayerCarryKeeper {
public:
bool isThrowHold() const;
bool isCarry() const;

private:
u8 padding[0x70];
Expand Down
1 change: 1 addition & 0 deletions src/Player/PlayerInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class PlayerInput {
bool isHoldAction() const;
bool isHoldJump() const;
bool isHoldHipDrop() const;
bool isHoldSquat() const;
bool isTriggerStartTalk() const;
bool isTriggerStartWorldWarp() const;
bool isTriggerCancelWorldWarp() const;
Expand Down
18 changes: 18 additions & 0 deletions src/Player/PlayerJudgeStartSquat.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "Player/PlayerJudgeStartSquat.h"

#include "Player/PlayerCarryKeeper.h"
#include "Player/PlayerCounterForceRun.h"
#include "Player/PlayerInput.h"

PlayerJudgeStartSquat::PlayerJudgeStartSquat(const PlayerInput* input,
const PlayerCounterForceRun* counterForceRun,
const PlayerCarryKeeper* carryKeeper)
: mInput(input), mCounterForceRun(counterForceRun), mCarryKeeper(carryKeeper) {}

bool PlayerJudgeStartSquat::judge() const {
return !mCarryKeeper->isCarry() && mInput->isHoldSquat() && mCounterForceRun->getCounter() < 1;
}

void PlayerJudgeStartSquat::reset() {}

void PlayerJudgeStartSquat::update() {}
24 changes: 24 additions & 0 deletions src/Player/PlayerJudgeStartSquat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once

#include "Library/HostIO/HioNode.h"

#include "Player/IJudge.h"

class PlayerInput;
class PlayerCounterForceRun;
class PlayerCarryKeeper;

class PlayerJudgeStartSquat : public al::HioNode, public IJudge {
public:
PlayerJudgeStartSquat(const PlayerInput*, const PlayerCounterForceRun*,
const PlayerCarryKeeper*);
void reset();
void update();
bool judge() const;

private:
const PlayerInput* mInput;
const PlayerCounterForceRun* mCounterForceRun;
const PlayerCarryKeeper* mCarryKeeper;
};
static_assert(sizeof(PlayerJudgeStartSquat) == 0x20);

0 comments on commit 20c7664

Please sign in to comment.