Skip to content

Commit 5eeb1ef

Browse files
authored
obj_yousei equivalent / bullet done (#2426)
* obj_yousei equivalent * d_a_bullet done
1 parent eddbe73 commit 5eeb1ef

File tree

6 files changed

+1103
-1389
lines changed

6 files changed

+1103
-1389
lines changed

configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ def MatchingFor(*versions) -> bool:
15171517
ActorRel(NonMatching, "d_a_midna"),
15181518
ActorRel(Equivalent, "d_a_nbomb"), # weak func order
15191519
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_life_container"),
1520-
ActorRel(NonMatching, "d_a_obj_yousei"),
1520+
ActorRel(Equivalent, "d_a_obj_yousei"), # weak func order
15211521
ActorRel(MatchingFor("GZ2E01"), "d_a_spinner"),
15221522
ActorRel(MatchingFor("GZ2E01"), "d_a_suspend"),
15231523
ActorRel(MatchingFor("GZ2E01"), "d_a_tag_attention"),
@@ -1623,7 +1623,7 @@ def MatchingFor(*versions) -> bool:
16231623
ActorRel(MatchingFor("GZ2E01"), "d_a_b_zant_mobile"),
16241624
ActorRel(MatchingFor("GZ2E01"), "d_a_b_zant_sima"),
16251625
ActorRel(NonMatching, "d_a_balloon_2D"),
1626-
ActorRel(NonMatching, "d_a_bullet"),
1626+
ActorRel(MatchingFor("GZ2E01"), "d_a_bullet"),
16271627
ActorRel(Equivalent, "d_a_coach_2D"), # weak func order
16281628
ActorRel(MatchingFor("GZ2E01"), "d_a_coach_fire"),
16291629
ActorRel(Equivalent, "d_a_cow"),

include/d/actor/d_a_bullet.h

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#ifndef D_A_BULLET_H
22
#define D_A_BULLET_H
33

4-
#include "dolphin/types.h"
54
#include "f_op/f_op_actor_mng.h"
5+
#include "d/d_bg_s_acch.h"
6+
#include "d/d_cc_d.h"
67

78
/**
89
* @ingroup actors-unsorted
@@ -12,37 +13,60 @@
1213
* @details
1314
*
1415
*/
15-
class daBullet_c : public fopEn_enemy_c {
16+
class daBullet_c : public fopAc_ac_c {
1617
public:
17-
/* 8065594C */ ~daBullet_c();
18-
/* 80655B08 */ void create();
19-
/* 80655E5C */ void CreateHeap();
20-
/* 80655EDC */ void Delete();
21-
/* 80655F10 */ void Execute();
22-
/* 806560FC */ void Draw();
23-
/* 80656160 */ void createHeapCallBack(fopAc_ac_c*);
24-
/* 80656180 */ void getResName();
25-
/* 80656198 */ void getBmdName();
26-
/* 806561B0 */ void getTypeFromParam();
27-
/* 806561D0 */ void initialize();
28-
/* 80656378 */ void setProcess(int (daBullet_c::*)(void*));
29-
/* 80656420 */ void wait(void*);
30-
/* 806564B8 */ void move(void*);
18+
typedef int (daBullet_c::*processFn)(void*);
19+
20+
/* 0x568 */ request_of_phase_process_class mPhase;
21+
/* 0x570 */ J3DModel* mpModel;
22+
/* 0x574 */ dBgS_ObjAcch mAcch;
23+
/* 0x74C */ dCcD_Stts mCcStts;
24+
/* 0x788 */ dBgS_AcchCir mAcchCir;
25+
/* 0x7C8 */ dCcD_Sph mCcSph;
26+
/* 0x900 */ cBgS_GndChk mGndChk;
27+
/* 0x93C */ u8 field_0x93C[0x940 - 0x93C];
28+
/* 0x940 */ f32 mGroundY;
29+
/* 0x944 */ processFn mProcess;
30+
/* 0x950 */ int mLifetime;
31+
/* 0x954 */ u16 mMode;
32+
/* 0x956 */ u8 mType;
33+
/* 0x957 */ u8 field_0x957;
3134

32-
static u8 const mCcDObjInfo[48];
33-
static u8 mCcDSph[64];
35+
/* 8065594C */ virtual ~daBullet_c();
36+
/* 80655B08 */ int create();
37+
/* 80655E5C */ BOOL CreateHeap();
38+
/* 80655EDC */ int Delete();
39+
/* 80655F10 */ int Execute();
40+
/* 806560FC */ int Draw();
41+
/* 80656160 */ static int createHeapCallBack(fopAc_ac_c*);
42+
/* 80656180 */ const char* getResName();
43+
/* 80656198 */ const char* getBmdName();
44+
/* 806561B0 */ int getTypeFromParam();
45+
/* 806561D0 */ void initialize();
46+
/* 80656378 */ int setProcess(processFn);
47+
/* 80656420 */ int wait(void*);
48+
/* 806564B8 */ int move(void*);
3449

35-
private:
36-
/* 0x5ac */ u8 field_0x5ac[0x95c - 0x5ac];
50+
static dCcD_SrcGObjInf const mCcDObjInfo;
51+
static dCcD_SrcSph mCcDSph;
3752
};
3853

3954
STATIC_ASSERT(sizeof(daBullet_c) == 0x95c);
4055

56+
struct daBullet_HIOParam {
57+
/* 0x00 */ f32 gravity;
58+
/* 0x04 */ f32 weight;
59+
/* 0x08 */ f32 height;
60+
/* 0x0C */ f32 knee_height;
61+
/* 0x10 */ f32 width;
62+
/* 0x14 */ s16 lifetime;
63+
};
64+
4165
class daBullet_Param_c {
4266
public:
43-
/* 806566A8 */ ~daBullet_Param_c();
67+
/* 806566A8 */ virtual ~daBullet_Param_c() {}
4468

45-
static u8 const m[24];
69+
static daBullet_HIOParam const m;
4670
};
4771

4872

include/d/actor/d_a_obj_yousei.h

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define D_A_OBJ_YOUSEI_H
33

44
#include "f_op/f_op_actor_mng.h"
5+
#include "d/actor/d_a_player.h"
56

67
/**
78
* @ingroup actors-objects
@@ -11,7 +12,7 @@
1112
* @details
1213
*
1314
*/
14-
class daObjYOUSEI_c : public fopAc_ac_c {
15+
class daObjYOUSEI_c : public fopEn_enemy_c {
1516
public:
1617
/* 804CE738 */ void InitCcSph();
1718
/* 804CE7A4 */ void SetCcSph();
@@ -21,20 +22,58 @@ class daObjYOUSEI_c : public fopAc_ac_c {
2122
/* 804CF098 */ void LinkChk();
2223
/* 804CF6C4 */ void WaitAction();
2324
/* 804CFCE8 */ void LinkAction();
24-
/* 804D057C */ void LinkSearch();
25-
/* 804D065C */ void WayBgCheck(f32, f32, s16);
25+
/* 804D057C */ bool LinkSearch();
26+
/* 804D065C */ bool WayBgCheck(f32, f32, s16);
2627
/* 804D0780 */ void CareAction();
2728
/* 804D080C */ void CheckGround();
28-
/* 804D0988 */ void CheckWater();
29+
/* 804D0988 */ bool CheckWater();
2930
/* 804D0AD0 */ void Action();
3031
/* 804D0CCC */ void ObjHit();
31-
/* 804D0DF0 */ void Execute();
32-
/* 804D0F98 */ void Delete();
32+
/* 804D0DF0 */ int Execute();
33+
/* 804D0F98 */ int Delete();
3334
/* 804D0FCC */ void setBaseMtx();
34-
/* 804D111C */ void create();
35+
/* 804D111C */ int create();
3536

36-
private:
37-
/* 0x568 */ u8 field_0x568[0xa4c - 0x568];
37+
inline int CreateHeap();
38+
inline int Draw();
39+
40+
/* 0x5AC */ u8 field_0x5ac;
41+
/* 0x5AD */ u8 field_0x5ad;
42+
/* 0x5AE */ u8 field_0x5ae;
43+
/* 0x5AF */ u8 field_0x5af;
44+
/* 0x5B0 */ cXyz field_0x5b0;
45+
/* 0x5BC */ daPy_boomerangMove_c mBoomerangMove;
46+
/* 0x5C8 */ u8 mPrm;
47+
/* 0x5CA */ s16 mAction;
48+
/* 0x5CC */ s16 mMode;
49+
/* 0x5CE */ s16 mTimers[4];
50+
/* 0x5D6 */ s16 field_0x5d6;
51+
/* 0x5D8 */ u8 field_0x5D8[0x5DA - 0x5D8];
52+
/* 0x5DA */ s16 mAngleTarget;
53+
/* 0x5DC */ s16 field_0x5dc;
54+
/* 0x5E0 */ f32 mSpeedVTarget;
55+
/* 0x5E4 */ f32 mSpeedFTarget;
56+
/* 0x5E8 */ f32 field_0x5e8;
57+
/* 0x5EC */ f32 field_0x5ec;
58+
/* 0x5F0 */ f32 mAnmSpeed;
59+
/* 0x5F4 */ u8 field_0x5F4[0x5F8 - 0x5F4];
60+
/* 0x5F8 */ cXyz field_0x5f8;
61+
/* 0x604 */ u32 field_0x604;
62+
/* 0x608 */ u32 field_0x608;
63+
/* 0x60C */ u32 field_0x60c;
64+
/* 0x610 */ u32 field_0x610;
65+
/* 0x614 */ f32 mDistToPlayer;
66+
/* 0x618 */ s16 mAngleToPlayer;
67+
/* 0x61A */ s16 field_0x61a;
68+
/* 0x61C */ Z2Creature mSound;
69+
/* 0x6AC */ u8 field_0x6AC[0x6B0 - 0x6AC];
70+
/* 0x6B0 */ mDoExt_McaMorfSO* mpModelMorf;
71+
/* 0x6B4 */ u8 field_0x6B4[0x6BC - 0x6B4];
72+
/* 0x6BC */ dBgS_AcchCir mAcchCir;
73+
/* 0x6FC */ dBgS_ObjAcch mAcch;
74+
/* 0x8D4 */ dCcD_Stts mCcStts;
75+
/* 0x910 */ dCcD_Sph mCcSph;
76+
/* 0xA48 */ u8 field_0xa48[0xA4C - 0xA48];
3877
};
3978

4079
STATIC_ASSERT(sizeof(daObjYOUSEI_c) == 0xa4c);

include/d/actor/d_a_player.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ class daPy_py_c : public fopAc_ac_c {
920920
bool checkGrabThrow() const { return checkResetFlg0(RFLG0_GRAB_THROW); }
921921
bool checkMidnaAtnPos() const { return checkNoResetFlg1(FLG1_MIDNA_ATN_POS); }
922922
bool checkMidnaHairAtnPos() const { return checkNoResetFlg1(FLG1_MIDNA_HAIR_ATN_POS); }
923+
bool checkAttentionLock() const { return checkResetFlg0(RFLG0_UNK_10000); }
923924

924925
void onBossRoomWait() { onEndResetFlg0(ERFLG0_BOSS_ROOM_WAIT); }
925926
void onBeeFollow() { onEndResetFlg0(ERFLG0_BEE_FOLLOW); }

0 commit comments

Comments
 (0)