summaryrefslogtreecommitdiff
path: root/src/d/actor
diff options
context:
space:
mode:
authorYunataSavior <58997725+YunataSavior@users.noreply.github.com>2025-02-28 23:05:49 -0800
committerGitHub <noreply@github.com>2025-02-28 23:05:49 -0800
commit9c3c07575a47d64fa70561d6a2cfd166aee94ccd (patch)
treecc3842d3a4ecf99da60f9d10a478bbc06bf983c4 /src/d/actor
parent4453d0617ecf42e83e2266f0422ce3df25aa4216 (diff)
d_a_e_ym (a.k.a. Twilight bugs) 99% equivalent (daE_YM_c::checkBeforeBg and daE_YM_c::create have regalloc issues) (#2311)
* checkWallCrash and checkWolfBark done for d_a_e_ym * d_a_e_ym at 36 percent * 46% completion for d_a_e_ym * d_a_e_ym at 65% completion * d_a_e_ym 83% complete * d_a_e_ym 90% complete * d_a_e_ym 99% decompiled. All done except for 2 functions with regalloc issues. Cleanup of mSound funcs in d_a_e_ym. * Update d_a_e_ym based on Taka's feedback
Diffstat (limited to 'src/d/actor')
-rw-r--r--src/d/actor/d_a_e_ym.cpp3778
-rw-r--r--src/d/actor/d_a_kago.cpp2
2 files changed, 2766 insertions, 1014 deletions
diff --git a/src/d/actor/d_a_e_ym.cpp b/src/d/actor/d_a_e_ym.cpp
index 1dc1fd27c0..2ec51c5ba3 100644
--- a/src/d/actor/d_a_e_ym.cpp
+++ b/src/d/actor/d_a_e_ym.cpp
@@ -4,264 +4,17 @@
*/
#include "d/actor/d_a_e_ym.h"
+#include "c/c_damagereaction.h"
+#include "d/actor/d_a_kago.h"
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
+#include "d/actor/d_a_tag_firewall.h"
#include "d/d_com_inf_game.h"
-#include "dol2asm.h"
UNK_REL_DATA;
#include "f_op/f_op_actor_enemy.h"
//
-// Forward References:
-//
-
-extern "C" void __ct__12daE_YM_HIO_cFv();
-extern "C" void checkBck__8daE_YM_cFPCci();
-extern "C" void bckSet__8daE_YM_cFiUcff();
-extern "C" void bckSetFly__8daE_YM_cFiUcff();
-extern "C" void draw__8daE_YM_cFv();
-extern "C" static void daE_YM_Draw__FP8daE_YM_c();
-extern "C" static void s_obj_sub__FPvPv();
-extern "C" void setDigEffect__8daE_YM_cFv();
-extern "C" void setElecEffect1__8daE_YM_cFv();
-extern "C" void setElecEffect2__8daE_YM_cFv();
-extern "C" void setFireEffect__8daE_YM_cFv();
-extern "C" void checkWallCrash__8daE_YM_cFv();
-extern "C" void checkWolfBark__8daE_YM_cFv();
-extern "C" void checkSurpriseLock__8daE_YM_cFv();
-extern "C" void checkRailSurprise__8daE_YM_cFv();
-extern "C" void checkSurpriseNear__8daE_YM_cFv();
-extern "C" void setNormalCc__8daE_YM_cFv();
-extern "C" void setAppear__8daE_YM_cFv();
-extern "C" void setMoveSound__8daE_YM_cFi();
-extern "C" void setTurnSound__8daE_YM_cFv();
-extern "C" void setActionMode__8daE_YM_cFi();
-extern "C" void executeWait__8daE_YM_cFv();
-extern "C" void executeMove__8daE_YM_cFv();
-extern "C" void executeEscape__8daE_YM_cFv();
-extern "C" void executeDown__8daE_YM_cFv();
-extern "C" void __dt__8cM3dGPlaFv();
-extern "C" void damage_check__8daE_YM_cFv();
-extern "C" void executeWind__8daE_YM_cFv();
-extern "C" void getSurpriseType__8daE_YM_cFv();
-extern "C" void setSurpriseAway__8daE_YM_cFv();
-extern "C" void setGoHomeType__8daE_YM_cFv();
-extern "C" void executeSurprise__8daE_YM_cFv();
-extern "C" void executeBack__8daE_YM_cFv();
-extern "C" void executeFall__8daE_YM_cFv();
-extern "C" void executeAttack__8daE_YM_cFv();
-extern "C" void checkAttackEnd__8daE_YM_cFv();
-extern "C" void setAttackMotion__8daE_YM_cFv();
-extern "C" void executeAttackWall__8daE_YM_cFv();
-extern "C" void executeDefense__8daE_YM_cFv();
-extern "C" void checkFlyTerritory__8daE_YM_cFv();
-extern "C" void initFly__8daE_YM_cFv();
-extern "C" void executeFly__8daE_YM_cFv();
-extern "C" void setInclination__8daE_YM_cFv();
-extern "C" void executeFlyAttack__8daE_YM_cFv();
-extern "C" void setNextPathPoint__8daE_YM_cFv();
-extern "C" void checkRailDig__8daE_YM_cFv();
-extern "C" void executeRail__8daE_YM_cFv();
-extern "C" void executeBackRail__8daE_YM_cFv();
-extern "C" void checkElectricStart__8daE_YM_cFv();
-extern "C" void executeElectric__8daE_YM_cFv();
-extern "C" void executeSwitch__8daE_YM_cFv();
-extern "C" void initFireFly__8daE_YM_cFi();
-extern "C" void executeFire__8daE_YM_cFv();
-extern "C" void setRiverAttention__8daE_YM_cFv();
-extern "C" void setLockByCargo__8daE_YM_cFv();
-extern "C" void executeRiver__8daE_YM_cFv();
-extern "C" static void s_ym_sub__FPvPv();
-extern "C" void checkFrinedSamePos__8daE_YM_cFv();
-extern "C" void action__8daE_YM_cFv();
-extern "C" void mtx_set__8daE_YM_cFv();
-extern "C" void cc_set__8daE_YM_cFv();
-extern "C" void execute__8daE_YM_cFv();
-extern "C" static void daE_YM_Execute__FP8daE_YM_c();
-extern "C" static bool daE_YM_IsDelete__FP8daE_YM_c();
-extern "C" void _delete__8daE_YM_cFv();
-extern "C" static void daE_YM_Delete__FP8daE_YM_c();
-extern "C" void CreateHeap__8daE_YM_cFv();
-extern "C" void __ct__4cXyzFv();
-extern "C" void __dt__12J3DFrameCtrlFv();
-extern "C" static void useHeapInit__FP10fopAc_ac_c();
-extern "C" void checkBeforeBg__8daE_YM_cFs();
-extern "C" void checkBeforeGround__8daE_YM_cFv();
-extern "C" void checkInitialWall__8daE_YM_cFv();
-extern "C" void checkWall__8daE_YM_cFv();
-extern "C" void setHideType__8daE_YM_cFv();
-extern "C" void create__8daE_YM_cFv();
-extern "C" void __dt__8cM3dGSphFv();
-extern "C" void __dt__8cM3dGAabFv();
-extern "C" void __dt__10dCcD_GSttsFv();
-extern "C" void __dt__12dBgS_ObjAcchFv();
-extern "C" void __dt__12dBgS_AcchCirFv();
-extern "C" static void daE_YM_Create__FP8daE_YM_c();
-extern "C" void __dt__10cCcD_GSttsFv();
-extern "C" void __dt__12daE_YM_HIO_cFv();
-extern "C" void __sinit_d_a_e_ym_cpp();
-extern "C" static void func_808154DC();
-extern "C" static void func_808154E4();
-extern "C" void __dt__4cXyzFv();
-extern "C" void getLeftHandPos__9daPy_py_cCFv();
-extern "C" void getPos__13daTag_FWall_cFUc();
-extern "C" extern char const* const d_a_e_ym__stringBase0;
-extern "C" u8 cc_sph_src__6E_YM_n[64];
-
-//
-// External References:
-//
-
-extern "C" void mDoMtx_XrotS__FPA4_fs();
-extern "C" void mDoMtx_XrotM__FPA4_fs();
-extern "C" void mDoMtx_YrotS__FPA4_fs();
-extern "C" void mDoMtx_YrotM__FPA4_fs();
-extern "C" void mDoMtx_ZrotS__FPA4_fs();
-extern "C" void mDoMtx_ZrotM__FPA4_fs();
-extern "C" void transM__14mDoMtx_stack_cFRC4cXyz();
-extern "C" void scaleM__14mDoMtx_stack_cFfff();
-extern "C" void ZXYrotM__14mDoMtx_stack_cFRC5csXyz();
-extern "C" void play__14mDoExt_baseAnmFv();
-extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss();
-extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef();
-extern "C" void
-__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl();
-extern "C" void setAnm__16mDoExt_McaMorfSOFP15J3DAnmTransformiffff();
-extern "C" void play__16mDoExt_McaMorfSOFUlSc();
-extern "C" void entryDL__16mDoExt_McaMorfSOFv();
-extern "C" void modelCalc__16mDoExt_McaMorfSOFv();
-extern "C" void __ct__10fopAc_ac_cFv();
-extern "C" void fopAc_IsActor__FPv();
-extern "C" void fopAcM_SearchByName__FsPP10fopAc_ac_c();
-extern "C" void fopAcM_delete__FP10fopAc_ac_c();
-extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl();
-extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff();
-extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff();
-extern "C" void fopAcM_posMoveF__FP10fopAc_ac_cPC4cXyz();
-extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c();
-extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c();
-extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c();
-extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc();
-extern "C" void fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci();
-extern "C" void fpcEx_Search__FPFPvPv_PvPv();
-extern "C" void fpcM_IsCreating__FUi();
-extern "C" void getLayerNo__14dComIfG_play_cFi();
-extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc();
-extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc();
-extern "C" void dComIfGp_getReverb__Fi();
-extern "C" void
-dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj();
-extern "C" void isLightDropGetFlag__16dSv_light_drop_cCFUc();
-extern "C" void onSwitch__10dSv_info_cFii();
-extern "C" void isSwitch__10dSv_info_cCFii();
-extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci();
-extern "C" void getEmitter__Q213dPa_control_c7level_cFUl();
-extern "C" void setHitMark__13dPa_control_cFUsP10fopAc_ac_cPC4cXyzPC5csXyzPC4cXyzUl();
-extern "C" void
-set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf();
-extern "C" void
-set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf();
-extern "C" void dPath_GetPnt__FPC5dPathi();
-extern "C" void dPath_GetRoomPath__Fii();
-extern "C" void LockonTarget__12dAttention_cFl();
-extern "C" void LockonTruth__12dAttention_cFv();
-extern "C" void LineCross__4cBgSFP11cBgS_LinChk();
-extern "C" void GroundCross__4cBgSFP11cBgS_GndChk();
-extern "C" void GetTriPla__4cBgSCFRC13cBgS_PolyInfoP8cM3dGPla();
-extern "C" void GetGroundCode__4dBgSFRC13cBgS_PolyInfo();
-extern "C" void __ct__12dBgS_AcchCirFv();
-extern "C" void SetWall__12dBgS_AcchCirFff();
-extern "C" void __dt__9dBgS_AcchFv();
-extern "C" void __ct__9dBgS_AcchFv();
-extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz();
-extern "C" void CrrPos__9dBgS_AcchFR4dBgS();
-extern "C" void SetGroundUpY__9dBgS_AcchFf();
-extern "C" void __ct__11dBgS_GndChkFv();
-extern "C" void __dt__11dBgS_GndChkFv();
-extern "C" void __ct__18dBgS_ObjGndChk_WtrFv();
-extern "C" void __dt__18dBgS_ObjGndChk_WtrFv();
-extern "C" void __ct__11dBgS_LinChkFv();
-extern "C" void __dt__11dBgS_LinChkFv();
-extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c();
-extern "C" void SetObj__16dBgS_PolyPassChkFv();
-extern "C" void __ct__10dCcD_GSttsFv();
-extern "C" void Move__10dCcD_GSttsFv();
-extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c();
-extern "C" void __ct__12dCcD_GObjInfFv();
-extern "C" void ChkAtHit__12dCcD_GObjInfFv();
-extern "C" void GetAtHitObj__12dCcD_GObjInfFv();
-extern "C" void ChkTgHit__12dCcD_GObjInfFv();
-extern "C" void GetTgHitObj__12dCcD_GObjInfFv();
-extern "C" void ChkCoHit__12dCcD_GObjInfFv();
-extern "C" void GetCoHitObj__12dCcD_GObjInfFv();
-extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph();
-extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo();
-extern "C" void checkNowWolfEyeUp__9daPy_py_cFv();
-extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c();
-extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c();
-extern "C" void dKy_darkworld_check__Fv();
-extern "C" void GetAc__8cCcD_ObjFv();
-extern "C" void Set__4cCcSFP8cCcD_Obj();
-extern "C" void __pl__4cXyzCFRC3Vec();
-extern "C" void __mi__4cXyzCFRC3Vec();
-extern "C" void __ml__4cXyzCFf();
-extern "C" bool __eq__4cXyzCFRC3Vec();
-extern "C" void cM_atan2s__Fff();
-extern "C" void cM_rnd__Fv();
-extern "C" void cM_rndF__Ff();
-extern "C" void cM_rndFX__Ff();
-extern "C" void SetPos__11cBgS_GndChkFPC3Vec();
-extern "C" void SetPos__11cBgS_GndChkFPC4cXyz();
-extern "C" void __dt__13cBgS_PolyInfoFv();
-extern "C" void __dt__8cM3dGCirFv();
-extern "C" void SetC__8cM3dGSphFRC4cXyz();
-extern "C" void SetR__8cM3dGSphFf();
-extern "C" void cLib_addCalc2__FPffff();
-extern "C" void cLib_addCalcAngleS__FPsssss();
-extern "C" void cLib_chaseF__FPfff();
-extern "C" void cLib_chasePos__FP4cXyzRC4cXyzf();
-extern "C" void cLib_chaseAngleS__FPsss();
-extern "C" void cLib_targetAngleY__FPC3VecPC3Vec();
-extern "C" void cLib_targetAngleX__FPC4cXyzPC4cXyz();
-extern "C" void cLib_offsetPos__FP4cXyzPC4cXyzsPC4cXyz();
-extern "C" void cLib_distanceAngleS__Fss();
-extern "C" void __ct__15Z2CreatureEnemyFv();
-extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc();
-extern "C" void setLinkSearch__15Z2CreatureEnemyFb();
-extern "C" void setEnemyName__15Z2CreatureEnemyFPCc();
-extern "C" void* __nw__FUl();
-extern "C" void* __nwa__FUl();
-extern "C" void __dl__FPv();
-extern "C" void init__12J3DFrameCtrlFs();
-extern "C" void checkPass__12J3DFrameCtrlFf();
-extern "C" void __construct_new_array();
-extern "C" void _savegpr_19();
-extern "C" void _savegpr_25();
-extern "C" void _savegpr_26();
-extern "C" void _savegpr_27();
-extern "C" void _savegpr_28();
-extern "C" void _savegpr_29();
-extern "C" void _restgpr_19();
-extern "C" void _restgpr_25();
-extern "C" void _restgpr_26();
-extern "C" void _restgpr_27();
-extern "C" void _restgpr_28();
-extern "C" void _restgpr_29();
-extern "C" extern void* __vt__8dCcD_Sph[36];
-extern "C" extern void* __vt__9dCcD_Stts[11];
-extern "C" extern void* __vt__12cCcD_SphAttr[25];
-extern "C" extern void* __vt__14cCcD_ShapeAttr[22];
-extern "C" extern void* __vt__9cCcD_Stts[8];
-extern "C" u8 now__14mDoMtx_stack_c[48];
-extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32];
-extern "C" u8 sincosTable___5JMath[65536];
-extern "C" extern u8 JPTracePCB4[4];
-extern "C" u8 m_midnaActor__9daPy_py_c[4];
-extern "C" void __register_global_object();
-extern "C" void checkNextPath__8daKago_cF4cXyz();
-
-//
// Declarations:
//
@@ -283,160 +36,7 @@ dCcD_SrcSph E_YM_n::cc_sph_src = {
};
/* 80815B7C-80815B84 000078 0008+00 0/0 0/0 0/0 .data w_eff_id$5427 */
-#pragma push
-#pragma force_active on
-SECTION_DATA static u8 w_eff_id[8] = {
- 0x01, 0xB8, 0x01, 0xB9, 0x01, 0xBA, 0x01, 0xBB,
-};
-#pragma pop
-
-/* 80815B84-80815BA4 -00001 0020+00 1/1 0/0 0/0 .data @6063 */
-SECTION_DATA static void* lit_6063[8] = {
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0xEC),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0x1F4),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0x708),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0x810),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0xB44),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0x83C),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0xA88),
- (void*)(((char*)executeSurprise__8daE_YM_cFv) + 0xAEC),
-};
-
-/* 80815BA4-80815BD0 -00001 002C+00 1/1 0/0 0/0 .data @7049 */
-SECTION_DATA static void* lit_7049[11] = {
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x10C),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x13C),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x1EC),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x228),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x798),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0xAB0),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x798),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x9BC),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x11DC),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0x11DC),
- (void*)(((char*)executeFly__8daE_YM_cFv) + 0xFCC),
-};
-
-/* 80815BD0-80815BDC 0000CC 000C+00 1/1 0/0 0/0 .data YM_DIG_POS_Y$7355 */
-SECTION_DATA static Vec YM_DIG_POS_Y = {-15.0f, -30.0f, -70.0f};
-
-/* 80815BDC-80815C28 -00001 004C+00 1/1 0/0 0/0 .data @8522 */
-SECTION_DATA static void* lit_8522[19] = {
- (void*)(((char*)action__8daE_YM_cFv) + 0x124), (void*)(((char*)action__8daE_YM_cFv) + 0x130),
- (void*)(((char*)action__8daE_YM_cFv) + 0x13C), (void*)(((char*)action__8daE_YM_cFv) + 0x148),
- (void*)(((char*)action__8daE_YM_cFv) + 0x154), (void*)(((char*)action__8daE_YM_cFv) + 0x160),
- (void*)(((char*)action__8daE_YM_cFv) + 0x16C), (void*)(((char*)action__8daE_YM_cFv) + 0x178),
- (void*)(((char*)action__8daE_YM_cFv) + 0x184), (void*)(((char*)action__8daE_YM_cFv) + 0x194),
- (void*)(((char*)action__8daE_YM_cFv) + 0x1A4), (void*)(((char*)action__8daE_YM_cFv) + 0x1B0),
- (void*)(((char*)action__8daE_YM_cFv) + 0x1BC), (void*)(((char*)action__8daE_YM_cFv) + 0x1CC),
- (void*)(((char*)action__8daE_YM_cFv) + 0x1D8), (void*)(((char*)action__8daE_YM_cFv) + 0x1E4),
- (void*)(((char*)action__8daE_YM_cFv) + 0x1F4), (void*)(((char*)action__8daE_YM_cFv) + 0x200),
- (void*)(((char*)action__8daE_YM_cFv) + 0x20C),
-};
-
-/* 80815C28-80815C48 -00001 0020+00 1/1 0/0 0/0 .data @9421 */
-SECTION_DATA static void* lit_9421[8] = {
- (void*)(((char*)create__8daE_YM_cFv) + 0x40C), (void*)(((char*)create__8daE_YM_cFv) + 0x434),
- (void*)(((char*)create__8daE_YM_cFv) + 0x464), (void*)(((char*)create__8daE_YM_cFv) + 0x47C),
- (void*)(((char*)create__8daE_YM_cFv) + 0x494), (void*)(((char*)create__8daE_YM_cFv) + 0x524),
- (void*)(((char*)create__8daE_YM_cFv) + 0x5B4), (void*)(((char*)create__8daE_YM_cFv) + 0x5C4),
-};
-
-/* 80815C48-80815C68 -00001 0020+00 1/0 0/0 0/0 .data l_daE_YM_Method */
-static actor_method_class l_daE_YM_Method = {
- (process_method_func)daE_YM_Create__FP8daE_YM_c,
- (process_method_func)daE_YM_Delete__FP8daE_YM_c,
- (process_method_func)daE_YM_Execute__FP8daE_YM_c,
- (process_method_func)daE_YM_IsDelete__FP8daE_YM_c,
- (process_method_func)daE_YM_Draw__FP8daE_YM_c,
-};
-
-/* 80815C68-80815C98 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_YM */
-extern actor_process_profile_definition g_profile_E_YM = {
- fpcLy_CURRENT_e, // mLayerID
- 7, // mListID
- fpcPi_CURRENT_e, // mListPrio
- PROC_E_YM, // mProcName
- &g_fpcLf_Method.base, // sub_method
- sizeof(daE_YM_c), // mSize
- 0, // mSizeOther
- 0, // mParameters
- &g_fopAc_Method.base, // sub_method
- 194, // mPriority
- &l_daE_YM_Method, // sub_method
- 0x00040100, // mStatus
- fopAc_ENEMY_e, // mActorType
- fopAc_CULLBOX_CUSTOM_e, // cullType
-};
-
-/* 80815C98-80815CA4 000194 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */
-SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__12dBgS_AcchCirFv,
-};
-
-/* 80815CA4-80815CB0 0001A0 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */
-SECTION_DATA extern void* __vt__10cCcD_GStts[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__10cCcD_GSttsFv,
-};
-
-/* 80815CB0-80815CBC 0001AC 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */
-SECTION_DATA extern void* __vt__10dCcD_GStts[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__10dCcD_GSttsFv,
-};
-
-/* 80815CBC-80815CC8 0001B8 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGSph */
-SECTION_DATA extern void* __vt__8cM3dGSph[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__8cM3dGSphFv,
-};
-
-/* 80815CC8-80815CD4 0001C4 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGAab */
-SECTION_DATA extern void* __vt__8cM3dGAab[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__8cM3dGAabFv,
-};
-
-/* 80815CD4-80815CF8 0001D0 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */
-SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__12dBgS_ObjAcchFv,
- (void*)NULL,
- (void*)NULL,
- (void*)func_808154E4,
- (void*)NULL,
- (void*)NULL,
- (void*)func_808154DC,
-};
-
-/* 80815CF8-80815D04 0001F4 000C+00 2/2 0/0 0/0 .data __vt__12J3DFrameCtrl */
-SECTION_DATA extern void* __vt__12J3DFrameCtrl[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__12J3DFrameCtrlFv,
-};
-
-/* 80815D04-80815D10 000200 000C+00 6/6 0/0 0/0 .data __vt__8cM3dGPla */
-SECTION_DATA extern void* __vt__8cM3dGPla[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__8cM3dGPlaFv,
-};
-
-/* 80815D10-80815D1C 00020C 000C+00 2/2 0/0 0/0 .data __vt__12daE_YM_HIO_c */
-SECTION_DATA extern void* __vt__12daE_YM_HIO_c[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__12daE_YM_HIO_cFv,
-};
+static u16 w_eff_id[] = {0x01B8, 0x01B9, 0x01BA, 0x01BB}; // unused
/* 8080812C-80808184 0000EC 0058+00 1/1 0/0 0/0 .text __ct__12daE_YM_HIO_cFv */
daE_YM_HIO_c::daE_YM_HIO_c() {
@@ -452,8 +52,8 @@ daE_YM_HIO_c::daE_YM_HIO_c() {
/* 80808184-808081E0 000144 005C+00 3/3 0/0 0/0 .text checkBck__8daE_YM_cFPCci */
-BOOL daE_YM_c::checkBck(char const* i_arcName, int i_resNo) {
- return field_0x5b4->getAnm() == (J3DAnmTransform*)dComIfG_getObjectRes(i_arcName, i_resNo);
+u8 daE_YM_c::checkBck(char const* i_arcName, int i_resNo) {
+ return mpMorf->getAnm() == (J3DAnmTransform*)dComIfG_getObjectRes(i_arcName, i_resNo);
}
/* 808081E0-80808328 0001A0 0148+00 18/18 0/0 0/0 .text bckSet__8daE_YM_cFiUcff */
@@ -479,17 +79,17 @@ void daE_YM_c::bckSet(int i_resID, u8 i_attribute, f32 i_morf, f32 i_speed) {
tm_res_id = 9;
}
- field_0x5b4->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_TM", tm_res_id), i_attribute,
+ mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_TM", tm_res_id), i_attribute,
i_morf, i_speed, 0.0f, -1.0f);
} else {
- field_0x5b4->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_YM", i_resID), i_attribute,
+ mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_YM", i_resID), i_attribute,
i_morf, i_speed, 0.0f, -1.0f);
}
}
/* 80808328-808083CC 0002E8 00A4+00 4/4 0/0 0/0 .text bckSetFly__8daE_YM_cFiUcff */
void daE_YM_c::bckSetFly(int i_resID, u8 i_attribute, f32 i_morf, f32 i_speed) {
- field_0x5b4->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_TM", i_resID), i_attribute,
+ mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_TM", i_resID), i_attribute,
i_morf, i_speed, 0.0f, -1.0f);
}
@@ -523,7 +123,7 @@ int daE_YM_c::draw() {
if (mFlyType == true) {
J3DShape* shape_p =
- field_0x5b4->getModel()->getModelData()->getMaterialNodePointer(1)->getShape();
+ mpMorf->getModel()->getModelData()->getMaterialNodePointer(1)->getShape();
if (shape_p != NULL) {
if (field_0x6cc) {
@@ -534,7 +134,7 @@ int daE_YM_c::draw() {
}
}
- J3DModel* model_p = field_0x5b4->getModel();
+ J3DModel* model_p = mpMorf->getModel();
g_env_light.settingTevStruct(6, &current.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(model_p, &tevStr);
@@ -545,9 +145,9 @@ int daE_YM_c::draw() {
if (bvar) {
if (field_0x6dc != -70.0f) {
- field_0x5b8->entry(model_p->getModelData());
+ mpBrk->entry(model_p->getModelData());
dComIfGd_setListDark();
- field_0x5b4->entryDL();
+ mpMorf->entryDL();
dComIfGd_setList();
}
@@ -555,7 +155,7 @@ int daE_YM_c::draw() {
sp40.set(current.pos.x, current.pos.y + 100.0f, current.pos.z);
field_0x69c = dComIfGd_setShadow(field_0x69c, 1, model_p, &sp40, 400.0f, 0.0f,
- current.pos.y, field_0x760.GetGroundH(), field_0x760.m_gnd,
+ current.pos.y, mAcch.GetGroundH(), mAcch.m_gnd,
&tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex());
}
@@ -569,7 +169,7 @@ static int daE_YM_Draw(daE_YM_c* i_this) {
/* ############################################################################################## */
/* 80815D28-80815D2C 000008 0004+00 2/2 0/0 0/0 .bss None */
-static u8 data_80815D28[4];
+static u8 lbl_253_bss_8;
/* 80815D38-80815D5C 000018 0024+00 18/18 0/0 0/0 .bss l_HIO */
static daE_YM_HIO_c l_HIO;
@@ -620,9 +220,9 @@ void daE_YM_c::setElecEffect1() {
cXyz cStack_2c(fVar3, fVar3, fVar3);
MtxP iVar5;
if (mFlyType == true) {
- iVar5 = field_0x5b4->getModel()->getAnmMtx(8);
+ iVar5 = mpMorf->getModel()->getAnmMtx(8);
} else {
- iVar5 = field_0x5b4->getModel()->getAnmMtx(0);
+ iVar5 = mpMorf->getModel()->getAnmMtx(0);
}
cXyz cStack_38(iVar5[0][3], iVar5[1][3], iVar5[2][3]);
@@ -639,22 +239,50 @@ void daE_YM_c::setElecEffect2() {
cXyz cStack_2c(fVar3, fVar3, fVar3);
MtxP iVar5;
if (mFlyType == true) {
- iVar5 = field_0x5b4->getModel()->getAnmMtx(8);
+ iVar5 = mpMorf->getModel()->getAnmMtx(8);
} else {
- iVar5 = field_0x5b4->getModel()->getAnmMtx(0);
+ iVar5 = mpMorf->getModel()->getAnmMtx(0);
}
cXyz cStack_38(iVar5[0][3], iVar5[1][3], iVar5[2][3]);
setElecEffect1();
- field_0xae0 = dComIfGp_particle_set(field_0xae0, 0x8395, &cStack_38, &tevStr, &shape_angle, &cStack_2c,
+ field_0xae0 = dComIfGp_particle_set(field_0xae0, 0x8395, &cStack_38, &tevStr,
+ &shape_angle, &cStack_2c,
0xff, 0, -1, 0, 0, 0);
- field_0xae4 = dComIfGp_particle_set(field_0xae4, 0x8396, &cStack_38, &tevStr, &shape_angle, &cStack_2c,
+ field_0xae4 = dComIfGp_particle_set(field_0xae4, 0x8396, &cStack_38, &tevStr,
+ &shape_angle, &cStack_2c,
0xff, 0, -1, 0, 0, 0);
}
/* 80808B3C-80808E34 000AFC 02F8+00 1/1 0/0 0/0 .text setFireEffect__8daE_YM_cFv */
void daE_YM_c::setFireEffect() {
- // NONMATCHING
+ cXyz my_vec_0(1.0f, 1.0f, 1.0f);
+ mParticleKeys[0] = dComIfGp_particle_set(mParticleKeys[0], 0x3ad, &current.pos, NULL,
+ NULL, &my_vec_0, 0xff, NULL, -1,
+ NULL, NULL, NULL);
+ mParticleKeys[1] = dComIfGp_particle_set(mParticleKeys[1], 0x3af, &current.pos, NULL,
+ NULL, &my_vec_0, 0xff, NULL, -1,
+ NULL, NULL, NULL);
+ mParticleKeys[2] = dComIfGp_particle_set(mParticleKeys[2], 0x3ae, &current.pos, NULL,
+ NULL, &my_vec_0, 0xff, NULL, -1,
+ NULL, NULL, NULL);
+ if (field_0x6d0 != NULL) {
+ for (int idx = 0x2c; idx >= 0; --idx) {
+ field_0x6d0[idx+1] = field_0x6d0[idx];
+ }
+ field_0x6d0[0] = speed;
+ for (int idx = 0; idx < 3; ++idx) {
+ JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(mParticleKeys[idx]);
+ if (emitter != NULL) {
+ if (speed.abs() > 1.0f) {
+ emitter->setParticleCallBackPtr((JPAParticleCallBack*)&JPTracePCB4);
+ emitter->setUserWork((u32)field_0x6d0);
+ } else {
+ emitter->setParticleCallBackPtr(NULL);
+ }
+ }
+ }
+ }
}
/* 80808E34-80809000 000DF4 01CC+00 3/3 0/0 0/0 .text checkWallCrash__8daE_YM_cFv */
@@ -662,7 +290,7 @@ bool daE_YM_c::checkWallCrash() {
if (mType == 1 && (daPy_getPlayerActorClass()->checkFrontRollCrash() ||
daPy_getPlayerActorClass()->checkWolfAttackReverse()))
{
- cXyz tmp = daPy_getPlayerActorClass()->current.pos - field_0x670;
+ cXyz tmp = daPy_getPlayerActorClass()->current.pos - mPrevPos;
if (tmp.absXZ() < 600.0f) {
if (mTagPosP != NULL) {
setActionMode(ACT_FLY);
@@ -677,68 +305,206 @@ bool daE_YM_c::checkWallCrash() {
return false;
}
-
-/* ############################################################################################## */
-/* 808159F8-808159FC 000064 0004+00 0/1 0/0 0/0 .rodata @4472 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4472 = 900.0f;
-COMPILER_STRIP_GATE(0x808159F8, &lit_4472);
-#pragma pop
-
/* 80809000-80809228 000FC0 0228+00 3/3 0/0 0/0 .text checkWolfBark__8daE_YM_cFv */
-void daE_YM_c::checkWolfBark() {
- // NONMATCHING
+u8 daE_YM_c::checkWolfBark() {
+ if (mType == 2) {
+ return 0;
+ } else if (daPy_getPlayerActorClass()->checkWolfBark() && mDistToPlayer < 900.0f) {
+ if (mType == 0) {
+ s16 dist_ang = cLib_distanceAngleS(mAngleToPlayer, shape_angle.y);
+ cXyz my_vec_0 = current.pos - mPrevPos;
+ if (my_vec_0.abs() < l_HIO.mMoveRange && dist_ang < 0x4000 && cM_rndF(10.0f) > 1.0f) {
+ setActionMode(ACT_BACK);
+ } else {
+ if (mTagPosP != NULL) {
+ setActionMode(ACT_FLY);
+ } else {
+ setActionMode(ACT_SURPRISE);
+ }
+ }
+ } else if (mType == 1) {
+ return 0;
+ }
+ return 1;
+ } else {
+ return 0;
+ }
}
-/* ############################################################################################## */
-/* 808159FC-80815A00 000068 0004+00 0/3 0/0 0/0 .rodata @4603 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4603 = 150.0f;
-COMPILER_STRIP_GATE(0x808159FC, &lit_4603);
-#pragma pop
-
/* 80809228-8080963C 0011E8 0414+00 1/1 0/0 0/0 .text checkSurpriseLock__8daE_YM_cFv */
-void daE_YM_c::checkSurpriseLock() {
- // NONMATCHING
+u8 daE_YM_c::checkSurpriseLock() {
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ if (mType == 2) {
+ return 0;
+ }
+ if (mAction != ACT_WAIT && mAction != ACT_MOVE && mAction != ACT_SURPRISE
+ && mAction != ACT_ATTACK && mAction != ACT_ATTACK_WALL) {
+ return 0;
+ }
+ if (field_0x6f6 != 0) {
+ return 0;
+ }
+ if (field_0x6fc) {
+ return 0;
+ }
+ if (mAction != 8) {
+ bool truth = dComIfGp_getAttention().LockonTruth();
+ if (truth) {
+ fopAc_ac_c* tgt = dComIfGp_getAttention().LockonTarget(0);
+ if (tgt == this && mType == 0) {
+ cXyz my_vec_0 = current.pos - mPrevPos;
+ cXyz my_vec_1 = player->current.pos - mPrevPos;
+ if (mType == 4) {
+ return checkRailSurprise();
+ }
+ switch (field_0x6a1) {
+ case 0:
+ if (my_vec_0.abs() > l_HIO.mMoveRange || my_vec_1.abs() > (l_HIO.mMoveRange + 150.0f)) {
+ if (mAction != ACT_SURPRISE) {
+ if (mTagPosP != NULL) {
+ setActionMode(ACT_FLY);
+ } else {
+ setActionMode(ACT_SURPRISE);
+ }
+ return 1;
+ }
+ return 0;
+ } else {
+ setActionMode(ACT_ATTACK);
+ return 1;
+ }
+ case 1:
+ if (mAction != ACT_SURPRISE) {
+ if (mTagPosP != NULL) {
+ setActionMode(ACT_FLY);
+ } else {
+ setActionMode(ACT_SURPRISE);
+ }
+ }
+ return 1;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ return 0;
}
-/* ############################################################################################## */
-/* 80815A00-80815A04 00006C 0004+00 1/9 0/0 0/0 .rodata @4618 */
-SECTION_RODATA static f32 const lit_4618 = 200.0f;
-COMPILER_STRIP_GATE(0x80815A00, &lit_4618);
-
/* 8080963C-808096EC 0015FC 00B0+00 2/2 0/0 0/0 .text checkRailSurprise__8daE_YM_cFv */
-void daE_YM_c::checkRailSurprise() {
- // NONMATCHING
+u8 daE_YM_c::checkRailSurprise() {
+ if (dComIfGp_checkPlayerStatus0(0, 0x8000000)) {
+ if (mDistToPlayer > 200.0f || (s16)cLib_distanceAngleS(mAngleToPlayer, shape_angle.y) > 0x2000) {
+ field_0x70a = 0x1e;
+ }
+ }
+ if (field_0x70a != 0) {
+ return 0;
+ }
+ if (field_0x704 == 0) {
+ setActionMode(ACT_BACK_RAIL);
+ } else {
+ setActionMode(ACT_SURPRISE);
+ }
+ return 1;
}
-/* ############################################################################################## */
-/* 80815A04-80815A08 000070 0004+00 0/10 0/0 0/0 .rodata @4820 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4820 = 50.0f;
-COMPILER_STRIP_GATE(0x80815A04, &lit_4820);
-#pragma pop
-
-/* 80815A08-80815A0C 000074 0004+00 0/1 0/0 0/0 .rodata @4821 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4821 = 350.0f;
-COMPILER_STRIP_GATE(0x80815A08, &lit_4821);
-#pragma pop
-
-/* 80815A0C-80815A10 000078 0004+00 0/1 0/0 0/0 .rodata @4822 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4822 = 16.0f;
-COMPILER_STRIP_GATE(0x80815A0C, &lit_4822);
-#pragma pop
-
/* 808096EC-80809D6C 0016AC 0680+00 3/3 0/0 0/0 .text checkSurpriseNear__8daE_YM_cFv */
-void daE_YM_c::checkSurpriseNear() {
- // NONMATCHING
+u8 daE_YM_c::checkSurpriseNear() {
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz my_vec_0;
+ if (mType == 1) {
+ if (field_0x6fa) {
+ return 0;
+ }
+ if (player->checkClimbMove()) {
+ f32 my_val = field_0x6e0 - 50.0f;
+ if (my_val < 50.0f) {
+ my_val = 50.0f;
+ }
+ cXyz my_vec_1 = player->current.pos;
+ my_vec_1.y += 100.0f;
+ my_vec_0 = mPrevPos - current.pos;
+ if (my_vec_0.abs() < my_val) {
+ my_vec_0 = my_vec_1 - current.pos;
+ if (my_vec_0.abs() < 350.0f) {
+ dBgS_GndChk gnd_chk;
+ gnd_chk.SetPos(&my_vec_1);
+ if ((player->current.pos.y - dComIfG_Bgsp().GroundCross(&gnd_chk)) > 50.0f) {
+ field_0x6a5 = 0;
+ setActionMode(ACT_ATTACK_WALL);
+ return 1;
+ }
+ }
+ } else {
+ my_vec_0 = mPrevPos - my_vec_1;
+ if (my_vec_0.abs() < 100.0f) {
+ field_0x6a5 = 1;
+ setActionMode(ACT_ATTACK_WALL);
+ return 1;
+ }
+ }
+ }
+ } else if (mType == 0 || mType == 4) {
+ if (mAcch.ChkGroundHit() == 0) {
+ return 0;
+ }
+ f32 my_val;
+ if (mType == 4) {
+ my_val = l_HIO.mSurpriseDistance + 200.0f;
+ } else {
+ if (field_0x6a9 != 0) {
+ my_val = l_HIO.mSurpriseDistance;
+ } else {
+ my_val = l_HIO.mSurpriseDistance + 200.0f;
+ }
+ }
+ if (mDistToPlayer < my_val) {
+ if (mSphCc.ChkCoHit()) {
+ cCcD_Obj* hit_obj = mSphCc.GetCoHitObj();
+ fopAc_ac_c* my_ac = dCc_GetAc(hit_obj->GetAc());
+ if (fopAcM_GetName(my_ac) == PROC_ALINK) {
+ if (mType == 4) {
+ return checkRailSurprise();
+ }
+ if (mTagPosP != NULL) {
+ setActionMode(ACT_FLY);
+ } else {
+ setActionMode(ACT_SURPRISE);
+ }
+ return 1;
+ }
+ }
+ if (mAction == ACT_ATTACK) {
+ return 0;
+ }
+ if (player->getSpeedF() >= 16.0f) {
+ field_0x6f6 = 0;
+ } else {
+ if (field_0x6f8) {
+ return 0;
+ }
+ if (mDistToPlayer > l_HIO.mSurpriseDistance - 100.0f) {
+ field_0x6f8 = 0x3c;
+ return 0;
+ }
+ }
+ if (field_0x6f6 == 0) {
+ if (mType == 4) {
+ return checkRailSurprise();
+ }
+ if (mTagPosP != NULL) {
+ setActionMode(ACT_FLY);
+ } else {
+ setActionMode(ACT_SURPRISE);
+ }
+ return 1;
+ }
+ } else {
+ field_0x6f8 = 0;
+ }
+ }
+ return 0;
}
/* 80809D6C-80809D84 001D2C 0018+00 6/6 0/0 0/0 .text setNormalCc__8daE_YM_cFv */
@@ -758,33 +524,30 @@ void daE_YM_c::setAppear() {
field_0x714 = 4;
}
-/* ############################################################################################## */
-/* 80815A10-80815A14 00007C 0004+00 0/1 0/0 0/0 .rodata @4871 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4871 = 3.0f / 20.0f;
-COMPILER_STRIP_GATE(0x80815A10, &lit_4871);
-#pragma pop
-
-/* 80815A14-80815A18 000080 0004+00 1/21 0/0 0/0 .rodata @4872 */
-SECTION_RODATA static f32 const lit_4872 = 5.0f;
-COMPILER_STRIP_GATE(0x80815A14, &lit_4872);
-
-/* 80815A18-80815A1C 000084 0004+00 0/3 0/0 0/0 .rodata @4873 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4873 = 9.0f;
-COMPILER_STRIP_GATE(0x80815A18, &lit_4873);
-#pragma pop
-
/* 80809DA8-80809EF0 001D68 0148+00 8/8 0/0 0/0 .text setMoveSound__8daE_YM_cFi */
void daE_YM_c::setMoveSound(int param_0) {
- // NONMATCHING
+ if (mFlyType == 1) {
+ if (checkBck("E_TM", 10) == 0) {
+ return;
+ }
+ } else if (checkBck("E_YM", 16) == 0) {
+ return;
+ }
+ mpMorf->setPlaySpeed(fabsf(speedF) * 0.15f);
+ if (mpMorf->checkFrame(1.0f) || mpMorf->checkFrame(5.0f) || mpMorf->checkFrame(9.0f)) {
+ if (param_0) {
+ mSound.startCreatureSound(Z2SE_EN_YM_FN_UNDER, 0, -1);
+ } else {
+ mSound.startCreatureSound(Z2SE_EN_YM_FOOTNOTE, 0, -1);
+ }
+ }
}
/* 80809EF0-80809F9C 001EB0 00AC+00 3/3 0/0 0/0 .text setTurnSound__8daE_YM_cFv */
void daE_YM_c::setTurnSound() {
- // NONMATCHING
+ if (mpMorf->checkFrame(1.0f) || mpMorf->checkFrame(5.0f) || mpMorf->checkFrame(9.0f)) {
+ mSound.startCreatureSound(Z2SE_EN_YM_FOOTNOTE, 0, -1);
+ }
}
/* 80809F9C-80809FC4 001F5C 0028+00 26/26 0/0 0/0 .text setActionMode__8daE_YM_cFi */
@@ -797,140 +560,507 @@ void daE_YM_c::setActionMode(int i_action) {
current.angle.y = shape_angle.y;
}
-/* ############################################################################################## */
-/* 80815A1C-80815A20 000088 0004+00 0/7 0/0 0/0 .rodata @5021 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5021 = -60.0f;
-COMPILER_STRIP_GATE(0x80815A1C, &lit_5021);
-#pragma pop
-
/* 80809FC4-8080A57C 001F84 05B8+00 1/1 0/0 0/0 .text executeWait__8daE_YM_cFv */
void daE_YM_c::executeWait() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz my_vec_0;
+ if (mType != 2) {
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_WAIT, 0, -1);
+ }
+ if (mType != 1) {
+ cLib_chaseF(&speed.y, -60.0f, 5.0f);
+ }
+ if (field_0x6a1 == 1 && mMode != 0 && field_0x6f2 == 0) {
+ field_0x6c9 = 0;
+ field_0x708 = 0;
+ }
+ switch (mMode) {
+ case 0x64:
+ field_0x6f0 = 0x1e;
+ mMode = 0x65;
+ case 0x65: {
+ current.pos = home.pos;
+ setHideType();
+ mPrevPos = current.pos;
+ if (field_0x6a6 == 1 || field_0x6f0 == 0) {
+ field_0x6f0 = 0;
+ mMode = 0;
+ }
+ break;
+ }
+ case 0:
+ field_0x6f2 = 0x1e;
+ checkWall();
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ if (mType == 2) {
+ mMode = 2;
+ field_0x6dc = -70.0f;
+ field_0x714 = 0;
+ field_0x6f0 = 5;
+ field_0x6a5 = 0;
+ } else if (mType == 1) {
+ if (field_0x6a3 != 0xff) {
+ if (dComIfGs_isSwitch(field_0x6a3, fopAcM_GetRoomNo(this)) == 0) {
+ mMode = 4;
+ break;
+ }
+ }
+ setNormalCc();
+ mMode = 1;
+ if (mDistToPlayer < 400.0f) {
+ field_0x6f0 = cM_rndFX(10.0f) + 30.0f;
+ } else {
+ field_0x6f0 = cM_rndFX(30.0f) + 100.0f;
+ }
+ } else {
+ setNormalCc();
+ mMode = 1;
+ field_0x6f0 = cM_rndFX(30.0f) + 100.0f;
+ }
+ break;
+ case 1:
+ if (checkSurpriseNear()) {
+ return;
+ }
+ if (checkWolfBark()) {
+ return;
+ }
+ if (checkWallCrash()) {
+ return;
+ }
+ if (field_0x6f0 == 0) {
+ setActionMode(ACT_MOVE);
+ return;
+ }
+ break;
+ case 2:
+ checkFrinedSamePos();
+ switch (field_0x6a6) {
+ case 1:
+ field_0x718 = 1;
+ if (field_0x6d4) {
+ field_0x714 = 4;
+ } else {
+ field_0x714 = 0;
+ }
+ m_near_obj = NULL;
+ m_obj_dist = 100.0f;
+ fpcM_Search(s_obj_sub, this);
+ if (m_near_obj == NULL) {
+ setActionMode(ACT_ESCAPE);
+ field_0x718 = 0;
+ }
+ break;
+ case 2:
+ break;
+ default:
+ if (player->checkWolfDig()) {
+ my_vec_0 = player->getLeftHandPos() - current.pos;
+ if (my_vec_0.abs() < 200.0f) {
+ field_0x6f0 = 0x14;
+ mMode = 3;
+ field_0x6a6 = 0;
+ fopAcM_OnStatus(this, 0x4000);
+ }
+ }
+ }
+ break;
+ case 3:
+ if (field_0x6f0 == 0) {
+ setActionMode(ACT_ESCAPE);
+ }
+ break;
+ case 4:
+ if (field_0x6d4) {
+ field_0x714 = 4;
+ } else {
+ field_0x714 = 0;
+ }
+ if (dComIfGs_isSwitch(field_0x6a3, fopAcM_GetRoomNo(this)) && mType == 1) {
+ field_0x714 = 4;
+ if (mTagPosP != NULL) {
+ setActionMode(ACT_FLY);
+ } else {
+ setActionMode(ACT_FALL);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
}
-/* ############################################################################################## */
-/* 80815A20-80815A24 00008C 0004+00 0/5 0/0 0/0 .rodata @5268 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5268 = 1.5f;
-COMPILER_STRIP_GATE(0x80815A20, &lit_5268);
-#pragma pop
-
-/* 80815A24-80815A28 000090 0004+00 0/2 0/0 0/0 .rodata @5269 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5269 = 32768.0f;
-COMPILER_STRIP_GATE(0x80815A24, &lit_5269);
-#pragma pop
-
-/* 80815A28-80815A2C 000094 0004+00 0/10 0/0 0/0 .rodata @5270 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5270 = 40.0f;
-COMPILER_STRIP_GATE(0x80815A28, &lit_5270);
-#pragma pop
-
/* 8080A57C-8080ACB4 00253C 0738+00 1/1 0/0 0/0 .text executeMove__8daE_YM_cFv */
void daE_YM_c::executeMove() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ (void) player; // acquired, but not used.
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ f32 my_val = field_0x6e0 - 50.0f;
+ if (my_val < 50.0f) {
+ my_val = 50.0f;
+ }
+ if (checkSurpriseNear() == 0 && checkWolfBark() == 0 && checkWallCrash() == 0 && setAttackMotion() == 0) {
+ if (mType != 1) {
+ cLib_chaseF(&speed.y, -60.0f, 5.0f);
+ }
+ switch (mMode) {
+ case 0:
+ bckSet(0xe, 2, 10.0f, 1.5f);
+ checkWall();
+ if (mType == 1) {
+ mAcch.SetGroundUpY(fabsf(cM_ssin(field_0x668.x) * 30.0f));
+ }
+ field_0x6e4 = cM_rndFX(32768.0f);
+ if ((s16)cLib_distanceAngleS(field_0x6e4, shape_angle.y) < 0x2000) {
+ field_0x6e4 = shape_angle.y + 0x4000;
+ }
+ my_vec_0 = mPrevPos - current.pos;
+ field_0x6a5 = 0;
+ if (my_vec_0.abs() > my_val) {
+ if (mType == 1) {
+ mDoMtx_stack_c::ZrotS(-field_0x668.z);
+ mDoMtx_stack_c::XrotM(-field_0x668.x);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ } else {
+ my_vec_1 = my_vec_0;
+ }
+ field_0x6e4 = cM_atan2s(my_vec_1.x, my_vec_1.z);
+ field_0x6a5 = 1;
+ }
+ mMode = 1;
+ break;
+ case 1: {
+ setTurnSound();
+ s16 my_step = 0x200;
+ if (mType == 1 && mDistToPlayer < 400.0f) {
+ my_step = 0x300;
+ }
+ if (cLib_chaseAngleS(&shape_angle.y, field_0x6e4, my_step)) {
+ if ((!field_0x6e0 && field_0x6a5 == 0) || checkBeforeBg(field_0x6e4)) {
+ setActionMode(ACT_WAIT);
+ } else {
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ field_0x6f0 = cM_rndF(10.0f) + 5.0f;
+ mMode = 2;
+ }
+ }
+ break;
+ }
+ case 2:
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_WAIT, 0, -1);
+ if (field_0x6f0 == 0 && mpMorf->checkFrame(1.0f)) {
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ mMode = 3;
+ speedF = 10.0f;
+ if (field_0x6a5 == 0 && speedF > field_0x6e0) {
+ speedF = field_0x6e0;
+ }
+ field_0x6f0 = cM_rndF(40.0f) + 10.0f;
+ }
+ break;
+ case 3: {
+ setMoveSound(0);
+ bool my_bool = false;
+ my_vec_0 = current.pos - mPrevPos;
+ if (field_0x6a5 == 0) {
+ if (my_vec_0.abs() > field_0x6e0) {
+ my_bool = true;
+ }
+ } else {
+ if (my_vec_0.abs() < my_val) {
+ field_0x6a5 = 0;
+ }
+ }
+ if (my_bool || field_0x6f0 == 0 || checkBeforeBg(field_0x6e4)) {
+ speedF = 0.0f;
+ setActionMode(ACT_WAIT);
+ return;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
+ }
}
-/* ############################################################################################## */
-/* 80815A2C-80815A30 000098 0004+00 0/2 0/0 0/0 .rodata @5413 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5413 = 8.0f;
-COMPILER_STRIP_GATE(0x80815A2C, &lit_5413);
-#pragma pop
-
-/* 80815A30-80815A34 00009C 0004+00 0/1 0/0 0/0 .rodata @5414 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5414 = 8192.0f;
-COMPILER_STRIP_GATE(0x80815A30, &lit_5414);
-#pragma pop
-
-/* 80815A34-80815A38 0000A0 0004+00 0/1 0/0 0/0 .rodata @5415 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5415 = 45.0f;
-COMPILER_STRIP_GATE(0x80815A34, &lit_5415);
-#pragma pop
-
-/* 80815A38-80815A3C 0000A4 0004+00 0/4 0/0 0/0 .rodata @5416 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5416 = 500.0f;
-COMPILER_STRIP_GATE(0x80815A38, &lit_5416);
-#pragma pop
-
-/* 80815A3C-80815A44 0000A8 0008+00 0/4 0/0 0/0 .rodata @5418 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_5418[8] = {
- 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x80815A3C, &lit_5418);
-#pragma pop
-
/* 8080ACB4-8080B444 002C74 0790+00 1/1 0/0 0/0 .text executeEscape__8daE_YM_cFv */
void daE_YM_c::executeEscape() {
- // NONMATCHING
+ cLib_chaseF(&speed.y, -60.0f, 5.0f);
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ (void) player; // acquired, but not used.
+ cXyz my_vec_0;
+ if (field_0x6dc < 0.0f) {
+ field_0x6dc += 8.0f;
+ if (field_0x6dc > 0.0f) {
+ field_0x6dc = 0.0f;
+ }
+ }
+ if (dComIfGp_event_runCheck() == 0) {
+ fopAcM_OffStatus(this, 0x4000);
+ }
+ switch (mMode) {
+ case 0:
+ if (mType == 2) {
+ setAppear();
+ }
+ if (mLastAction != 4) {
+ s16 adj_angle = mAngleToPlayer + 0x8000;
+ if (mFriendFlag & 0x1) {
+ shape_angle.y = adj_angle;
+ } else if (mFriendFlag & 0x2) {
+ if (field_0x6a6 == 0) {
+ shape_angle.y = adj_angle + 0x2800;
+ } else {
+ shape_angle.y = adj_angle + 0x1800;
+ }
+ } else if (mFriendFlag & 0x4) {
+ if (field_0x6a6 == 0) {
+ shape_angle.y = adj_angle - 0x2800;
+ } else {
+ shape_angle.y = adj_angle - 0x1800;
+ }
+ } else {
+ shape_angle.y = adj_angle + cM_rndFX(8192.0f);
+ }
+ if (field_0x6a6 == 0 || field_0x6a6 == 4) {
+ field_0x6f0 = 0x28;
+ mMode = 3;
+ speedF = 5.0f;
+ speed.y = cM_rndF(5.0f) + 30.0f;
+ field_0x6a5 = 0;
+ } else {
+ speedF = 10.0f;
+ speed.y = cM_rndF(5.0f) + 45.0f;
+ field_0x6f0 = 0x28;
+ mMode = 1;
+ }
+ field_0x6dc = 0.0f;
+ bckSet(0xb, 0, 5.0f, 1.0f);
+ mSound.startCreatureSound(Z2SE_EN_YM_JUMP, 0, -1);
+ } else {
+ field_0x6f2 = 10;
+ mMode = 2;
+ }
+ field_0x6a9 = 1;
+ field_0x6e4 = shape_angle.y;
+ field_0x6e6 = 0x5dc;
+ field_0x6e8 = 0;
+ break;
+ case 1:
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ if (mAcch.ChkGroundHit()) {
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ bckSet(0xc, 0, 0.0f, 1.0f);
+ speedF = 0.0f;
+ speed.y = 0.0f;
+ mMode = 2;
+ field_0x6f2 = 10;
+ if (field_0x6f0 >= 2) {
+ field_0x6f0 = 1;
+ }
+ field_0x70e = 0x5a;
+ }
+ break;
+ case 2:
+ if (field_0x70e) {
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ }
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_WAIT, 0, -1);
+ if (field_0x6f2 == 0) {
+ speedF = 10.0f;
+ mMode = 4;
+ field_0x6e6 = 0x5dc;
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ }
+ break;
+ case 3:
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ if (field_0x6a5 == 0) {
+ cLib_addCalcAngleS(&shape_angle.y, field_0x6e4 + field_0x6e8, 8, 0x1000, 0x100);
+ if (mAcch.ChkGroundHit()) {
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ field_0x6a5 = 1;
+ speedF = 0.0f;
+ bckSet(0xc, 0, 0.0f, 1.0f);
+ }
+ } else {
+ if (mpMorf->isStop()) {
+ mMode = 4;
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ }
+ }
+ break;
+ case 4:
+ if (field_0x70e) {
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ }
+ cLib_chaseF(&speedF, 20.0f, 1.0f);
+ setMoveSound(0);
+ if (mAcch.ChkWallHit()) {
+ field_0x6e4 += 0x800;
+ }
+ if (field_0x6e8 >= 0) {
+ field_0x6e6 -= 200;
+ } else {
+ field_0x6e6 += 200;
+ }
+ field_0x6e8 += field_0x6e6;
+ cLib_addCalcAngleS(&shape_angle.y, field_0x6e4 + field_0x6e8, 8, 0x1000, 0x100);
+ my_vec_0 = current.pos - mPrevPos;
+ if (my_vec_0.absXZ() > 500.0f) {
+ speedF = 0.0f;
+ mPrevPos = current.pos;
+ field_0x6dc = 0.0f;
+ setActionMode(ACT_WAIT);
+ setNormalCc();
+ }
+ break;
+ default:
+ break;
+ }
+ if (field_0x6f0 == 1) {
+ mSphCc.SetCoSPrm(0x75);
+ }
+ current.angle.y = shape_angle.y;
}
-/* ############################################################################################## */
-/* 80815A44-80815A48 0000B0 0004+00 0/2 0/0 0/0 .rodata @5644 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5644 = -5.0f;
-COMPILER_STRIP_GATE(0x80815A44, &lit_5644);
-#pragma pop
-
-/* 80815A48-80815A4C 0000B4 0004+00 0/8 0/0 0/0 .rodata @5645 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5645 = 15.0f;
-COMPILER_STRIP_GATE(0x80815A48, &lit_5645);
-#pragma pop
-
-/* 80815A4C-80815A50 0000B8 0004+00 0/9 0/0 0/0 .rodata @5646 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5646 = 60.0f;
-COMPILER_STRIP_GATE(0x80815A4C, &lit_5646);
-#pragma pop
-
-/* 80815A50-80815A54 0000BC 0004+00 0/2 0/0 0/0 .rodata @5647 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5647 = 1000.0f;
-COMPILER_STRIP_GATE(0x80815A50, &lit_5647);
-#pragma pop
-
-/* 80815A54-80815A58 0000C0 0004+00 0/1 0/0 0/0 .rodata @5648 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5648 = -1000000000.0f;
-COMPILER_STRIP_GATE(0x80815A54, &lit_5648);
-#pragma pop
-
-/* 80815AEC-80815AEC 000158 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_80815AF6 = "R_SP108";
-#pragma pop
-
/* 8080B444-8080BB34 003404 06F0+00 2/2 0/0 0/0 .text executeDown__8daE_YM_cFv */
void daE_YM_c::executeDown() {
- // NONMATCHING
-}
-
-/* 8080BB34-8080BB7C 003AF4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGPlaFv */
-// cM3dGPla::~cM3dGPla() {
-extern "C" void __dt__8cM3dGPlaFv() {
- // NONMATCHING
+ field_0x6f4 = 10;
+ field_0x6dc = 0.0f;
+ maxFallSpeed = -60.0f;
+ Vec wtr_pos = current.pos;
+ wtr_pos.y += 500.0f;
+ dBgS_ObjGndChk_Wtr gnd_chk_wtr;
+ gnd_chk_wtr.SetPos(&wtr_pos);
+ f32 gnd_cross = dComIfG_Bgsp().GroundCross(&gnd_chk_wtr);
+ if (current.pos.y > gnd_cross) {
+ gravity = -5.0f;
+ } else {
+ gravity = 0.0f;
+ }
+#if DEBUG
+ OSReport("YM executeDown %d %f %f \n", gnd_cross, current.pos.z, mMode);
+#endif
+ field_0x6cf = 0;
+ switch (mMode) {
+ case 0:
+ if (mFlyType == 1) {
+ bckSet(6, 0, 5.0f, 0.0f);
+ } else {
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ }
+ mMode = 1;
+ field_0x668.set(0, 0, 0);
+ speedF = cM_rndF(5.0f) + 15.0f;
+ speed.y = cM_rndF(5.0f) + 40.0f;
+ shape_angle.y = mAtInfo.mHitDirection + 0x8000;
+ shape_angle.x = 0;
+ mAcch.ClrGroundHit();
+ mAcchCir.SetWall(40.0f, 60.0f);
+ if (mType == 1) {
+ cXyz my_vec_0 = daPy_getPlayerActorClass()->current.pos;
+ my_vec_0.y += 50.0f;
+ cXyz my_vec_1(speedF * cM_ssin(shape_angle.y), speed.y, speedF * cM_scos(shape_angle.y));
+ my_vec_1 += current.pos;
+ dBgS_LinChk lin_chk;
+ lin_chk.Set(&my_vec_0, &my_vec_1, NULL);
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ cM3dGPla plane;
+ dComIfG_Bgsp().GetTriPla(lin_chk, &plane);
+ current.pos = lin_chk.GetCross() + (plane.mNormal * 60.0f);
+ speedF = 0.0f;
+ }
+ }
+ setAppear();
+ field_0x714 = 0;
+ if (0 == strcmp("R_SP108", dComIfGp_getStartStageName())) {
+ if (dComIfGp_getStartStageRoomNo() == 0 && dComIfG_play_c::getLayerNo(0) == 0xe && mSwitchBit != 0xff) {
+ if (dComIfGs_isSwitch(mSwitchBit, fopAcM_GetRoomNo(this)) == 0) {
+ dComIfGs_onSwitch(mSwitchBit, fopAcM_GetRoomNo(this));
+ }
+ }
+ }
+ break;
+ case 1:
+ case 2:
+ if (mMode == 1) {
+ if (speed.y < 0.0f) {
+ mAcch.SetGroundUpY(30.0f);
+ }
+ cLib_addCalcAngleS(&shape_angle.x, 0x7800, 8, 0x1000, 0x10);
+ } else {
+ cLib_addCalcAngleS(&shape_angle.x, -0x8000, 8, 0x1000, 0x10);
+ }
+ if (mAcch.ChkGroundHit()) {
+ if (mFlyType != 1) {
+ bckSet(6, 0, 0.0f, 1.0f);
+ }
+ if (mMode == 1) {
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ mMode = 2;
+ speedF = cM_rndF(5.0f) + 5.0f;
+ speed.y = 15.0f;
+ } else {
+ mSound.startCreatureSound(Z2SE_EN_YM_MOGAKU, 0, -1);
+ mMode = 3;
+ speedF = 0.0f;
+ shape_angle.x = -0x8000;
+ field_0x6f0 = 0;
+ }
+ break;
+ }
+ if (current.pos.y < gnd_cross) {
+ mSound.startCreatureSound(Z2SE_CM_BODYFALL_WATER_M, 0, -1);
+ mSound.startCreatureSound(Z2SE_EN_YM_MOGAKU, 0, -1);
+ bckSet(6, 0, 0.0f, 1.0f);
+ speedF = 0.0f;
+ gravity = 0.0f;
+ speed.y = 0.0f;
+ current.pos.y = gnd_cross;
+ shape_angle.x = -0x8000;
+ field_0x6f0 = 0;
+ mMode = 3;
+ break;
+ }
+ if (speed.y < 0.0f && fabsf(gnd_cross - current.pos.y) > 1000.f) {
+ dBgS_GndChk gnd_chk;
+ gnd_chk.SetPos(&current.pos);
+ gnd_cross = dComIfG_Bgsp().GroundCross(&gnd_chk);
+ if (gnd_cross == -1000000000.0f || fabsf(gnd_cross - current.pos.y) > 1000.0f
+ || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 4 || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 10
+ || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 5) {
+ bckSet(6, 0, 0.0f, 1.0f);
+ mMode = 3;
+ speedF = 0.0f;
+ shape_angle.x = -0x8000;
+ field_0x6f0 = 0;
+ }
+ }
+ break;
+ case 3:
+ if (mpMorf->isStop()) {
+ if (mSwitchBit != 0xff && dComIfGs_isSwitch(mSwitchBit, fopAcM_GetRoomNo(this)) == 0) {
+ dComIfGs_onSwitch(mSwitchBit, fopAcM_GetRoomNo(this));
+ }
+ fopAcM_delete(this);
+ fopAcM_createDisappear(this, &current.pos, 10, 1, 0xff);
+ }
+ break;
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
}
/* 8080BB7C-8080BCFC 003B3C 0180+00 1/1 0/0 0/0 .text damage_check__8daE_YM_cFv */
@@ -938,36 +1068,28 @@ void daE_YM_c::damage_check() {
if (field_0x6f4 != 0 || mAction == ACT_RIVER || mAction == ACT_DOWN) {
return;
}
-
- field_0x938.Move();
-
+ mStts.Move();
if (mSphCc.ChkTgHit()) {
mAtInfo.mpCollider = mSphCc.GetTgHitObj();
-
if (field_0x700 == 0 || !mAtInfo.mpCollider->ChkAtType(0xD8000000)) {
cc_at_check(this, &mAtInfo);
-
if (mAtInfo.mpCollider->ChkAtType(0xD8000000)) {
field_0x6f4 = 20;
} else {
field_0x6f4 = 10;
}
-
if (mAtInfo.mAttackPower <= 1) {
field_0x6f4 = 10;
}
-
if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_BOOMERANG)) {
if (mIsHide) {
setActionMode(ACT_WIND);
}
} else if (mType != 2) {
- field_0x5bc.startCreatureSound(Z2SE_EN_YM_DEATH, 0, -1);
-
+ mSound.startCreatureSound(Z2SE_EN_YM_DEATH, 0, -1);
if (mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000)) {
dComIfGp_setHitMark(3, this, &eyePos, NULL, NULL, 0);
}
-
setActionMode(ACT_DOWN);
executeDown();
}
@@ -975,183 +1097,667 @@ void daE_YM_c::damage_check() {
}
}
-/* ############################################################################################## */
-/* 80815A58-80815A5C 0000C4 0004+00 0/5 0/0 0/0 .rodata @5724 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5724 = 25.0f;
-COMPILER_STRIP_GATE(0x80815A58, &lit_5724);
-#pragma pop
-
-/* 80815A5C-80815A60 0000C8 0004+00 0/2 0/0 0/0 .rodata @5725 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5725 = 4096.0f;
-COMPILER_STRIP_GATE(0x80815A5C, &lit_5725);
-#pragma pop
-
-/* 80815A60-80815A64 0000CC 0004+00 0/1 0/0 0/0 .rodata @5726 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5726 = 2048.0f;
-COMPILER_STRIP_GATE(0x80815A60, &lit_5726);
-#pragma pop
-
/* 8080BCFC-8080C05C 003CBC 0360+00 1/1 0/0 0/0 .text executeWind__8daE_YM_cFv */
void daE_YM_c::executeWind() {
- // NONMATCHING
+ cLib_chaseF(&speed.y, -60.0f, 5.0f);
+ switch (mMode) {
+ case 0:
+ setAppear();
+ setNormalCc();
+ field_0x6f0 = cM_rndFX(5.0f) + 20.0f;
+ field_0x6f2 = 0x28;
+ mMode = 1;
+ field_0x6dc = 0.0f;
+ case 1:
+ if (speed.y < 0.0f) {
+ mAcch.SetGroundUpY(50.0f);
+ }
+ cLib_chaseAngleS(&shape_angle.z, -0x8000, 0x400);
+ if (field_0x6f0) {
+ cLib_chaseAngleS(&field_0x6e6, 4000, 200);
+ speed.y = 25.0f;
+ } else {
+ if (mAcch.ChkGroundHit()) {
+ mMode = 2;
+ speedF = 0.0f;
+ speed.y = 15.0f;
+ }
+ }
+ break;
+ case 2:
+ if (mAcch.ChkGroundHit()) {
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ if (cLib_chaseAngleS(&field_0x6e6, 0, 200)) {
+ mMode = 3;
+ field_0x6f0 = 0x32;
+ field_0x6f2 = (u8)(cM_rndF(5.0f) + 5.0f);
+ field_0x6e8 = shape_angle.y;
+ field_0x6a5 = 0;
+ }
+ }
+ break;
+ case 3:
+ if (field_0x6f0 < 0xf) {
+ shape_angle.z = cM_rndF(4096.0f) + 32768.0f;
+ shape_angle.y = field_0x6e8 + cM_rndF(2048.0f);
+ } else {
+ if (field_0x6f2 == 0) {
+ field_0x6f2 = (u8)(cM_rndF(5.0f) + 5.0f);
+ field_0x6a5 = field_0x6a5 + 1 & 1;
+ }
+ if (field_0x6a5 == 0) {
+ shape_angle.z = cM_rndF(2048.0f) + 32768.0f;
+ shape_angle.y = field_0x6e8 + cM_rndF(2048.0f);
+ }
+ }
+ if (field_0x6f0 == 0) {
+ speedF = cM_rndF(5.0f) + 5.0f;
+ speed.y = 15.0f;
+ mMode = 4;
+ mAcch.SetGroundUpY(0.0f);
+ current.angle.y = shape_angle.y - 0x4000;
+ }
+ break;
+ case 4:
+ if (cLib_chaseAngleS(&shape_angle.z, 0, 0x1000) && mAcch.ChkGroundHit()) {
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ setActionMode(ACT_ESCAPE);
+ }
+ break;
+ default:
+ break;
+ }
+ shape_angle.y += field_0x6e6;
}
/* 8080C05C-8080C1FC 00401C 01A0+00 1/1 0/0 0/0 .text getSurpriseType__8daE_YM_cFv */
-void daE_YM_c::getSurpriseType() {
- // NONMATCHING
+int daE_YM_c::getSurpriseType() {
+ cXyz my_vec_0 = mPrevPos - current.pos;
+ int ret;
+ if (my_vec_0.abs() > l_HIO.mMoveRange) {
+ ret = 2;
+ } else {
+ s16 dist_ang = cLib_distanceAngleS(mAngleToPlayer, shape_angle.y);
+ ret = 1;
+ if (dist_ang < 0x3000 && cM_rndF(10.0f) > 8.0f) {
+ ret = 0;
+ }
+ }
+ return ret;
}
-/* ############################################################################################## */
-/* 80815A64-80815A68 0000D0 0004+00 1/1 0/0 0/0 .rodata @5774 */
-SECTION_RODATA static f32 const lit_5774 = 12.0f;
-COMPILER_STRIP_GATE(0x80815A64, &lit_5774);
-
/* 8080C1FC-8080C24C 0041BC 0050+00 2/2 0/0 0/0 .text setSurpriseAway__8daE_YM_cFv */
void daE_YM_c::setSurpriseAway() {
- // NONMATCHING
+ field_0x6f0 = 0x1e;
+ mMode = 1;
+ bckSet(0x10, 2, 3.0f, speedF / 12.0f);
}
-/* ############################################################################################## */
-/* 80815A68-80815A6C 0000D4 0004+00 0/1 0/0 0/0 .rodata @5792 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5792 = 1.0f / 10.0f;
-COMPILER_STRIP_GATE(0x80815A68, &lit_5792);
-#pragma pop
-
-/* 80815A6C-80815A70 0000D8 0004+00 0/2 0/0 0/0 .rodata @5793 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_5793 = 4000.0f;
-COMPILER_STRIP_GATE(0x80815A6C, &lit_5793);
-#pragma pop
-
/* 8080C24C-8080C374 00420C 0128+00 1/1 0/0 0/0 .text setGoHomeType__8daE_YM_cFv */
void daE_YM_c::setGoHomeType() {
- // NONMATCHING
+ s16 tgt_ang = cLib_targetAngleY(&current.pos, &mPrevPos);
+ f32 rand_val = cM_rnd();
+ field_0x6a8 = 1;
+ if (field_0x6a8 == 0 && rand_val < 0.1f && mAcch.ChkGroundHit() && mAcch.ChkWallHit() == 0) {
+ field_0x6a8 = 1;
+ field_0x6a5 = 2;
+ shape_angle.y = tgt_ang + cM_rndFX(4000.0f);
+ mMode = 3;
+ } else {
+ if ((s16)(mAngleToPlayer - tgt_ang) < 0) {
+ field_0x6a5 = 2;
+ } else {
+ field_0x6a5 = 3;
+ }
+ if (field_0x6cb) {
+ speedF = 25.0f;
+ } else {
+ speedF = l_HIO.mMoveSpeed;
+ }
+ setSurpriseAway();
+ }
}
-/* ############################################################################################## */
-/* 80815A70-80815A74 0000DC 0004+00 0/2 0/0 0/0 .rodata @6055 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6055 = -90.0f;
-COMPILER_STRIP_GATE(0x80815A70, &lit_6055);
-#pragma pop
-
-/* 80815A74-80815A78 0000E0 0004+00 0/1 0/0 0/0 .rodata @6056 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6056 = 28.0f;
-COMPILER_STRIP_GATE(0x80815A74, &lit_6056);
-#pragma pop
-
-/* 80815A78-80815A7C 0000E4 0004+00 0/2 0/0 0/0 .rodata @6057 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6057 = 17.0f;
-COMPILER_STRIP_GATE(0x80815A78, &lit_6057);
-#pragma pop
-
/* 8080C374-8080CEE0 004334 0B6C+00 2/1 0/0 0/0 .text executeSurprise__8daE_YM_cFv */
void daE_YM_c::executeSurprise() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ if (mType != 1) {
+ cLib_chaseF(&speed.y, -90.0f, 15.0f);
+ }
+ cXyz my_vec_0 = mPrevPos - current.pos;
+ if (daPy_getPlayerActorClass()->checkWolfLock(this) && mAcch.ChkGroundHit()) {
+ cLib_chaseF(&speedF, 0.0f, 5.0f);
+ cLib_chaseAngleS(&shape_angle.y,mAngleToPlayer, 0x400);
+ return;
+ }
+ switch (mMode) {
+ case 0:
+ if (field_0x6a1 == 1 && field_0x708 == 0 && field_0x6c9 == 0) {
+ field_0x708 = 0x78;
+ }
+ if (getSurpriseType() == 2 && field_0x6a9) {
+ setGoHomeType();
+ } else {
+ field_0x6a5 = 0;
+ field_0x6e4 = mAngleToPlayer + 0x8000;
+ s16 sh_ang = player->shape_angle.y;
+ s16 dist_ang = cLib_distanceAngleS(field_0x6e4, player->shape_angle.y);
+ if (sh_ang + dist_ang == field_0x6e4) {
+ field_0x6a5 = 0;
+ } else {
+ field_0x6a5 = 1;
+ }
+ if (field_0x6cb) {
+ speedF = 25.0f;
+ if (field_0x6a9 == 0) {
+ speedF = 28.0f;
+ field_0x6a9 = 1;
+ }
+ } else {
+ speedF = 17.0f;
+ if (field_0x6a9 == 0) {
+ speedF = 20.0f;
+ field_0x6a9 = 1;
+ }
+ }
+ setSurpriseAway();
+ }
+ break;
+ case 1:
+ if (mAcch.ChkWallHit() && field_0x6a5 < 2) {
+ setGoHomeType();
+ return;
+ }
+ setMoveSound(0);
+ if (field_0x6a5 == 0) {
+ field_0x6e4 = mAngleToPlayer - 0x6000;
+ } else if (field_0x6a5 == 1) {
+ field_0x6e4 = mAngleToPlayer + 0x6000;
+ } else {
+ s16 sh_val = -0x2000;
+ if (field_0x6a5 == 2) {
+ sh_val = 0x2000;
+ }
+ if (current.pos.absXZ(mPrevPos) < 100.0f) {
+ field_0x6e4 = sh_val + cLib_targetAngleY(&current.pos, &home.pos);
+ } else {
+ s16 next_0x6e4 = sh_val + cLib_targetAngleY(&current.pos, &mPrevPos);
+ if (mAcch.ChkWallHit()) {
+ s16 wall_angle = mAcchCir.GetWallAngleY();
+ if (abs((s16)(next_0x6e4 - wall_angle)) > 0x6000) {
+ if ((s16)(cLib_targetAngleY(&current.pos, &mPrevPos) - wall_angle) > 0) {
+ next_0x6e4 = wall_angle + 0x4000;
+ } else {
+ next_0x6e4 = wall_angle - 0x4000;
+ }
+ }
+ }
+ field_0x6e4 = next_0x6e4;
+ }
+ }
+ if (field_0x6a5 <= 1 && my_vec_0.abs() >= l_HIO.mMoveRange + 200.0f) {
+ field_0x6f0 = 0;
+ }
+ cLib_addCalcAngleS(&shape_angle.y, field_0x6e4, 8, 0x1000, 0x100);
+ if (field_0x6f0 == 0) {
+ if (!field_0x6d4 && cM_rnd() < 0.3f) {
+ if (field_0x6a1 == 1) {
+ setActionMode(ACT_ELECTRIC);
+ return;
+ }
+ if (field_0x6a1) {
+ return;
+ }
+ if (daPy_getPlayerActorClass()->current.pos.abs(mPrevPos) <= l_HIO.mMoveRange + 200.0f) {
+ setActionMode(ACT_ATTACK);
+ }
+ return;
+ }
+ if (field_0x6c9 && mDistToPlayer < 300.0f) {
+ setActionMode(ACT_ELECTRIC);
+ } else {
+ setActionMode(ACT_WAIT);
+ speedF = 0.0f;
+ field_0x6f6 = 5;
+ }
+ }
+ break;
+ case 2:
+ field_0x6a5 = getSurpriseType();
+ if (mAcch.ChkWallHit()) {
+ field_0x6a5 = 2;
+ }
+ if (field_0x6a5 == 0) {
+ shape_angle.y = mAngleToPlayer + cM_rndFX(4000.0f);
+ } else if (field_0x6a5 == 1) {
+ shape_angle.y = mAngleToPlayer + 0x8000 + cM_rndFX(4000.0f);
+ } else {
+ shape_angle.y = cLib_targetAngleY(&current.pos, &mPrevPos) + cM_rndFX(4000.0f);
+ }
+ case 3:
+ mMode = 5;
+ speedF = 0.0f;
+ bckSet(10, 0, 10.0f, 2.0f);
+ break;
+ case 5:
+ if (mpMorf->isStop()) {
+ bckSet(0xb, 0, 5.0f, 1.0f);
+ mSound.startCreatureSound(Z2SE_EN_YM_JUMP, 0, -1);
+ mMode = 6;
+ switch (field_0x6a5 & 3) {
+ case 0:
+ speedF = (mDistToPlayer + 650.0f) / 12.0f;
+ speed.y = 90.0f;
+ break;
+ case 1:
+ speedF = (650.0f - mDistToPlayer) / 10.0f;
+ speed.y = 75.0f;
+ break;
+ case 2:
+ speedF = my_vec_0.abs() / 10.0f;
+ speed.y = 75.0f;
+ break;
+ default:
+ break;
+ }
+ if (speedF < 35.0f) {
+ speedF = 35.0f;
+ } else if (speedF >= 50.0f) {
+ speedF = 50.0f;
+ }
+ if (speed.y < 60.0f) {
+ speed.y = 60.0f;
+ } else if (speed.y >= 90.0f) {
+ speed.y = 90.0f;
+ }
+ }
+ break;
+ case 6:
+ if (mAcch.ChkGroundHit()) {
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ bckSet(0xc, 0, 0.0f, 1.0f);
+ mMode = 7;
+ speedF = 0.0f;
+ }
+ break;
+ case 7:
+ if (mpMorf->isStop() && field_0x6f0 == 0) {
+ setActionMode(ACT_WAIT);
+ field_0x6f6 = 0xf;
+ field_0x6a7 = 0;
+ }
+ break;
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
}
/* 8080CEE0-8080CFC8 004EA0 00E8+00 1/1 0/0 0/0 .text executeBack__8daE_YM_cFv */
void daE_YM_c::executeBack() {
- // NONMATCHING
+ if (mType != 1) {
+ cLib_chaseF(&speed.y, -60.0f, 5.0f);
+ }
+ switch (mMode) {
+ case 0:
+ field_0x6f0 = 0x32;
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ mMode = 1;
+ speedF = -5.0f;
+ break;
+ case 1:
+ cLib_chaseAngleS(&shape_angle.y, mAngleToPlayer, 0x400);
+ current.angle.y = shape_angle.y;
+ setMoveSound(0);
+ if (field_0x6f0 == 0) {
+ speedF = 0.0f;
+ setActionMode(ACT_WAIT);
+ }
+ break;
+ default:
+ break;
+ }
}
/* 8080CFC8-8080D2C8 004F88 0300+00 1/1 0/0 0/0 .text executeFall__8daE_YM_cFv */
void daE_YM_c::executeFall() {
- // NONMATCHING
+ cLib_chaseF(&speed.y, -90.0f, 10.0f);
+ switch (mMode) {
+ case 0:
+ mSound.startCreatureSound(Z2SE_EN_YM_FALL, 0, -1);
+ field_0x6f0 = 0xc;
+ mMode = 1;
+ case 1:
+ if (field_0x6f0 == 0) {
+ mType = 0;
+ bckSet(0xb, 0, 10.0f, 2.0f);
+ mSound.startCreatureSound(Z2SE_EN_YM_JUMP, 0, -1);
+ speedF = 30.0f;
+ speed.y = 50.0f;
+ mMode = 2;
+ mAcchCir.SetWall(40.0f, 60.0f);
+ mAcch.SetGroundUpY(0.0f);
+ shape_angle.x = field_0x668.x;
+ shape_angle.y = field_0x668.z;
+ current.angle.y = shape_angle.y + 0x8000;
+ if ((s16)cLib_distanceAngleS(current.angle.y, mAngleToPlayer) < 0x1000) {
+ if ((s16)cLib_distanceAngleS(current.angle.y, mAngleToPlayer + 0x1000) < 0x1000) {
+ current.angle.y = shape_angle.y - 0x7000;
+ } else {
+ current.angle.y = shape_angle.y + 0x7000;
+ }
+ }
+ field_0x668.z = 0;
+ field_0x668.x = 0;
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ }
+ break;
+ case 2:
+ field_0x6fe = 0x1e;
+ cLib_chaseAngleS(&shape_angle.y, current.angle.y, 0x1000);
+ cLib_chaseAngleS(&shape_angle.x, 0, 0x800);
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ if (mAcch.ChkGroundHit() == 0) {
+ break;
+ }
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ speedF = 0.0f;
+ setActionMode(ACT_WAIT);
+ bckSet(0xf, 2, 2.0f, 1.0f);
+ shape_angle.y = current.angle.y;
+ shape_angle.x = 0;
+ mPrevPos = current.pos;
+ break;
+ default:
+ break;
+ }
}
-/* ############################################################################################## */
-/* 80815A7C-80815A80 0000E8 0004+00 0/0 0/0 0/0 .rodata @6058 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6058 = 3.0f / 10.0f;
-COMPILER_STRIP_GATE(0x80815A7C, &lit_6058);
-#pragma pop
-
-/* 80815A80-80815A84 0000EC 0004+00 0/0 0/0 0/0 .rodata @6059 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6059 = 650.0f;
-COMPILER_STRIP_GATE(0x80815A80, &lit_6059);
-#pragma pop
-
-/* 80815A84-80815A88 0000F0 0004+00 0/1 0/0 0/0 .rodata @6060 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6060 = 90.0f;
-COMPILER_STRIP_GATE(0x80815A84, &lit_6060);
-#pragma pop
-
-/* 80815A88-80815A8C 0000F4 0004+00 0/0 0/0 0/0 .rodata @6061 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6061 = 75.0f;
-COMPILER_STRIP_GATE(0x80815A88, &lit_6061);
-#pragma pop
-
-/* 80815A8C-80815A90 0000F8 0004+00 0/1 0/0 0/0 .rodata @6062 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6062 = 35.0f;
-COMPILER_STRIP_GATE(0x80815A8C, &lit_6062);
-#pragma pop
-
-/* 80815A90-80815A94 0000FC 0004+00 0/2 0/0 0/0 .rodata @6244 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6244 = -100.0f;
-COMPILER_STRIP_GATE(0x80815A90, &lit_6244);
-#pragma pop
-
-/* 80815A94-80815A98 000100 0004+00 0/1 0/0 0/0 .rodata @6245 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_6245 = 4.0f;
-COMPILER_STRIP_GATE(0x80815A94, &lit_6245);
-#pragma pop
-
/* 8080D2C8-8080D990 005288 06C8+00 1/1 0/0 0/0 .text executeAttack__8daE_YM_cFv */
void daE_YM_c::executeAttack() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz my_vec_0 = player->current.pos - mPrevPos;
+ if (mType != 1) {
+ cLib_chaseF(&speed.y, -100.0f, 4.0f);
+ }
+ if (my_vec_0.abs() <= l_HIO.mMoveRange + 200.0f) {
+ field_0x688 = mDistToPlayer;
+ field_0x6e4 = mAngleToPlayer;
+ }
+ switch (mMode) {
+ case 0:
+ bckSet(0xe, 2, 10.0f, 1.5f);
+ speedF = 0.0f;
+ field_0x6f0 = 0x50;
+ mMode = 1;
+ field_0x6a5 = 0;
+ break;
+ case 1:
+ if (field_0x6d4 && (dComIfGp_getAttention().LockonTruth() == 0 || dComIfGp_getAttention().LockonTarget(0) != this)) {
+ if (checkSurpriseNear()) {
+ return;
+ }
+ }
+ setTurnSound();
+ if (cLib_distanceAngleS(shape_angle.y, field_0x6e4) < 0x200) {
+ if (checkBck("E_YM", 0xf) == 0) {
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ }
+ field_0x6a5 += 1;
+ } else {
+ if (checkBck("E_YM", 0xe) == 0) {
+ bckSet(0xe, 2, 10.0f, 1.5f);
+ }
+ cLib_chaseAngleS(&shape_angle.y, field_0x6e4, 0x200);
+ field_0x6a5 = 0;
+ }
+ if (field_0x6f0 == 0 || field_0x6a5 >= 0x1e || my_vec_0.abs() > l_HIO.mMoveRange + 200.0f) {
+ bckSet(0xd, 0, 10.0f, 2.0f);
+ mMode = 2;
+ }
+ break;
+ case 2:
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ if (mpMorf->isStop()) {
+ bckSet(10, 0, 10.0f, 2.0f);
+ mMode = 3;
+ }
+ break;
+ case 3:
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ if (mpMorf->isStop()) {
+ bckSet(0xb, 0, 5.0f, 1.0f);
+ mSound.startCreatureSound(Z2SE_EN_YM_JUMP, 0, -1);
+ speed.y = 35.0f;
+ speedF = (field_0x688 * 4.0f) / 90.0f;
+ mMode = 4;
+ }
+ break;
+ case 4:
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ if (mAcch.ChkGroundHit()) {
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ bckSet(0xc, 0, 0.0f, 1.0f);
+ speedF = 0.0f;
+ mMode = 5;
+ }
+ break;
+ case 5:
+ if (mpMorf->isStop()) {
+ setActionMode(ACT_WAIT);
+ field_0x6f6 = 0xf;
+ field_0x6fc = 0x32;
+ }
+ break;
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
}
/* 8080D990-8080DB58 005950 01C8+00 1/1 0/0 0/0 .text checkAttackEnd__8daE_YM_cFv */
-void daE_YM_c::checkAttackEnd() {
- // NONMATCHING
+u8 daE_YM_c::checkAttackEnd() {
+ if (daPy_getPlayerActorClass()->checkClimbMove() == 0) {
+ setActionMode(ACT_MOVE);
+ speedF = 0.0f;
+ return 1;
+ } else {
+ cXyz my_vec_0 = mPrevPos - current.pos;
+ if (my_vec_0.abs() > l_HIO.mMoveRange + 50.0f) {
+ setActionMode(ACT_WAIT);
+ speedF = 0.0f;
+ return 1;
+ } else {
+ return 0;
+ }
+ }
}
/* 8080DB58-8080DC5C 005B18 0104+00 2/2 0/0 0/0 .text setAttackMotion__8daE_YM_cFv */
-void daE_YM_c::setAttackMotion() {
- // NONMATCHING
+u8 daE_YM_c::setAttackMotion() {
+ if (mType != 1) {
+ return 0;
+ }
+ if (mSphCc.ChkAtHit()) {
+ fopAc_ac_c* hit_actor = dCc_GetAc(mSphCc.GetAtHitObj()->GetAc());
+ if (fopAcM_GetName(hit_actor) == PROC_ALINK) {
+ if (mAction != ACT_ATTACK_WALL) {
+ setActionMode(ACT_ATTACK_WALL);
+ } else if (mMode == 4) {
+ return 0;
+ }
+ speedF = 0.0f;
+ mMode = 4;
+ bckSet(5, 0, 3.0f, 1.0f);
+ mSound.startCreatureSound(Z2SE_EN_YM_ATTACK, 0, -1);
+ return 1;
+ }
+ }
+ return 0;
}
/* 8080DC5C-8080E26C 005C1C 0610+00 1/1 0/0 0/0 .text executeAttackWall__8daE_YM_cFv */
void daE_YM_c::executeAttackWall() {
- // NONMATCHING
+ field_0x6fa = 0x1e;
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ cXyz my_vec_2;
+ if (checkWolfBark() == 0 && checkWallCrash() == 0 && setAttackMotion() == 0) {
+ switch (mMode) {
+ case 0:
+ checkWall();
+ if (field_0x6a5 == 0) {
+ my_vec_2 = player->current.pos;
+ my_vec_2.y += 100.0f;
+ my_vec_0 = my_vec_2 - current.pos;
+ } else {
+ my_vec_0 = mPrevPos - current.pos;
+ }
+ mDoMtx_stack_c::ZrotS(-field_0x668.z);
+ mDoMtx_stack_c::XrotM(-field_0x668.x);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ field_0x6e4 = cM_atan2s(my_vec_1.x, my_vec_1.z);
+ if (checkBeforeBg(field_0x6e4)) {
+ setActionMode(ACT_MOVE);
+ speedF = 0.0f;
+ return;
+ }
+ bckSet(0xe, 2, 10.0f, 1.5f);
+ speedF = 0.0f;
+ mMode = 1;
+ break;
+ case 1:
+ if (checkAttackEnd()) {
+ return;
+ }
+ setTurnSound();
+ if (cLib_chaseAngleS(&shape_angle.y, field_0x6e4, 0x400)) {
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ mMode = 2;
+ }
+ break;
+ case 2:
+ if (checkAttackEnd()) {
+ return;
+ }
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_WAIT, 0, -1);
+ if (field_0x6f0 == 0) {
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ mMode = 3;
+ speedF = 20.0f;
+ field_0x6f0 = cM_rndF(20.0f) + 30.0f;
+ mSound.startCreatureSound(Z2SE_EN_YM_FIND, 0, -1);
+ }
+ break;
+ case 3: {
+ setMoveSound(0);
+ bool do_stuff = false;
+ if (field_0x6f0 == 0 || checkBeforeBg(field_0x6e4)) {
+ do_stuff = true;
+ } else {
+ my_vec_0 = mPrevPos - current.pos;
+ if (field_0x6a5 == 0) {
+ if (my_vec_0.abs() > l_HIO.mMoveRange + 100.0f) {
+ do_stuff = true;
+ }
+ } else if (my_vec_0.abs() < 30.0f) {
+ do_stuff = true;
+ }
+ }
+ if (do_stuff) {
+ speedF = 0.0f;
+ mMode = 4;
+ bckSet(5, 0, 3.0f, 1.0f);
+ mSound.startCreatureSound(Z2SE_EN_YM_ATTACK, 0, -1);
+ }
+ break;
+ }
+ case 4:
+ if (mpMorf->isStop()) {
+ setActionMode(ACT_WAIT);
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
+ }
}
/* 8080E26C-8080E49C 00622C 0230+00 1/1 0/0 0/0 .text executeDefense__8daE_YM_cFv */
void daE_YM_c::executeDefense() {
- // NONMATCHING
+ switch (mMode) {
+ case 0:
+ mSound.startCreatureSound(Z2SE_EN_YM_DEFENCE, 0, -1);
+ if (mType != 1) {
+ bckSet(7, 2, 3.0f, 1.0f);
+ mMode = 1;
+ shape_angle.y = mAngleToPlayer;
+ current.angle.y = mAngleToPlayer + 0x8000;
+ if (mAcch.ChkGroundHit()) {
+ speedF = 15.0f;
+ field_0x6a5 = 1;
+ } else {
+ speedF = 15.0f;
+ speed.y = 25.0f;
+ field_0x6a5 = 0;
+ }
+ } else {
+ bckSet(7, 0, 3.0f, 1.0f);
+ mMode = 2;
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ }
+ break;
+ case 1:
+ cLib_chaseF(&speed.y, -60.0f, 5.0f);
+ if (mAcch.ChkGroundHit()) {
+ if (field_0x6a5 == 0) {
+ mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1);
+ field_0x6a5 = 1;
+ }
+ if (speedF >= 3.0f) {
+ fopAcM_effSmokeSet2(&field_0xad0, &field_0xad4, &current.pos, NULL, 1.5f, &tevStr);
+ }
+ speed.y = 0.0f;
+ if (cLib_chaseF(&speedF, 0.0f, 1.0f)) {
+ setActionMode(ACT_WAIT);
+ }
+ }
+ break;
+ case 2:
+ if (mpMorf->isStop()) {
+ setActionMode(ACT_WAIT);
+ }
+ break;
+ default:
+ break;
+ }
}
/* 8080E49C-8080E630 00645C 0194+00 1/1 0/0 0/0 .text checkFlyTerritory__8daE_YM_cFv */
-void daE_YM_c::checkFlyTerritory() {
- // NONMATCHING
+u8 daE_YM_c::checkFlyTerritory() {
+ if (mPrevPos.absXZ(current.pos) > 300.0f) {
+ return 0;
+ } else {
+ if (fabsf(mPrevPos.y - current.pos.y) > 150.0f) {
+ return 0;
+ }
+ return 1;
+ }
}
/* 8080E630-8080E6A0 0065F0 0070+00 1/1 0/0 0/0 .text initFly__8daE_YM_cFv */
@@ -1159,35 +1765,234 @@ void daE_YM_c::initFly() {
attention_info.distances[fopAc_attn_BATTLE_e] = 46;
gravity = 0.0f;
field_0x6e4 = 0;
-
if (mTagPosP != NULL) {
- field_0x670 = mTagPos;
+ mPrevPos = mTagPos;
} else {
- field_0x670 = home.pos;
+ mPrevPos = home.pos;
}
-
mType = 3;
shape_angle.x = 0;
}
-/* ############################################################################################## */
-/* 80815A98-80815A9C 000104 0004+00 0/2 0/0 0/0 .rodata @7042 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7042 = 14.0f;
-COMPILER_STRIP_GATE(0x80815A98, &lit_7042);
-#pragma pop
-
-/* 80815A9C-80815AA0 000108 0004+00 0/1 0/0 0/0 .rodata @7043 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7043 = -10.0f;
-COMPILER_STRIP_GATE(0x80815A9C, &lit_7043);
-#pragma pop
-
/* 8080E6A0-8080F8C8 006660 1228+00 2/1 0/0 0/0 .text executeFly__8daE_YM_cFv */
void daE_YM_c::executeFly() {
- // NONMATCHING
+ fopAc_ac_c* player = dComIfGp_getPlayer(0);
+ cXyz player_pos(player->current.pos);
+ cXyz my_vec_1 = current.pos - player_pos;
+ cXyz my_vec_2 = current.pos - mPrevPos;
+ cXyz my_vec_3 = player_pos - mPrevPos;
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY, 0, -1);
+ switch (mMode) {
+ case 0:
+ field_0x6f2 = 100;
+ bckSetFly(0xd, 0, 0.0f, 1.0f);
+ field_0x6a5 = 0;
+ mMode = 1;
+ case 1:
+ if (mType == 1) {
+ setElecEffect1();
+ }
+ if (mpMorf->checkFrame(6.0f)) {
+ field_0x6cc = 1;
+ }
+ if (mpMorf->checkFrame(14.0f)) {
+ if (mType != 1) {
+ mMode = 7;
+ field_0x6f0 = 0x1e;
+ initFly();
+ } else {
+ field_0x70e = 0x28;
+ mMode = 10;
+ field_0x6f0 = 0x5a;
+ speed.y = -10.0f;
+ initFly();
+ current.angle.y = cLib_targetAngleY(&current.pos, &mPrevPos);
+ }
+ }
+ break;
+ case 2:
+ field_0x6f2 = 100;
+ bckSetFly(0xe, 2, 5.0f, 1.0f);
+ initFly();
+ field_0x6a5 = 0;
+ mMode = 3;
+ break;
+ case 3: {
+ mAcch.SetGroundUpY(70.0f);
+ if (field_0x6a5) {
+ if (field_0x70c == 0 && cM_rnd() < 0.4f) {
+ field_0x70c = 0x5a;
+ field_0x67c = mPrevPos;
+ if (my_vec_3.absXZ() >= 400.0f) {
+ if (checkFlyTerritory()) {
+ field_0x67c.x += cM_rndFX(300.0f);
+ field_0x67c.z += cM_rndFX(300.0f);
+ }
+ } else {
+ s16 tgt_ang_y;
+ if (checkFlyTerritory()) {
+ tgt_ang_y = cLib_targetAngleY(&current.pos, &player_pos) + 0x8000;
+ } else {
+ tgt_ang_y = cLib_targetAngleY(&current.pos, &mPrevPos);
+ }
+ field_0x67c.x += cM_ssin(tgt_ang_y) * 300.0f;
+ field_0x67c.z += cM_scos(tgt_ang_y) * 300.0f;
+ }
+ field_0x67c.y = player_pos.y + cM_rndF(50.0f);
+ if (fabsf(field_0x67c.y - mPrevPos.y) > 300.0f) {
+ field_0x67c.y = mPrevPos.y + cM_rndF(75.0f);
+ }
+ current.angle.y = cLib_targetAngleY(&current.pos, &field_0x67c);
+ current.angle.x = cLib_targetAngleX(&current.pos, &field_0x67c);
+ speedF = l_HIO.mFlyMoveSpeed * cM_scos(current.angle.x);
+ speed.y = l_HIO.mFlyMoveSpeed * cM_ssin(current.angle.x);
+ field_0x6f0 = 0x14;
+ mMode = 6;
+ break;
+ }
+ } else {
+ field_0x6a5 += 1;
+ }
+ if (my_vec_3.absXZ() >= 400.0f) {
+ field_0x67c = mPrevPos;
+ if (checkFlyTerritory()) {
+ field_0x67c.x += cM_rndFX(300.0f);
+ if (mPrevPos.y < current.pos.y) {
+ field_0x67c.y -= cM_rndF(75.0f);
+ } else {
+ field_0x67c.y += cM_rndF(75.0f);
+ }
+ field_0x67c.z += cM_rndFX(300.0f);
+ }
+ current.angle.y = cLib_targetAngleY(&current.pos, &field_0x67c);
+ current.angle.x = cLib_targetAngleX(&current.pos, &field_0x67c);
+ } else {
+ if (checkFlyTerritory()) {
+ current.angle.y = cLib_targetAngleY(&current.pos, &player_pos) + 0x8000;
+ current.angle.x = cM_rndF(4096.0f);
+ } else {
+ current.angle.y = cLib_targetAngleY(&current.pos, &mPrevPos);
+ current.angle.x = cLib_targetAngleX(&current.pos, &mPrevPos);
+ if ((s16)(cLib_targetAngleY(&current.pos, &player_pos) - current.angle.y) < 0) {
+ current.angle.y += 0x3000;
+ } else {
+ current.angle.y -= 0x3000;
+ }
+ }
+ }
+ speed.y = l_HIO.mFlyMoveSpeed * cM_ssin(current.angle.x);
+ field_0x6f0 = 0x14;
+ mMode = 4;
+ }
+ case 4:
+ case 6: {
+ cLib_chaseF(&speedF, l_HIO.mFlyMoveSpeed * fabsf(cM_scos(current.angle.x)), 1.0f);
+ if (mpMorf->isStop() && checkBck("E_TM", 0xd)) {
+ bckSetFly(0xc, 2, 0.0f, 1.0f);
+ }
+ cLib_chaseAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &player_pos), 0x400);
+ s16 ang_diff = current.angle.y - shape_angle.y;
+ cLib_chaseAngleS(&shape_angle.z, cM_ssin(ang_diff) * -3072.0f * fabsf(cM_scos(current.angle.x)), 0x100);
+ if (fabsf(cM_scos(current.angle.x)) >= fabsf(cM_ssin(current.angle.x))) {
+ cLib_chaseAngleS(&shape_angle.x, cM_scos(ang_diff) * 5120.0f * fabsf(cM_scos(current.angle.x)), 0x400);
+ } else {
+ cLib_chaseAngleS(&shape_angle.x, fabsf(cM_ssin(current.angle.x)) * 5120.0f, 0x400);
+ }
+ int do_stuff = false;
+ if (mMode == 4) {
+ if (field_0x6f0 == 0) {
+ do_stuff = true;
+ }
+ } else if (fabsf(field_0x67c.y - current.pos.y) < 100.0f || mAcch.ChkGroundHit()) {
+ do_stuff = true;
+ speed.y = 0.0f;
+ }
+ if (do_stuff) {
+ mMode = 5;
+ field_0x6f0 = 0x1e;
+ bckSetFly(0xe, 2, 5.0f, 1.0f);
+ }
+ break;
+ }
+ case 7: {
+ if (mpMorf->isStop() && checkBck("E_TM", 0xd)) {
+ bckSetFly(0xc, 2, 0.0f, 1.0f);
+ }
+ cLib_chaseF(&speedF, 20.0f, 3.0f);
+ cLib_chaseF(&speed.y, 15.0f, 3.0f);
+ cLib_addCalcAngleS(&shape_angle.y, mAngleToPlayer + 0x8000, 8, 0x1000, 0x100);
+ current.angle.y = shape_angle.y;
+ if (field_0x6f0 == 0) {
+ mMode = 5;
+ field_0x6f0 = 0x1e;
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ bckSetFly(0xe, 2, 5.0f, 1.0f);
+ }
+ break;
+ }
+ case 5: {
+ cLib_chaseAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &player_pos), 0x800);
+ cLib_chaseAngleS(&shape_angle.x, 0, 0x400);
+ cLib_chaseAngleS(&shape_angle.z, 0, 0x400);
+ cLib_chaseF(&speedF, 0.0f, 1.0f);
+ cLib_chaseF(&speed.y, 0.0f, 3.0f);
+ if (field_0x6f0 == 0 || my_vec_1.absXZ() < 50.0f
+ || (daPy_getPlayerActorClass()->checkWolfBark() && my_vec_1.absXZ() < 100.0f)) {
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ mMode = 3;
+ return;
+ }
+ if (field_0x6f2 == 0 && my_vec_1.absXZ() < 500.0f
+ && my_vec_3.absXZ() < l_HIO.mMoveRange + 150.0f && fabsf(my_vec_2.y) < 150.0f) {
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ setActionMode(ACT_FLY_ATTACK);
+ return;
+ }
+ break;
+ }
+ case 10: {
+ if (field_0x70e) {
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ }
+ if (field_0x70e) {
+ if (mpMorf->isStop() && checkBck("E_TM", 0xd)) {
+ bckSetFly(0xc, 2, 0.0f, 1.0f);
+ }
+ if (player_pos.y + 100.0f > current.pos.y) {
+ speed.y -= 1.0f;
+ if (speed.y < -15.0f) {
+ speed.y = -15.0f;
+ }
+ } else {
+ cLib_chaseF(&speed.y, 0.0f, 1.0f);
+ }
+ cLib_chaseF(&speedF, 30.0f - fabsf(speed.y), 1.0f);
+ } else {
+ s16 tgt_ang = cLib_targetAngleY(&current.pos, &mPrevPos);
+ if ((s16)(cLib_targetAngleY(&current.pos, &player_pos) - tgt_ang) < 0) {
+ tgt_ang += 0x3000;
+ } else {
+ tgt_ang -= 0x3000;
+ }
+ cLib_chaseAngleS(&current.angle.y, tgt_ang, 0x400);
+ current.angle.x = cLib_targetAngleX(&current.pos, &mPrevPos);
+ speed.y = l_HIO.mFlyMoveSpeed * cM_ssin(current.angle.x);
+ cLib_chaseF(&speedF, l_HIO.mFlyMoveSpeed * cM_scos(current.angle.x), 1.0f);
+ }
+ cLib_chaseAngleS(&shape_angle.y, current.angle.y, 0x400);
+ if (field_0x6f0 == 0) {
+ mMode = 3;
+ }
+ }
+ }
+ field_0x6e4 += 0x800;
+ current.pos.y += cM_ssin(field_0x6e4) * 3.0f;
}
/* 8080F8C8-8080F92C 007888 0064+00 1/1 0/0 0/0 .text setInclination__8daE_YM_cFv */
@@ -1196,37 +2001,299 @@ void daE_YM_c::setInclination() {
if (tan < -6000) {
tan = -6000;
}
-
if (tan > 6000) {
tan = 6000;
}
-
cLib_chaseAngleS(&shape_angle.x, tan, 0x0180);
}
/* 8080F92C-80810084 0078EC 0758+00 1/1 0/0 0/0 .text executeFlyAttack__8daE_YM_cFv */
void daE_YM_c::executeFlyAttack() {
- // NONMATCHING
+ cXyz my_vec_0;
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY, 0, -1);
+ switch (mMode) {
+ case 0:
+ field_0x6e4 = 0;
+ bckSetFly(5, 0, 0.0f, 1.0f);
+ mMode = 1;
+ field_0x67c = dComIfGp_getPlayer(0)->current.pos;
+ field_0x67c.y += 50.0f;
+ break;
+ case 1:
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ cLib_chaseAngleS(&shape_angle.x, 0, 0x400);
+ cLib_chaseAngleS(&shape_angle.z, 0, 0x400);
+ if (mpMorf->isStop()) {
+ bckSetFly(6, 2, 0.0f, 1.0f);
+ mMode = 2;
+ field_0x6f0 = 300;
+ }
+ break;
+ case 2: {
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY_ATTACK, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ my_vec_0 = field_0x67c - current.pos;
+ cLib_chaseAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &field_0x67c), 0x800);
+ current.angle.y = shape_angle.y;
+ int tan_val = cM_atan2s(my_vec_0.absXZ(), my_vec_0.y);
+ cLib_chaseF(&speed.y, l_HIO.mFlyAttackSpeed * cM_scos(tan_val), 5.0f);
+ cLib_chaseF(&speedF, l_HIO.mFlyAttackSpeed * cM_ssin(tan_val), 3.0f);
+ if (mSphCc.ChkAtHit()) {
+ fopAc_ac_c* hit_actor = dCc_GetAc(mSphCc.GetAtHitObj()->GetAc());
+ if (fopAcM_GetName(hit_actor) == PROC_ALINK) {
+ bckSetFly(7, 0, 0.0f, 1.0f);
+ speed.y = 0.0f;
+ speedF = 0.0f;
+ mMode = 4;
+ current.angle.y = cLib_targetAngleY(&current.pos, &mPrevPos);
+ shape_angle.x = 0;
+ return;
+ }
+ }
+ if (my_vec_0.abs() < 100.0f || field_0x6f0 == 0) {
+ mMode = 5;
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ bckSetFly(0xe, 2, 5.0f, 1.0f);
+ field_0x6f0 = 0x1e;
+ }
+ setInclination();
+ break;
+ }
+ case 4:
+ case 5: {
+ field_0x6e4 += 0x800;
+ current.pos.y += cM_ssin(field_0x6e4) * 3.0f;
+ cLib_chaseF(&speed.y, 0.0f, 3.0f);
+ cLib_chaseF(&speedF, 0.0f, 3.0f);
+ int do_stuff = 0;
+ if (mMode == 4) {
+ if (mpMorf->isStop()) {
+ do_stuff = true;
+ }
+ } else if (field_0x6f0 == 0) {
+ do_stuff = true;
+ }
+ if (do_stuff) {
+ mMode = 3;
+ bckSetFly(0xe, 2, 5.0f, 1.0f);
+ speedF = 0.0f;
+ speed.y = 0.0f;
+ field_0x6f0 = cM_rndF(10.0f) + 30.0f;
+ }
+ setInclination();
+ break;
+ }
+ case 3: {
+ s16 mang = mAngleToPlayer;
+ cLib_addCalcAngleS(&current.angle.y, mang + 0x8000, 4, 0x1000, 0x100);
+ cLib_chaseAngleS(&shape_angle.y, mang, 0x400);
+ cLib_chaseF(&speed.y, 10.0f, 3.0f);
+ cLib_chaseF(&speedF, 10.0f, 3.0f);
+ if (field_0x6f0 == 0) {
+ setActionMode(ACT_FLY);
+ mMode = 2;
+ }
+ s16 tan = cM_atan2s(speedF, speed.y) - 0x4000;
+ if (tan < -6000) {
+ tan = -6000;
+ }
+ if (tan > 6000) {
+ tan = 6000;
+ }
+ cLib_chaseAngleS(&shape_angle.x, tan, 0x180);
+ setInclination();
+ break;
+ }
+ default:
+ break;
+ }
}
/* 80810084-8081013C 008044 00B8+00 1/1 0/0 0/0 .text setNextPathPoint__8daE_YM_cFv */
void daE_YM_c::setNextPathPoint() {
- // NONMATCHING
+ cXyz my_vec_0;
+ ++mCurrentPntNo;
+ if (mCurrentPntNo >= mpPath->m_num) {
+ mCurrentPntNo = 0;
+ }
+ my_vec_0 = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ shape_angle.y = current.angle.y = cLib_targetAngleY(&current.pos, &my_vec_0);
+ mMode = 2;
+ bckSet(0x10, 2, 5.0f, 1.0f);
}
/* 8081013C-8081030C 0080FC 01D0+00 1/1 0/0 0/0 .text checkRailDig__8daE_YM_cFv */
-void daE_YM_c::checkRailDig() {
- // NONMATCHING
+u8 daE_YM_c::checkRailDig() {
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz my_vec_0;
+ if (player->checkWolfDig()) {
+ my_vec_0 = player->getLeftHandPos() - current.pos;
+ if (my_vec_0.abs() < 200.0f) {
+ field_0x714 &= ~0x80;
+ field_0x6f0 = 0x14;
+ mMode = 3;
+ mAcchCir.SetWall(40.0f, 60.0f);
+ fopAcM_OnStatus(this, 0x4000);
+ return 1;
+ }
+ }
+ return 0;
}
/* 8081030C-80810690 0082CC 0384+00 1/1 0/0 0/0 .text executeRail__8daE_YM_cFv */
void daE_YM_c::executeRail() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();;
+ cXyz my_vec_0;
+ switch (mMode) {
+ case 0:
+ mIsHide = 1;
+ field_0x6a6 = 4;
+ field_0x714 |= 4;
+ field_0x6dc = -70.0f;
+ old.pos = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ current.pos = old.pos;
+ field_0x6f0 = 0x3c;
+ field_0x714 |= 0x80;
+ mSphCc.SetCoSPrm(0x145);
+ mSphCc.SetTgType(0x10000);
+ setNextPathPoint();
+ case 1:
+ if (checkRailDig() == 0) {
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_WAIT, 0, -1);
+ if (player->checkWolfDig() == 0 && field_0x6f0 == 0) {
+ setNextPathPoint();
+ }
+ }
+ break;
+ case 2:
+ if (checkRailDig() == 0) {
+ speedF = 9.0f;
+ setMoveSound(1);
+ my_vec_0 = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ if (cLib_chasePos(&current.pos, my_vec_0, speedF) || current.pos.absXZ(my_vec_0) < 10.0f) {
+ mMode = 1;
+ field_0x6f0 = 0x3c;
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ }
+ speedF = 0.0f;
+ }
+ break;
+ case 3:
+ if (field_0x6f0 == 0) {
+ setAppear();
+ mPrevPos = current.pos;
+ setActionMode(ACT_ESCAPE);
+ field_0x704 = 0x1c2;
+ field_0x70e = 0x5a;
+ if (mTagPosP != NULL) {
+ mType = 0;
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
+/* 80815BD0-80815BDC 0000CC 000C+00 1/1 0/0 0/0 .data YM_DIG_POS_Y$7355 */
+static f32 YM_DIG_POS_Y[] = {-15.0f, -30.0f, -70.0f};
+
/* 80810690-80810DF8 008650 0768+00 1/1 0/0 0/0 .text executeBackRail__8daE_YM_cFv */
void daE_YM_c::executeBackRail() {
- // NONMATCHING
+ cXyz my_vec_0 = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ switch (mMode) {
+ case 0:
+ if (current.pos.abs(my_vec_0) < 150.0f) {
+ if ((s16)cLib_distanceAngleS(shape_angle.y, cLib_targetAngleY(&current.pos, &my_vec_0)) >= 0x2000) {
+ ++mCurrentPntNo;
+ if (mCurrentPntNo >= mpPath->m_num) {
+ mCurrentPntNo = 0;
+ }
+ my_vec_0 = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ }
+ }
+ bckSet(8, 2, 5.0f, 1.0f);
+ mIsHide = 1;
+ field_0x6a5 = 0;
+ field_0x6f0 = 7;
+ mMode = 1;
+ mAcchCir.SetWall(40.0f, 60.0f);
+ case 1:
+ setDigEffect();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_DIG, 0, -1);
+ cLib_chaseF(&field_0x6dc, YM_DIG_POS_Y[field_0x6a5], 3.0f);
+ cLib_addCalcAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &my_vec_0), 8, 0x2000, 0x100);
+ current.angle.y = shape_angle.y;
+ cLib_chaseF(&speedF, 5.0f, 1.0f);
+ if (field_0x6f0 == 0) {
+ field_0x6f0 = 10;
+ mMode = 2;
+ speedF = 0.0f;
+ }
+ break;
+ case 2:
+ setDigEffect();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_DIG, 0, -1);
+ if (field_0x6f0 == 0) {
+ ++field_0x6a5;
+ if (field_0x6a5 >= 3) {
+ mMode = 3;
+ field_0x6a5 = 0;
+ mSphCc.SetCoSPrm(0x145);
+ mSphCc.SetTgType(0x10000);
+ field_0x714 &= ~0x4;
+ bckSet(0x10, 2, 3.0f, 0.0f);
+ } else {
+ if (field_0x6a5 == 2) {
+ field_0x6f0 = 0xf;
+ mSphCc.SetCoSPrm(0x145);
+ mSphCc.SetTgType(0x10000);
+ field_0x714 &= ~0x4;
+ } else {
+ field_0x6f0 = 7;
+ }
+ mMode = 1;
+ }
+ }
+ break;
+ case 3:
+ cLib_chaseF(&field_0x6dc, -70.0f, 2.0f);
+ setMoveSound(1);
+ if (current.pos.absXZ(my_vec_0) < 100.0f) {
+ cLib_chaseAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &my_vec_0), 0x1000);
+ } else {
+ cLib_addCalcAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &my_vec_0), 8, 0x2000, 0x100);
+ }
+ current.angle.y = shape_angle.y;
+ cLib_chaseF(&speedF, 20.0f, 1.0f);
+ if (mAcch.ChkWallHit()) {
+ field_0x6a5 += 2;
+ if (field_0x6a5 >= 0x14 && checkBeforeGround()) {
+ field_0x6a5 = 0;
+ }
+ } else if (field_0x6a5) {
+ --field_0x6a5;
+ }
+ if (current.pos.absXZ(my_vec_0) < 30.0f && field_0x6dc == -70.0f) {
+ speedF = 0.0f;
+ mMode = 4;
+ field_0x6f0 = 100;
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ }
+ break;
+ case 4:
+ if (field_0x6f0 == 0) {
+ field_0x714 |= 4;
+ setActionMode(ACT_RAIL);
+ }
+ break;
+ default:
+ break;
+ }
}
/* 80810DF8-80810E64 008DB8 006C+00 1/1 0/0 0/0 .text checkElectricStart__8daE_YM_cFv */
@@ -1248,103 +2315,331 @@ void daE_YM_c::checkElectricStart() {
}
}
-/* ############################################################################################## */
-/* 80815AA0-80815AA4 00010C 0004+00 0/2 0/0 0/0 .rodata @7044 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7044 = 70.0f;
-COMPILER_STRIP_GATE(0x80815AA0, &lit_7044);
-#pragma pop
-
-/* 80815AA4-80815AA8 000110 0004+00 0/0 0/0 0/0 .rodata @7045 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7045 = 2.0f / 5.0f;
-COMPILER_STRIP_GATE(0x80815AA4, &lit_7045);
-#pragma pop
-
-/* 80815AA8-80815AAC 000114 0004+00 0/0 0/0 0/0 .rodata @7046 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7046 = -3072.0f;
-COMPILER_STRIP_GATE(0x80815AA8, &lit_7046);
-#pragma pop
-
-/* 80815AAC-80815AB0 000118 0004+00 0/0 0/0 0/0 .rodata @7047 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7047 = 5120.0f;
-COMPILER_STRIP_GATE(0x80815AAC, &lit_7047);
-#pragma pop
-
-/* 80815AB0-80815AB4 00011C 0004+00 0/1 0/0 0/0 .rodata @7048 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7048 = -15.0f;
-COMPILER_STRIP_GATE(0x80815AB0, &lit_7048);
-#pragma pop
-
-/* 80815AB4-80815AB8 000120 0004+00 0/1 0/0 0/0 .rodata @7556 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7556 = 36.0f;
-COMPILER_STRIP_GATE(0x80815AB4, &lit_7556);
-#pragma pop
-
/* 80810E64-8081105C 008E24 01F8+00 1/1 0/0 0/0 .text executeElectric__8daE_YM_cFv */
void daE_YM_c::executeElectric() {
- // NONMATCHING
+ switch (mMode) {
+ case 0:
+ field_0x6c9 = 0;
+ bckSet(9, 0, 3.0f, 1.0f);
+ speedF = 0.0f;
+ mMode = 1;
+ break;
+ case 1:
+ if (mpMorf->getFrame() < 36.0f) {
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC, 0, -1);
+ } else {
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ }
+ if (mpMorf->checkFrame(40.0f)) {
+ mMode = 2;
+ }
+ break;
+ case 2:
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ if (mpMorf->isStop()) {
+ mMode = 3;
+ field_0x6f0 = 0x1e;
+ bckSet(0xf, 2, 5.0f, 1.0f);
+ }
+ break;
+ case 3:
+ if (field_0x6f0 == 0) {
+ setActionMode(ACT_WAIT);
+ }
+ default:
+ break;
+ }
}
/* 8081105C-80811740 00901C 06E4+00 1/1 0/0 0/0 .text executeSwitch__8daE_YM_cFv */
void daE_YM_c::executeSwitch() {
- // NONMATCHING
+ cXyz my_vec_0;
+ switch (mMode) {
+ case 0:
+ mSphCc.SetCoSPrm(0x145);
+ mSphCc.SetTgType(0);
+ field_0x6dc = -70.0f;
+ mIsHide = 1;
+ if (mpPath != NULL) {
+ if (mpPath->field_0x4 == 1) {
+ field_0x714 = 4;
+ } else {
+ field_0x714 = 0;
+ field_0x6cf = 0;
+ }
+ } else {
+ field_0x714 = 0;
+ }
+ if (dComIfGs_isSwitch(field_0x6a3, fopAcM_GetRoomNo(this))) {
+ if (mpPath == NULL) {
+ mPrevPos = current.pos;
+ mMode = 1;
+ field_0x6f0 = 10;
+ field_0x6e4 = shape_angle.y;
+ field_0x6e6 = 0x5dc;
+ field_0x6e8 = 0;
+ } else {
+ dStage_dPnt_c* pnt = dPath_GetPnt(mpPath, mCurrentPntNo);
+ mCurrentPntNo = 0;
+ ++mCurrentPntNo;
+ old.pos = pnt->m_position;
+ current.pos = old.pos;
+ mMode = 2;
+ }
+ if (field_0x6cb) {
+ speedF = 25.0f;
+ } else {
+ speedF = 17.0f;
+ }
+ setAppear();
+ setNormalCc();
+ field_0x70e = 0x5a;
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ }
+ break;
+ case 1:
+ cLib_chaseF(&field_0x6dc, 0.0f, 15.0f);
+ setMoveSound(0);
+ if (mAcch.ChkWallHit()) {
+ field_0x6e4 += 0x800;
+ }
+ if (field_0x6e8 >= 0) {
+ field_0x6e6 -= 200;
+ } else {
+ field_0x6e6 += 200;
+ }
+ field_0x6e8 += field_0x6e6;
+ cLib_addCalcAngleS(&shape_angle.y, field_0x6e4 + field_0x6e8, 4, 0x1000, 0x100);
+ if (current.pos.absXZ(mPrevPos) > 500.0f) {
+ speedF = 0.0f;
+ mPrevPos = current.pos;
+ field_0x6dc = 0.0f;
+ setActionMode(ACT_WAIT);
+ }
+ break;
+ case 2:
+ mAcchCir.SetWall(0.0f, 0.0f);
+ if (field_0x70e) {
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ }
+ cLib_chaseF(&field_0x6dc, 0.0f, 3.0f);
+ setMoveSound(0);
+ my_vec_0 = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ cLib_addCalcAngleS(&shape_angle.y, cLib_targetAngleY(&current.pos, &my_vec_0),
+ 4, 0x2000, 0x100);
+ if (current.pos.absXZ(my_vec_0) < 50.0f) {
+ ++mCurrentPntNo;
+ if (mCurrentPntNo >= mpPath->m_num) {
+ if (mpPath->field_0x4 == 2) {
+ field_0x71d = 1;
+ field_0x714 = 0;
+ } else {
+ speedF = 0.0f;
+ mPrevPos = current.pos;
+ field_0x6dc = 0.0f;
+ mAcchCir.SetWall(40.0f, 60.0f);
+ setActionMode(ACT_WAIT);
+ }
+ }
+ }
+ break;
+ case 10:
+ setAppear();
+ setNormalCc();
+ old.pos = dPath_GetPnt(mpPath, mpPath->m_num-1)->m_position;
+ current.pos = old.pos;
+ mPrevPos = current.pos;
+ field_0x6dc = 0.0f;
+ speedF = 0.0f;
+ mAcchCir.SetWall(40.0f, 60.0f);
+ setActionMode(ACT_WAIT);
+ break;
+ default:
+ break;
+ }
+ current.angle.y = shape_angle.y;
}
-/* ############################################################################################## */
-/* 80815AB8-80815ABC 000124 0004+00 0/1 0/0 0/0 .rodata @7719 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7719 = 512.0f;
-COMPILER_STRIP_GATE(0x80815AB8, &lit_7719);
-#pragma pop
-
/* 80811740-80811838 009700 00F8+00 1/1 0/0 0/0 .text initFireFly__8daE_YM_cFi */
void daE_YM_c::initFireFly(int param_0) {
- // NONMATCHING
+ field_0x6e6 = cM_rndFX(512.0f);
+ if (param_0 && mAcch.ChkWallHit()) {
+ s16 wall_ang = mAcchCir.GetWallAngleY();
+ s16 res = (wall_ang << 1) - (current.angle.y + 0x8000);
+ current.angle.y = res + cM_rndFX(4096.0);
+ speed.y += cM_rndFX(15.0f);
+ field_0x70e = cM_rndFX(5.0f) + 10.0f;
+ }
+ field_0x6f0 = 10;
}
-/* ############################################################################################## */
-/* 80815ABC-80815AC0 000128 0004+00 0/1 0/0 0/0 .rodata @7942 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7942 = 550.0f;
-COMPILER_STRIP_GATE(0x80815ABC, &lit_7942);
-#pragma pop
-
-/* 80815AC0-80815AC4 00012C 0004+00 0/1 0/0 0/0 .rodata @7943 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_7943 = 250.0f;
-COMPILER_STRIP_GATE(0x80815AC0, &lit_7943);
-#pragma pop
-
/* 80811838-808120B0 0097F8 0878+00 1/1 0/0 0/0 .text executeFire__8daE_YM_cFv */
void daE_YM_c::executeFire() {
- // NONMATCHING
+ if (current.pos.y >= 550.0f) {
+ current.pos.y = 550.0f;
+ mAcch.SetRoofHit();
+ }
+ switch (mMode) {
+ case 0:
+ if (field_0x6f0) {
+ setElecEffect2();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ } else if (daPy_getPlayerActorClass()->checkFrontRollCrash() || daPy_getPlayerActorClass()->checkWolfAttackReverse()) {
+ cXyz pos_diff = daPy_getPlayerActorClass()->current.pos - current.pos;
+ if (pos_diff.abs() < 250.0f) {
+ field_0x6f0 = 10;
+ }
+ }
+ if (field_0x6d4) {
+ field_0x714 = 4;
+ } else {
+ field_0x714 = 0;
+ }
+ mSphCc.SetCoSPrm(0x145);
+ mSphCc.SetTgType(0);
+ field_0x6dc = -70.0f;
+ mIsHide = 1;
+ field_0x71c = 1;
+ current.pos = home.pos;
+ if (field_0x6a3 == 0xff || dComIfGs_isSwitch(field_0x6a3, fopAcM_GetRoomNo(this))) {
+ field_0x71c = 0;
+ mPrevPos = current.pos;
+ field_0x6e4 = 0;
+ setAppear();
+ setNormalCc();
+ mSphCc.SetTgType(0);
+ field_0x6dc = 0.0f;
+ mMode = 1;
+ bckSetFly(0xd, 0, 5.0f, 1.0f);
+ field_0x6a5 = 0;
+ }
+ break;
+ case 1:
+ if (mpMorf->checkFrame(6.0f)) {
+ field_0x6cc = 1;
+ }
+ if (mpMorf->checkFrame(14.0f)) {
+ attention_info.distances[2] = 0x2e;
+ gravity = 0.0f;
+ fopAcM_SearchByName(0x1f7, &field_0x660);
+ if (field_0x660 != NULL) {
+ for (int idx = 0; idx < 20; ++idx) {
+ if (((daTag_FWall_c*)field_0x660)->getTagNo(idx) == getTagNo()) {
+ field_0x67c = ((daTag_FWall_c*)field_0x660)->getPos(idx);
+ break;
+ }
+ }
+ mMode = 2;
+ } else {
+ initFireFly(0);
+ mMode = 3;
+ }
+ }
+ case 2:
+ if (fopAcM_CheckCondition(this, 4) == 0) {
+ setFireEffect();
+ setElecEffect2();
+ }
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ current.angle.y = cLib_targetAngleY(&current.pos, &field_0x67c);
+ current.angle.x = cLib_targetAngleX(&current.pos, &field_0x67c);
+ speedF = cM_scos(current.angle.x) * 40.0f;
+ speed.y = cM_ssin(current.angle.x) * 40.0f;
+ if (field_0x67c.abs(current.pos) < 200.0f && mAcch.ChkWallHit()) {
+ mMode = 3;
+ initFireFly(1);
+ for (int idx = 0; idx < 20; ++idx) {
+ if (((daTag_FWall_c*)field_0x660)->getTagNo(idx) == getTagNo()) {
+ ((daTag_FWall_c*)field_0x660)->setFire(idx);
+ }
+ }
+ }
+ shape_angle.y = current.angle.y;
+ break;
+ case 3:
+ if (dComIfGp_event_runCheck() == 0) {
+ mSphCc.OnCoSetBit();
+ } else {
+ mSphCc.OffCoSetBit();
+ }
+ if (field_0x6a5 == 0 && mpMorf->isStop()) {
+ bckSetFly(0xc, 2, 0.0f, 1.0f);
+ ++field_0x6a5;
+ }
+ if (fopAcM_CheckCondition(this, 4) == 0) {
+ setFireEffect();
+ }
+ if (field_0x70e) {
+ if (fopAcM_CheckCondition(this, 4) == 0) {
+ setElecEffect2();
+ }
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_ELECTRIC_LOOP, 0, -1);
+ field_0x700 = l_HIO.mElectricInvincibilityTimeExtension;
+ mSphCc.OnAtSetBit();
+ }
+ if (current.pos.y > 400.0f) {
+ speed.y -= 1.0f;
+ if (speed.y < -15.0f) {
+ speed.y = -15.0f;
+ }
+ } else if (current.pos.y < 200.0f) {
+ if (speed.y < 0.0f) {
+ speed.y = 0.0f;
+ }
+ } else {
+ speed.y += 1.0f;
+ if (speed.y > 15.0f) {
+ speed.y = 15.0f;
+ }
+ }
+ speedF = 40.0f - fabsf(speed.y);
+ current.angle.y += field_0x6e6;
+ if (mAcch.ChkWallHit()) {
+ initFireFly(1);
+ } else if (field_0x6f0 == 0) {
+ initFireFly(0);
+ }
+ shape_angle.y = current.angle.y;
+ break;
+ default:
+ break;
+ }
+ field_0x6e4 += 0x2000;
+ current.pos.y += cM_ssin(field_0x6e4) * 3.0f;
+ if (mMode) {
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY, 0, -1);
+ }
}
-/* ############################################################################################## */
-/* 80815AC4-80815AC8 000130 0004+00 0/2 0/0 0/0 .rodata @8040 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8040 = 2000.0f;
-COMPILER_STRIP_GATE(0x80815AC4, &lit_8040);
-#pragma pop
-
/* 808120B0-808123C4 00A070 0314+00 1/1 0/0 0/0 .text setRiverAttention__8daE_YM_cFv */
void daE_YM_c::setRiverAttention() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz player_pos = player->current.pos;
+ attention_info.distances[2] = 60;
+ field_0x714 = 0;
+ if (current.pos.abs(mpKago->current.pos) > 2000.0f) {
+ return;
+ }
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ mDoMtx_stack_c::YrotS(-shape_angle.y);
+ mDoMtx_stack_c::XrotM(-shape_angle.x);
+ mDoMtx_stack_c::transM(current.pos - mpKago->current.pos);
+ mDoMtx_stack_c::multVecZero(&my_vec_0);
+ my_vec_1.set(my_vec_0.x, my_vec_0.z, my_vec_0.y);
+ if (abs(cM_atan2s(my_vec_1.y, my_vec_1.absXZ()) - 0x4000) < 0x2000) {
+ field_0x714 = 4;
+ }
}
/* 808123C4-808123D0 00A384 000C+00 0/0 0/0 1/1 .text setLockByCargo__8daE_YM_cFv */
@@ -1352,24 +2647,197 @@ void daE_YM_c::setLockByCargo() {
field_0x6f2 = 90;
}
-/* ############################################################################################## */
-/* 80815AC8-80815ACC 000134 0004+00 0/1 0/0 0/0 .rodata @8350 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8350 = 1500.0f;
-COMPILER_STRIP_GATE(0x80815AC8, &lit_8350);
-#pragma pop
-
-/* 80815ACC-80815AD0 000138 0004+00 0/1 0/0 0/0 .rodata @8351 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8351 = 12.0f / 5.0f;
-COMPILER_STRIP_GATE(0x80815ACC, &lit_8351);
-#pragma pop
-
/* 808123D0-80812F0C 00A390 0B3C+00 1/1 0/0 0/0 .text executeRiver__8daE_YM_cFv */
void daE_YM_c::executeRiver() {
- // NONMATCHING
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz player_pos = player->current.pos;
+ cXyz pnt_pos = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ cXyz my_vec_0;
+ switch (mMode) {
+ case 0:
+ field_0x714 = 0;
+ field_0x6d4 = 0.0f;
+ field_0x6dc = 0.0f;
+ gravity = 0.0f;
+ speedF = 0.0f;
+ speed.y = 0.0f;
+ field_0x6ec = 0.0f;
+ field_0x6f2 = 0;
+ if (mpKago == NULL) {
+ fopAcM_SearchByName(0xf4, (fopAc_ac_c**)&mpKago);
+ } else if ( mpKago->getPathDir() ) {
+ if (dComIfGs_isLightDropGetFlag(dComIfGp_getStartStageDarkArea()) == 0) {
+ field_0x71d = 1;
+ } else {
+ if (mpKago->getPathDir() > 0) {
+ if (mpPath != NULL) {
+ mMode = 1;
+ } else {
+ field_0x71d = 1;
+ break;
+ }
+ } else {
+ if (field_0x6b0 != NULL) {
+ mMode = 1;
+ mpPath = field_0x6b0;
+ } else {
+ field_0x71d = 1;
+ break;
+ }
+ }
+ if (mMode == 1) {
+ bckSetFly(0xe, 2, 5.0f, 1.0f);
+ field_0x6cc = 1;
+ mCurrentPntNo = 0;
+ pnt_pos = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ old.pos = pnt_pos;
+ current.pos = old.pos;
+ ++mCurrentPntNo;
+ pnt_pos = dPath_GetPnt(mpPath, mCurrentPntNo)->m_position;
+ s16 tgt_ang = cLib_targetAngleY(&current.pos, &pnt_pos);
+ current.angle.y = tgt_ang;
+ shape_angle.y = tgt_ang;
+ setAppear();
+ setNormalCc();
+ field_0x6f0 = 0;
+ }
+ }
+ }
+ break;
+ case 1:
+ setElecEffect1();
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY, 0, -1);
+ if (mpKago->isFlying()) {
+ if (field_0x6a3 != 0xff) {
+ if (dComIfGs_isSwitch(field_0x6a3, fopAcM_GetRoomNo(this))) {
+ speedF = 0.0f;
+ speed.y = 0.0f;
+ mMode = 2;
+ bckSetFly(0xb, 2, 5.0f, 1.0f);
+ }
+ } else {
+ f32 next_path = mpKago->checkNextPath(current.pos);
+ if (next_path < 2000.0f) {
+ speedF = 0.0f;
+ speed.y = 0.0f;
+ mMode = 2;
+ bckSetFly(0xb, 2, 5.0f, 1.0f);
+ }
+ }
+ }
+ break;
+ case 2: {
+ setRiverAttention();
+ field_0x6e8 += 0x200;
+ current.pos.y += cM_ssin(field_0x6e8 << 1) * 15.0f;
+ f32 my_float_val = cM_scos(field_0x6e8) * 15.0f;
+ current.pos.x += my_float_val * cM_ssin(shape_angle.y);
+ current.pos.z += my_float_val * cM_scos(shape_angle.y);
+ s16 tgt_ang = cLib_targetAngleY(&current.pos, &pnt_pos);
+ current.angle.y = tgt_ang;
+ shape_angle.y = tgt_ang;
+ tgt_ang = cLib_targetAngleX(&current.pos, &pnt_pos);
+ current.angle.x = tgt_ang;
+ shape_angle.x = tgt_ang;
+ // The following is necessary for matching, but unused?!
+ abs(mAngleToPlayer - shape_angle.y);
+ f32 next_path = mpKago->checkNextPath(current.pos);
+ if (mpKago->isFlying()) {
+ if (field_0x6f2) {
+ field_0x714 = 4;
+ if (next_path < 200.0f) {
+ cLib_chaseF(&field_0x6ec, 70.0f, 1.0f);
+ } else if (next_path > 1000.0f) {
+ cLib_chaseF(&field_0x6ec, 10.0f, 1.0f);
+ } else {
+ cLib_chaseF(&field_0x6ec, 30.0f, 1.0f);
+ }
+ } else {
+ if (next_path < 0.0f) {
+ field_0x6f0 = 0x96;
+ cLib_chaseF(&field_0x6ec, 70.0f, 1.0f);
+ } else if (field_0x6f0) {
+ cLib_chaseF(&field_0x6ec, 70.0f, 1.0f);
+ } else {
+ if (next_path < 4000.0f) {
+ if (next_path < 1500.0f) {
+ f32 abs_val = mpKago->speed.abs();
+ abs_val -= 10.0f;
+ if (abs_val < 30.0f) {
+ abs_val = 30.0f;
+ }
+ cLib_chaseF(&field_0x6ec, abs_val, 1.0f);
+ } else {
+ cLib_chaseF(&field_0x6ec, 30.0f, 1.0f);
+ }
+ } else {
+ cLib_chaseF(&field_0x6ec, 0.0f, 1.0f);
+ }
+ }
+ }
+ } else {
+ cLib_chaseF(&field_0x6ec, 0.0f, 1.0f);
+ field_0x6d4 = 0.0f;
+ }
+ speed.y = field_0x6ec * cM_ssin(current.angle.x);
+ speedF = field_0x6ec * cM_scos(current.angle.x);
+ if (pnt_pos.abs(current.pos) < 500.0f && ((++mCurrentPntNo), mCurrentPntNo >= mpPath->m_num)) {
+ speedF = 0.0f;
+ mPrevPos = pnt_pos;
+ field_0x6dc = 0.0f;
+ mAcchCir.SetWall(40.0f, 60.0f);
+ current.angle.x = 0;
+ shape_angle.x = 0;
+ setActionMode(ACT_WAIT);
+ } else {
+ if (current.pos.abs(mpKago->current.pos) > 2000.0f) {
+ field_0x68c = 2.4f;
+ setElecEffect2();
+ field_0x68c = 1.5f;
+ }
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_FLY, 0, -1);
+ if (mSphCc.ChkTgHit()) {
+ cCcD_Obj * tg_hit_obj = mSphCc.GetTgHitObj();
+ fopAc_ac_c* hit_actor = dCc_GetAc(tg_hit_obj->GetAc());
+ if (fopAcM_GetName(hit_actor) == PROC_KAGO) {
+ if (mpKago == tg_hit_obj->GetAc()) {
+ if (mpKago->getLockActor() == this) {
+ mpKago->setLockActor(NULL);
+ }
+ setAppear();
+ speedF = 0.0f;
+ speed.y = 0.0f;
+ field_0x714 = 0;
+ bckSet(0x10, 2, 5.0f, 1.0f);
+ mpKago->setEatYm();
+ mMode = 3;
+ field_0x6ce = 1;
+ }
+ }
+ }
+ }
+ break;
+ }
+ case 3:
+ setElecEffect1();
+ if (mpKago != NULL) {
+ mDoMtx_stack_c::copy(mpKago->getMouthMtx());
+ mDoMtx_stack_c::multVecZero(&my_vec_0);
+ current.pos += mpKago->speed;
+ current.pos = my_vec_0;
+ if (cLib_chasePos(&current.pos, my_vec_0, 50.0f)) {
+ if (mSwitchBit != 0xff && dComIfGs_isSwitch(mSwitchBit, fopAcM_GetRoomNo(this)) == 0) {
+ dComIfGs_onSwitch(mSwitchBit, fopAcM_GetRoomNo(this));
+ }
+ dComIfGp_setHitMark(3, this, &current.pos, NULL, NULL, 0);
+ fopAcM_delete(this);
+ fopAcM_createDisappear(this, &current.pos, 0x14, 1, 0xff);
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
/* 80812F0C-80812FCC 00AECC 00C0+00 1/1 0/0 0/0 .text s_ym_sub__FPvPv */
@@ -1404,7 +2872,148 @@ void daE_YM_c::checkFrinedSamePos() {
/* 8081300C-80813528 00AFCC 051C+00 2/1 0/0 0/0 .text action__8daE_YM_cFv */
void daE_YM_c::action() {
- // NONMATCHING
+ if (daPy_getPlayerActorClass()->getCutType() == 0x36) {
+ field_0x700 = 0;
+ }
+ mDistToPlayer = fopAcM_searchPlayerDistance(this);
+ mAngleToPlayer = fopAcM_searchPlayerAngleY(this);
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ mSphCc.OnTgSetBit();
+ if (field_0x6fe) {
+ mSphCc.OffTgSetBit();
+ }
+ if (!field_0x6d4) {
+ mSphCc.OffTgSetBit();
+ }
+ mSphCc.SetTgSpl(0);
+ mSphCc.SetAtMtrl(0);
+ if (field_0x700) {
+ mSphCc.SetAtMtrl(7);
+ }
+ if (mType == 1) {
+ mSphCc.OnAtSetBit();
+ } else {
+ mSphCc.OffAtSetBit();
+ }
+ damage_check();
+ checkSurpriseLock();
+ field_0x6cf = 1;
+ int do_stuff = false;
+ switch (mAction) {
+ case ACT_WAIT:
+ executeWait();
+ break;
+ case ACT_MOVE:
+ executeMove();
+ break;
+ case ACT_ESCAPE:
+ executeEscape();
+ break;
+ case ACT_DOWN:
+ executeDown();
+ break;
+ case ACT_WIND:
+ executeWind();
+ break;
+ case ACT_SURPRISE:
+ executeSurprise();
+ break;
+ case ACT_BACK:
+ executeBack();
+ break;
+ case ACT_FALL:
+ executeFall();
+ break;
+ case ACT_ATTACK:
+ do_stuff = true;
+ executeAttack();
+ break;
+ case ACT_ATTACK_WALL:
+ do_stuff = true;
+ executeAttackWall();
+ break;
+ case ACT_DEFENSE:
+ executeDefense();
+ break;
+ case ACT_FLY:
+ executeFly();
+ break;
+ case ACT_FLY_ATTACK:
+ do_stuff = true;
+ executeFlyAttack();
+ break;
+ case ACT_RAIL:
+ executeRail();
+ break;
+ case ACT_BACK_RAIL:
+ executeBackRail();
+ break;
+ case ACT_ELECTRIC:
+ do_stuff = true;
+ executeElectric();
+ break;
+ case ACT_SWITCH:
+ executeSwitch();
+ break;
+ case ACT_FIRE:
+ executeFire();
+ break;
+ case ACT_RIVER:
+ executeRiver();
+ break;
+ default:
+ break;
+ }
+ mSound.setLinkSearch(do_stuff);
+ if (field_0x6cf) {
+ mSound.startCreatureSoundLevel(Z2SE_EN_YM_NEAR, 0, -1);
+ }
+ if (mType != 1) {
+ if (mAcch.ChkGroundHit()) {
+ cM3dGPla plane;
+ dComIfG_Bgsp().GetTriPla(mAcch.m_gnd, &plane);
+ cXyz* p_vec = plane.GetNP();
+ cLib_addCalcAngleS(&field_0x668.x, (s16)cM_atan2s(p_vec->z, p_vec->y), 8, 0x800, 0x100);
+ cLib_addCalcAngleS(&field_0x668.y, (s16)cM_atan2s(p_vec->x, p_vec->y), 8, 0x800, 0x100);
+ } else {
+ field_0x668.set(0, 0, 0);
+ }
+ fopAcM_posMoveF(this, mStts.GetCCMoveP());
+ if (field_0x71c == 0) {
+ mAcch.CrrPos(dComIfG_Bgsp());
+ }
+ } else {
+ mDoMtx_stack_c::XrotS(field_0x668.x);
+ mDoMtx_stack_c::ZrotM(field_0x668.z);
+ mDoMtx_stack_c::YrotM(current.angle.y);
+ my_vec_0.set(0.0f, 0.0f, speedF);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ speed = my_vec_1;
+ current.pos += speed;
+ }
+ if (!field_0x6d4) {
+ attention_info.flags = 0;
+ if (daPy_getPlayerActorClass()->checkWolfLock(this)) {
+ daPy_getPlayerActorClass()->cancelWolfLock(this);
+ }
+ onWolfNoLock();
+ } else {
+ attention_info.flags = field_0x714;
+ offWolfNoLock();
+ if (mType == 1 && fopAcM_CheckCondition(this, 4) == 0) {
+ dBgS_LinChk lin_chk;
+ lin_chk.Set(&dComIfGp_getCamera(0)->lookat.eye, &attention_info.position, this);
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ onWolfNoLock();
+ }
+ }
+ }
+ cXyz unused_vec(field_0x68c, field_0x68c, field_0x68c);
+ cXyz my_pos = current.pos;
+ setMidnaBindEffect(this, &mSound, &my_pos, &scale);
+ mpMorf->play(NULL, dComIfGp_getReverb(fopAcM_GetRoomNo(this)));
+ mpBrk->play();
}
/* 80813528-808135B0 00B4E8 0088+00 1/1 0/0 0/0 .text mtx_set__8daE_YM_cFv */
@@ -1414,28 +3023,59 @@ void daE_YM_c::mtx_set() {
mDoMtx_stack_c::ZXYrotM(shape_angle);
mDoMtx_stack_c::scaleM(field_0x68c, field_0x68c, field_0x68c);
- field_0x5b4->getModel()->setBaseTRMtx(mDoMtx_stack_c::get());
- field_0x5b4->modelCalc();
+ mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get());
+ mpMorf->modelCalc();
}
-/* ############################################################################################## */
-/* 80815AD0-80815AD4 00013C 0004+00 0/1 0/0 0/0 .rodata @8621 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8621 = -30.0f;
-COMPILER_STRIP_GATE(0x80815AD0, &lit_8621);
-#pragma pop
-
-/* 80815AD4-80815AD8 000140 0004+00 0/1 0/0 0/0 .rodata @8622 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8622 = -20.0f;
-COMPILER_STRIP_GATE(0x80815AD4, &lit_8622);
-#pragma pop
-
/* 808135B0-808138AC 00B570 02FC+00 1/1 0/0 0/0 .text cc_set__8daE_YM_cFv */
void daE_YM_c::cc_set() {
- // NONMATCHING
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ J3DModel* model = mpMorf->getModel();
+ cXyz my_vec_2(0.0f, 0.0f, 0.0f);
+ if (mIsHide) {
+ my_vec_2.y = 40.0f;
+ }
+ if (field_0x718 == 0) {
+ if (mType != 1) {
+ MTXCopy(model->getAnmMtx(0), mDoMtx_stack_c::get());
+ my_vec_0.set(30.0f, 0.0f, 0.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &eyePos);
+ attention_info.position = eyePos;
+ attention_info.position.y += field_0x68c * 50.0f;
+ } else {
+ mDoMtx_stack_c::XrotS(field_0x668.x);
+ mDoMtx_stack_c::ZrotM(field_0x668.z);
+ my_vec_0.set(0.0f, -30.0f, 50.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ eyePos = current.pos + my_vec_1;
+ mDoMtx_stack_c::XrotS(field_0x668.x);
+ mDoMtx_stack_c::ZrotM(field_0x668.z);
+ my_vec_0.set(0.0f, 30.0f, 70.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ attention_info.position = current.pos + my_vec_1;
+ }
+ } else if (field_0x718 == 1) {
+ eyePos = current.pos;
+ attention_info.position = eyePos;
+ attention_info.position.y += 70.0f;
+ }
+ MTXCopy(model->getAnmMtx(0), mDoMtx_stack_c::get());
+ if (mType != 1) {
+ my_vec_0.set(10.0f, -20.0f, 0.0f);
+ } else {
+ my_vec_0.set(10.0f, 40.0f, 0.0f);
+ }
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ mSphCc.SetC(my_vec_1 + my_vec_2);
+ if (mAction == ACT_RIVER) {
+ mSphCc.SetR(100.0f);
+ } else if (field_0x700) {
+ mSphCc.SetR(40.0f);
+ } else {
+ mSphCc.SetR(30.0f);
+ }
+ dComIfG_Ccsp()->Set(&mSphCc);
}
/* 808138AC-80813A10 00B86C 0164+00 1/1 0/0 0/0 .text execute__8daE_YM_cFv */
@@ -1522,11 +3162,11 @@ int daE_YM_c::_delete() {
}
if (field_0xaf4) {
- data_80815D28[0] = 0;
+ lbl_253_bss_8 = 0;
}
if (heap != NULL) {
- field_0x5bc.deleteObject();
+ mSound.deleteObject();
}
return 1;
@@ -1539,19 +3179,45 @@ static int daE_YM_Delete(daE_YM_c* i_this) {
/* 80813AF0-80813E38 00BAB0 0348+00 1/1 0/0 0/0 .text CreateHeap__8daE_YM_cFv */
int daE_YM_c::CreateHeap() {
- // NONMATCHING
-}
-
-/* 80813E38-80813E3C 00BDF8 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */
-// cXyz::cXyz() {
-extern "C" void __ct__4cXyzFv() {
- /* empty function */
-}
-
-/* 80813E3C-80813E84 00BDFC 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */
-// J3DFrameCtrl::~J3DFrameCtrl() {
-extern "C" void __dt__12J3DFrameCtrlFv() {
- // NONMATCHING
+ if (mFlyType == 1) {
+ J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_TM", 0x11);
+ JUT_ASSERT(0x1094, modelData != NULL);
+ mpMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL, (J3DAnmTransform*)dComIfG_getObjectRes("E_TM", 10),
+ 0, 1.0f, 0, -1, &mSound, 0x80000,0x11000084);
+ if (mpMorf == NULL || mpMorf->getModel() == NULL) {
+ return 0;
+ }
+ mpBrk = new mDoExt_brkAnm();
+ if (mpBrk == NULL) {
+ return 0;
+ }
+ if (!mpBrk->init(mpMorf->getModel()->getModelData(),
+ (J3DAnmTevRegKey*)dComIfG_getObjectRes("E_TM", 0x14),
+ TRUE, 2, 1.0f, 0, -1)) {
+ return 0;
+ }
+ } else {
+ J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_YM", 0x13);
+ JUT_ASSERT(0x10bb, modelData != NULL);
+ mpMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL, (J3DAnmTransform*)dComIfG_getObjectRes("E_YM", 0x10),
+ 0, 1.0f, 0, -1, &mSound, 0x80000,0x11000084);
+ if (mpMorf == NULL || mpMorf->getModel() == NULL) {
+ return 0;
+ }
+ mpBrk = new mDoExt_brkAnm();
+ if (mpBrk == NULL) {
+ return 0;
+ }
+ if (!mpBrk->init(mpMorf->getModel()->getModelData(),
+ (J3DAnmTevRegKey*)dComIfG_getObjectRes("E_YM", 0x16),
+ TRUE, 2, 1.0f, 0, -1)) {
+ return 0;
+ }
+ }
+ if (mType == 6) {
+ field_0x6d0 = new cXyz[45];
+ }
+ return 1;
}
/* 80813E84-80813EA4 00BE44 0020+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */
@@ -1559,47 +3225,150 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return static_cast<daE_YM_c*>(i_this)->CreateHeap();
}
-/* ############################################################################################## */
-/* 80815AD8-80815ADC 000144 0004+00 0/2 0/0 0/0 .rodata @8964 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8964 = -200.0f;
-COMPILER_STRIP_GATE(0x80815AD8, &lit_8964);
-#pragma pop
-
-/* 80815ADC-80815AE0 000148 0004+00 0/1 0/0 0/0 .rodata @8965 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_8965 = 80.0f;
-COMPILER_STRIP_GATE(0x80815ADC, &lit_8965);
-#pragma pop
-
/* 80813EA4-808143A0 00BE64 04FC+00 2/2 0/0 0/0 .text checkBeforeBg__8daE_YM_cFs */
-void daE_YM_c::checkBeforeBg(s16 param_0) {
- // NONMATCHING
+u8 daE_YM_c::checkBeforeBg(s16 i_rot_val) {
+ // NONMATCHING - regalloc
+ dBgS_LinChk lin_chk;
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ cXyz my_vec_2;
+ cXyz my_vec_3;
+ if (!speedF) {
+ return 0;
+ }
+ if (mType != 1) {
+ if (mAcch.ChkWallHit()) {
+ return 1;
+ }
+ } else {
+ mDoMtx_stack_c::XrotS(field_0x668.x);
+ mDoMtx_stack_c::ZrotM(field_0x668.z);
+ mDoMtx_stack_c::YrotM(i_rot_val);
+ my_vec_0.set(0.0f, 30.0f, 0.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_3);
+ my_vec_3 += current.pos;
+ mDoMtx_stack_c::XrotS(field_0x668.x);
+ mDoMtx_stack_c::ZrotM(field_0x668.z);
+ mDoMtx_stack_c::YrotM(i_rot_val);
+ my_vec_0.set(0.0f, 0.0f, 60.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ my_vec_0.set(my_vec_1.x, 0.0f, my_vec_1.z);
+ my_vec_2 = my_vec_3 + my_vec_0;
+ lin_chk.Set(&my_vec_3, &my_vec_2, NULL);
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ return 1;
+ }
+ if (my_vec_1.y > 0.0f) {
+ my_vec_0.set(0.0f, 60.0f, 0.0f);
+ } else {
+ my_vec_0.set(0.0f, -200.0f, 0.0f);
+ }
+ my_vec_2 = my_vec_3 + my_vec_0;
+ lin_chk.Set(&my_vec_3, &my_vec_2, NULL);
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ return 1;
+ }
+ mDoMtx_stack_c::XrotS(field_0x668.x);
+ mDoMtx_stack_c::ZrotM(field_0x668.z);
+ mDoMtx_stack_c::YrotM(i_rot_val);
+ my_vec_0.set(0.0f, 30.0f, 80.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ my_vec_3 = current.pos + my_vec_1;
+ cXyz inside_vec(0.0f, 0.0f, 80.0f);
+ cLib_offsetPos(&my_vec_2, &my_vec_3, field_0x668.z, &inside_vec);
+ lin_chk.Set(&my_vec_3, &my_vec_2, NULL);
+ if (dComIfG_Bgsp().LineCross(&lin_chk) == 0) {
+ return 1;
+ }
+ cM3dGPla plane;
+ dComIfG_Bgsp().GetTriPla(lin_chk, &plane);
+ cXyz* p_vec = plane.GetNP();
+ f32 absxz_val = p_vec->absXZ();
+ s16 tan_val = cM_atan2s(absxz_val, p_vec->y) + -0x8000;
+ if (abs(tan_val + 0x4000) <= 0x1555) {
+ if (field_0x668.z != (s16)(cM_atan2s(p_vec->x, p_vec->z) + 0x8000)) {
+ return 1;
+ }
+ }
+ }
+ return 0;
}
/* 808143A0-808144D8 00C360 0138+00 1/1 0/0 0/0 .text checkBeforeGround__8daE_YM_cFv */
-void daE_YM_c::checkBeforeGround() {
- // NONMATCHING
+u8 daE_YM_c::checkBeforeGround() {
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ dBgS_GndChk gnd_chk;
+ cXyz adj_pos = current.pos;
+ adj_pos.y += 300.0f;
+ mDoMtx_stack_c::YrotS(current.angle.y);
+ my_vec_0.set(0.0f, 00.0f, 60.0f);
+ mDoMtx_stack_c::multVec(&my_vec_0, &my_vec_1);
+ adj_pos.x += my_vec_1.x;
+ adj_pos.z += my_vec_1.z;
+ gnd_chk.SetPos(&adj_pos);
+ f32 gnd_cross = dComIfG_Bgsp().GroundCross(&gnd_chk);
+ if (gnd_cross > current.pos.y) {
+ current.pos.set(adj_pos.x, gnd_cross, adj_pos.z);
+ old.pos = current.pos;
+ return 1;
+ } else {
+ return 0;
+ }
}
/* 808144D8-80814758 00C498 0280+00 1/1 0/0 0/0 .text checkInitialWall__8daE_YM_cFv */
void daE_YM_c::checkInitialWall() {
- // NONMATCHING
+ cXyz my_vec_0;
+ cXyz my_vec_1(0.0f, 0.0f, 200.0f);
+ dBgS_LinChk lin_chk;
+ for (int idx = 0; idx < 4; ++idx) {
+ cLib_offsetPos(&my_vec_0, &current.pos, shape_angle.y + (idx << 0xe), &my_vec_1);
+ lin_chk.Set(&current.pos, &my_vec_0, NULL);
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ cM3dGPla plane;
+ dComIfG_Bgsp().GetTriPla(lin_chk, &plane);
+ cXyz* p_vec = plane.GetNP();
+ f32 absxz_val = p_vec->absXZ();
+ s16 tan_val = cM_atan2s(absxz_val, p_vec->y) + -0x8000;
+ if (abs(tan_val + 0x4000) <= 0x1555) {
+ current.pos = lin_chk.GetCross();
+ field_0x668.z = cM_atan2s(p_vec->x, p_vec->z) + 0x8000;
+ field_0x668.x = tan_val;
+ mAcchCir.SetWall(20.0f, 10.0f);
+ return;
+ }
+ }
+ }
+ mType = 0;
}
-/* ############################################################################################## */
-/* 80815AE0-80815AE4 00014C 0004+00 0/1 0/0 0/0 .rodata @9187 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_9187 = -50.0f;
-COMPILER_STRIP_GATE(0x80815AE0, &lit_9187);
-#pragma pop
-
/* 80814758-80814AF0 00C718 0398+00 3/3 0/0 0/0 .text checkWall__8daE_YM_cFv */
-void daE_YM_c::checkWall() {
- // NONMATCHING
+u8 daE_YM_c::checkWall() {
+ cXyz my_vec_0;
+ cXyz my_vec_1;
+ cXyz my_vec_2(0.0f, 0.0f, 100.0f);
+ dBgS_LinChk lin_chk;
+ if (mType != 1) {
+ return 0;
+ }
+ cLib_offsetPos(&my_vec_1, &current.pos, field_0x668.z, &my_vec_2);
+ my_vec_2.z = -50.0;
+ cLib_offsetPos(&my_vec_0, &current.pos, field_0x668.z, &my_vec_2);
+ lin_chk.Set(&my_vec_0, &my_vec_1, NULL);
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ cM3dGPla plane;
+ dComIfG_Bgsp().GetTriPla(lin_chk, &plane);
+ cXyz* p_vec = plane.GetNP();
+ s16 tan_val = cM_atan2s(p_vec->absXZ(), p_vec->y) + -0x8000;
+ if (abs(tan_val + 0x4000) <= 0x1555) {
+ current.pos = lin_chk.GetCross();
+ field_0x668.z = cM_atan2s(p_vec->x, p_vec->z) + 0x8000;
+ field_0x668.x = cM_atan2s(p_vec->absXZ(), p_vec->y) + -0x8000;
+ return 1;
+ }
+ }
+ return 0;
}
/* 80814AF0-80814BA4 00CAB0 00B4+00 1/1 0/0 0/0 .text setHideType__8daE_YM_cFv */
@@ -1624,25 +3393,9 @@ void daE_YM_c::setHideType() {
}
}
-/* ############################################################################################## */
-/* 80815AE4-80815AEC 000150 0008+00 0/1 0/0 0/0 .rodata @9420 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_9420[8] = {
- 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x80815AE4, &lit_9420);
-#pragma pop
-
-/* 80815AEC-80815AEC 000158 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_80815AFE = "E_ym";
-#pragma pop
-
/* 80814BA4-80815224 00CB64 0680+00 2/1 0/0 0/0 .text create__8daE_YM_cFv */
-// NONMATCHING - literals / small issue
int daE_YM_c::create() {
+ // NONMATCHING - regalloc
fopAcM_SetupActor(this, daE_YM_c);
mType = fopAcM_GetParam(this);
@@ -1660,11 +3413,9 @@ int daE_YM_c::create() {
field_0x6e0 = prm2 * 100.0f;
u8 prm1 = fopAcM_GetParam(this) >> 0x8;
- u8 tmp0 = current.angle.z >> 8;
-
- mTagNo = (u8)current.angle.z;
+ u8 tmp0 = (current.angle.z >> 8) & 0xff;
+ mTagNo = current.angle.z;
field_0x6a1 = 1;
-
if ((current.angle.x & 3) != 0) {
field_0x6a1 = 0;
}
@@ -1673,9 +3424,13 @@ int daE_YM_c::create() {
field_0x6cb = 1;
}
- field_0x6a3 = (u8)(current.angle.x >> 8);
+ field_0x6a3 = (current.angle.x >> 8) & 0xff;
if (mSwitchBit != 0xFF && dComIfGs_isSwitch(mSwitchBit, fopAcM_GetRoomNo(this))) {
+#ifdef DEBUG
+ // E_YM won't reset because it's already been defeated.
+ OSReport("E_YM やられ後なので再セットしません\n");
+#endif
return cPhs_ERROR_e;
}
@@ -1698,47 +3453,47 @@ int daE_YM_c::create() {
shape_angle.z = 0;
shape_angle.x = 0;
- if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)useHeapInit, 0x28B0)) {
+ if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x28B0)) {
return cPhs_ERROR_e;
}
- if (!data_80815D28[0]) {
+ if (!lbl_253_bss_8) {
field_0xaf4 = 1;
- data_80815D28[0] = true;
+ lbl_253_bss_8 = 1;
l_HIO.field_0x4 = -1;
}
field_0x714 = 4;
attention_info.distances[fopAc_attn_BATTLE_e] = 58;
- fopAcM_SetMtx(this, field_0x5b4->getModel()->getBaseTRMtx());
+ fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx());
fopAcM_SetMin(this, -200.0f, -100.0f, -200.0f);
fopAcM_SetMax(this, 200.0f, 100.0f, 200.0f);
- field_0x760.Set(&current.pos, &old.pos, this, 1, &field_0x720, &speed, NULL, NULL);
- field_0x760.OnLineCheck();
- field_0x720.SetWall(30.0f, 60.0f);
+ mAcch.Set(&current.pos, &old.pos, this, 1, &mAcchCir, &speed, NULL, NULL);
+ mAcch.OnLineCheck();
+ mAcchCir.SetWall(30.0f, 60.0f);
health = 10;
field_0x560 = 10;
- field_0x938.Init(100, 0, this);
+ mStts.Init(100, 0, this);
mSphCc.Set(E_YM_n::cc_sph_src);
- mSphCc.SetStts(&field_0x938);
+ mSphCc.SetStts(&mStts);
- field_0x5bc.init(&current.pos, &eyePos, 3, 1);
- field_0x5bc.setEnemyName("E_ym");
- mAtInfo.mpSound = &field_0x5bc;
+ mSound.init(&current.pos, &eyePos, 3, 1);
+ mSound.setEnemyName("E_ym");
+ mAtInfo.mpSound = &mSound;
mAtInfo.mPowerType = 1;
field_0x68c = 0.6f;
switch (mType) {
case 0:
- field_0x670 = current.pos;
+ mPrevPos = current.pos;
setActionMode(ACT_WAIT);
break;
case 1:
checkInitialWall();
- field_0x670 = current.pos;
+ mPrevPos = current.pos;
setActionMode(ACT_WAIT);
break;
case 2:
@@ -1756,20 +3511,20 @@ int daE_YM_c::create() {
if (mpPath != NULL) {
attention_info.distances[fopAc_attn_ETC_e] = 31;
field_0x6a6 = 4;
- field_0x670 = current.pos;
+ mPrevPos = current.pos;
setActionMode(ACT_WAIT);
break;
}
}
mType = 0;
- field_0x670 = current.pos;
+ mPrevPos = current.pos;
setActionMode(ACT_WAIT);
break;
case 5:
if (field_0x6a3 == 0xFF) {
mType = 0;
- field_0x670 = current.pos;
+ mPrevPos = current.pos;
setActionMode(ACT_WAIT);
} else {
if (tmp0 != 0xFF) {
@@ -1814,37 +3569,34 @@ int daE_YM_c::create() {
return phase;
}
-/* 80815224-8081526C 00D1E4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */
-// cM3dGSph::~cM3dGSph() {
-extern "C" void __dt__8cM3dGSphFv() {
- // NONMATCHING
-}
-
-/* 8081526C-808152B4 00D22C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */
-// cM3dGAab::~cM3dGAab() {
-extern "C" void __dt__8cM3dGAabFv() {
- // NONMATCHING
-}
-
-/* 808152B4-80815310 00D274 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */
-// dCcD_GStts::~dCcD_GStts() {
-extern "C" void __dt__10dCcD_GSttsFv() {
- // NONMATCHING
-}
-
-/* 80815310-80815380 00D2D0 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */
-// dBgS_ObjAcch::~dBgS_ObjAcch() {
-extern "C" void __dt__12dBgS_ObjAcchFv() {
- // NONMATCHING
-}
-
-/* 80815380-808153F0 00D340 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */
-// dBgS_AcchCir::~dBgS_AcchCir() {
-extern "C" void __dt__12dBgS_AcchCirFv() {
- // NONMATCHING
-}
-
/* 808153F0-80815410 00D3B0 0020+00 1/0 0/0 0/0 .text daE_YM_Create__FP8daE_YM_c */
static int daE_YM_Create(daE_YM_c* i_this) {
return i_this->create();
}
+
+/* 80815C48-80815C68 -00001 0020+00 1/0 0/0 0/0 .data l_daE_YM_Method */
+static actor_method_class l_daE_YM_Method = {
+ (process_method_func)daE_YM_Create,
+ (process_method_func)daE_YM_Delete,
+ (process_method_func)daE_YM_Execute,
+ (process_method_func)daE_YM_IsDelete,
+ (process_method_func)daE_YM_Draw,
+};
+
+/* 80815C68-80815C98 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_YM */
+extern actor_process_profile_definition g_profile_E_YM = {
+ fpcLy_CURRENT_e, // mLayerID
+ 7, // mListID
+ fpcPi_CURRENT_e, // mListPrio
+ PROC_E_YM, // mProcName
+ &g_fpcLf_Method.base, // sub_method
+ sizeof(daE_YM_c), // mSize
+ 0, // mSizeOther
+ 0, // mParameters
+ &g_fopAc_Method.base, // sub_method
+ 194, // mPriority
+ &l_daE_YM_Method, // sub_method
+ 0x00040100, // mStatus
+ fopAc_ENEMY_e, // mActorType
+ fopAc_CULLBOX_CUSTOM_e, // cullType
+};
diff --git a/src/d/actor/d_a_kago.cpp b/src/d/actor/d_a_kago.cpp
index d42dff0b07..c6131c3ac7 100644
--- a/src/d/actor/d_a_kago.cpp
+++ b/src/d/actor/d_a_kago.cpp
@@ -938,7 +938,7 @@ void daKago_c::endBalloonScore() {
}
/* 8084B088-8084B108 001BC8 0080+00 3/3 0/0 1/1 .text checkNextPath__8daKago_cF4cXyz */
-void daKago_c::checkNextPath(cXyz param_0) {
+f32 daKago_c::checkNextPath(cXyz param_0) {
// NONMATCHING
}