Repository: zeldaret/tww
Pull request #741: D_a_obj_doguu
Author: login: Zeclos
Created: 2025-04-25T19:41:08Z | Merged: 2025-04-25T21:12:32Z



Diff:
diff --git a/configure.py b/configure.py
index 8ce3668e5..ca18d1946 100755
--- a/configure.py
+++ b/configure.py
@@ -1381,7 +1381,7 @@ def MatchingFor(*versions):
     ActorRel(Matching,    "d_a_obj_cafelmp"),
     ActorRel(NonMatching, "d_a_obj_coming"),
     ActorRel(NonMatching, "d_a_obj_demo_barrel"),
-    ActorRel(NonMatching, "d_a_obj_doguu"),
+    ActorRel(Equivalent, "d_a_obj_doguu"), # weak func order
     ActorRel(Matching,    "d_a_obj_doguu_demo"),
     ActorRel(Matching,    "d_a_obj_gryw00", extra_cflags=['-pragma "nosyminline on"']),
     ActorRel(Matching,    "d_a_obj_hfuck1", extra_cflags=['-pragma "nosyminline on"']),
diff --git a/include/d/actor/d_a_obj_doguu.h b/include/d/actor/d_a_obj_doguu.h
index 163f757df..3494e6981 100644
--- a/include/d/actor/d_a_obj_doguu.h
+++ b/include/d/actor/d_a_obj_doguu.h
@@ -1,32 +1,65 @@
 #ifndef D_A_OBJ_DOGUU_H
 #define D_A_OBJ_DOGUU_H
 
-#include "f_op/f_op_actor.h"
+#include "d/d_npc.h"
 
-class daObjDoguu_c : public fopAc_ac_c {
+class daObjDoguu_c : public fopNpc_npc_c {
 public:
+    daObjDoguu_c();
     inline cPhs_State _create();
     inline bool _delete();
     inline bool _draw();
     inline bool _execute();
-    void setEffectMtx(const cXyz*, float); // weak but not inlined?
+    inline void setEffectMtx(const cXyz*, float); // weak but not inlined?
 
     void setPointLight();
-    void CreateHeap();
+    BOOL CreateHeap();
     void CreateInit();
     void set_mtx();
-    void next_msgStatus(unsigned long*);
-    void getMsg();
+    u16 next_msgStatus(unsigned long*);
+    u32 getMsg();
     void setGoal(int);
     void setPlayerAngle(int);
     void setQuake(int);
     void setJDemo(int);
     void privateCut();
-    void getFinishEventCount();
+    int getFinishEventCount();
     void setFinishMyEvent();
 
 public:
-    /* Place member variables here */
-};
+    /* 0x6C4 */ request_of_phase_process_class mPhs;
+    /* 0x6CC */ J3DModel* field_0x6CC;
+    /* 0x6D0 */ J3DModel* field_0x6D0;
+    /* 0x6D4 */ J3DModel* field_0x6D4;
+    /* 0x6D8 */ J3DModel* field_0x6D8;
+    /* 0x6DC */ mDoExt_brkAnm mBrk;
+    /* 0x6F4 */ mDoExt_bckAnm mBckHead;
+    /* 0x704 */ mDoExt_bckAnm mBckBody;
+    /* 0x714 */ mDoExt_bckAnm mBckCrystal;
+    /* 0x724 */ dCcD_Stts mStts;
+    /* 0x760 */ dCcD_Cyl mCyl;
+    /* 0x890 */ u8 mItemNo;
+    /* 0x894 */ int field_0x894;
+    /* 0x898 */ u32 mHead1JntNo;
+    /* 0x89C */ u32 field_0x89C;
+    /* 0x8A0 */ bool field_0x8A0;
+    /* 0x8A1 */ bool field_0x8A1;
+    /* 0x8A2 */ bool field_0x8A2;
+    /* 0x8A3 */ bool field_0x8A3;
+    /* 0x8A4 */ s16 mDoguuDemo1EventIdx;
+    /* 0x8A6 */ s16 mDoguuDemo2EventIdx;
+    /* 0x8A8 */ s16 mDoguuDemo3EventIdx;
+    /* 0x8AA */ s16 mMegamiDemoEventIdx;
+    /* 0x8AC */ int field_0x8AC;
+    /* 0x8B0 */ s8 mActIdx;
+    /* 0x8B4 */ cXyz field_0x8B4;
+    /* 0x8C0 */ int mTimer;
+    /* 0x8C4 */ int field_0x8C4;
+    /* 0x8C8 */ f32 mAllColRatio;
+    /* 0x8CC */ u32 mShape;
+    /* 0x8D0 */ cXyz mPos;
+    /* 0x8DC */ LIGHT_INFLUENCE mLightInfluence;
+    /* 0x8FC */ f32 field_0x8FC;
+};  // Size: 0x900
 
 #endif /* D_A_OBJ_DOGUU_H */
diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h
index 158f888f1..c1719a5a7 100644
--- a/include/m_Do/m_Do_ext.h
+++ b/include/m_Do/m_Do_ext.h
@@ -29,6 +29,7 @@ class mDoExt_baseAnm {
     f32 getPlaySpeed() { return mFrameCtrl->getRate(); }
     void setPlaySpeed(f32 speed) { mFrameCtrl->setRate(speed); }
     BOOL checkFrame(f32 frame) { return mFrameCtrl->checkPass(frame); }
+    f32 getStartFrame() { return mFrameCtrl->getStart(); }
     f32 getFrame() { return mFrameCtrl->getFrame(); }
     f32 getEndFrame() { return mFrameCtrl->getEnd(); }
     void setFrame(f32 frame) { mFrameCtrl->setFrame(frame); }
diff --git a/src/d/actor/d_a_obj_doguu.cpp b/src/d/actor/d_a_obj_doguu.cpp
index 5b44d3695..4fea3b719 100644
--- a/src/d/actor/d_a_obj_doguu.cpp
+++ b/src/d/actor/d_a_obj_doguu.cpp
@@ -5,120 +5,804 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBckHead.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mHead1JntNo = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSBA));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBckBody.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBckCrystal.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, TRUE)){ 
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBckHead.setFrame(mBckHead.getStartFrame());
+        mBckBody.setFrame(mBckBody.getStartFrame());
+        mBckCrystal.setFrame(mBckCrystal.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else if (dComIfGs_isEventBit(0x1480) && dComIfGs_isEventBit(0x1440) && dComIfGs_isEventBit(0x1410)) {
+
+        mBckHead.setFrame(mBckHead.getEndFrame());
+        mBckBody.setFrame(mBckBody.getEndFrame());
+        mBckCrystal.setFrame(mBckCrystal.getEndFrame());
+        field_0x8A0 = true;
+        field_0x8A1 = true;
+        field_0x8A2 = false;
+        field_0x8AC = 14;
+        
+    } else {
+        field_0x8A1 = false;
+        if (
+            (field_0x894 == 0) && dComIfGs_isEventBit(0x1480) ||
+            (field_0x894 == 1 && dComIfGs_isEventBit(0x1440) ||
+            (field_0x894 == 2 && dComIfGs_isEventBit(0x1410)))
+        ) {
+            field_0x8A2 = true;
+            field_0x8A0 = true;
+            field_0x8AC = 10;                   
+        } else {
+            field_0x8A2 = false;
+            field_0x8A0 = false;
+            field_0x8AC = 0;
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mHead1JntNo));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_stack_c::multVecZero(&pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_stack_c::multVecZero(&mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+                break;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBckHead.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBckBody.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBckCrystal.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc(&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    mDoMtx_stack_c::scaleS(scale, scale, 1.0f);
+    MTXConcat(mDoMtx_stack_c::now, mtx_adj, mDoMtx_stack_c::now);
+    MTXConcat(mDoMtx_stack_c::now, reflMtx, mDoMtx_stack_c::now);
+    mDoMtx_stack_c::now[0][3] = 0.0f;
+    mDoMtx_stack_c::now[1][3] = 0.0f;
+    mDoMtx_stack_c::now[2][3] = 0.0f;
+    J3DModelData *modelData = field_0x6D0->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
+    modelData = field_0x6D4->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
 }
 
 /* 00002264-00002288       .text daObjDoguu_Execute__FPv */
-static BOOL daObjDoguu_Execute(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Execute(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_execute();
 }
 
 /* 00002288-000027AC       .text _execute__12daObjDoguu_cFv */
 bool daObjDoguu_c::_execute() {
-    /* Nonmatching */
+    if (field_0x8A3 == 1) {
+        mPos.x = 0.0f;
+        mPos.y = 0.0f;
+        mPos.z = 0.0f;
+        mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+        mDoMtx_stack_c::multVecZero(&mPos);
+        setPointLight();
+    }
+    
+    mCyl.SetC(current.pos);
+    dComIfG_Ccsp()->Set(&mCyl);
+    if (mAllColRatio != 1.0f) {
+        dKy_set_allcol_ratio(mAllColRatio);
+    }
+    
+    switch(field_0x8AC) {
+        case 0:
+            fopAc_ac_c *ac;
+            if (checkItemGet(mItemNo, TRUE) && mCyl.ChkCoHit()) {
+                cCcD_Obj* hitObj = mCyl.GetCoHitObj();
+                if (hitObj != NULL) {
+                    ac = hitObj->GetAc();
+                    if ((ac != NULL) && (fopAcM_GetName(ac) == PROC_PLAYER)) {
+                        mCyl.SetR(50.0f);
+                        fopAcM_orderOtherEventId(this, mDoguuDemo1EventIdx);
+                        field_0x8AC = 1;
+                    }
+                }
+            }
+            break;        
+        case 1:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 2;
+            } else {
+                fopAcM_orderOtherEventId(this, mDoguuDemo1EventIdx);
+            }
+            break;
+        case 2:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo1EventIdx)) {
+            field_0x8AC = 3;
+            }
+            break;
+        case 3:
+            if (getFinishEventCount() == 0) {
+                fopAcM_orderChangeEventId(this, mDoguuDemo2EventIdx, 0, 0xFFFF);
+                field_0x8AC = 4;
+            }
+            else {
+                fopAcM_orderChangeEventId(this, mDoguuDemo3EventIdx, 0, 0xFFFF);
+                field_0x8AC = 7;
+            }
+            break;
+        case 4:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 5;
+            }
+            break;
+        case 5:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo2EventIdx)) {
+                field_0x8AC = 6;
+            }
+            break;
+        case 6:
+            fopAcM_orderChangeEventId(this, mDoguuDemo3EventIdx, 0, 0xFFFF);
+            field_0x8AC = 7;
+            break;
+        case 7:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 8;
+            }
+            break;
+        case 8:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo3EventIdx)) {
+                field_0x8AC = 9;
+            }
+            break;
+        case 9:
+            setFinishMyEvent();
+    
+            if (getFinishEventCount() >= 3) {
+                dComIfGs_onEventBit(0x1e40);
+                fopAcM_orderChangeEventId(this, mMegamiDemoEventIdx, 0, 0xFFFF);
+                field_0x8AC = 11;
+            } else {
+                field_0x8AC = 10;
+                dComIfGp_event_reset();
+            }
+            break;
+        case 10:
+            mCyl.SetR(30.0f);
+            break;
+        case 11:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 12;
+            }
+            break;
+        case 12:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mMegamiDemoEventIdx)) {
+                field_0x8AC = 13;
+            }
+            break;
+        case 14:
+            mCyl.SetR(30.0f);
+            break;
+    }
+    
+    if (!field_0x8A1 && field_0x8A2 == true) {
+        if (mBrk.getFrame() < 1.0f) {
+            fopAcM_seStartCurrent(this, JA_SE_OBJ_SDOLL_EYE_PULSE, 0);
+        }
+        mBrk.play();
+    }
+
+    if(demoActorID != 0){
+        dDemo_actor_c* demo_actor = dComIfGp_demo_getActor(demoActorID);
+        if (demo_actor != NULL) {
+            if (demo_actor->checkEnable(dDemo_actor_c::ENABLE_SHAPE_e)) {
+                mShape = demo_actor->getShapeId();
+            }
+            if (demo_actor->checkEnable(dDemo_actor_c::ENABLE_ROTATE_e)) {
+                current.angle = *demo_actor->getRatate();
+            }
+            if (demo_actor->checkEnable(dDemo_actor_c::ENABLE_TRANS_e)) {
+                current.pos = *demo_actor->getTrans();
+            }
+            if(demo_actor->checkEnable(dDemo_actor_c::ENABLE_ANM_FRAME_e)) {
+                f32 frame = demo_actor->getAnmFrame();
+                mBckHead.setFrame(frame);
+                mBckBody.setFrame(frame);
+                mBckCrystal.setFrame(frame);
+            }
+        }
+        if (mShape == 0) {
+            field_0x8A1 = false;
+        }else {
+            field_0x8A1 = true;
+        }
+    }
+    set_mtx();
+    return true;
 }
 
 /* 000027AC-000027B4       .text daObjDoguu_IsDelete__FPv */
 static BOOL daObjDoguu_IsDelete(void*) {
-    /* Nonmatching */
+    return TRUE;
 }
 
 static actor_method_class daObj_DoguuMethodTable = {


Reviews:
user: login: LagoLunatic
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-25T20:21:59Z
user: login: Zeclos
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-25T20:49:12Z
user: login: Zeclos
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-25T20:49:43Z

Review comments:
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: Missing res enum here
created_at: 2025-04-25T19:59:33Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: Since the asserts show the names of the local variables, the member variables could be renamed to match them. mBckHead, mBckBody, mBckCrystal
created_at: 2025-04-25T20:02:15Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: This could have the joint's name from the string in the member variable
```suggestion
            mHead1JntNo = i;
```
created_at: 2025-04-25T20:04:56Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
    if(!checkItemGet(mItemNo, TRUE)){
```
created_at: 2025-04-25T20:06:30Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    PSMTXScale(mDoMtx_stack_c::now, scale, scale, 1.0f);
+    MTXConcat(mDoMtx_stack_c::now, mtx_adj, mDoMtx_stack_c::now);
+    MTXConcat(mDoMtx_stack_c::now, reflMtx, mDoMtx_stack_c::now);
+    mDoMtx_stack_c::now[0][3] = 0.0f;
+    mDoMtx_stack_c::now[1][3] = 0.0f;
+    mDoMtx_stack_c::now[2][3] = 0.0f;
+    J3DModelData *modelData = field_0x6D0->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
+    modelData = field_0x6D4->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
 }
 
 /* 00002264-00002288       .text daObjDoguu_Execute__FPv */
-static BOOL daObjDoguu_Execute(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Execute(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_execute();
 }
 
 /* 00002288-000027AC       .text _execute__12daObjDoguu_cFv */
 bool daObjDoguu_c::_execute() {
-    /* Nonmatching */
+    if (field_0x8A3 == 1) {
+        mPos.x = 0.0f;
+        mPos.y = 0.0f;
+        mPos.z = 0.0f;
+        mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+        mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+        setPointLight();
+    }
+    
+    mCyl.SetC(current.pos);
+    dComIfG_Ccsp()->Set(&mCyl);
+    if (mAllColRatio != 1.0f) {
+        dKy_set_allcol_ratio(mAllColRatio);
+    }
+    
+    switch(field_0x8AC) {
+        case 0:
+            fopAc_ac_c *ac;
+            if ((checkItemGet(mItemNo, 1) != 0) && mCyl.ChkCoHit()) {
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
            if (checkItemGet(mItemNo, TRUE) && mCyl.ChkCoHit()) {
```
created_at: 2025-04-25T20:07:04Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    PSMTXScale(mDoMtx_stack_c::now, scale, scale, 1.0f);
+    MTXConcat(mDoMtx_stack_c::now, mtx_adj, mDoMtx_stack_c::now);
+    MTXConcat(mDoMtx_stack_c::now, reflMtx, mDoMtx_stack_c::now);
+    mDoMtx_stack_c::now[0][3] = 0.0f;
+    mDoMtx_stack_c::now[1][3] = 0.0f;
+    mDoMtx_stack_c::now[2][3] = 0.0f;
+    J3DModelData *modelData = field_0x6D0->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
+    modelData = field_0x6D4->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
 }
 
 /* 00002264-00002288       .text daObjDoguu_Execute__FPv */
-static BOOL daObjDoguu_Execute(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Execute(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_execute();
 }
 
 /* 00002288-000027AC       .text _execute__12daObjDoguu_cFv */
 bool daObjDoguu_c::_execute() {
-    /* Nonmatching */
+    if (field_0x8A3 == 1) {
+        mPos.x = 0.0f;
+        mPos.y = 0.0f;
+        mPos.z = 0.0f;
+        mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+        mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+        setPointLight();
+    }
+    
+    mCyl.SetC(current.pos);
+    dComIfG_Ccsp()->Set(&mCyl);
+    if (mAllColRatio != 1.0f) {
+        dKy_set_allcol_ratio(mAllColRatio);
+    }
+    
+    switch(field_0x8AC) {
+        case 0:
+            fopAc_ac_c *ac;
+            if ((checkItemGet(mItemNo, 1) != 0) && mCyl.ChkCoHit()) {
+                cCcD_Obj* hitObj = mCyl.GetCoHitObj();
+                if (hitObj != NULL) {
+                    if (hitObj->GetStts() == NULL) {
+                        ac = NULL;
+                    } else {
+                        ac = hitObj->GetStts()->GetActor();
+                    }
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
                    ac = hitObj->GetAc();
```
created_at: 2025-04-25T20:07:55Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    PSMTXScale(mDoMtx_stack_c::now, scale, scale, 1.0f);
+    MTXConcat(mDoMtx_stack_c::now, mtx_adj, mDoMtx_stack_c::now);
+    MTXConcat(mDoMtx_stack_c::now, reflMtx, mDoMtx_stack_c::now);
+    mDoMtx_stack_c::now[0][3] = 0.0f;
+    mDoMtx_stack_c::now[1][3] = 0.0f;
+    mDoMtx_stack_c::now[2][3] = 0.0f;
+    J3DModelData *modelData = field_0x6D0->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
+    modelData = field_0x6D4->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
 }
 
 /* 00002264-00002288       .text daObjDoguu_Execute__FPv */
-static BOOL daObjDoguu_Execute(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Execute(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_execute();
 }
 
 /* 00002288-000027AC       .text _execute__12daObjDoguu_cFv */
 bool daObjDoguu_c::_execute() {
-    /* Nonmatching */
+    if (field_0x8A3 == 1) {
+        mPos.x = 0.0f;
+        mPos.y = 0.0f;
+        mPos.z = 0.0f;
+        mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+        mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+        setPointLight();
+    }
+    
+    mCyl.SetC(current.pos);
+    dComIfG_Ccsp()->Set(&mCyl);
+    if (mAllColRatio != 1.0f) {
+        dKy_set_allcol_ratio(mAllColRatio);
+    }
+    
+    switch(field_0x8AC) {
+        case 0:
+            fopAc_ac_c *ac;
+            if ((checkItemGet(mItemNo, 1) != 0) && mCyl.ChkCoHit()) {
+                cCcD_Obj* hitObj = mCyl.GetCoHitObj();
+                if (hitObj != NULL) {
+                    if (hitObj->GetStts() == NULL) {
+                        ac = NULL;
+                    } else {
+                        ac = hitObj->GetStts()->GetActor();
+                    }
+                    if ((ac != NULL) && (fopAcM_GetName(ac) == PROC_PLAYER)) {
+                        mCyl.SetR(50.0f);
+                        fopAcM_orderOtherEventId(this, mDoguuDemo1EventIdx);
+                        field_0x8AC = 1;
+                    }
+                }
+            }
+            break;        
+        case 1:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 2;
+            } else {
+                fopAcM_orderOtherEventId(this, mDoguuDemo1EventIdx);
+            }
+            break;
+        case 2:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo1EventIdx)) {
+            field_0x8AC = 3;
+            }
+            break;
+        case 3:
+            if (getFinishEventCount() == 0) {
+                fopAcM_orderChangeEventId(this, mDoguuDemo2EventIdx, 0, 0xFFFF);
+                field_0x8AC = 4;
+            }
+            else {
+                fopAcM_orderChangeEventId(this, mDoguuDemo3EventIdx, 0, 0xFFFF);
+                field_0x8AC = 7;
+            }
+            break;
+        case 4:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+            field_0x8AC = 5;
+            }
+            break;
+        case 5:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo2EventIdx)) {
+                field_0x8AC = 6;
+            }
+            break;
+        case 6:
+            fopAcM_orderChangeEventId(this, mDoguuDemo3EventIdx, 0, 0xFFFF);
+            field_0x8AC = 7;
+            break;
+        case 7:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 8;
+            }
+            break;
+        case 8:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo3EventIdx)) {
+                field_0x8AC = 9;
+            }
+            break;
+        case 9:
+            setFinishMyEvent();
+    
+            if (getFinishEventCount() >= 3) {
+                dComIfGs_onEventBit(0x1e40);
+                fopAcM_orderChangeEventId(this, mMegamiDemoEventIdx, 0, 0xFFFF);
+                field_0x8AC = 11;
+            } else {
+                field_0x8AC = 10;
+                dComIfGp_event_reset();
+            }
+            break;
+        case 10:
+            mCyl.SetR(30.0f);
+            break;
+        case 11:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 12;
+            }
+            break;
+        case 12:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mMegamiDemoEventIdx)) {
+                field_0x8AC = 13;
+            }
+            break;
+        case 14:
+            mCyl.SetR(30.0f);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
            mCyl.SetR(30.0f);
            break;
```
created_at: 2025-04-25T20:11:56Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
                doCutEnd = true;
                break;
```
created_at: 2025-04-25T20:12:30Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    PSMTXScale(mDoMtx_stack_c::now, scale, scale, 1.0f);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
    mDoMtx_stack_c::scaleS(scale, scale, 1.0f);
```
created_at: 2025-04-25T20:13:29Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: I think the first cast is unnecessary?
```suggestion
    dKyr_get_vectle_calc(&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
```
created_at: 2025-04-25T20:14:46Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: dComIfGs_isEventBit doesn't return an eventBit, it checks if an eventBit is set. Also, assignments within an if statement is a Ghidra thing and should be avoided unless strictly necessary. Try something like this:
```suggestion
    } else if (
        dComIfGs_isEventBit(0x1480) &&
        dComIfGs_isEventBit(0x1440) &&
        dComIfGs_isEventBit(0x1410)
    ) {
```
created_at: 2025-04-25T20:17:42Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: Same applies here
created_at: 2025-04-25T20:18:35Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
    mDoMtx_stack_c::multVecZero(&pos);
```
created_at: 2025-04-25T20:20:31Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
                    mDoMtx_stack_c::multVecZero(&mPos);
```
created_at: 2025-04-25T20:20:45Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    PSMTXScale(mDoMtx_stack_c::now, scale, scale, 1.0f);
+    MTXConcat(mDoMtx_stack_c::now, mtx_adj, mDoMtx_stack_c::now);
+    MTXConcat(mDoMtx_stack_c::now, reflMtx, mDoMtx_stack_c::now);
+    mDoMtx_stack_c::now[0][3] = 0.0f;
+    mDoMtx_stack_c::now[1][3] = 0.0f;
+    mDoMtx_stack_c::now[2][3] = 0.0f;
+    J3DModelData *modelData = field_0x6D0->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
+    modelData = field_0x6D4->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
 }
 
 /* 00002264-00002288       .text daObjDoguu_Execute__FPv */
-static BOOL daObjDoguu_Execute(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Execute(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_execute();
 }
 
 /* 00002288-000027AC       .text _execute__12daObjDoguu_cFv */
 bool daObjDoguu_c::_execute() {
-    /* Nonmatching */
+    if (field_0x8A3 == 1) {
+        mPos.x = 0.0f;
+        mPos.y = 0.0f;
+        mPos.z = 0.0f;
+        mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+        mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: ```suggestion
        mDoMtx_stack_c::multVecZero(&mPos);
```
created_at: 2025-04-25T20:20:55Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
+    field_0x8B4 = pos;
+    dComIfGp_evmng_setGoal(&field_0x8B4);
 }
 
 /* 00000E98-00000F18       .text setPlayerAngle__12daObjDoguu_cFi */
-void daObjDoguu_c::setPlayerAngle(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setPlayerAngle(int i_staffIdx) {
+    u32 angle = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "angle");
+    daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
+    player->setPlayerPosAndAngle(&player->current.pos, current.angle.y + (s16)angle);
 }
 
 /* 00000F18-00000FB8       .text setQuake__12daObjDoguu_cFi */
-void daObjDoguu_c::setQuake(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setQuake(int i_staffIdx) {
+    // u8 temp[4] = {0x00, 0x10, 0xFF, 0xEE}; // Doesn't match
+    u32 temp2 = 0x0010FFEE;
+    u8* temp = (u8*)&temp2;
+    dComIfGp_getVibration().StartQuake(temp, 0, 63, cXyz(0.0f, 1.0f, 0.0f));
+    mTimer = *dComIfGp_evmng_getMyIntegerP(i_staffIdx, "Timer");
+
 }
 
 /* 00000FB8-0000100C       .text setJDemo__12daObjDoguu_cFi */
 void daObjDoguu_c::setJDemo(int) {
-    /* Nonmatching */
+    dComIfGp_setNextStage("ADMumi", (short)field_0x894, 0, 8);
 }
 
 /* 0000100C-000015A8       .text privateCut__12daObjDoguu_cFv */
 void daObjDoguu_c::privateCut() {
-    /* Nonmatching */
+    static char* cut_name_tbl[] = {
+        "SETGOAL",
+        "SETBALL",
+        "SETANGLE",
+        "EYEFLASH",
+        "MESSAGE_KOKOE",
+        "MESSAGE_OITA",
+        "QUAKE",
+        "JDEMO",
+        "SETLIGHT",
+    };
+
+    int staffIdx = dComIfGp_evmng_getMyStaffId("Doguu");
+    if (staffIdx != -1) {
+        mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
+        if(mActIdx == -1) {
+            dComIfGp_evmng_cutEnd(staffIdx);
+        } else{
+            bool doCutEnd = false;
+            if (dComIfGp_evmng_getIsAddvance(staffIdx)) {
+                switch (mActIdx) {
+                case 0:
+                    setGoal(staffIdx);
+                    break;
+                case 1:
+                    field_0x8A0 = true;
+                    fopAcM_seStartCurrent(this, JA_SE_LK_PUT_PEARL, 0);
+                    break;
+                case 2:
+                    setPlayerAngle(staffIdx);
+                    break;
+                case 3:
+                    field_0x8A2 = true;
+                    break;
+                case 5:
+                    mDoAud_subBgmStart(JA_BGM_GET_PEARL); 
+                    break;
+                case 6:
+                    setQuake(staffIdx);
+                    break;
+                case 7:
+                    setJDemo(staffIdx);
+                    break;
+                case 8:
+                    field_0x8C4 = 0;
+                    break;
+                }
+            }
+            switch (mActIdx) {
+            case 0:
+                doCutEnd = true;
+                break;
+            case 1:
+                doCutEnd = true;
+                break;
+            case 2:
+                doCutEnd = true;
+                break;
+            case 3:
+                doCutEnd = true;
+                break;
+            case 4:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 5:
+                if (talk(1) == fopMsgStts_BOX_CLOSED_e) {
+                    doCutEnd = true;
+                }
+                break;
+            case 6:
+                mTimer--;
+                if (mTimer == 0) {
+                  doCutEnd = true;
+                  dComIfGp_getVibration().StopQuake(63);
+                }
+                break;
+            case 7:
+                doCutEnd = true;
+                break;
+            case 8:
+                int iVar2 = field_0x8C4;
+                if(iVar2 >= 200){
+                    mAllColRatio = 1.0f;
+                    doCutEnd = true;
+                } else {
+                    field_0x8C4++;
+                }
+                iVar2 = field_0x8C4;
+                if (iVar2 < 21) {
+                    mAllColRatio = 1.0f - iVar2 * 0.01875f;
+                } else if (iVar2 < 41) {
+                    mAllColRatio = 0.625f - (iVar2 + -20) * 0.0125f;
+                } else if (iVar2 < 61) {
+                    mAllColRatio = 0.375f - (iVar2 + -40) * 0.00625f;
+                } else if ((iVar2 >= 130) && (iVar2 < 150)) {
+                    mAllColRatio = (iVar2 + -130) * 0.00625f + 0.25f;
+                } else {
+                    if((field_0x8C4 >= 150) && (field_0x8C4 < 170)){
+                        mAllColRatio = (iVar2 + -150) * 0.0125f + 0.375f;
+                    } else if((iVar2 >= 170) && (iVar2 <= 190)){
+                        mAllColRatio = (iVar2 + -170) * 0.01875f + 0.625f;
+                    }
+                }
+
+                if (field_0x8C4 == 40) {
+                    mPos.x = 0.0f;
+                    mPos.y = 0.0f;
+                    mPos.z = 0.0f;
+                    mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+                    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+                    
+                    if (field_0x894 == 0) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8434, &mPos, &current.angle);
+                    } else if (field_0x894 == 1) {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8436, &mPos, &current.angle);
+                    } else {
+                        dComIfGp_particle_set(dPa_name::ID_SCENE_8435, &mPos, &current.angle);
+                    }
+                } else if (field_0x8C4 == 125) {
+                    field_0x8A3 = true;
+                }
+                break;
+            default:
+                doCutEnd = true;
+            }
+            if(doCutEnd){
+                dComIfGp_evmng_cutEnd(staffIdx);
+            } 
+        }
+    }
 }
 
 /* 000015A8-00001630       .text getFinishEventCount__12daObjDoguu_cFv */
-void daObjDoguu_c::getFinishEventCount() {
-    /* Nonmatching */
+int daObjDoguu_c::getFinishEventCount() {
+    int count = 0;
+    if (dComIfGs_isEventBit(0x1480)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1440)) {
+        count += 1;
+    }
+    if (dComIfGs_isEventBit(0x1410)) {
+        count += 1;
+    }
+    return count;
 }
 
+
 /* 00001630-000016A4       .text setFinishMyEvent__12daObjDoguu_cFv */
 void daObjDoguu_c::setFinishMyEvent() {
-    /* Nonmatching */
+    if (field_0x894 == 0) {
+        dComIfGs_onEventBit(0x1480);
+      } else if (field_0x894 == 1) {
+        dComIfGs_onEventBit(0x1440);
+      } else {
+        dComIfGs_onEventBit(0x1410);
+      }
+      return;
 }
 
 /* 000016A4-000016C4       .text daObjDoguu_Create__FPv */
-static cPhs_State daObjDoguu_Create(void*) {
-    /* Nonmatching */
+static cPhs_State daObjDoguu_Create(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_create();
 }
 
+daObjDoguu_c::daObjDoguu_c() {}
+
 /* 000016C4-0000178C       .text _create__12daObjDoguu_cFv */
 cPhs_State daObjDoguu_c::_create() {
-    /* Nonmatching */
+    fopAcM_SetupActor(this, daObjDoguu_c);
+    if(subtype >= 1) {
+        field_0x894 = subtype - 1;
+    } else {
+        field_0x894 = fopAcM_GetParam(this) & 0xFF;
+    }
+    cPhs_State phase_state = dComIfG_resLoad(&mPhs,"Doguu");
+    if (phase_state == cPhs_COMPLEATE_e) {
+        if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)){
+            return cPhs_ERROR_e;
+        } else{
+            CreateInit();
+        }   
+    }
+    return phase_state;
 }
 
+bool daObjDoguu_c::_delete(){
+    dKy_plight_cut(&mLightInfluence);
+    dComIfG_resDelete(&mPhs,"Doguu");
+    return true;
+}
+
+
 /* 00001CC8-00001D0C       .text daObjDoguu_Delete__FPv */
-static BOOL daObjDoguu_Delete(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Delete(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_delete();
 }
 
 /* 00001D0C-00001D30       .text daObjDoguu_Draw__FPv */
-static BOOL daObjDoguu_Draw(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Draw(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_draw();
 }
 
 /* 00001D30-00001F64       .text _draw__12daObjDoguu_cFv */
 bool daObjDoguu_c::_draw() {
-    /* Nonmatching */
+    g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6CC, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D0, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D4, &tevStr);
+    g_env_light.setLightTevColorType(field_0x6D8, &tevStr);
+    
+    setEffectMtx(&eyePos, attr().mScale);
+
+    if(field_0x8A1){
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]);
+        
+        field_0x6D4->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBck1.entry(field_0x6D0->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D0);
+        field_0x6D0->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+
+        mBck2.entry(field_0x6D4->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D4);
+        field_0x6D4->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);
+    } else {
+        J3DMaterialTable* bmt = (J3DMaterialTable*)dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]);
+        field_0x6CC->getModelData()->setMaterialTable(bmt, J3DMatCopyFlag_All);
+        mBrk.entry(field_0x6CC->getModelData());
+        mDoExt_modelUpdateDL(field_0x6CC);
+        field_0x6CC->getModelData()->getMaterialTable().removeTevRegAnimator(mBrk.getBrkAnm());
+    }
+    if (field_0x8A0 == true) {
+        mBck3.entry(field_0x6D8->getModelData());
+        mDoExt_modelUpdateDL(field_0x6D8);
+        field_0x6D8->getModelData()->getJointNodePointer(0)->setMtxCalc(NULL);       
+    }
+    return true;
 }
 
 /* 00001F64-00002264       .text setEffectMtx__12daObjDoguu_cFPC4cXyzf */
