Match MarioActor::doRush

This commit is contained in:
Headpenguin 2023-07-05 10:51:01 -04:00
parent 704cf95b96
commit e8e15eeefc
8 changed files with 114 additions and 10 deletions

View File

@ -195,7 +195,7 @@ updateBehavior__10MarioActorFv,MarioActor.o,Player.a,true
updateBindRatio__10MarioActorFv,MarioActor.o,Player.a,true
isInPunchTimerRange__10MarioActorCFv,MarioActor.o,Player.a,true
updatePunching__10MarioActorFv,MarioActor.o,Player.a,true
doRush__10MarioActorFv,MarioActor.o,Player.a,false
doRush__10MarioActorFv,MarioActor.o,Player.a,true
updateSwingTimer__10MarioActorFv,MarioActor.o,Player.a,false
updateSwingAction__10MarioActorFv,MarioActor.o,Player.a,false
checkClapCatchStart__10MarioActorFv,MarioActor.o,Player.a,false

1 Symbol Name Object File Library Archive Matching
195 updateBindRatio__10MarioActorFv MarioActor.o Player.a true
196 isInPunchTimerRange__10MarioActorCFv MarioActor.o Player.a true
197 updatePunching__10MarioActorFv MarioActor.o Player.a true
198 doRush__10MarioActorFv MarioActor.o Player.a false true
199 updateSwingTimer__10MarioActorFv MarioActor.o Player.a false
200 updateSwingAction__10MarioActorFv MarioActor.o Player.a false
201 checkClapCatchStart__10MarioActorFv MarioActor.o Player.a false

View File

@ -86,6 +86,11 @@ public:
void checkEnforceMove();
bool isDamaging() const;
bool tryWallPunch();
void decDamageAfterTimer();
void incAirWalkTimer();
void updateCubeCode();
void forceExitSwim();
bool isForceStopRush() const;
inline bool getPunchFlag1() const { // poor name
return _8_8;
@ -572,11 +577,11 @@ public:
MarioDarkDamage* mDarkDamage;
MarioFaint* mFaint;
MarioBlown* mBlown;
MarioSwim* mSwim;
MarioSlider* mSlider;
MarioStep* mStep;
MarioBump* mBump;
MarioMagic* mMagic;
MarioSwim* mSwim; // _884
MarioSlider* mSlider; // _888
MarioStep* mStep; // _88c
MarioBump* mBump; // _890
MarioMagic* mMagic; // _894
u8 _898;
MarioFpView* mFpView;
MarioMove* mMove;

View File

@ -21,6 +21,8 @@ public:
virtual f32 getBlurOffset() const;
virtual void draw3D() const;
void setHoming();
XanimeResourceTable* _8;
XanimePlayer* _c;
};

View File

