d_a_e_cr / d_a_e_cr_egg done (#2536)

* d_a_e_cr_egg done

* e_cr done
This commit is contained in:
TakaRikka
2025-07-15 22:57:21 +03:00
committed by GitHub
parent aeeaf91054
commit 70f0ed7ef7
7 changed files with 810 additions and 846 deletions
+2 -2
View File
@@ -1657,8 +1657,8 @@ config.libs = [
ActorRel(NonMatching, "d_a_e_bs"),
ActorRel(NonMatching, "d_a_e_bu"),
ActorRel(NonMatching, "d_a_e_bug"),
ActorRel(NonMatching, "d_a_e_cr"),
ActorRel(NonMatching, "d_a_e_cr_egg"),
ActorRel(Equivalent, "d_a_e_cr"), # weak func order
ActorRel(MatchingFor("GZ2E01"), "d_a_e_cr_egg"),
ActorRel(NonMatching, "d_a_e_db"),
ActorRel(MatchingFor("GZ2E01"), "d_a_e_db_leaf"),
ActorRel(NonMatching, "d_a_e_dd"),
+47 -5
View File
@@ -1,6 +1,10 @@
#ifndef D_A_E_CR_H
#define D_A_E_CR_H
#include "f_op/f_op_actor_mng.h"
#include "d/d_bg_s_acch.h"
#include "d/d_cc_d.h"
#include "d/d_cc_uty.h"
/**
* @ingroup actors-enemies
@@ -10,16 +14,54 @@
* @details
*
*/
class e_cr_class : public fopEn_enemy_c {
private:
/* 0x5ac */ u8 field_0x5ac[0xa60 - 0x5ac];
class e_cr_class {
public:
/* 0x000 */ fopEn_enemy_c enemy;
/* 0x5AC */ request_of_phase_process_class phase;
/* 0x5B4 */ u8 field_0x5b4;
/* 0x5B5 */ u8 field_0x5b5;
/* 0x5B8 */ mDoExt_McaMorfSO* modelMorf;
/* 0x5BC */ Z2CreatureEnemy sound;
/* 0x660 */ int anm;
/* 0x664 */ s16 lifetime;
/* 0x666 */ s16 action;
/* 0x668 */ s16 mode;
/* 0x66A */ u8 field_0x66A[0x678 - 0x66A];
/* 0x678 */ s16 angle_target;
/* 0x67A */ u8 field_0x67A[0x67C - 0x67A];
/* 0x67C */ s16 angle_to_pl;
/* 0x680 */ f32 dist_to_pl;
/* 0x684 */ s16 timers[4];
/* 0x68C */ s16 invulnerabilityTimer;
/* 0x68E */ s16 field_0x68e;
/* 0x690 */ s8 field_0x690;
/* 0x692 */ s16 field_0x692;
/* 0x694 */ s16 head_rot;
/* 0x696 */ s16 head_rot_target;
/* 0x698 */ dBgS_AcchCir acchcir;
/* 0x6D8 */ dBgS_ObjAcch acch;
/* 0x8B0 */ dCcD_Stts ccStts;
/* 0x8EC */ dCcD_Sph ccSph;
/* 0xA24 */ dCcU_AtInfo atInfo;
/* 0xA48 */ u32 field_0xa48;
/* 0xA4C */ u32 field_0xa4c;
/* 0xA50 */ u8 field_0xA50[0xA5C - 0xA50];
/* 0xA5C */ u8 HIOInit;
};
STATIC_ASSERT(sizeof(e_cr_class) == 0xa60);
class daE_CR_HIO_c {
class daE_CR_HIO_c : public JORReflexible {
public:
/* 8069800C */ daE_CR_HIO_c();
/* 806997F4 */ ~daE_CR_HIO_c();
/* 806997F4 */ virtual ~daE_CR_HIO_c() {}
void genMessage(JORMContext*);
/* 0x04 */ s8 id;
/* 0x08 */ f32 base_size;
/* 0x0C */ f32 move_speed;
/* 0x10 */ f32 pl_search_range;
};
+23 -3
View File
@@ -1,6 +1,10 @@
#ifndef D_A_E_CR_EGG_H
#define D_A_E_CR_EGG_H
#include "f_op/f_op_actor_mng.h"
#include "d/d_bg_s_acch.h"
#include "d/d_cc_d.h"
#include "d/d_cc_uty.h"
/**
* @ingroup actors-enemies
@@ -10,9 +14,25 @@
* @details
*
*/
class e_cr_egg_class : public fopEn_enemy_c {
private:
/* 0x5ac */ u8 field_0x5ac[0xa0c - 0x5ac];
class e_cr_egg_class {
public:
/* 0x000 */ fopEn_enemy_c enemy;
/* 0x5AC */ request_of_phase_process_class phase;
/* 0x5B4 */ u8 field_0x5b4;
/* 0x5B5 */ u8 field_0x5b5;
/* 0x5B8 */ J3DModel* model;
/* 0x5BC */ Z2Creature sound;
/* 0x64C */ s16 lifetime;
/* 0x64E */ s16 action;
/* 0x650 */ s16 mode;
/* 0x652 */ s16 timers[2];
/* 0x656 */ s16 field_0x656;
/* 0x658 */ u8 field_0x658[0x65C - 0x658];
/* 0x65C */ dBgS_AcchCir acchcir;
/* 0x69C */ dBgS_ObjAcch acch;
/* 0x874 */ dCcD_Stts ccStts;
/* 0x8B0 */ dCcD_Sph ccSph;
/* 0x9E8 */ dCcU_AtInfo atInfo;
};
STATIC_ASSERT(sizeof(e_cr_egg_class) == 0xa0c);
+1 -1
View File
@@ -61,7 +61,7 @@ public:
/* 0x684 */ u32 mShadowId;
/* 0x688 */ s16 mTargetAngle;
/* 0x68A */ s16 mTargetStep;
/* 0x68C */ u8 field_0x68c;
/* 0x68C */ u8 mMoveWaitTimer;
/* 0x68E */ s16 mInvulnerabilityTimer;
/* 0x690 */ u8 field_0x690;
/* 0x691 */ u8 field_0x691;
+502 -508
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+22 -20
View File
@@ -182,10 +182,12 @@ int daE_WS_c::checkPlayerPos() {
gndchk.SetPos(&gndpos);
gndpos.y = dComIfG_Bgsp().GroundCross(&gndchk);
if (current.pos.y - gndpos.y > l_HIO.dist_to_ground) {
// Return 1 if walltula is looking towards player
if (cLib_distanceAngleS(shape_angle.y, calcTargetAngle(current.pos, player_pos)) < l_HIO.search_angle) {
return 1;
}
// otherwise return 2 if player is near the walltula
if (calcTargetDist(current.pos, player_pos) < 150.0f) {
return 2;
}
@@ -230,12 +232,12 @@ void daE_WS_c::executeWait() {
switch (mMode) {
case 0:
field_0x68c = 50.0f + cM_rndF(50.0f);
mMoveWaitTimer = 50.0f + cM_rndF(50.0f);
setBck(9, 2, 3.0f, 1.0f);
mMode = 1;
/* fallthrough */
case 1:
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
mMode = 2;
}
break;
@@ -263,19 +265,19 @@ void daE_WS_c::executeWait() {
if (cLib_chaseAngleS(&shape_angle.y, mTargetAngle, mTargetStep)) {
mMode = 4;
field_0x68c = 10;
mMoveWaitTimer = 10;
setBck(9, 2, 3.0f, 1.0f);
}
break;
case 4:
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
mMode = 5;
}
break;
case 5:
mMode = 6;
speedF = 3.0f;
field_0x68c = 20.0f + cM_rndF(10.0f);
mMoveWaitTimer = 20.0f + cM_rndF(10.0f);
setBck(7, 2, 3.0f, 1.0f);
/* fallthrough */
case 6:
@@ -283,15 +285,15 @@ void daE_WS_c::executeWait() {
if (field_0x690 == 0) {
if (calcTargetDist(current.pos, field_0x65c) >= l_HIO.move_range) {
field_0x68c = 0;
mMoveWaitTimer = 0;
}
}
if (checkBeforeBg(shape_angle.y)) {
field_0x68c = 0;
mMoveWaitTimer = 0;
}
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
speedF = 0.0f;
mMode = 0;
}
@@ -322,12 +324,12 @@ void daE_WS_c::executeAttack() {
mMode = 2;
setBck(10, 2, 3.0f, 1.0f);
mSound.startCreatureVoice(Z2SE_EN_WS_V_YOKOKU, -1);
field_0x68c = 10;
mMoveWaitTimer = 10;
}
}
break;
case 2:
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
speedF = l_HIO.attack_speed * mBodyScale;
setBck(7, 2, 3.0f, 3.0f);
mMode = 3;
@@ -410,7 +412,7 @@ void daE_WS_c::executeDown() {
speedF = 3.0f + cM_rndF(2.0f);
speed.y = 12.0f;
mMode = 3;
field_0x68c = 30;
mMoveWaitTimer = 30;
setBck(6, 0, 5.0f, 1.0f);
mSound.startCreatureSound(Z2SE_CM_BODYFALL_S, 0, -1);
}
@@ -445,7 +447,7 @@ void daE_WS_c::executeDown() {
cLib_addCalc2(&mDownColor, -20.0f, 1.0f, 0.4f);
if (mpModelMorf->isStop()) {
field_0x68c = 15;
mMoveWaitTimer = 15;
mMode = 5;
return;
}
@@ -453,7 +455,7 @@ void daE_WS_c::executeDown() {
case 5:
cLib_addCalc2(&mDownColor, -20.0f, 1.0f, 0.4f);
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
fopAcM_delete(this);
fopAcM_createDisappear(this, &current.pos, 7, 0, 7);
@@ -480,7 +482,7 @@ void daE_WS_c::executeWindDown() {
setBck(7, 2, 3.0f, 1.0f);
mSound.startCreatureVoice(Z2SE_EN_WS_V_DAMAGE, -1);
field_0x68c = 5;
mMoveWaitTimer = 5;
mAcch.SetGroundUpY(20.0f);
attention_info.flags = 0;
speed.y = 0.0f;
@@ -496,7 +498,7 @@ void daE_WS_c::executeWindDown() {
shape_angle.z += 0x800;
speed.y = 30.0f;
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
mMode = 2;
gravity = -3.0f;
}
@@ -512,7 +514,7 @@ void daE_WS_c::executeWindDown() {
speedF = 3.0f + cM_rndF(2.0f);
speed.y = 12.0f;
mMode = 3;
field_0x68c = 30;
mMoveWaitTimer = 30;
setBck(6, 0, 5.0f, 1.0f);
mSound.startCreatureVoice(Z2SE_EN_WS_V_DEATH, -1);
mSound.startCreatureSound(Z2SE_CM_BODYFALL_S, 0, -1);
@@ -539,13 +541,13 @@ void daE_WS_c::executeWindDown() {
shape_angle.y += mTargetStep;
if (mpModelMorf->isStop()) {
field_0x68c = 15;
mMoveWaitTimer = 15;
mMode = 5;
}
break;
case 5:
cLib_addCalc2(&mDownColor, -20.0f, 1.0f, 0.4f);
if (field_0x68c == 0) {
if (mMoveWaitTimer == 0) {
fopAcM_delete(this);
fopAcM_createDisappear(this, &current.pos, 7, 0, 7);
@@ -690,8 +692,8 @@ void daE_WS_c::cc_set() {
/* 807E5C0C-807E5CB8 0022EC 00AC+00 1/1 0/0 0/0 .text execute__8daE_WS_cFv */
int daE_WS_c::execute() {
if (field_0x68c != 0) {
field_0x68c--;
if (mMoveWaitTimer != 0) {
mMoveWaitTimer--;
}
if (mInvulnerabilityTimer != 0) {