Work on d_a_bk, c_damagereaction

This commit is contained in:
LagoLunatic
2025-03-12 22:30:10 -04:00
parent f5e7395ddd
commit a9e1527253
23 changed files with 654 additions and 271 deletions
+38 -38
View File
@@ -294,7 +294,7 @@ static BOOL week_atari_check(am2_class* i_this) {
}
i_this->mAction = ACTION_ITAI;
i_this->mState = 0x14;
i_this->mState = 20;
if (i_this->m2CE == 7 || i_this->m2CE == 8) {
actor->health = 0;
}
@@ -341,7 +341,7 @@ static BOOL body_atari_check(am2_class* i_this) {
break;
}
i_this->mAction = ACTION_HANDOU_MOVE;
i_this->mState = 0x1E;
i_this->mState = 30;
i_this->m2CE = 7;
if (player->getCutType() == 0x11) {
i_this->m2CE = 8;
@@ -598,7 +598,7 @@ static void action_dousa(am2_class* i_this) {
fopAcM_delete(i_this);
} else {
i_this->mAction = ACTION_MODORU_MOVE;
i_this->mState = 0x28;
i_this->mState = 40;
}
} else if (!medama_atari_check(i_this)) {
if (i_this->mState < 3 || !week_atari_check(i_this)) {
@@ -613,7 +613,7 @@ static void action_mahi(am2_class* i_this) {
fopAc_ac_c* actor = i_this; // Fixes regswaps
switch (i_this->mState) {
case 0xA:
case 10:
for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) {
i_this->mCountUpTimers[i] = 0;
}
@@ -633,7 +633,7 @@ static void action_mahi(am2_class* i_this) {
i_this->mState++;
break;
case 0xB:
case 11:
cLib_addCalc0(&actor->speedF, 0.5f, 1.0f);
if (actor->speedF < 0.2f) {
if (i_this->mpMorf->isStop()) {
@@ -644,7 +644,7 @@ static void action_mahi(am2_class* i_this) {
}
}
break;
case 0xC:
case 12:
if (i_this->mCountDownTimers[3] == 0 || i_this->mCountDownTimers[3] > 3) {
cLib_onBit<u32>(actor->attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
}
@@ -653,7 +653,7 @@ static void action_mahi(am2_class* i_this) {
fopAcM_delete(actor);
} else {
i_this->mAction = ACTION_MODORU_MOVE;
i_this->mState = 0x28;
i_this->mState = 40;
}
} else {
if (i_this->mCountUpTimers[1] != 0 && i_this->mAcch.ChkGroundHit()) {
@@ -676,7 +676,7 @@ static void action_mahi(am2_class* i_this) {
}
}
break;
case 0xD:
case 13:
actor->current.angle.y = player->shape_angle.y;
if (actor->home.roomNo != actor->current.roomNo) {
i_this->mbNotInHomeRoom = true;
@@ -692,15 +692,15 @@ static void action_mahi(am2_class* i_this) {
actor->speed.y = 25.0f;
actor->speedF = 35.0f;
i_this->mAcch.OnLineCheck();
i_this->mState = 0xE;
i_this->mState = 14;
} else {
actor->gravity = -3.0f;
i_this->mCountUpTimers[1] = 1;
i_this->mState = 0xC;
i_this->mState = 12;
}
}
break;
case 0xE:
case 14:
if (i_this->mAcch.ChkWallHit()) {
actor->speedF = 0.0f;
}
@@ -710,7 +710,7 @@ static void action_mahi(am2_class* i_this) {
} else {
i_this->mAcch.OffLineCheck();
i_this->mAction = ACTION_MODORU_MOVE;
i_this->mState = 0x28;
i_this->mState = 40;
}
} else {
if (i_this->mAcch.ChkGroundHit()) {
@@ -740,20 +740,20 @@ static void action_mahi(am2_class* i_this) {
} else {
actor->speedF = 0.0f;
i_this->mCountUpTimers[0] = 0;
i_this->mState = 0xC;
i_this->mState = 12;
}
}
cLib_addCalc0(&actor->speedF, 0.5f, 1.0f);
}
break;
case 0xF:
case 15:
if (naraku_check(i_this)) {
if (i_this->mbNotInHomeRoom) {
fopAcM_delete(actor);
} else {
i_this->mAction = ACTION_MODORU_MOVE;
i_this->mState = 0x28;
i_this->mState = 40;
return;
}
}
@@ -771,7 +771,7 @@ static void action_mahi(am2_class* i_this) {
i_this->mTargetAngleY = actor->current.angle.y;
if (i_this->mState >= 0xC && i_this->mState != 0xF) {
if (i_this->mState >= 12 && i_this->mState != 15) {
if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF) {
if (!dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) {
i_this->mCountDownTimers[2] = 20*30;
@@ -811,12 +811,12 @@ static void action_mahi(am2_class* i_this) {
actor->gravity = -4.0f;
actor->speed.y = 20.0f;
i_this->mBodyCyl.OnCoSetBit();
i_this->mState = 0xF;
i_this->mState = 15;
}
}
}
if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e) || i_this->mState == 0xF || !week_atari_check(i_this)) {
if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e) || i_this->mState == 15 || !week_atari_check(i_this)) {
body_atari_check(i_this);
}
}
@@ -824,7 +824,7 @@ static void action_mahi(am2_class* i_this) {
/* 00002B08-000032AC .text action_itai__FP9am2_class */
static void action_itai(am2_class* i_this) {
switch (i_this->mState) {
case 0x14:
case 20:
for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) {
i_this->mCountUpTimers[i] = 0;
}
@@ -847,10 +847,10 @@ static void action_itai(am2_class* i_this) {
}
i_this->mState++;
} else {
i_this->mState = 0x16;
i_this->mState = 22;
}
break;
case 0x15:
case 21:
cLib_addCalc0(&i_this->speedF, 0.5f, 1.0f);
if (i_this->speedF < 0.2f) {
i_this->speedF = 0.0f;
@@ -861,11 +861,11 @@ static void action_itai(am2_class* i_this) {
} else {
anm_init(i_this, AM2_BCK_MAHI, 1.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, -1);
i_this->mAction = ACTION_MAHI;
i_this->mState = 0xC;
i_this->mState = 12;
}
}
break;
case 0x16:
case 22:
i_this->mEyeSph.OffTgSetBit();
i_this->mWeakSph.OffTgSetBit();
i_this->mEyeSph.ClrTgHit();
@@ -873,7 +873,7 @@ static void action_itai(am2_class* i_this) {
anm_init(i_this, AM2_BCK_DEAD1, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, -1);
i_this->mState++;
break;
case 0x17:
case 23:
if (!i_this->mpMorf->isStop()) {
break;
}
@@ -887,7 +887,7 @@ static void action_itai(am2_class* i_this) {
anm_init(i_this, AM2_BCK_DEAD2, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, -1);
i_this->mState++;
// Fall-through
case 0x18:
case 24:
if (i_this->speed.y > 0.0f && i_this->mCountUpTimers[1] == 0) {
fopAcM_monsSeStart(i_this, JA_SE_CV_AM2_JUMP, 0x42);
i_this->mCountUpTimers[1] = 1;
@@ -924,7 +924,7 @@ static void action_itai(am2_class* i_this) {
i_this->mState++;
}
break;
case 0x19:
case 25:
if (!i_this->mpMorf->isStop()) {
break;
}
@@ -942,15 +942,15 @@ static void action_itai(am2_class* i_this) {
if (naraku_check(i_this)) {
if (i_this->mbNotInHomeRoom || i_this->health <= 0) {
if (i_this->mState != 0x19) {
if (i_this->mState != 25) {
anm_init(i_this, AM2_BCK_DEAD3, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, -1);
fopAcM_seStart(i_this, JA_SE_CM_AM2_BEF_EXPLODE, 0);
i_this->speedF = 0.0f;
i_this->mState = 0x19;
i_this->mState = 25;
}
} else {
i_this->mAction = ACTION_MODORU_MOVE;
i_this->mState = 0x28;
i_this->mState = 40;
}
}
}
@@ -959,7 +959,7 @@ static void action_itai(am2_class* i_this) {
static void action_handou_move(am2_class* i_this) {
daPy_py_c* player = daPy_getPlayerActorClass();
switch (i_this->mState) {
case 0x1E: {
case 30: {
i_this->speedF = 40.0f;
s16 angleToPlayer = fopAcM_searchPlayerAngleY(i_this);
i_this->current.angle.y = angleToPlayer + 0x8000;
@@ -975,7 +975,7 @@ static void action_handou_move(am2_class* i_this) {
i_this->mState++;
// Fall-through
}
case 0x1F:
case 31:
fopAcM_seStart(i_this, JA_SE_CM_AM2_SLIP, 0);
cLib_addCalc0(&i_this->speedF, 0.8f, 2.0f);
if (i_this->speedF < 0.1f) {
@@ -987,7 +987,7 @@ static void action_handou_move(am2_class* i_this) {
i_this->attention_info.flags = 0;
i_this->mCountDownTimers[2] = 20*30;
i_this->mAction = ACTION_MAHI;
i_this->mState = 0xC;
i_this->mState = 12;
}
}
}
@@ -997,7 +997,7 @@ static void action_handou_move(am2_class* i_this) {
fopAcM_delete(i_this);
} else {
i_this->mAction = ACTION_MODORU_MOVE;
i_this->mState = 0x28;
i_this->mState = 40;
}
}
}
@@ -1006,7 +1006,7 @@ static void action_handou_move(am2_class* i_this) {
static void action_modoru_move(am2_class* i_this) {
// Respawns the Armos back at its spawn point after it falls into an abyss.
switch (i_this->mState) {
case 0x28:
case 40:
dCam_getBody()->ForceLockOff(fopAcM_GetID(i_this));
i_this->mInAbyssTimer = 0;
i_this->mbMadeWaterSplash = false;
@@ -1015,7 +1015,7 @@ static void action_modoru_move(am2_class* i_this) {
fopAcM_seStart(i_this, JA_SE_CM_AM2_WTR_RECOVER, 0);
i_this->mState++;
// Fall-through
case 0x29:
case 41:
cLib_addCalc0(&i_this->scale.x, 1.0f, 0.1f);
i_this->scale.y = i_this->scale.z = i_this->scale.x;
@@ -1037,7 +1037,7 @@ static void action_modoru_move(am2_class* i_this) {
i_this->mState++;
}
break;
case 0x2A:
case 42:
i_this->shape_angle.y = i_this->mSpawnRotY;
i_this->current.angle.y = i_this->shape_angle.y;
i_this->current.pos = i_this->mSpawnPos;
@@ -1062,7 +1062,7 @@ static void action_modoru_move(am2_class* i_this) {
i_this->attention_info.flags = 0;
i_this->mCountDownTimers[2] = 20*30;
i_this->mAction = ACTION_MAHI;
i_this->mState = 0xC;
i_this->mState = 12;
}
}
break;
@@ -1456,7 +1456,7 @@ static s32 daAM2_Create(fopAc_ac_c* i_actor) {
i_this->attention_info.flags = 0;
i_this->mCountDownTimers[2] = 20*30;
i_this->mAction = ACTION_MAHI;
i_this->mState = 0xC;
i_this->mState = 12;
}
i_this->mAcchRadius = 40.0f + REG8_F(10);