-void daObjDoguu_c::setEffectMtx(const cXyz*, float) {
-    /* Nonmatching */
+void daObjDoguu_c::setEffectMtx(const cXyz* i_pos, float i_scale) {
+    static Mtx mtx_adj = { 
+        0.5f, 0.0f, 0.0f, 0.5f,
+        0.0f, -0.5f, 0.0f, 0.5f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+    };
+    
+    float scale = 1.0f /i_scale;
+    camera_class* camera = dCam_getCamera();
+    cXyz lookDir = *i_pos - camera->mLookat.mEye;
+    cXyz lightDir;
+    cXyz refl;
+
+    dKyr_get_vectle_calc((cXyz*)&tevStr.mLightPosWorld, (cXyz*)i_pos, &lightDir);
+
+    C_VECHalfAngle(&lookDir, &lightDir, &refl);
+    Mtx reflMtx;
+    C_MTXLookAt(reflMtx, &cXyz::Zero, &cXyz::BaseY, &refl);
+    PSMTXScale(mDoMtx_stack_c::now, scale, scale, 1.0f);
+    MTXConcat(mDoMtx_stack_c::now, mtx_adj, mDoMtx_stack_c::now);
+    MTXConcat(mDoMtx_stack_c::now, reflMtx, mDoMtx_stack_c::now);
+    mDoMtx_stack_c::now[0][3] = 0.0f;
+    mDoMtx_stack_c::now[1][3] = 0.0f;
+    mDoMtx_stack_c::now[2][3] = 0.0f;
+    J3DModelData *modelData = field_0x6D0->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
+    modelData = field_0x6D4->getModelData();
+    for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
+        J3DMaterial* mat = modelData->getMaterialNodePointer(i);
+        for (u32 j = 0; j < 8; j++) {
+            J3DTexMtx* texMtx = mat->getTexMtx(j);
+            if (texMtx != NULL && texMtx->getTexMtxInfo().mInfo == 10) {
+                texMtx->getTexMtxInfo().setEffectMtx(mDoMtx_stack_c::now);
+            }
+        }
+    }
 }
 
 /* 00002264-00002288       .text daObjDoguu_Execute__FPv */
