Skip to content

Commit c5f9d8d

Browse files
authored
d_a_e_tk2 Matching (#2399)
* d_a_e_tk2 first pass * d_a_e_tk2 matching * d_a_e_tk, d_a_e_tk2 cleanup
1 parent 0ab8dc2 commit c5f9d8d

File tree

5 files changed

+579
-520
lines changed

5 files changed

+579
-520
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ def MatchingFor(*versions):
16751675
ActorRel(Equivalent, "d_a_e_th"), # weak func order
16761676
ActorRel(MatchingFor("GZ2E01"), "d_a_e_th_ball"),
16771677
ActorRel(MatchingFor("GZ2E01"), "d_a_e_tk"),
1678-
ActorRel(NonMatching, "d_a_e_tk2"),
1678+
ActorRel(MatchingFor("GZ2E01"), "d_a_e_tk2"),
16791679
ActorRel(NonMatching, "d_a_e_tk_ball"),
16801680
ActorRel(NonMatching, "d_a_e_tt"),
16811681
ActorRel(NonMatching, "d_a_e_vt"),

include/d/actor/d_a_e_tk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class e_tk_class : public fopEn_enemy_c {
4949
/* 0x6A1 */ s8 mTKBallSpawned;
5050
/* 0x6A4 */ u32 mHamonSet;
5151
/* 0x6A8 */ u8 field_0x6a8[4];
52-
/* 0x6AC */ fpc_ProcID mpBallID;
52+
/* 0x6AC */ fpc_ProcID mBallID;
5353
/* 0x6B0 */ dBgS_AcchCir mAcchCir;
5454
/* 0x6F0 */ dBgS_ObjAcch mAcch;
5555
/* 0x8C8 */ dCcD_Stts mStts;

include/d/actor/d_a_e_tk2.h

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,72 @@
11
#ifndef D_A_E_TK2_H
22
#define D_A_E_TK2_H
3-
#include "f_op/f_op_actor_mng.h"
3+
4+
#include "d/d_bg_s_acch.h"
5+
#include "d/d_cc_d.h"
6+
#include "d/d_cc_uty.h"
7+
#include "f_op/f_op_actor.h"
48

59
/**
610
* @ingroup actors-enemies
711
* @class e_tk2_class
812
* @brief Fire Toadpoli
9-
*
10-
* @details
11-
*
13+
*
14+
* @details Fire Toadpoli in the Goron Mines Entrance.
15+
* Armored, two-legged frogs that spit Fireballs at Link.
16+
* They cannot swim, but will dive under the lava if Link
17+
* gets too close. They share most of the code with the
18+
* Water Toadpoli e_tk.
1219
*/
20+
1321
class e_tk2_class : public fopEn_enemy_c {
14-
private:
15-
/* 0x5ac */ u8 field_0x5ac[0xa50 - 0x5ac];
22+
public:
23+
/* 0x5AC */ request_of_phase_process_class mPhaseReq;
24+
/* 0x5B4 */ u8 mArg0;
25+
/* 0x5B5 */ u8 mArg1;
26+
/* 0x5B6 */ u8 mArg2;
27+
/* 0x5B7 */ u8 mArg3; /* Unused */
28+
/* 0x5B8 */ mDoExt_McaMorfSO* mpMorf;
29+
/* 0x5BC */ int mAnim;
30+
/* 0x5C0 */ Z2CreatureEnemy mSound;
31+
/* 0x664 */ f32 mAnimSpeed;
32+
/* 0x668 */ s16 mLifetime;
33+
/* 0x66A */ s16 mAction;
34+
/* 0x66C */ s16 mMode;
35+
/* 0x670 */ cXyz mPos;
36+
/* 0x67C */ s16 mSomeAngle;
37+
/* 0x67E */ u8 field18_0x67e[2];
38+
/* 0x680 */ s16 mPlayerAngleY;
39+
/* 0x684 */ f32 mPlayerDistanceLimit;
40+
/* 0x688 */ u8 field24_0x688[2];
41+
/* 0x68A */ s16 mActionTimer[3];
42+
/* 0x690 */ s16 mExecuteState;
43+
/* 0x692 */ s16 mInvincibilityTimer;
44+
/* 0x694 */ s8 mAttentionOFF;
45+
/* 0x695 */ s8 mTKBallSpawned;
46+
/* 0x698 */ fpc_ProcID mBallID;
47+
/* 0x69C */ dBgS_AcchCir mAcchCir;
48+
/* 0x6DC */ dBgS_ObjAcch mAcch;
49+
/* 0x8B4 */ dCcD_Stts mStts;
50+
/* 0x8F0 */ dCcD_Sph mSph;
51+
/* 0xA28 */ dCcU_AtInfo mAtInfo;
52+
/* 0xA4C */ bool mInitHIO;
1653
};
1754

18-
STATIC_ASSERT(sizeof(e_tk2_class) == 0xa50);
55+
STATIC_ASSERT(sizeof(e_tk2_class) == 0xA50);
1956

2057
class daE_TK2_HIO_c {
58+
public:
2159
/* 807BA56C */ daE_TK2_HIO_c();
22-
/* 807BBD00 */ ~daE_TK2_HIO_c();
60+
/* 807BBD00 */ virtual ~daE_TK2_HIO_c() {};
61+
62+
/* 0x04 */ s8 field_0x04;
63+
/* 0x08 */ f32 mRadiusScale;
64+
/* 0x0C */ f32 mPlayerRange1;
65+
/* 0x10 */ f32 mPlayerRange2;
66+
/* 0x14 */ f32 mSpeedModifier1; /* Unused */
67+
/* 0x18 */ f32 mSpeedModifier2; /* Unused */
2368
};
2469

70+
STATIC_ASSERT(sizeof(daE_TK2_HIO_c) == 0x1C);
2571

2672
#endif /* D_A_E_TK2_H */

src/d/actor/d_a_e_tk.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void e_tk_attack(e_tk_class* i_this) {
347347
case MODE_TK_APPEAR:
348348
if (pl_y_check(i_this)) {
349349
if ((int)i_this->mpMorf->getFrame() == 24) {
350-
i_this->mpBallID =
350+
i_this->mBallID =
351351
fopAcM_createChild(PROC_E_TK_BALL, fopAcM_GetID(i_this), 0, &i_this->eyePos,
352352
fopAcM_GetRoomNo(i_this), &i_this->shape_angle, 0, -1, 0);
353353
}
@@ -627,7 +627,7 @@ static int daE_TK_Execute(e_tk_class* i_this) {
627627

628628
if (i_this->mTKBallSpawned) {
629629
e_tk_ball_class* ball_actor =
630-
static_cast<e_tk_ball_class*>(fopAcM_SearchByID(i_this->mpBallID));
630+
static_cast<e_tk_ball_class*>(fopAcM_SearchByID(i_this->mBallID));
631631
if (ball_actor != NULL) {
632632
ball_actor->current.pos = i_this->eyePos;
633633
ball_actor->field_0x5ac[0x31C] = 0x0;
@@ -667,7 +667,6 @@ static int daE_TK_IsDelete(e_tk_class* i_this) {
667667

668668
/* 807B9C58-807B9CC0 001B58 0068+00 1/0 0/0 0/0 .text daE_TK_Delete__FP10e_tk_class */
669669
static int daE_TK_Delete(e_tk_class* i_this) {
670-
// fopAcM_GetID(i_this);
671670
dComIfG_resDelete(&i_this->mPhaseReq, "E_tk");
672671
if (i_this->mInitHIO) {
673672
hioInit = false;

0 commit comments

Comments
 (0)