Skip to content

Commit d932913

Browse files
authored
Match 97% of Mogucchi (#1899)
* add individual TRotation3::setDir inlines * Mogucchi at 49% * Mogucchi 55% * Mogucchi 69% * Mogucchi 84% * Mogucchi 93% * Mogucchi data match * Mogucchi 97% * Match Mogucchi::initAfterPlacement * Fix float mismatch in Mogucchi::updateReferenceMtx() * Name Mogucchi _9C * Name Mogucchi _D0 * More Mogucchi member documentation * Mogucchi NamoObjFactory regression fix * Remove redundant include in `MogucchiHill.cpp` * Simplify isDown declaration in `Mogucchi::receuceAttackBySpinSensor`
1 parent cd8a11f commit d932913

5 files changed

Lines changed: 554 additions & 5 deletions

File tree

include/Game/Enemy/Mogucchi.hpp

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,53 @@
11
#pragma once
22

3-
#include "Game/NameObj/NameObj.hpp"
43
#include "Game/LiveActor/LiveActor.hpp"
54

5+
class MogucchiHill;
6+
class ModelObj;
67

78
class Mogucchi : public LiveActor {
89
public:
910
Mogucchi(const char*);
1011
virtual ~Mogucchi();
1112

12-
private:
13-
u8 mPad[(0xF4) - sizeof(LiveActor)];
13+
virtual void init(const JMapInfoIter& rIter);
14+
virtual void initAfterPlacement();
15+
virtual void makeActorAppeared();
16+
virtual void kill();
17+
virtual void control();
18+
virtual void attackSensor(HitSensor* pSender, HitSensor* pReceiver);
19+
virtual bool receiveMsgPlayerAttack(u32 msg, HitSensor* pSender, HitSensor* pReceiver);
20+
21+
void exeStroll();
22+
void endStroll();
23+
void exeAppearDown();
24+
void exeDive();
25+
void exeScatter();
26+
void exeDie();
27+
void exeDown();
28+
void initSensor();
29+
void createMogucchiHill();
30+
void createHole();
31+
void updatePosition();
32+
void updateReferenceMtx();
33+
bool checkHipDrop() const;
34+
void updateStrollSpeed();
35+
void reflectStarPointer2P();
36+
void makeEulerRotation();
37+
void calcAttackDir(TVec3f*, const TVec3f&, const TVec3f&) const;
38+
bool receiveAttackBySpinSensor(u32 msg, HitSensor* pSender, HitSensor* pReceiver);
39+
bool receiveAttackByBodySensor(u32 msg, HitSensor* pSender, HitSensor* pReceiver);
40+
void calcScatterVec(const TVec3f&, const TVec3f&);
41+
42+
/* 0x8C */ MogucchiHill* mHill;
43+
/* 0x90 */ ModelObj* mHole;
44+
/* 0x94 */ TPos3f mNewHolePos;
45+
/* 0xC4 */ TVec3f mRailGravity;
46+
/* 0xD0 */ bool mGrounded;
47+
/* 0xD4 */ f32 mScatterPropulsionSpeed;
48+
/* 0xD8 */ TVec3f mScatterNormal;
49+
f32 _E4;
50+
/* 0xE8 */ f32 mStrollSpeed;
51+
/* 0xEC */ f32 mMaxStrollSpeed;
52+
/* 0xF0 */ bool mIsStoppedByP2;
1453
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#pragma once
2+
3+
#include "Game/LiveActor/LiveActor.hpp"
4+
5+
class HitSensor;
6+
7+
class MogucchiHill : public LiveActor {
8+
public:
9+
MogucchiHill(LiveActor*, s32, const char*);
10+
11+
virtual void init();
12+
virtual void control();
13+
14+
virtual void notifyAppearAttackToPlayer(HitSensor*, HitSensor*);
15+
virtual void notifyWaitAttackToPlayer(HitSensor*, HitSensor*);
16+
17+
void start();
18+
void end();
19+
void startNaturally();
20+
void endNaturally();
21+
void setAppearNum(s32);
22+
23+
u32 _8C;
24+
u32 _90;
25+
s32 _94;
26+
u32 _98;
27+
28+
Mtx _9C;
29+
30+
u8 _CC;
31+
f32 _D0;
32+
f32 _D4;
33+
u32 _D8;
34+
u32 _DC;
35+
u32 _E0;
36+
u32 _E4;
37+
u8 _E8;
38+
u32 _EC;
39+
u32 _F0;
40+
u32 _F4;
41+
};

libs/JSystem/include/JSystem/JGeometry/TMatrix.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,25 @@ namespace JGeometry {
250250
}
251251
void setXDir(const TVec3f& rSrc);
252252
void setXDir(f32 x, f32 y, f32 z);
253+
254+
inline void setXDirInline(const TVec3f& rSrc) {
255+
this->mMtx[0][0] = rSrc.x;
256+
this->mMtx[1][0] = rSrc.y;
257+
this->mMtx[2][0] = rSrc.z;
258+
}
259+
260+
inline void setYDirInline(const TVec3f& rSrc) {
261+
this->mMtx[0][1] = rSrc.x;
262+
this->mMtx[1][1] = rSrc.y;
263+
this->mMtx[2][1] = rSrc.z;
264+
}
265+
266+
inline void setZDirInline(const TVec3f& rSrc) {
267+
this->mMtx[0][2] = rSrc.x;
268+
this->mMtx[1][2] = rSrc.y;
269+
this->mMtx[2][2] = rSrc.z;
270+
}
271+
253272
void setYDir(const TVec3f& rSrc);
254273
void setYDir(f32 x, f32 y, f32 z);
255274
void setZDir(const TVec3f& rSrc);

0 commit comments

Comments
 (0)