-static BOOL daObjDoguu_Execute(void*) {
-    /* Nonmatching */
+static BOOL daObjDoguu_Execute(void* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->_execute();
 }
 
 /* 00002288-000027AC       .text _execute__12daObjDoguu_cFv */
 bool daObjDoguu_c::_execute() {
-    /* Nonmatching */
+    if (field_0x8A3 == 1) {
+        mPos.x = 0.0f;
+        mPos.y = 0.0f;
+        mPos.z = 0.0f;
+        mDoMtx_stack_c::copy(field_0x6D8->getAnmMtx(field_0x89C));
+        mDoMtx_multVecZero(mDoMtx_stack_c::get(), &mPos);
+        setPointLight();
+    }
+    
+    mCyl.SetC(current.pos);
+    dComIfG_Ccsp()->Set(&mCyl);
+    if (mAllColRatio != 1.0f) {
+        dKy_set_allcol_ratio(mAllColRatio);
+    }
+    
+    switch(field_0x8AC) {
+        case 0:
+            fopAc_ac_c *ac;
+            if ((checkItemGet(mItemNo, 1) != 0) && mCyl.ChkCoHit()) {
+                cCcD_Obj* hitObj = mCyl.GetCoHitObj();
+                if (hitObj != NULL) {
+                    if (hitObj->GetStts() == NULL) {
+                        ac = NULL;
+                    } else {
+                        ac = hitObj->GetStts()->GetActor();
+                    }
+                    if ((ac != NULL) && (fopAcM_GetName(ac) == PROC_PLAYER)) {
+                        mCyl.SetR(50.0f);
+                        fopAcM_orderOtherEventId(this, mDoguuDemo1EventIdx);
+                        field_0x8AC = 1;
+                    }
+                }
+            }
+            break;        
+        case 1:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+                field_0x8AC = 2;
+            } else {
+                fopAcM_orderOtherEventId(this, mDoguuDemo1EventIdx);
+            }
+            break;
+        case 2:
+            privateCut();
+            if (dComIfGp_evmng_endCheck(mDoguuDemo1EventIdx)) {
+            field_0x8AC = 3;
+            }
+            break;
+        case 3:
+            if (getFinishEventCount() == 0) {
+                fopAcM_orderChangeEventId(this, mDoguuDemo2EventIdx, 0, 0xFFFF);
+                field_0x8AC = 4;
+            }
+            else {
+                fopAcM_orderChangeEventId(this, mDoguuDemo3EventIdx, 0, 0xFFFF);
+                field_0x8AC = 7;
+            }
+            break;
+        case 4:
+            if(eventInfo.mCommand == dEvtCmd_INDEMO_e){
+            field_0x8AC = 5;
path: src/d/actor/d_a_obj_doguu.cpp
user: login: LagoLunatic
body: Indentation
created_at: 2025-04-25T20:21:21Z
author_association: COLLABORATOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: Zeclos
body: this gives undefined identifier 'mDoMtx_stack_c::mDoMtx_multVecZero',
also havent seen mDoMtx_multVecZero get applied like that any other time when i search through vscode
created_at: 2025-04-25T20:49:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -5,120 +5,811 @@
 
 #include "d/actor/d_a_obj_doguu.h"
 #include "d/d_procname.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_item.h"
+#include "d/res/res_doguu.h"
+#include "d/actor/d_a_player.h"
+#include "f_op/f_op_camera.h"
+#include "d/d_kankyo_rain.h"
+
+static dCcD_SrcCyl l_cyl_src = {
+    // dCcD_SrcGObjInf
+    {
+        /* Flags             */ 0,
+        /* SrcObjAt  Type    */ 0,
+        /* SrcObjAt  Atp     */ 0,
+        /* SrcObjAt  SPrm    */ 0,
+        /* SrcObjTg  Type    */ 0,
+        /* SrcObjTg  SPrm    */ 0,
+        /* SrcObjCo  SPrm    */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e,
+        /* SrcGObjAt Se      */ 0,
+        /* SrcGObjAt HitMark */ 0,
+        /* SrcGObjAt Spl     */ 0,
+        /* SrcGObjAt Mtrl    */ 0,
+        /* SrcGObjAt SPrm    */ 0,
+        /* SrcGObjTg Se      */ 0,
+        /* SrcGObjTg HitMark */ 0,
+        /* SrcGObjTg Spl     */ 0,
+        /* SrcGObjTg Mtrl    */ 0,
+        /* SrcGObjTg SPrm    */ cCcD_TgSPrm_IsPlayer_e,
+        /* SrcGObjCo SPrm    */ 0,
+    },
+    // cCcD_SrcCylAttr
+    {
+        /* Center */ 0.0f, 0.0f, 0.0f,
+        /* Radius */ 200.0f,
+        /* Height */ 200.0f,
+    }
+};
+const struct {
+    int bmt_vgsm[3];
+    int bmt_vgsb[3];
+    int bck[3];
+    int brk[3];
+    int bdl_vgsh[3];
+    int bdl_vgsp[3];
+} daObjDoguu_idx_table = {
+    DOGUU_BMT_VGSMD, DOGUU_BMT_VGSMF, DOGUU_BMT_VGSMN,
+    DOGUU_BMT_VGSBD, DOGUU_BMT_VGSBF, DOGUU_BMT_VGSBN,
+    DOGUU_BCK_VGSHD, DOGUU_BCK_VGSHF, DOGUU_BCK_VGSHN,
+    DOGUU_BRK_VGSMD, DOGUU_BRK_VGSMF, DOGUU_BRK_VGSMN,
+    DOGUU_BDL_VGSHD, DOGUU_BDL_VGSHF, DOGUU_BDL_VGSHN,
+    DOGUU_BDL_VGSPD, DOGUU_BDL_VGSPF, DOGUU_BDL_VGSPN
+};
+
+namespace {
+    struct Attr_c {
+        /* 0x00 */ float mScale;
+        /* 0x04 */ float mOffsetEyePos;
+    };
+
+    static const Attr_c L_attr = {
+        0.5f, 125.0f,
+    };
+
+    inline const Attr_c& attr() { return L_attr; }
+}
+
 
 /* 00000078-00000168       .text setPointLight__12daObjDoguu_cFv */
 void daObjDoguu_c::setPointLight() {
-    /* Nonmatching */
+    static const s16 light_color[3][3] = {
+        {0x00C8, 0x0032, 0x0032},
+        {0x0032, 0x00C8, 0x0032},
+        {0x0032, 0x0032, 0x00C8},
+    };
+    cLib_addCalc2(&field_0x8FC, cM_rndF(0.1f)+ 1.0f,0.5f,0.05f);
+    mLightInfluence.mPos = mPos;
+    mLightInfluence.mColor.r = light_color[field_0x894][0];
+    mLightInfluence.mColor.g = light_color[field_0x894][1];
+    mLightInfluence.mColor.b = light_color[field_0x894][2];
+    mLightInfluence.mPower = (s16)(field_0x8FC * 300.0f);
+    mLightInfluence.mFluctuation = 100.0f;
 }
 
 /* 00000168-00000188       .text CheckCreateHeap__FP10fopAc_ac_c */
-static BOOL CheckCreateHeap(fopAc_ac_c*) {
-    /* Nonmatching */
+static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
+    return static_cast<daObjDoguu_c*>(i_this)->CreateHeap();
 }
 
 /* 00000188-000007D0       .text CreateHeap__12daObjDoguu_cFv */
-void daObjDoguu_c::CreateHeap() {
-    /* Nonmatching */
+BOOL daObjDoguu_c::CreateHeap() {
+    J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSMA));
+    JUT_ASSERT(0x160, modelData != NULL);
+    
+    J3DMaterialTable* bmt = static_cast<J3DMaterialTable*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsm[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6CC = mDoExt_J3DModel__create(modelData, 0x80000, 0x15220202);
+
+    if (field_0x6CC == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTevRegKey* brk_doguu = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.brk[field_0x894]));
+    JUT_ASSERT(0x170, brk_doguu != NULL);
+    
+    if (mBrk.init(modelData, brk_doguu, true, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false, 0) == 0) {
+      return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsh[field_0x894]));
+    JUT_ASSERT(0x177, modelData != NULL);
+    field_0x6D0 =  mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D0 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_head = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bck[field_0x894]));
+    JUT_ASSERT(0x17D, bck_head != NULL);
+    
+    if (mBck1.init(modelData, bck_head, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+        return FALSE;
+    }
+
+    J3DSkinDeform* deform = new J3DSkinDeform();
+
+    if (deform){
+        field_0x6D0->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+    
+    modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Doguu", DOGUU_BDL_VGSBA));
+    JUT_ASSERT(0x18f, modelData != NULL);
+    bmt =  static_cast<J3DMaterialTable *>(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bmt_vgsb[field_0x894]));
+    modelData->setMaterialTable(bmt, J3DMatCopyFlag_All);
+    field_0x6D4 = mDoExt_J3DModel__create(modelData, 0x80000,0x15220202);
+    
+    if (field_0x6D4 == NULL) {
+      return FALSE;
+    }
+    
+    JUTNameTab* nameTable = field_0x6D4->getModelData()->getJointName();
+    
+    for (u16 i = 0; i < field_0x6D4->getModelData()->getJointNum(); i++) {
+        const char* name = nameTable->getName(i);
+        if (strcmp("head1", name) == 0) {
+            mJointIdx = i;
+            break;
+        }
+    }
+    
+    J3DAnmTransform* bck_body = static_cast<J3DAnmTransform *>(dComIfG_getObjectRes("Doguu", 6));
+    JUT_ASSERT(0x1AB, bck_body != NULL);
+    
+    if (mBck2.init(modelData, bck_body, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0) {
+      return FALSE;
+    }
+
+    deform = new J3DSkinDeform();
+
+    if(deform) {
+        field_0x6D4->setSkinDeform(deform, 1);
+    } else {
+        return FALSE;
+    }
+
+    modelData = (J3DModelData*)(dComIfG_getObjectRes("Doguu", daObjDoguu_idx_table.bdl_vgsp[field_0x894]));
+    JUT_ASSERT(0x1bd, modelData != NULL);
+    field_0x6D8 = mDoExt_J3DModel__create(modelData, 0,0x11020203);
+
+    if (field_0x6D8 == NULL) {
+        return FALSE;
+    }
+
+    J3DAnmTransform* bck_crystal = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Doguu", DOGUU_BCK_VGSPA));
+    JUT_ASSERT(0x1c3, bck_crystal != NULL);
+    
+    if(mBck3.init(modelData, bck_crystal, true, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false) == 0){
+        return FALSE;
+    } else{
+        field_0x89C = 1;
+        return TRUE;
+    }
 }
 
 /* 000007D0-00000B80       .text CreateInit__12daObjDoguu_cFv */
 void daObjDoguu_c::CreateInit() {
-    /* Nonmatching */
+    
+
+    cullMtx = field_0x6CC->getBaseTRMtx();
+    fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 400.0f, 600.0f);
+    fopAcM_setCullSizeFar(this, 1.0f);
+    if (field_0x894 == 0){
+        mItemNo = dItem_PEARL_DIN_e;
+    } else if(field_0x894 == 1) {
+        mItemNo = dItem_PEARL_FARORE_e;
+    } else{
+        mItemNo = dItem_PEARL_NAYRU_e;
+    }
+    mStts.Init(0xff, 0xff, this);
+    mCyl.Set(l_cyl_src);
+    if(!checkItemGet(mItemNo, 1)){
+        mCyl.SetR(50.f);
+    }
+    mCyl.SetStts(&mStts);
+    dKy_plight_set(&mLightInfluence);
+    if (subtype >= 1) {
+        mBck1.setFrame(mBck1.getStartFrame());
+        mBck2.setFrame(mBck2.getStartFrame());
+        mBck3.setFrame(mBck3.getStartFrame());
+
+        field_0x8A0 = true;
+        field_0x8A1 = false;
+        field_0x8A2 = true;
+        field_0x8AC = 14;
+    } else {
+        int eventBit = dComIfGs_isEventBit(0x1480);
+        if ((eventBit != false) && (eventBit = dComIfGs_isEventBit(0x1440),
+            eventBit != 0) && (eventBit = dComIfGs_isEventBit(0x1410),
+            eventBit != 0)) {
+        
+            mBck1.setFrame(mBck1.getEndFrame());
+            mBck2.setFrame(mBck2.getEndFrame());
+            mBck3.setFrame(mBck3.getEndFrame());
+            field_0x8A0 = true;
+            field_0x8A1 = true;
+            field_0x8A2 = false;
+            field_0x8AC = 14;
+        
+        } else {
+            field_0x8A1 = false;
+            if (((field_0x894 == 0) && (eventBit = dComIfGs_isEventBit(0x1480), eventBit != 0)) ||
+            (field_0x894 == 1 && (eventBit = dComIfGs_isEventBit(0x1440),
+             eventBit != 0)) || (field_0x894 == 2 && (eventBit = dComIfGs_isEventBit(0x1410),
+             eventBit != 0))){
+                field_0x8A2 = true;
+                field_0x8A0 = true;
+                field_0x8AC = 10;                   
+             }
+             else {
+                field_0x8A2 = false;
+                field_0x8A0 = false;
+                field_0x8AC = 0;
+             }
+        }
+    }
+    eyePos.y += attr().mOffsetEyePos;
+    set_mtx();
+
+    mDoguuDemo1EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO1", 0xff);
+    mDoguuDemo2EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO2", 0xff);
+    mDoguuDemo3EventIdx = dComIfGp_evmng_getEventIdx("DOGUU_DEMO3", 0xff);
+    mMegamiDemoEventIdx = dComIfGp_evmng_getEventIdx("MEGAMI_DEMO", 0xff);
+    field_0x8FC = 1.0f;
+    if (field_0x8A0 == true) {
+        field_0x8A3 = true;
+    } else {
+        field_0x8A3 = false;
+    }
+    mAllColRatio = 1.0f;
 }
 
 /* 00000B80-00000CEC       .text set_mtx__12daObjDoguu_cFv */
 void daObjDoguu_c::set_mtx() {
-    /* Nonmatching */
+    field_0x6CC->setBaseScale(scale);
+    field_0x6D4->setBaseScale(scale);
+    field_0x6D8->setBaseScale(scale);
+    field_0x6D0->setBaseScale(scale);
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6CC->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D4->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    field_0x6D8->setBaseTRMtx(mDoMtx_stack_c::get());
+
+    field_0x6D0->setBaseTRMtx(field_0x6D4->getAnmMtx(mJointIdx));
 }
 
 /* 00000CEC-00000D80       .text next_msgStatus__12daObjDoguu_cFPUl */
