Skip to content

Commit aeed67d

Browse files
d_a_e_bug equivalent (#2540)
* Tiny work * d_a_e_bug equivalent * took out unnecessary include * fixed broken match * PR cleanup * OS_REPORT fixed --------- Co-authored-by: hatal175 <hatal175@users.noreply.github.com>
1 parent 7d6c8ef commit aeed67d

File tree

7 files changed

+921
-939
lines changed

7 files changed

+921
-939
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@
4545
"--function-arg-placeholders=0",
4646
"-header-insertion=never",
4747
],
48+
"clangd.detectExtensionConflicts": true,
4849
}

configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,8 +1655,8 @@ def MatchingFor(*versions) -> bool:
16551655
ActorRel(NonMatching, "d_a_e_bi"),
16561656
ActorRel(MatchingFor("GZ2E01"), "d_a_e_bi_leaf"),
16571657
ActorRel(NonMatching, "d_a_e_bs"),
1658-
ActorRel(Equivalent, "d_a_e_bu"), # weak func order
1659-
ActorRel(NonMatching, "d_a_e_bug"),
1658+
ActorRel(Equivalent, "d_a_e_bu"),
1659+
ActorRel(Equivalent, "d_a_e_bug"), # weak func order
16601660
ActorRel(Equivalent, "d_a_e_cr"), # weak func order
16611661
ActorRel(MatchingFor("GZ2E01"), "d_a_e_cr_egg"),
16621662
ActorRel(NonMatching, "d_a_e_db"),

include/d/actor/d_a_e_bug.h

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,63 @@
1111
* @details
1212
*
1313
*/
14-
class e_bug_class : public fopEn_enemy_c {
15-
private:
16-
/* 0x5ac */ u8 field_0x5ac[0x7db0 - 0x5ac];
14+
15+
struct bug_s {
16+
/* 0x00 */ J3DModel* field_0x0;
17+
/* 0x04 */ J3DModel* field_0x4;
18+
/* 0x08 */ int field_0x8;
19+
/* 0x0C */ cXyz field_0xc;
20+
/* 0x18 */ cXyz field_0x18;
21+
/* 0x24 */ f32 field_0x24;
22+
/* 0x28 */ f32 field_0x28;
23+
/* 0x2C */ f32 field_0x2c;
24+
/* 0x30 */ cXyz field_0x30;
25+
/* 0x3C */ csXyz field_0x3c;
26+
/* 0x42 */ s16 field_0x42;
27+
/* 0x44 */ s16 field_0x44;
28+
/* 0x46 */ s16 field_0x46;
29+
/* 0x48 */ s16 field_0x48;
30+
/* 0x4A */ s16 field_0x4a;
31+
/* 0x4C */ s16 field_0x4c;
32+
/* 0x4E */ s16 field_0x4e;
33+
/* 0x50 */ s8 field_0x50;
34+
/* 0x51 */ s8 field_0x51;
35+
/* 0x52 */ s8 field_0x52;
36+
/* 0x53 */ u8 field_0x53;
37+
/* 0x54 */ u8 field_0x54[3];
38+
/* 0x58 */ Z2SoundObjSimple mSound;
39+
};
40+
41+
STATIC_ASSERT(sizeof(bug_s) == 0x78);
42+
class e_bug_class {
43+
public:
44+
/* 0x0000 */ fopAc_ac_c actor;
45+
/* 0x0568 */ request_of_phase_process_class mPhase;
46+
/* 0x0570 */ u8 field_0x570;
47+
/* 0x0574 */ int bitSw;
48+
/* 0x0578 */ u32 field_0x578;
49+
/* 0x057C */ f32 field_0x57c;
50+
/* 0x0580 */ s16 field_0x580;
51+
/* 0x0582 */ u8 field_0x582[0x588 - 0x582];
52+
/* 0x0588 */ bug_s Bug_s[256];
53+
/* 0x7D88 */ int bug_num;
54+
/* 0x7D8C */ Z2SoundObjBeeGroup mSound;
55+
/* 0x7DAC */ u8 field_0x7dac;
56+
/* 0x7DAD */ u8 field_0x7dad;
1757
};
1858

1959
STATIC_ASSERT(sizeof(e_bug_class) == 0x7db0);
2060

21-
class daE_Bug_HIO_c {
61+
class daE_Bug_HIO_c: public JORReflexible {
62+
public:
2263
/* 80694B8C */ daE_Bug_HIO_c();
23-
/* 80697BEC */ ~daE_Bug_HIO_c();
24-
};
64+
/* 80697BEC */ virtual ~daE_Bug_HIO_c() {}
2565

26-
struct bug_s {
27-
/* 80697B4C */ ~bug_s();
28-
/* 80697BB8 */ bug_s();
29-
};
66+
void genMessage(JORMContext*);
3067

68+
/* 0x4 */ s8 field_0x4;
69+
/* 0x8 */ f32 field_0x8;
70+
/* 0xC */ f32 field_0xc;
71+
};
3172

3273
#endif /* D_A_E_BUG_H */

include/d/actor/d_a_nbomb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class daNbomb_c : public dBomb_c {
7676
/* 804CAEE8 */ int execute();
7777
/* 804CBC60 */ int draw();
7878

79-
virtual BOOL checkExplodeNow() { return field_0xb51 != 0; }
79+
virtual u8 checkExplodeNow() { return field_0xb51 != 0; }
8080
virtual void deleteBombAndEffect() {
8181
fopAcM_delete(this);
8282
onStateFlg0(FLG0_UNK_40);

include/d/actor/d_a_player.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,12 @@ class daPy_py_c : public fopAc_ac_c {
12131213
BOOL checkSumouPunchStagger() const { return mSpecialMode == 0x1F; }
12141214
BOOL checkSumouTackleStagger() const { return mSpecialMode == 0x20; }
12151215
BOOL checkSumouGraspRelease() const { return mSpecialMode == 0x23; }
1216+
1217+
void onHeavyState() { onNoResetFlg0(FLG0_UNK_40000000); }
1218+
void onHeavyStateMidnaPanic() {
1219+
onHeavyState();
1220+
onEndResetFlg1(ERFLG1_UNK_40000);
1221+
}
12161222
};
12171223

12181224
int daPy_addCalcShort(s16* param_0, s16 param_1, s16 param_2, s16 param_3, s16 param_4);

include/d/d_bomb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class dBomb_c : public fopAc_ac_c {
3232
static bool checkWaterBomb(fopAc_ac_c*);
3333
static bool checkInsectBombMove(fopAc_ac_c*);
3434

35-
virtual BOOL checkExplodeNow() { return FALSE; }
35+
virtual u8 checkExplodeNow() { return false; }
3636
virtual void deleteBombAndEffect() {}
3737
virtual void setCargoBombExplode() {}
3838

0 commit comments

Comments
 (0)