diff --git a/src/d/actor/d_a_auction.cpp b/src/d/actor/d_a_auction.cpp index 9bdb94f03..2bb602947 100644 --- a/src/d/actor/d_a_auction.cpp +++ b/src/d/actor/d_a_auction.cpp @@ -11,6 +11,7 @@ #include "d/d_camera.h" #include "d/d_procname.h" #include "d/d_priority.h" +#include "d/res/res_pspl.h" #include "m_Do/m_Do_controller_pad.h" struct NpcDatStruct { @@ -252,7 +253,7 @@ cPhs_State daAuction_c::_create() { /* 000006F4-00000770 .text createHeap__11daAuction_cFv */ BOOL daAuction_c::createHeap() { - J3DModelData* modelData = static_cast(dComIfG_getObjectIDRes("Pspl", 0)); + J3DModelData* modelData = static_cast(dComIfG_getObjectIDRes("Pspl", PSPL_BDL_PSPL)); if (modelData == NULL) { return FALSE; diff --git a/src/d/actor/d_a_bb.cpp b/src/d/actor/d_a_bb.cpp index 27d4924ce..611f51427 100644 --- a/src/d/actor/d_a_bb.cpp +++ b/src/d/actor/d_a_bb.cpp @@ -343,9 +343,25 @@ void bb_eye_tex_anm(bb_class* i_this) { void anm_init(bb_class* i_this, int animFileIdx, float morf, unsigned char loopMode, float speed, int soundFileIdx) { if (i_this->unk_2DF < 3) { if (soundFileIdx >= 0) { - i_this->mpMorf->setAnm((J3DAnmTransform*)(dComIfG_getObjectRes("Bb", animFileIdx)), loopMode, morf, speed, 0.0f, -1.0f, dComIfG_getObjectRes("Bb", soundFileIdx)); + i_this->mpMorf->setAnm( + (J3DAnmTransform*)(dComIfG_getObjectRes("Bb", animFileIdx)), + loopMode, + morf, + speed, + 0.0f, + -1.0f, + dComIfG_getObjectRes("Bb", soundFileIdx) + ); } else { - i_this->mpMorf->setAnm((J3DAnmTransform*)(dComIfG_getObjectRes("Bb", animFileIdx)), loopMode, morf, speed, 0.0f, -1.0f, NULL); + i_this->mpMorf->setAnm( + (J3DAnmTransform*)(dComIfG_getObjectRes("Bb", animFileIdx)), + loopMode, + morf, + speed, + 0.0f, + -1.0f, + NULL + ); } } } @@ -718,14 +734,14 @@ void bb_path_move(bb_class* i_this) { frame = i_this->mpMorf->getFrame(); if (a_this->current.pos.y > i_this->unk_2F4.y && frame == (REG0_S(0) + 9)) { i_this->unk_2F0 = 1; - anm_init(i_this, 0x19, REG0_F(0) + 12.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, REG0_F(0) + 12.0f, 2, 1.0f, 9); } break; case 1: if (a_this->current.pos.y <= i_this->unk_2F4.y) { i_this->unk_2F0 = 0; - anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); } break; @@ -907,7 +923,7 @@ void bb_path_move(bb_class* i_this) { case 25: r29 = 1; - anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); i_this->unk_2F1 = -1; i_this->unk_310 = REG0_F(4) * 10.0f + 5000.0f; i_this->unk_300 = 25.0f; @@ -943,7 +959,7 @@ void bb_auto_move(bb_class* i_this) { if ((i_this->unk_318[0] == 0) && (frame == REG0_S(0) + 9)) { i_this->unk_2F0 = 1; i_this->unk_318[0] = cM_rndF(200.0) + 50.0f; - anm_init(i_this, 0x19, REG0_F(0) + 12.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, REG0_F(0) + 12.0f, 2, 1.0f, 9); } break; @@ -951,7 +967,7 @@ void bb_auto_move(bb_class* i_this) { if ((i_this->unk_318[0] == 0) && (i_this->actor.current.pos.y < i_this->unk_2F4.y)) { i_this->unk_2F0 = 0; i_this->unk_318[0] = cM_rndF(60.0) + 20.0f; - anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); } break; @@ -963,7 +979,7 @@ void bb_auto_move(bb_class* i_this) { if (frame == 0x22) { i_this->unk_2F0 = 0; i_this->unk_318[0] = cM_rndF(60.0f) + 20.0f; - anm_init(i_this, 0x18, 0.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 0.0f, 2, l_bbHIO.unk_24, 8); } break; } @@ -1027,11 +1043,11 @@ void bb_auto_move(bb_class* i_this) { if (i_this->unk_2F1 == 10) { if (sqrt < l_bbHIO.unk_50) { i_this->unk_2F1 = 11; - anm_init(i_this, 0x1A, 10.0f, 0, 1.0f, 10); + anm_init(i_this, BB_BCK_FLY03, 10.0f, 0, 1.0f, 10); } } else if (sqrt < REG0_F(9) * 10.0f + 300.0f) { i_this->unk_2F1 = 20; - anm_init(i_this, 0x1F, 5.0f, 2, l_bbHIO.unk_44, 15); + anm_init(i_this, BB_BCK_LAND01, 5.0f, 2, l_bbHIO.unk_44, 15); i_this->unk_2F0 = 10; i_this->actor.speed.y = 0.0f; i_this->unk_354 = 0; @@ -1064,7 +1080,7 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_2F1 = 25; } else if (i_this->mAcch.ChkGroundHit()) { i_this->actor.speed.y = -0.5f; - anm_init(i_this, 0x20, 5.0f, 0, l_bbHIO.unk_48, 0x10); + anm_init(i_this, BB_BCK_LAND02, 5.0f, 0, l_bbHIO.unk_48, 0x10); i_this->unk_2F1 = 22; i_this->unk_318[2] = 50; } @@ -1094,7 +1110,7 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_2F4.z = ac->current.pos.z; i_this->unk_310 = 1000.0f; i_this->unk_308 = 1.0f; - anm_init(i_this, 0x22, 5.0f, 2, 1.0f, 0x12); + anm_init(i_this, BB_BCK_WALK, 5.0f, 2, 1.0f, 0x12); } else { i_this->unk_2F1 = 0x19; } @@ -1114,7 +1130,7 @@ void bb_auto_move(bb_class* i_this) { i_this->unk_2F1 = 21; i_this->unk_318[2] = cM_rndF(50.0f) + 50.0f; - anm_init(i_this, 0x17, 5.0f, 0, 1.0f, 7); + anm_init(i_this, BB_BCK_EAT, 5.0f, 0, 1.0f, 7); i_this->unk_2F1 = 24; } @@ -1138,14 +1154,14 @@ void bb_auto_move(bb_class* i_this) { if (i_this->mpMorf->isStop()) { i_this->unk_2F1 = 21; i_this->unk_318[2] = cM_rndF(50.0f); - anm_init(i_this, 0x21, 5.0f, 2, 1.0f, 0x11); + anm_init(i_this, BB_BCK_WAIT, 5.0f, 2, 1.0f, 0x11); } break; } case 25: r29 = 1; i_this->unk_2F1 = 0; - anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); i_this->unk_310 = REG0_F(4) * 10.0f + 2000.0f; i_this->unk_300 = 25.0f; i_this->unk_304 = 1.0f; @@ -1189,7 +1205,7 @@ void bb_auto_move(bb_class* i_this) { } i_this->unk_2F0 = 0; i_this->unk_318[0] = cM_rndF(60.0f) + 20.0f; - anm_init(i_this, 0x18, 3.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 3.0f, 2, l_bbHIO.unk_24, 8); if (i_this->unk_2DA != 0xFF) { i_this->unk_35D = i_this->unk_2DA + 1; path_check(i_this); @@ -1249,14 +1265,14 @@ void bb_kamome_attack(bb_class* i_this) { s32 frame = i_this->mpMorf->getFrame(); if ((i_this->actor.current.pos.y > i_this->unk_2F4.y) && (frame == REG0_S(0) + 9)) { i_this->unk_2F0 = 1; - anm_init(i_this, 0x19, REG0_F(0) + 12.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, REG0_F(0) + 12.0f, 2, 1.0f, 9); } break; } case 1: { if (i_this->actor.current.pos.y <= i_this->unk_2F4.y) { i_this->unk_2F0 = 0; - anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); } break; } @@ -1267,7 +1283,7 @@ void bb_kamome_attack(bb_class* i_this) { switch (i_this->unk_2F1) { case 0: - anm_init(i_this, 0x19, 10.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, 10.0f, 2, 1.0f, 9); i_this->unk_2F1 = 1; case 1: { @@ -1337,7 +1353,7 @@ void bb_atack_move(bb_class* i_this) { i_this->unk_C7C = 0; i_this->unk_318[5] = (cM_rndF(30.0f) + 20.0f) * l_bbHIO.unk_20; - anm_init(i_this, 0x1B, 10.0f, 2, l_bbHIO.unk_28, 11); + anm_init(i_this, BB_BCK_FLYB01, 10.0f, 2, l_bbHIO.unk_28, 11); i_this->unk_308 = 0.0f; i_this->unk_30C = 0.0f; @@ -1362,7 +1378,7 @@ void bb_atack_move(bb_class* i_this) { i_this->unk_308 = 0.0f; i_this->unk_300 = 30.0f; i_this->unk_304 = 1.0f; - anm_init(i_this, 0x19, 10.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, 10.0f, 2, 1.0f, 9); case 1: case 2: @@ -1380,7 +1396,7 @@ void bb_atack_move(bb_class* i_this) { if (std::sqrtf(x * x + y * y + z * z) < l_bbHIO.unk_50) { i_this->unk_2F1 = 2; - anm_init(i_this, 0x1A, 10.0f, 0, 1.0f, 10); + anm_init(i_this, BB_BCK_FLY03, 10.0f, 0, 1.0f, 10); kuti_open(i_this, 0x15, JA_SE_CV_BB_FIND); } } else { @@ -1409,7 +1425,7 @@ void bb_atack_move(bb_class* i_this) { i_this->unk_308 = 0.0f; i_this->unk_30C = 0.0f; - anm_init(i_this, 0x1B, 5.0f, 2, l_bbHIO.unk_28, 11); + anm_init(i_this, BB_BCK_FLYB01, 5.0f, 2, l_bbHIO.unk_28, 11); kuti_open(i_this, 0x30, JA_SE_CV_BB_NORMAL); } break; @@ -1455,7 +1471,7 @@ void bb_atack_move(bb_class* i_this) { if (i_this->unk_33C > ((REG0_F(5) * 10.0f + 200.0f)) && i_this->unk_33C < (REG0_F(6) * 10.0f + 350.0f)) { i_this->unk_2F1 = 5; i_this->unk_318[0] = l_bbHIO.unk_32; - anm_init(i_this, 0x1B, 2.0f, 2, l_bbHIO.unk_34, 0xB); + anm_init(i_this, BB_BCK_FLYB01, 2.0f, 2, l_bbHIO.unk_34, 0xB); tex_anm_set(i_this, 0); } } @@ -1477,7 +1493,7 @@ void bb_atack_move(bb_class* i_this) { if (i_this->unk_318[0] == 0) { i_this->unk_2F1 = 6; - anm_init(i_this, 0x15, 2.0f, 0, l_bbHIO.unk_2C, 6); + anm_init(i_this, BB_BCK_ATACK01, 2.0f, 0, l_bbHIO.unk_2C, 6); i_this->unk_2F4.x = player->current.pos.x; i_this->unk_2F4.y = player->current.pos.y + 100.0f; @@ -1508,7 +1524,7 @@ void bb_atack_move(bb_class* i_this) { if (i_this->mpMorf->isStop()) { i_this->unk_2F1 = 4; - anm_init(i_this, 0x1B, 3.0f, 2, l_bbHIO.unk_28, 11); + anm_init(i_this, BB_BCK_FLYB01, 3.0f, 2, l_bbHIO.unk_28, 11); i_this->unk_318[5] = l_bbHIO.unk_20 * (cM_rndF(30.0f) + 20.0f); i_this->unk_308 = 0.0f; @@ -1530,7 +1546,7 @@ void bb_atack_move(bb_class* i_this) { i_this->unk_2F1 = 10; i_this->unk_318[0] = l_bbHIO.unk_30; - anm_init(i_this, 0x1E, 0.0f, 0, l_bbHIO.unk_38, 14); + anm_init(i_this, BB_BCK_GUSYA01, 0.0f, 0, l_bbHIO.unk_38, 14); i_this->unk_300 = REG0_F(7); i_this->unk_304 = 1.0f; a_this->speedF = -20.0f; @@ -1552,7 +1568,7 @@ void bb_atack_move(bb_class* i_this) { if (i_this->mpMorf->isStop() && (i_this->unk_2F1 == 10)) { i_this->unk_2F1 = 11; - anm_init(i_this, 0x1D, 0.0f, 2, l_bbHIO.unk_3C, 13); + anm_init(i_this, BB_BCK_FURA01, 0.0f, 2, l_bbHIO.unk_3C, 13); } if ((i_this->unk_2F1 == 11) && ((i_this->unk_318[0] & 7) == 5)) { @@ -1563,7 +1579,7 @@ void bb_atack_move(bb_class* i_this) { i_this->unk_2F1 = 4; i_this->unk_318[5] = l_bbHIO.unk_20 * (cM_rndF(30.0f) + 20.0f); - anm_init(i_this, 0x1B, 10.0f, 2, l_bbHIO.unk_28, 11); + anm_init(i_this, BB_BCK_FLYB01, 10.0f, 2, l_bbHIO.unk_28, 11); i_this->unk_308 = 0.0f; i_this->unk_30C = 0.0f; @@ -1589,14 +1605,14 @@ void bb_atack_move(bb_class* i_this) { if ((i_this->unk_2DD == 4) || (i_this->unk_2DD == 7)) { i_this->unk_2F1 = 10; - anm_init(i_this, 0x18, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); } else { i_this->unk_2F1 = 0; i_this->unk_318[0] = 0; i_this->unk_318[1] = 0; i_this->unk_2F0 = 1; - anm_init(i_this, 0x19, REG0_F(0) + 12.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, REG0_F(0) + 12.0f, 2, 1.0f, 9); a_this->speedF = 0.0; i_this->unk_2F4.y = player->current.pos.y + 500.0f; @@ -1652,7 +1668,7 @@ void bb_wait_move(bb_class* i_this) { i_this->unk_2F1 = 0; case 0: - anm_init(i_this, 0x21, 1.0f, 2, 1.0f, 0x11); + anm_init(i_this, BB_BCK_WAIT, 1.0f, 2, 1.0f, 0x11); i_this->unk_2F1 = 1; i_this->unk_318[0] = 100; @@ -1679,7 +1695,7 @@ void bb_wait_move(bb_class* i_this) { break; } i_this->unk_2F1 = 3; - anm_init(i_this, 0x18, 5.0f , 2, l_bbHIO.unk_24 * 1.5f, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f , 2, l_bbHIO.unk_24 * 1.5f, 8); i_this->unk_318[0] = REG0_S(0) + 70; case 3: @@ -1738,11 +1754,11 @@ void bb_wait_move(bb_class* i_this) { } else if (i_this->unk_2F1 == 11) { if (sqrt < l_bbHIO.unk_50) { i_this->unk_2F1 = 12; - anm_init(i_this, 0x1A, 10.0f, 0, 1.0f, 10); + anm_init(i_this, BB_BCK_FLY03, 10.0f, 0, 1.0f, 10); } } else if (i_this->unk_2F1 == 12 && sqrt < REG0_F(9) * 10.0f + 300.0f) { i_this->unk_2F1 = 20; - anm_init(i_this, 0x1F, 5.0f, 2, l_bbHIO.unk_44, 15); + anm_init(i_this, BB_BCK_LAND01, 5.0f, 2, l_bbHIO.unk_44, 15); i_this->unk_2F0 = 10; i_this->actor.speed.y = 0.0f; i_this->unk_354 = 0; @@ -1771,7 +1787,7 @@ void bb_wait_move(bb_class* i_this) { i_this->actor.current.pos.y = i_this->actor.home.pos.y; i_this->actor.speed.y = -0.5; if (old_354 > l_bbHIO.unk_40) { - anm_init(i_this, 0x20, 5.0f, 0, l_bbHIO.unk_48, 0x10); + anm_init(i_this, BB_BCK_LAND02, 5.0f, 0, l_bbHIO.unk_48, 0x10); i_this->unk_2F1 = -1; } } @@ -1813,7 +1829,7 @@ void bb_su_wait_move(bb_class* i_this) { i_this->unk_2F1 = 0; case 0: - anm_init(i_this, 0x21, 1.0f, 2, 1.0f, 0x11); + anm_init(i_this, BB_BCK_WAIT, 1.0f, 2, 1.0f, 0x11); i_this->unk_2F1 = 1; i_this->unk_318[0] = 100; @@ -1840,7 +1856,7 @@ void bb_su_wait_move(bb_class* i_this) { break; } i_this->unk_2F1 = 3; - anm_init(i_this, 0x18, 5.0f , 2, l_bbHIO.unk_24 * 1.5f, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f , 2, l_bbHIO.unk_24 * 1.5f, 8); i_this->unk_318[0] = REG0_S(0) + 70; case 3: @@ -1899,11 +1915,11 @@ void bb_su_wait_move(bb_class* i_this) { } else if (i_this->unk_2F1 == 11) { if (sqrt < l_bbHIO.unk_50) { i_this->unk_2F1 = 12; - anm_init(i_this, 0x1A, 10.0f, 0, 1.0f, 10); + anm_init(i_this, BB_BCK_FLY03, 10.0f, 0, 1.0f, 10); } } else if (i_this->unk_2F1 == 12 && sqrt < REG0_F(9) * 10.0f + 300.0f) { i_this->unk_2F1 = 20; - anm_init(i_this, 0x1F, 5.0f, 2, l_bbHIO.unk_44, 15); + anm_init(i_this, BB_BCK_LAND01, 5.0f, 2, l_bbHIO.unk_44, 15); i_this->unk_2F0 = 10; i_this->actor.speed.y = 0.0f; i_this->unk_354 = 0; @@ -1933,7 +1949,7 @@ void bb_su_wait_move(bb_class* i_this) { i_this->actor.current.pos.y = i_this->actor.home.pos.y; i_this->actor.speed.y = -0.5; if (old_354 > l_bbHIO.unk_40) { - anm_init(i_this, 0x20, 5.0f, 0, l_bbHIO.unk_48, 0x10); + anm_init(i_this, BB_BCK_LAND02, 5.0f, 0, l_bbHIO.unk_48, 0x10); i_this->unk_2F1 = -1; } } @@ -1967,7 +1983,7 @@ void bb_key_move(bb_class* i_this) { if (!CPad_CHECK_HOLD_B(0) && frame == REG0_S(0) + 9) { i_this->unk_2F0 = 1; - anm_init(i_this, 25, REG0_F(0) + 12.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, REG0_F(0) + 12.0f, 2, 1.0f, 9); } break; } @@ -1982,7 +1998,7 @@ void bb_key_move(bb_class* i_this) { if (CPad_CHECK_HOLD_B(0)) { i_this->unk_2F0 = 0; - anm_init(i_this, 24, 5.0f, 2, l_bbHIO.unk_24, 8); + anm_init(i_this, BB_BCK_FLY01, 5.0f, 2, l_bbHIO.unk_24, 8); fopAcM_monsSeStart(&i_this->actor, JA_SE_CV_BB_NORMAL, 0); } break; @@ -2069,7 +2085,7 @@ void damage_check(bb_class* i_this) { i_this->mEnemyIce.mFreezeDuration = REG0_S(3) + 300; i_this->unk_2DD = 3; i_this->unk_2F1 = 0; - anm_init(i_this, 0x16, 0.0f, 0, 1.0f, -1); + anm_init(i_this, BB_BCK_DAMAGEP, 0.0f, 0, 1.0f, -1); } else { i_this->mEnemyIce.mLightShrinkTimer = 1; } @@ -2179,7 +2195,7 @@ void damage_check(bb_class* i_this) { } i_this->unk_C7C = 1; - anm_init(i_this, 0x16, 0.0f, 0, 1.0f, -1); + anm_init(i_this, BB_BCK_DAMAGEP, 0.0f, 0, 1.0f, -1); } } @@ -2319,7 +2335,7 @@ static BOOL daBb_Execute(bb_class* i_this) { if (i_this->unk_2DF != 0) { switch (i_this->unk_2DF) { case 1: - anm_init(i_this, 0x1C, 1.0f, 2, l_bbHIO.unk_4C, 0xC); + anm_init(i_this, BB_BCK_FLYC, 1.0f, 2, l_bbHIO.unk_4C, 0xC); i_this->unk_2DF = 2; break; @@ -2358,7 +2374,7 @@ static BOOL daBb_Execute(bb_class* i_this) { if (i_this->unk_2E0 != 0) { i_this->unk_2DF = 0; - anm_init(i_this, 0x19, 12.0f, 2, 1.0f, 9); + anm_init(i_this, BB_BCK_FLY02, 12.0f, 2, 1.0f, 9); dr->mAction = 31; ac->speedF = 40.0f; } diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 823930a3b..81b3e7b3a 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -699,7 +699,7 @@ void spinattack2(fganon_class* i_this) { cXyz transformedPos; MtxPosition(&offset, &transformedPos); i_this->current.pos = player->current.pos + transformedPos; - anm_init(i_this, 10, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + anm_init(i_this, FGANON_BCK_KAITEN_S1, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mMode = 2; deru_brk(i_this); i_this->m38C = player->current.pos; @@ -712,7 +712,7 @@ void spinattack2(fganon_class* i_this) { cXyz local_e4; local_e4 = i_this->m38C - i_this->current.pos; if (local_e4.abs() < l_HIO.m38) { - anm_init(i_this, 9, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + anm_init(i_this, FGANON_BCK_KAITEN1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mMode = 3; i_this->speedF = 0.0f; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_FIRE_S, 0); @@ -760,7 +760,7 @@ void spinattack2(fganon_class* i_this) { void down(fganon_class* i_this) { switch(i_this->mMode) { case 0: { - anm_init(i_this, 6, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + anm_init(i_this, FGANON_BCK_DAMAGE1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mMode++; i_this->speed.y = 0.0f; } @@ -778,7 +778,7 @@ void down(fganon_class* i_this) { case 2: { if (i_this->mpMorf->isStop()) { i_this->mMode++; - anm_init(i_this, 8, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); + anm_init(i_this, FGANON_BCK_DOWN1, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } break; } @@ -790,7 +790,7 @@ void down(fganon_class* i_this) { break; } case 10: { - anm_init(i_this, 7, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + anm_init(i_this, FGANON_BCK_DAMAGE2, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mMode = 2; } default: @@ -940,7 +940,7 @@ void fail(fganon_class* i_this) { case 0: { kieru_brk(i_this, 1); i_this->mMode = 1; - anm_init(i_this, 7, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + anm_init(i_this, FGANON_BCK_DAMAGE2, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); break; } case 1: { @@ -1387,7 +1387,7 @@ void damage_check(fganon_class* i_this) { if (atInfo.mpActor && (fopAcM_GetName(atInfo.mpActor) == PROC_FGMAHOU)) { i_this->m670++; - anm_init(i_this, 6, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); + anm_init(i_this, FGANON_BCK_DAMAGE1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m3A4[0] = 60; diff --git a/src/d/actor/d_a_kn.cpp b/src/d/actor/d_a_kn.cpp index 188064eec..a0985ddcd 100644 --- a/src/d/actor/d_a_kn.cpp +++ b/src/d/actor/d_a_kn.cpp @@ -13,6 +13,26 @@ #include "d/d_com_inf_game.h" #include "f_op/f_op_actor_mng.h" +enum Mode { +#if VERSION == VERSION_DEMO + Mode_0_e = 0, + Mode_1_e = 1, + Mode_10_e = 10, +#else + Mode_10_e = 0, +#endif + Mode_11_e, + Mode_12_e, + Mode_13_e, + Mode_14_e, + Mode_15_e, + Mode_16_e, + Mode_17_e, + Mode_18_e, + Mode_19_e, + Mode_20_e, +}; + static const GXColor unused_color = {0xFF, 0, 0, 0x40}; #if VERSION == VERSION_DEMO static const GXColor unused_colors[] = { @@ -20,7 +40,6 @@ static const GXColor unused_colors[] = { {0, 0xFF, 0, 0xFF}, {0, 0, 0xFF, 0xFF}, }; - #endif /* 00000078-00000120 .text daKN_Draw__FP8kn_class */ @@ -103,7 +122,6 @@ void shibuki_set(kn_class* i_this) { } } -#if VERSION == VERSION_DEMO /* 00000440-00000CE8 .text kn_move__FP8kn_class */ void kn_move(kn_class* i_this) { f32 fVar8; @@ -121,14 +139,15 @@ void kn_move(kn_class* i_this) { s32 idx2; switch (i_this->m2BD) { - case 0: - anm_init(i_this, 7, 5.0f, 2, 1.0f, -1); +#if VERSION == VERSION_DEMO + case Mode_0_e: + anm_init(i_this, KN_BCK_WALK, 5.0f, 2, 1.0f, -1); i_this->m2CC = -25.0f; i_this->actor.current.angle.z = -0x2000; i_this->m2BD++; break; - case 1: + case Mode_1_e: cLib_addCalc0(&i_this->m2CC, 0.3f, 1.0f); if (i_this->m2CC > -10.0f) { cLib_addCalcAngleS2(&i_this->actor.current.angle.z, 0, 2, 0x200); @@ -137,11 +156,11 @@ void kn_move(kn_class* i_this) { if (abs(i_this->actor.shape_angle.z) < 0x100) { i_this->actor.current.angle.z = 0; i_this->actor.shape_angle.z = 0; - i_this->m2BD = 0xc; + i_this->m2BD = Mode_12_e; } break; - - case 10: +#endif + case Mode_10_e: if (cM_rnd() < 0.5f) { anm_init(i_this, KN_BCK_WAIT01, 5.0f, 2, 1.0f, -1); } else { @@ -151,21 +170,21 @@ void kn_move(kn_class* i_this) { i_this->m2CA = cM_rndF(2.0f) + 1.0f; i_this->m2BD++; - case 11: + case Mode_11_e: cLib_addCalc0(&i_this->actor.speedF, 1.0f, 2.0f); if (i_this->mpMorf->checkFrame(43.0f)) { i_this->m2CA--; if (i_this->m2CA <= 0) { - i_this->m2BD = 12; + i_this->m2BD = Mode_12_e; } } if ((i_this->m2C2[2] == 0) && fopAcM_searchPlayerDistance(&i_this->actor) < f28) { - i_this->m2BD = 18; + i_this->m2BD = Mode_18_e; } break; - case 12: + case Mode_12_e: anm_init(i_this, KN_BCK_WALK, 5.0f, 2, 1.0f, -1); i_this->m2D0 = i_this->actor.current.angle.y + cM_rndFX(10752.0f); i_this->m2E8 = f26; @@ -178,46 +197,53 @@ void kn_move(kn_class* i_this) { i_this->m2E8 = f26; } +#if VERSION == VERSION_DEMO + // Fakematch? idx = 40; rand = cM_rndF(idx); idx2 = 20; i_this->m2C2[0] = idx2 + rand; +#else + idx = 40; + idx2 = 20; + i_this->m2C2[0] = cM_rndF(idx) + idx2; +#endif i_this->m2E4 = i_this->m2E8; i_this->m2D2 = 0x800; i_this->m2BE = 0; i_this->m2BD++; - case 13: + case Mode_13_e: if (fopAcM_searchPlayerDistance(&i_this->actor) < f28) { - i_this->m2BD = 18; + i_this->m2BD = Mode_18_e; } else if (i_this->m2C2[2] == 0) { if (i_this->m2BE != 0) { shibuki_set(i_this); i_this->m2BF = 0; - i_this->m2BD = 15; + i_this->m2BD = Mode_15_e; } else if (std::sqrtf(SQUARE(fVar8) + SQUARE(fVar1)) > f29) { i_this->m2C2[1] = 0x14; i_this->m2E4 = i_this->m2E8 * -1.0f; - i_this->m2BD = 14; + i_this->m2BD = Mode_14_e; } else if (i_this->m2C2[0] == 0) { - i_this->m2BD = 10; + i_this->m2BD = Mode_10_e; } } break; - case 14: + case Mode_14_e: if (i_this->m2C2[1] == 0) { if (std::sqrtf(SQUARE(fVar8) + SQUARE(fVar1)) > f29) { i_this->m2D0 = cM_atan2s(fVar8, fVar1); i_this->m2E4 = std::fabsf(i_this->m2E8); i_this->m2C2[1] = 8; } else { - i_this->m2BD = 10; + i_this->m2BD = Mode_10_e; } } break; - case 15: + case Mode_15_e: i_this->actor.speedF = 0.0f; i_this->m2E4 = 0.0; i_this->m2C0 = 0; @@ -225,7 +251,7 @@ void kn_move(kn_class* i_this) { anm_init(i_this, KN_BCK_PATA, 5.0f, 2, 1.0f, -1); i_this->m2BD++; - case 16: + case Mode_16_e: if (i_this->m2C2[0] == 0) { f32 fVar9 = -7.0f; if (i_this->actor.scale.x > 1.5f) { @@ -254,12 +280,12 @@ void kn_move(kn_class* i_this) { shibuki_set(i_this); } anm_init(i_this, KN_BCK_PATA, 5.0f, 2, 1.0f, -1); - i_this->m2BD = 17; + i_this->m2BD = Mode_17_e; } } break; - case 17: + case Mode_17_e: cLib_addCalc0(&i_this->m2CC, 0.1f, 1.0f); if (i_this->m2CC < 0.2f) { if (i_this->m2BF != 0) { @@ -267,11 +293,11 @@ void kn_move(kn_class* i_this) { } i_this->m2CC = 0.0f; i_this->m2C2[2] = 0x28; - i_this->m2BD = 12; + i_this->m2BD = Mode_12_e; } break; - case 18: + case Mode_18_e: anm_init(i_this, KN_BCK_WALK, 5.0f, 2, 2.0f, -1); i_this->m2E8 = 40.0; i_this->m2C2[0] = 0; @@ -293,214 +319,29 @@ void kn_move(kn_class* i_this) { } i_this->m2BD++; - case 19: + case Mode_19_e: if (i_this->mAcchCir.ChkWallHit() || std::sqrtf(SQUARE(fVar8) + SQUARE(fVar1)) > f29) { - i_this->m300 = i_this->actor.current.pos; - i_this->m2BF = 1; - smoke_set(i_this); - i_this->m2BD = 15; - } else if (i_this->m2BE != 0) { - i_this->m2BF = 0; - shibuki_set(i_this); - i_this->m2BD = 15; - } - break; - } - - if (i_this->m2BD >= 13) { - if (i_this->m2BD < 18) { - i_this->m2E0 = 1.0f; - if ((s16)cLib_distanceAngleS(i_this->actor.current.angle.y, i_this->m2D0) > 0x100) { - i_this->m2E0 = 2.0f; - } - cLib_addCalc2(&i_this->m2DC, i_this->m2E0, 0.5f, 1.0f); - i_this->mpMorf->setPlaySpeed(i_this->m2DC); - } - cLib_addCalcAngleS2(&i_this->actor.current.angle.y, i_this->m2D0, 1, i_this->m2D2); - cLib_addCalc2(&i_this->actor.speedF, i_this->m2E4, 0.3f, 1.0f); - } - - i_this->actor.shape_angle.y = i_this->actor.current.angle.y + 0x4000; -} -#else -/* 00000440-00000CE8 .text kn_move__FP8kn_class */ -void kn_move(kn_class* i_this) { - f32 fVar8 = i_this->m2EC.x - i_this->actor.current.pos.x; - f32 fVar1 = i_this->m2EC.z - i_this->actor.current.pos.z; - s16 sVar5; - - switch (i_this->m2BD) { - case 0: - if (cM_rnd() < 0.5f) { - anm_init(i_this, KN_BCK_WAIT01, 5.0f, 2, 1.0f, -1); - } else { - anm_init(i_this, KN_BCK_WAIT02, 5.0f, 2, 1.0f, -1); - } - i_this->m2D2 = 0x800; - i_this->m2CA = cM_rndF(2.0f) + 1.0f; - i_this->m2BD++; - - case 1: - cLib_addCalc0(&i_this->actor.speedF, 1.0f, 2.0f); - if (i_this->mpMorf->checkFrame(43.0f)) { - i_this->m2CA--; - if (i_this->m2CA <= 0) { - i_this->m2BD = 2; - } - } - - if ((i_this->m2C2[2] == 0) && fopAcM_searchPlayerDistance(&i_this->actor) < 300.0f) { - i_this->m2BD = 8; - } - break; - - case 2: - anm_init(i_this, KN_BCK_WALK, 5.0f, 2, 1.0f, -1); - i_this->m2D0 = i_this->actor.current.angle.y + cM_rndFX(10752.0f); - i_this->m2E8 = 3.0f; - if (cM_rnd() < 0.5f) { - f32 tmp = 3.0f; - i_this->m2E8 = -tmp; - } - - if (i_this->m2C2[2] != 0) { - i_this->m2D0 = cM_atan2s(fVar8, fVar1); - i_this->m2E8 = 3.0f; - } - - i_this->m2C2[0] = cM_rndF(40.0f) + 20.0f; - i_this->m2E4 = i_this->m2E8; - i_this->m2D2 = 0x800; - i_this->m2BE = 0; - i_this->m2BD++; - - case 3: - if (fopAcM_searchPlayerDistance(&i_this->actor) < 300.0f) { - i_this->m2BD = 8; - } else if (i_this->m2C2[2] == 0) { - if (i_this->m2BE != 0) { - shibuki_set(i_this); - i_this->m2BF = 0; - i_this->m2BD = 5; - } else if (std::sqrtf(SQUARE(fVar8) + SQUARE(fVar1)) > 200.0f) { - i_this->m2C2[1] = 0x14; - i_this->m2E4 = i_this->m2E8 * -1.0f; - i_this->m2BD = 4; - } else if (i_this->m2C2[0] == 0) { - i_this->m2BD = 0; - } - } - break; - - case 4: - if (i_this->m2C2[1] == 0) { - if (std::sqrtf(SQUARE(fVar8) + SQUARE(fVar1)) > 200.0f) { - i_this->m2D0 = cM_atan2s(fVar8, fVar1); - i_this->m2E4 = std::fabsf(i_this->m2E8); - i_this->m2C2[1] = 8; - } else { - i_this->m2BD = 0; - } - } - break; - - case 5: - i_this->actor.speedF = 0.0f; - i_this->m2E4 = 0.0; - i_this->m2C0 = 0; - i_this->m2C2[0] = 0x14; - anm_init(i_this, KN_BCK_PATA, 5.0f, 2, 1.0f, -1); - i_this->m2BD++; - - case 6: - if (i_this->m2C2[0] == 0) { - fVar8 = -7.0f; - if (i_this->actor.scale.x > 1.5f) { - fVar8 = -11.0f; - } - - if (i_this->m2C0 == 0) { - if (std::fabsf(i_this->m2CC - fVar8) <= 1.0f) { - if (i_this->m2BF != 0) { - i_this->m314.remove(); - } - i_this->m2CC = fVar8; - i_this->m2C0 = 1; - i_this->m2C2[3] = cM_rndF(30.0f) + 30.0f; - } else { - cLib_addCalc2(&i_this->m2CC, fVar8, 0.1f, 1.0f); - } - } - - if ((i_this->m2C0 != 0) && (i_this->m2C2[3] == 0) && fopAcM_searchPlayerDistance(&i_this->actor) > 500.0f) { - if (i_this->m2BF != 0) { - i_this->m300 = i_this->actor.current.pos; - i_this->m300.y += 20.0f; - smoke_set(i_this); - } else { - shibuki_set(i_this); - } - anm_init(i_this, KN_BCK_PATA, 5.0f, 2, 1.0f, -1); - i_this->m2BD = 7; - } - } - break; - - case 7: - cLib_addCalc0(&i_this->m2CC, 0.1f, 1.0f); - if (i_this->m2CC < 0.2f) { - if (i_this->m2BF != 0) { - i_this->m314.remove(); - } - i_this->m2CC = 0.0f; - i_this->m2C2[2] = 0x28; - i_this->m2BD = 2; - } - break; - - case 8: - anm_init(i_this, KN_BCK_WALK, 5.0f, 2, 2.0f, -1); - i_this->m2E8 = 40.0; - i_this->m2C2[0] = 0; - i_this->m2C2[1] = 0; - i_this->m2C2[2] = 0; - i_this->m2D2 = 0x100; - i_this->m2E4 = i_this->m2E8; - i_this->m2BE = 0; - i_this->m2E4 = i_this->m2E8; - - sVar5 = fopAcM_searchPlayerAngleY(&i_this->actor) - -0x8000; - if ((s16)cLib_distanceAngleS(sVar5, i_this->actor.current.angle.y) < 0x4000) { - i_this->m2D0 = sVar5; - } else { - i_this->m2D0 = i_this->actor.current.angle.y; - if ((s16)cLib_distanceAngleS(sVar5, i_this->actor.current.angle.y) > (s16)(cLib_distanceAngleS(sVar5, i_this->actor.current.angle.y) - -0x8000)) { - i_this->m2E4 = i_this->m2E8 * -1.0f; - } - } - i_this->m2BD++; - - case 9: - if (i_this->mAcchCir.ChkWallHit() || std::sqrtf(SQUARE(fVar8) + SQUARE(fVar1)) > 200.0f) { +#if VERSION > VERSION_DEMO i_this->actor.speedF = 0.0f; i_this->m2E4 = 0.0f; i_this->actor.speed.x = 0.0f; i_this->actor.speed.y = 0.0f; i_this->actor.speed.z = 0.0f; +#endif i_this->m300 = i_this->actor.current.pos; i_this->m2BF = 1; smoke_set(i_this); - i_this->m2BD = 5; + i_this->m2BD = Mode_15_e; } else if (i_this->m2BE != 0) { i_this->m2BF = 0; shibuki_set(i_this); - i_this->m2BD = 5; + i_this->m2BD = Mode_15_e; } break; } - if (i_this->m2BD >= 3) { - if (i_this->m2BD < 8) { + if (i_this->m2BD >= Mode_13_e) { + if (i_this->m2BD < Mode_18_e) { i_this->m2E0 = 1.0f; if ((s16)cLib_distanceAngleS(i_this->actor.current.angle.y, i_this->m2D0) > 0x100) { i_this->m2E0 = 2.0f; @@ -514,7 +355,6 @@ void kn_move(kn_class* i_this) { i_this->actor.shape_angle.y = i_this->actor.current.angle.y + 0x4000; } -#endif void oya_kn_move(kn_class* i_this) { f32 tmp1 = 300.0f; @@ -610,12 +450,12 @@ static BOOL daKN_Execute(kn_class* i_this) { if (i_this->mAcch.ChkGroundHit()) { fopAcM_getGroundAngle(a_this, &i_this->m2F8); + if ( #if VERSION == VERSION_DEMO - if (i_this->m2BC == 0 && ((i_this->m2BD == 13) || (i_this->m2BD == 19)) && -#else - if (((i_this->m2BD == 3) || (i_this->m2BD == 9)) && + i_this->m2BC == 0 && #endif - i_this->mAcch.GetGroundH() != -G_CM3D_F_INF && dComIfG_Bgsp()->GetAttributeCode(i_this->mAcch.m_gnd) == 0x13) + ((i_this->m2BD == Mode_13_e) || (i_this->m2BD == Mode_19_e)) && + i_this->mAcch.GetGroundH() != -G_CM3D_F_INF && dComIfG_Bgsp()->GetAttributeCode(i_this->mAcch.m_gnd) == dBgS_Attr_WATER_e) { i_this->m2BE = 1; } @@ -695,7 +535,7 @@ static cPhs_State daKN_Create(fopAc_ac_c* a_this) { i_this->m2D4 = 100; } i_this->m2BC = 1; - i_this->m2BD = 0x14; + i_this->m2BD = Mode_20_e; return PVar1; } #endif @@ -720,7 +560,7 @@ static cPhs_State daKN_Create(fopAc_ac_c* a_this) { a_this->current.angle.z = -0x2000; i_this->m2CC = -25.0f; i_this->m2BC = 0; - i_this->m2BD = 0; + i_this->m2BD = Mode_0_e; } else #endif { @@ -732,13 +572,12 @@ static cPhs_State daKN_Create(fopAc_ac_c* a_this) { } #if VERSION == VERSION_DEMO i_this->m2BC = 0; - i_this->m2BD = 10; +#endif + i_this->m2BD = Mode_10_e; +#if VERSION > VERSION_DEMO + daKN_Execute(i_this); #endif } -#if VERSION > VERSION_DEMO - i_this->m2BD = 0; - daKN_Execute(i_this); -#endif } return PVar1; } diff --git a/src/d/actor/d_a_komore.cpp b/src/d/actor/d_a_komore.cpp index 52a5e32e9..d5efd692e 100644 --- a/src/d/actor/d_a_komore.cpp +++ b/src/d/actor/d_a_komore.cpp @@ -8,6 +8,7 @@ #include "d/d_com_inf_game.h" #include "d/d_procname.h" #include "d/d_priority.h" +#include "d/res/res_frlt.h" const char daKomore::Act_c::M_arcname[] = "frLt"; @@ -21,7 +22,7 @@ bool daKomore::Act_c::create_heap() { J3DModelData* mdl_data; J3DAnmTextureSRTKey* btk_data; - mdl_data = (J3DModelData*)(dComIfG_getObjectRes(M_arcname, 0x04)); + mdl_data = (J3DModelData*)(dComIfG_getObjectRes(M_arcname, FRLT_BDL_YFRLT00)); JUT_ASSERT(0x66, mdl_data != NULL); @@ -29,7 +30,7 @@ bool daKomore::Act_c::create_heap() { mpModel = mDoExt_J3DModel__create(mdl_data, 0, 0x11020203); } - btk_data = (J3DAnmTextureSRTKey*)(dComIfG_getObjectRes(M_arcname, 0x07)); + btk_data = (J3DAnmTextureSRTKey*)(dComIfG_getObjectRes(M_arcname, FRLT_BTK_YFRLT00)); JUT_ASSERT(0x6d, btk_data != NULL); diff --git a/src/d/actor/d_a_obj_xfuta.cpp b/src/d/actor/d_a_obj_xfuta.cpp index 3f96b3931..4064927d6 100644 --- a/src/d/actor/d_a_obj_xfuta.cpp +++ b/src/d/actor/d_a_obj_xfuta.cpp @@ -8,6 +8,7 @@ #include "d/d_com_inf_game.h" #include "d/d_procname.h" #include "d/d_priority.h" +#include "d/res/res_x_futa.h" #include "dolphin/types.h" namespace daObjXfuta { @@ -40,7 +41,7 @@ BOOL Act_c::solidHeapCB(fopAc_ac_c* i_this) { bool Act_c::create_heap() { J3DModelData* mdl_data; - mdl_data = (J3DModelData*)(dComIfG_getObjectRes(M_arcname, 0x03)); + mdl_data = (J3DModelData*)(dComIfG_getObjectRes(M_arcname, X_FUTA_BDL_X_FUTA)); JUT_ASSERT(0x105, mdl_data != NULL);