-void daObjDoguu_c::next_msgStatus(unsigned long*) {
-    /* Nonmatching */
+u16 daObjDoguu_c::next_msgStatus(u32* pMsgNo) {
+    u16 message_status = fopMsgStts_MSG_CONTINUES_e;
+    switch (*pMsgNo) {
+        case 3822:
+        case 3823:
+        case 3824:
+            if (getFinishEventCount() == 0) {
+                *pMsgNo = 3825;
+            } else if (getFinishEventCount() == 1) {
+                *pMsgNo = 3826;
+            } else {
+                message_status = fopMsgStts_MSG_ENDS_e;
+            }
+            break;
+
+        default:
+            message_status = fopMsgStts_MSG_ENDS_e;
+            break;
+    }
+    return message_status;
 }
 
 /* 00000D80-00000DBC       .text getMsg__12daObjDoguu_cFv */
-void daObjDoguu_c::getMsg() {
-    /* Nonmatching */
+u32 daObjDoguu_c::getMsg() {
+    if (mActIdx == 4) {
+        return 3821;
+    }
+    if (field_0x894 == 0) {
+        return 3822;
+    }
+    if(field_0x894 == 1){
+        return 3823;
+    } else{
+        return 3824;
+    }
 }
 
 /* 00000DBC-00000E98       .text setGoal__12daObjDoguu_cFi */
-void daObjDoguu_c::setGoal(int) {
-    /* Nonmatching */
+void daObjDoguu_c::setGoal(int i_staffIdx) {
+    cXyz pos = *dComIfGp_evmng_getMyXyzP(i_staffIdx, "Posion");
+
+    mDoMtx_stack_c::transS(current.pos);
+    mDoMtx_stack_c::YrotM(current.angle.y);
+    mDoMtx_stack_c::transM(pos.x, pos.y,  pos.z);
+
+    mDoMtx_multVecZero(mDoMtx_stack_c::get(), &pos);
path: src/d/actor/d_a_obj_doguu.cpp
user: login: Zeclos
body: wait nevermind im dumb
created_at: 2025-04-25T20:49:43Z
author_association: CONTRIBUTOR

PR comments:
user: login: decomp-dev[bot]
created_at: 2025-04-25T19:46:30Z
body: ### Report for GZLE01 (168b10e - 2f3f547)

📈 **Matched code**: 37.50% (+0.13%, +10332 bytes)

✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | CheckCreateHeap(fopAc_ac_c*)` +28 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Create(void*)` +28 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Delete(void*)` +65 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Draw(void*)` +33 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Execute(void*)` +33 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_IsDelete(void*)` +4 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setPointLight()` +237 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::CreateHeap()` +1605 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::CreateInit()` +940 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::set_mtx()` +360 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::next_msgStatus(unsigned long*)` +144 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::getMsg()` +57 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setGoal(int)` +216 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setPlayerAngle(int)` +124 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setQuake(int)` +156 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setJDemo(int)` +81 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::privateCut()` +1433 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::getFinishEventCount()` +133 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setFinishMyEvent()` +113 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::_create()` +200 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::daObjDoguu_c()` +532 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_bckAnm::~mDoExt_bckAnm()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_brkAnm::~mDoExt_brkAnm()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_baseAnm::~mDoExt_baseAnm()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | dCcD_Cyl::~dCcD_Cyl()` +204 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cM3dGCyl::~cM3dGCyl()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cCcD_ShapeAttr::~cCcD_ShapeAttr()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cM3dGAab::~cM3dGAab()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | dBgS_ObjAcch::~dBgS_ObjAcch()` +112 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::_draw()` +564 bytes -> 100.00%
...and 25 more items

author_association: NONE
user: login: decomp-dev[bot]
created_at: 2025-04-25T19:46:31Z
body: ### Report for GZLJ01 (168b10e - 2f3f547)

📈 **Matched code**: 36.45% (+0.13%, +10328 bytes)

✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | CheckCreateHeap(fopAc_ac_c*)` +28 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Create(void*)` +28 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Delete(void*)` +65 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Draw(void*)` +33 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Execute(void*)` +33 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_IsDelete(void*)` +4 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setPointLight()` +237 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::CreateHeap()` +1605 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::CreateInit()` +940 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::set_mtx()` +360 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::next_msgStatus(unsigned long*)` +144 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::getMsg()` +57 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setGoal(int)` +216 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setPlayerAngle(int)` +124 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setQuake(int)` +156 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setJDemo(int)` +81 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::privateCut()` +1433 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::getFinishEventCount()` +133 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setFinishMyEvent()` +113 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::_create()` +200 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::daObjDoguu_c()` +532 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_bckAnm::~mDoExt_bckAnm()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_brkAnm::~mDoExt_brkAnm()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_baseAnm::~mDoExt_baseAnm()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | dCcD_Cyl::~dCcD_Cyl()` +204 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cM3dGCyl::~cM3dGCyl()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cCcD_ShapeAttr::~cCcD_ShapeAttr()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cM3dGAab::~cM3dGAab()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | dBgS_ObjAcch::~dBgS_ObjAcch()` +112 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::_draw()` +564 bytes -> 100.00%
...and 25 more items

author_association: NONE
user: login: decomp-dev[bot]
created_at: 2025-04-25T19:46:32Z
body: ### Report for GZLP01 (168b10e - 2f3f547)

📈 **Matched code**: 37.09% (+0.13%, +10332 bytes)

✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | CheckCreateHeap(fopAc_ac_c*)` +28 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Create(void*)` +28 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Delete(void*)` +65 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Draw(void*)` +33 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_Execute(void*)` +33 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_IsDelete(void*)` +4 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setPointLight()` +237 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::CreateHeap()` +1605 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::CreateInit()` +940 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::set_mtx()` +360 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::next_msgStatus(unsigned long*)` +144 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::getMsg()` +57 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setGoal(int)` +216 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setPlayerAngle(int)` +124 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setQuake(int)` +156 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setJDemo(int)` +81 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::privateCut()` +1433 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::getFinishEventCount()` +133 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::setFinishMyEvent()` +113 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::_create()` +200 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::daObjDoguu_c()` +532 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_bckAnm::~mDoExt_bckAnm()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_brkAnm::~mDoExt_brkAnm()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | mDoExt_baseAnm::~mDoExt_baseAnm()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | dCcD_Cyl::~dCcD_Cyl()` +204 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cM3dGCyl::~cM3dGCyl()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cCcD_ShapeAttr::~cCcD_ShapeAttr()` +92 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | cM3dGAab::~cM3dGAab()` +72 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | dBgS_ObjAcch::~dBgS_ObjAcch()` +112 bytes -> 100.00%
✅ `d_a_obj_doguu/d/actor/d_a_obj_doguu | daObjDoguu_c::_draw()` +564 bytes -> 100.00%
...and 25 more items

author_association: NONE