@ -1,8 +1,18 @@
#pragma once
#include "Game/Player/MarioModule.h"
class MarioActor;
class MarioSwim {
class MarioSwim : public MarioModule {
public:
MarioSwim(MarioActor *);
void checkWaterCube(bool);
u8 _8[0x13c];
u32 _144;
u8 _148[0x18];
TVec3f _160;
TVec3f _16c;
};

View File

@ -0,0 +1,9 @@
#pragma once
#include "Game/LiveActor/LiveActor.h"
class RushEndInfo {
public:
RushEndInfo(LiveActor *, unsigned long, const TVec3f &, bool, unsigned long);
u8 _0[0x24];
};

View File

@ -0,0 +1,11 @@
#pragma once
class GameSceneLayoutHolder {
public:
void changeLifeMeterGround();
void changeLifeMeterSwim();
};
namespace MR {
GameSceneLayoutHolder& getGameSceneLayoutHolder();
}

View File

@ -7,6 +7,7 @@ class AreaObj;
class AreaObjContainer;
class AreaObjMgr;
class AreaCubeBoundingBox;
class WaterInfo;
namespace MR {
AreaObjMgr* getAreaObjManager(const char *);
@ -29,4 +30,6 @@ namespace MR {
AreaObj* getCurrentAstroOverlookAreaObj();
AreaObj* getAreaIn(const char *, const TVec3f &);
AreaObj* getWaterAreaObj(WaterInfo *, const TVec3f &);
};

View File

@ -12,6 +12,10 @@
#include "Game/Animation/XanimePlayer.h"
#include "Game/Map/CollisionParts.h"
#include "Game/Player/MarioParts.h"
#include "Game/Map/WaterInfo.h"
#include "Game/Player/MarioSwim.h"
#include "Game/Screen/GameSceneLayoutHolder.h"
#include "Game/Player/RushEndInfo.h"
static bool isLuigi;
@ -30,7 +34,6 @@ Triangle &Triangle::operator=(const Triangle &rOther) {
return *this;
}
static float ZERO = 0f;
void MarioActor::init(const JMapInfoIter &rInfo) {
@ -593,8 +596,8 @@ void MarioActor::updatePunching() {
bool r29 = isInPunchTimerRange();
if(!_230 -> isSwimming()) r29 = true;
if(r29) {
const Mario::Nonsense &rNonsense = bs(*this);
if(rNonsense.get8() || rNonsense.get1a() || rNonsense.get19()) _230 -> tryWallPunch();
const Mario::Nonsense &rNonsense = getStates();
if(rNonsense._8_8 || rNonsense._8_1a || rNonsense._8_19) _230 -> tryWallPunch();
}
}
if (
@ -607,3 +610,64 @@ void MarioActor::updatePunching() {
_230 -> stopAnimation(NULL, (const char *)NULL);
}
}
bool MarioActor::doRush() {
if(_934) {
tryCoinPull();
tryRushInRush();
if(!_934) return false;
updateGravityVec(false, false);
if(checkClapCatchStart() && _7dc) bodyClap();
_7dc = 0;
_7e2 = false;
_230 -> _130 = mPosition;
_230 -> updateGroundInfo();
_230 -> updateCubeCode();
_230 -> decDamageAfterTimer();
if(selectWaterInOutRush(_924)) {
WaterInfo stack_44;
if(!MR::getWaterAreaObj(&stack_44, mPosition)) _230 -> forceExitSwim();
}
else if(!selectWaterInOut(_924 -> mActor -> mName)) {
s32 initial = _230 -> mSwim -> _144;
_230 -> mSwim -> checkWaterCube(false);
if((int)_230 -> mSwim -> _144 != initial) {
if(_230 -> mSwim -> _144 <= 1 && (u32)initial - 2 <= 1) {
playEffectRT("水面ジャンプ水柱", _230 -> mSwim -> _160, _230 -> mSwim -> _16c);
emitEffectWaterColumn(_230 -> mSwim -> _160, _230 -> mSwim -> _16c);
}
else if((u32)initial <= 1 && _230 -> mSwim -> _144 - 2 <= 1) {
playEffectRT("水面ジャンプ水柱", -_230 -> _328, _230 -> mSwim -> _16c);
emitEffectWaterColumn(_230 -> mSwim -> _160, _230 -> mSwim -> _16c);
}
if(initial == 2) {
_384 = 8;
MR::getGameSceneLayoutHolder().changeLifeMeterGround();
_230 -> forceExitSwim();
}
else if(initial == 0) MR::getGameSceneLayoutHolder().changeLifeMeterSwim();
}
}
if(_230 -> isForceStopRush()) {
bool received = _924 -> receiveMessage(0x95, getSensor("body"));
if(_934 && received) {
RushEndInfo stack_20(NULL, 4, TVec3f(0f, 0f, 0f), false, 0);
endRush(&stack_20);
}
}
_234 -> setHoming();
updateTornado();
if(_934 && selectRecoverFlyMeter(_924)) {
for(u32 i = 0; i < 4; i++) {
_230 -> incAirWalkTimer();
}
}
updateSwingTimer();
return true;
}
else {
_7e2 = false;
return false;
}
}