mirror of
https://github.com/MonsterDruide1/OdysseyDecomp.git
synced 2024-11-23 13:29:49 +00:00
Player: Implement PlayerJudgeSandSink (#100)
This commit is contained in:
parent
1c0c21f1de
commit
7d9e5840aa
@ -27927,10 +27927,10 @@ Address,Quality,Size,Name
|
||||
0x000000710045b03c,O,000012,_ZNK20PlayerJudgeSameNerve5judgeEv
|
||||
0x000000710045b048,O,000004,_ZN20PlayerJudgeSameNerve5resetEv
|
||||
0x000000710045b04c,O,000004,_ZN20PlayerJudgeSameNerve6updateEv
|
||||
0x000000710045b050,U,000024,_ZN19PlayerJudgeSandSinkC1EPK19IUsePlayerCollisionPK20PlayerSandSinkAffect
|
||||
0x000000710045b068,U,000080,_ZNK19PlayerJudgeSandSink5judgeEv
|
||||
0x000000710045b0b8,U,000004,_ZN19PlayerJudgeSandSink5resetEv
|
||||
0x000000710045b0bc,U,000004,_ZN19PlayerJudgeSandSink6updateEv
|
||||
0x000000710045b050,O,000024,_ZN19PlayerJudgeSandSinkC1EPK19IUsePlayerCollisionPK20PlayerSandSinkAffect
|
||||
0x000000710045b068,O,000080,_ZNK19PlayerJudgeSandSink5judgeEv
|
||||
0x000000710045b0b8,O,000004,_ZN19PlayerJudgeSandSink5resetEv
|
||||
0x000000710045b0bc,O,000004,_ZN19PlayerJudgeSandSink6updateEv
|
||||
0x000000710045b0c0,U,000024,_ZN16PlayerJudgeSleepC1EPK15PlayerStateWait
|
||||
0x000000710045b0d8,U,000008,_ZNK16PlayerJudgeSleep5judgeEv
|
||||
0x000000710045b0e0,U,000004,_ZN16PlayerJudgeSleep5resetEv
|
||||
|
Can't render this file because it is too large.
|
17
src/Player/PlayerJudgeSandSink.cpp
Normal file
17
src/Player/PlayerJudgeSandSink.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "Player/PlayerJudgeSandSink.h"
|
||||
|
||||
#include "Player/PlayerSandSinkAffect.h"
|
||||
#include "Util/PlayerCollisionUtil.h"
|
||||
|
||||
PlayerJudgeSandSink::PlayerJudgeSandSink(const IUsePlayerCollision* collider,
|
||||
const PlayerSandSinkAffect* sandSinkAffect)
|
||||
: mCollider(collider), mSandSinkAffect(sandSinkAffect) {}
|
||||
|
||||
void PlayerJudgeSandSink::reset() {}
|
||||
|
||||
void PlayerJudgeSandSink::update() {}
|
||||
|
||||
bool PlayerJudgeSandSink::judge() const {
|
||||
return mSandSinkAffect->isSink() ||
|
||||
(rs::isCollidedGround(mCollider) && rs::isCollisionCodeSandSink(mCollider));
|
||||
}
|
23
src/Player/PlayerJudgeSandSink.h
Normal file
23
src/Player/PlayerJudgeSandSink.h
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "Library/HostIO/HioNode.h"
|
||||
|
||||
#include "Player/IJudge.h"
|
||||
|
||||
class IUsePlayerCollision;
|
||||
class PlayerSandSinkAffect;
|
||||
|
||||
class PlayerJudgeSandSink : public al::HioNode, public IJudge {
|
||||
public:
|
||||
PlayerJudgeSandSink(const IUsePlayerCollision* collider,
|
||||
const PlayerSandSinkAffect* sandSinkAffect);
|
||||
|
||||
void reset() override;
|
||||
void update() override;
|
||||
bool judge() const override;
|
||||
|
||||
private:
|
||||
const IUsePlayerCollision* mCollider;
|
||||
const PlayerSandSinkAffect* mSandSinkAffect;
|
||||
};
|
||||
static_assert(sizeof(PlayerJudgeSandSink) == 0x18);
|
35
src/Player/PlayerSandSinkAffect.h
Normal file
35
src/Player/PlayerSandSinkAffect.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <math/seadVector.h>
|
||||
|
||||
namespace al {
|
||||
class LiveActor;
|
||||
}
|
||||
class PlayerConst;
|
||||
class PlayerInput;
|
||||
class IUsePlayerCollision;
|
||||
class PlayerEffect;
|
||||
|
||||
class PlayerSandSinkAffect {
|
||||
public:
|
||||
PlayerSandSinkAffect(const al::LiveActor*, const PlayerConst*, const PlayerInput*,
|
||||
IUsePlayerCollision*, PlayerEffect*);
|
||||
void clear();
|
||||
bool isSink() const;
|
||||
void update(bool);
|
||||
bool isSinkDeathHeight() const;
|
||||
void reduceVelocity(sead::Vector3f*);
|
||||
bool isEnableCapThrow() const;
|
||||
f32 calcSandSinkDeathRate() const;
|
||||
|
||||
private:
|
||||
const al::LiveActor* mPlayer;
|
||||
const PlayerConst* mConst;
|
||||
const PlayerInput* mInput;
|
||||
IUsePlayerCollision* mCollider;
|
||||
PlayerEffect* mEffect;
|
||||
f32 mSinkVelocity;
|
||||
f32 mSinkAmount;
|
||||
bool mIsSafe;
|
||||
};
|
||||
static_assert(sizeof(PlayerSandSinkAffect) == 0x38);
|
@ -23,5 +23,6 @@ bool isOnGround(const al::LiveActor*, const IUsePlayerCollision*);
|
||||
bool isJustLand(const IUsePlayerCollision*);
|
||||
void calcGroundNormalOrGravityDir(sead::Vector3f*, const al::LiveActor*,
|
||||
const IUsePlayerCollision*);
|
||||
bool isCollisionCodeSandSink(const IUsePlayerCollision*);
|
||||
|
||||
} // namespace rs
|
||||
|
Loading…
Reference in New Issue
Block a user