// // Generated by dtk // Translation Unit: d_a_agbsw0.cpp // #include "global.h" #include "d/d_procname.h" // need to figure out what's putting this data in front of a bunch of rels with the compiler-generated symbol names static f32 dummy[3] = {1.0f, 1.0f, 1.0f}; static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; static f64 dummy4[2] = {3.0, 0.5}; #include "d/actor/d_a_agbsw0.h" #include "f_op/f_op_actor_mng.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" #include "d/d_item_data.h" #include "d/d_map.h" #include "d/d_kankyo_wether.h" #include "d/actor/d_a_agb.h" #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_bomb.h" #include "m_Do/m_Do_gba_com.h" #include "d/actor/d_a_ghostship.h" #include "d/actor/d_a_npc_os.h" #include "d/actor/d_a_npc_md.h" #include "d/actor/d_a_npc_cb1.h" static dCcD_SrcCyl l_cyl_src = { // dCcD_SrcGObjInf { /* Flags */ 0, /* SrcObjAt Type */ 0, /* SrcObjAt Atp */ 0, /* SrcObjAt SPrm */ 0, /* SrcObjTg Type */ AT_TYPE_BOMB, /* SrcObjTg SPrm */ TG_SPRM_SET | TG_SPRM_IS_OTHER, /* SrcObjCo SPrm */ 0, /* 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 */ G_TG_SPRM_NO_HIT_MARK, /* SrcGObjCo SPrm */ 0, }, // cM3dGCylS { /* Center */ 0.0f, 0.0f, 0.0f, /* Radius */ 100.0f, /* Height */ 100.0f, }, }; /* 00004838-00004B2C .text draw__10daAgbsw0_cFv */ BOOL daAgbsw0_c::draw() { u8 toCheck = getSw0(); u8 behavior = getType(); s16 condition = getParamNo(); if(!mDoGaC_GbaLink()) { return true; } if(behavior == 3) { if(toCheck != 0xFF) { if(condition == 0) { if(!fopAcM_isSwitch(this, toCheck)) { return 1; } } else { if(fopAcM_isSwitch(this, toCheck)) { return true; } } } if(MoveCheck(condition)) { return true; } } else { if(behavior == 2) { if(toCheck != 0xFF && !fopAcM_isSwitch(this, toCheck)) { return true; } } else if (behavior == 9) { if(toCheck != 0xFF && fopAcM_isSwitch(this, toCheck)) { return true; } } else if(behavior == 0xD) { if(!dComIfGs_checkGetItem(dItem_SKULL_HAMMER_e) || dComIfGs_isEventBit(0x2D01)) { return true; } } else if(behavior == 0xE) { if(!dComIfGs_isEventBit(0x1820) || dComIfGs_getTriforceNum() == 8) { return true; } } else { return true; } } if(behavior == 3 || (behavior == 9 && field_0x299 == 1)) { s8 roomNo = fopAcM_GetHomeRoomNo(this); dMap_drawPoint(7, current.pos.x, current.pos.y, current.pos.z, roomNo, -0x8000, 0, 0, 0); } else if(behavior == 2 || behavior == 0xD || behavior == 0xE) { u8 iconType; s32 iconRot; u8 temp; if(condition == 0) { iconType = 8; iconRot = 0x8000; temp = 0; } else if(condition <= 8) { iconType = 9; iconRot = (u16)((4 - (condition - 1)) * 0x2000); temp = 0; } else if(condition < 0x19) { iconType = 10; iconRot = 0x8000; temp = condition - 9; } else if(condition == 0x22) { iconType = 0x15; iconRot = 0x8000; temp = 0; } else { iconType = 0xB; iconRot = 0x8000; temp = 0; } s8 roomNo = fopAcM_GetHomeRoomNo(this); dMap_drawPoint(iconType, current.pos.x, current.pos.y, current.pos.z, roomNo, iconRot, temp, 0, 0); } return true; } /* 00004F80-00005458 .text create__10daAgbsw0_cFv */ int daAgbsw0_c::create() { u8 behavior = current.angle.z & 0xFF; u8 condition = getSw0(); s16 xRot = getParamNo(); s32 xRot2 = xRot; if(behavior == 9) { if(xRot < 0 && -3 <= xRot2) { behavior = 0xA; current.angle.z = 0x000A; current.angle.x = -xRot; } } else if(behavior == 2) { if(0x1A <= xRot && xRot2 < 0x22) { behavior = 0xD; current.angle.z = 0x000D; current.angle.x = xRot + -0x19; } else if(xRot2 == 0x22) { behavior = 0xE; current.angle.z = 0x000E; } } if(behavior == 1) { if(condition < 0x20 && getParamNo() && dComIfGs_isTbox(condition)) { return cPhs_ERROR_e; } } else if(behavior == 0xA) { if(((xRot2 == 1 || xRot2 == 3) && condition != 0xFF && fopAcM_isSwitch(this, condition)) || xRot2 == 2 && condition < 0x20 && dComIfGs_isTbox(condition)) { return cPhs_ERROR_e; } } else if(behavior == 0xB) { u8 activated = getSw1(); if((activated == 0xFF || (condition != 0xFF && fopAcM_isSwitch(this, condition))) || (activated != 0xFF && fopAcM_isSwitch(this, activated))) { return cPhs_ERROR_e; } } else if(behavior == 0x6 || behavior == 0x8 || behavior == 9) { if(condition == 0xFF || (condition != 0xFF && fopAcM_isSwitch(this, condition))) { return cPhs_ERROR_e; } } else if(behavior == 0xD) { if(dComIfGs_isEventBit(0x2D01)) { return cPhs_ERROR_e; } } else if(behavior == 0xE) { if(dComIfGs_getTriforceNum() == 8) { return cPhs_ERROR_e; } } else if(behavior != 0x2 && behavior != 0x7) { if(condition != 0xFF && getParamNo() != 0 && fopAcM_isSwitch(this, condition)) { return cPhs_ERROR_e; } } if(behavior == 0xA && getMsgNo() == 0xFFFF) { fopAcM_SetParam(this, fopAcM_GetParam(this) & 0xFFFF0000 | 0xE); } if(behavior != 0x7 && behavior != 0x6 && behavior != 0x8 && behavior != 0xE && getMsgNo() == 0xFFFF) { return cPhs_ERROR_e; } else { if((behavior == 0x9 || behavior == 0xB) && (xRot < 0 || 0x1E < xRot2 || (u32)(xRot2 - 7 & 0xFFFF) <= 1 || xRot2 == 0x15)) { return cPhs_ERROR_e; } else { if(scale.x == scale.z) { mNonCircular = false; } else { mNonCircular = true; } if(behavior == 8) { scale.x *= 8000.0f; scale.y *= 8000.0f; scale.z *= 8000.0f; } else { scale.x *= 200.0f; scale.y *= 200.0f; scale.z *= 200.0f; } mOrigScaleX = scale.x; mOrigScaleZ = scale.z; shape_angle.x = 0; shape_angle.y = current.angle.y; shape_angle.z = 0; field_0x298 = 0; field_0x299 = 0; mTimer = 0; l_cyl_src.mCylAttr.mCyl.mRadius = scale.x; l_cyl_src.mCylAttr.mCyl.mHeight = scale.y; mStts.Init(0, 0xFF, this); mCyl.Set(l_cyl_src); mCyl.SetC(current.pos); mCyl.SetStts(&mStts); if(behavior == 0x8) { if(0 < xRot) { mTimer = xRot2 * 30 & 0xFFFF; } } else if(behavior == 0xA && xRot2 == 4) { field_0x299 = 1; mTimer = 1; } } } return cPhs_COMPLEATE_e; } BOOL daAgbsw0_c::execute() { typedef BOOL (daAgbsw0_c::*exeSubFunc)(); static exeSubFunc ExeSubTable[] = { &daAgbsw0_c::ExeSubA, &daAgbsw0_c::ExeSubAT, &daAgbsw0_c::ExeSubM, &daAgbsw0_c::ExeSubA2, &daAgbsw0_c::ExeSubF2, &daAgbsw0_c::ExeSubF, &daAgbsw0_c::ExeSubT, &daAgbsw0_c::ExeSubMW, &daAgbsw0_c::ExeSubS, &daAgbsw0_c::ExeSubR, &daAgbsw0_c::ExeSubB, &daAgbsw0_c::ExeSubD, &daAgbsw0_c::ExeSubFA, &daAgbsw0_c::ExeSubM2, &daAgbsw0_c::ExeSubM3 }; return (this->*ExeSubTable[current.angle.z & 0xFF])(); } agb_mail_struct daAgbsw0_c::mMail; u32 daAgbsw0_c::mSE; /* 00000078-00000344 .text ExeSubA__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubA() { u32 sw = getSw0(); s16 condition = getParamNo(); if(sw != 0xFF) { if(condition == 0) { if(!fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { #if VERSION == VERSION_JPN if(mDoGac_SendStatusCheck(5)) { #else if(!mDoGac_SendStatusCheck(5)) { #endif return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } return true; } } else { if(fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } } } if(MoveCheck(condition)) { #if VERSION != VERSION_JPN if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return 1; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } #endif return true; } if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && (agb->isFree() || agb->getFollowTarget() != 1) && HitCheck(agb)) { u32 param = fopAcM_GetParam(this); MailSend(BigLittleChange(getMsgNo()) >> 0x10, 1, getSw1(), 0xFF, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } return true; } /* 00000344-0000066C .text ExeSubAT__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubAT() { u32 flag = getSw0(); s16 condition = getParamNo(); if(flag < 0x20) { if(condition == 0) { if(!dComIfGs_isTbox(flag)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { #if VERSION == VERSION_JPN if(mDoGac_SendStatusCheck(5)) { #else if(!mDoGac_SendStatusCheck(5)) { #endif return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } return true; } } else { if(dComIfGs_isTbox(flag)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } } if(MoveCheck(condition)) { return true; } } else if(dComIfGs_isOceanSvBit(fopAcM_GetHomeRoomNo(this), 0xF)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return 1; } MailSend(-1, 0, 0xFF, 0xFF, 0); } } fopAcM_delete(this); return true; } if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && (agb->isFree() || agb->getFollowTarget() != 1) && HitCheck(agb)) { if(flag < 0x20) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 2, getSw1(), 0xFF, 0); } else { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 2, 0xFF, 0xFF, 0); } field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } return true; } /* 0000066C-00000940 .text ExeSubA2__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubA2() { u32 sw = getSw0(); s16 condition = getParamNo(); if(sw != 0xFF) { if(condition == 0) { if(!fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } return true; } } else { if(fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } } } if(MoveCheck(condition)) { #if VERSION != VERSION_JPN if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return 1; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } #endif return true; } else { if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && (agb->isFree() || agb->getFollowTarget() == 0) && HitCheck(agb)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 4, getSw1(), sw, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } } return true; } /* 00000940-00000AB4 .text ExeSubF__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubF() { u32 sw = getSw0(); s16 condition = getParamNo(); if(sw != 0xFF) { if(condition == 0) { if(!fopAcM_isSwitch(this, sw)) { return true; } } else { if(fopAcM_isSwitch(this, sw)) { fopAcM_delete(this); return true; } } } else { fopAcM_delete(this); return true; } if(MoveCheck(condition)) { return true; } if(mDoGaC_GbaLink() && mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && agb->isActive() && !agb->isFree() && agb->getFollowTarget() == 0 && HitCheck(agb)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 6, getSw1(), sw, 0); } } return true; } /* 00000AB4-00000E48 .text ExeSubF2__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubF2() { u32 sw = getSw0(); s16 condition = getParamNo(); daAgb_c* agb = dComIfGp_getAgb(); if(sw != 0xFF) { if(condition == 0) { if(!fopAcM_isSwitch(this, sw)) { return true; } } else { if(fopAcM_isSwitch(this, sw)) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } fopAcM_delete(this); return true; } } } else { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } fopAcM_delete(this); return true; } if(MoveCheck(condition)) { return true; } if(mDoGaC_GbaLink() && mDoGac_SendStatusCheck(5) && agb) { fopAc_ac_c* player = dComIfGp_getPlayer(0); if(field_0x299 == 0) { if(agb->isActive() && !agb->isFree() && agb->getFollowTarget() == 0 && HitCheck(agb)) { MailSend(0x5A00, 6, 0xFF, 0xFF, 0); agb->onFree(); agb->onHold(); f32 x = current.pos.x; agb->current.pos.x = x; agb->home.pos.x = x; f32 y = current.pos.y + 50.0f; agb->current.pos.y = y; agb->home.pos.y = y; f32 z = current.pos.z; agb->current.pos.z = z; agb->home.pos.z = z; agb->shape_angle.x = 0x3FFF; agb->field_0x67f = true; mOrigScaleX = scale.x; mOrigScaleZ = scale.z; scale.z = 50.0f; scale.x = 50.0f; field_0x299 += 1; } } else if(field_0x299 == 1) { if(agb->isActive() && HitCheck(player->current.pos, 60.0f)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 5, getSw1(), sw, 0); agb->resetCursor(false); field_0x299 += 1; } else { if(HitCheck(agb)) { MailSend(0x5A00, 1, 0xFF, 0xFF, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } } return true; } /* 00000E48-00000FE4 .text ExeSubM__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubM() { u32 sw = getSw0(); if(sw != 0xFF && !fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5)) { MailSend(-1, 0, 0xFF, 0xFF, 0); } } field_0x298 = 0; } return true; } else { if(mDoGaC_GbaLink() && mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && agb->isActive() && (agb->isFree() || agb->getFollowTarget() != 1) && HitCheck(agb)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0x3, 0xFF, 0xFF, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } return true; } } /* 00001198-00001368 .text ExeSubM3__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubM2() { if(dComIfGs_isEventBit(0x2D01)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } else { if(!dComIfGs_checkGetItem(dItem_SKULL_HAMMER_e)) { return true; } else { if(mDoGaC_GbaLink() && mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && agb->isActive() && (agb->isFree() || agb->getFollowTarget() != 1) && HitCheck(agb)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0x3, 0xFF, 0xFF, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } return true; } } /* 00001198-00001368 .text ExeSubM3__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubM3() { if(dComIfGs_getTriforceNum() == 8) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } else { if(!dComIfGs_isEventBit(0x1820)) { return true; } else { if(mDoGaC_GbaLink() && mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && agb->isActive() && (agb->isFree() || agb->getFollowTarget() != 1) && HitCheck(agb)) { #if VERSION == VERSION_JPN u16 gbaMsgNo = TriforceCheck(); #else u16 gbaMsgNo = TriforceCheck(agb); #endif MailSend(BigLittleChange(gbaMsgNo) >> 0x10, 0xF, 0xFF, 0xFF, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } return true; } } #if VERSION == VERSION_JPN u32 daAgbsw0_c::TriforceCheck() #else /* 00001368-000017B0 .text TriforceCheck__10daAgbsw0_cFP7daAgb_c */ u32 daAgbsw0_c::TriforceCheck(daAgb_c* agb) #endif { for(int i = 0; i < 8; i++) { if(dComIfGs_isCollectMapTriforce(i + 1) && !dComIfGs_isTriforce(i)) { return dComIfGs_isEventBit(0x3E02) ? 0x304 : 0x303; } } for(int i = 1; i < 9; i++) { if(dComIfGs_isGetCollectMap(i) && !dComIfGs_isCollectMapTriforce(i)) { if(398 <= (u32)dComIfGs_getRupee()) { return 0x305; } else { f32 rnd = cM_rndF(3.0f); if(rnd <= 1.0) { return 0x306; } else if(rnd <= 2.0) { return 0x307; } else { return 0x308; } } } } if(!dComIfGs_isGetCollectMap(1)) { return 0x309; } if(!dComIfGs_isGetCollectMap(2) && dComIfGs_checkGetItem(dItem_SKULL_HAMMER_e)) { if(dComIfGs_checkGetItem(COTTAGE_PAPER)) { #if VERSION == VERSION_JPN s8 roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif return roomNo == 0x21 ? 0x30A : 0x30B; } else { u8 num = dComIfGs_checkGetItemNum(dItem_JOY_PENDANT_e); return num >= 0x14 ? 0x30C : 0x30D; } } if(!dComIfGs_isGetCollectMap(3)) { if(dComIfGs_checkGetItem(ESA_BAG)) { if(dComIfGs_checkBaitItem(dItem_HYOI_PEAR_e)) { #if VERSION == VERSION_JPN s8 roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif return roomNo == 0x23 ? 0x311 : 0x310; } else { return 0x30F; } } return 0x30E; } if(!dComIfGs_isGetCollectMap(4) && dComIfGs_checkGetItem(dItem_HOOKSHOT_e)) { if(dComIfGs_isOpenCollectMap(0x24)) { s32 hour = dKy_getdaytime_hour(); if(hour < 6 || hour >= 0x13) { u32 moonType = dKy_moon_type_chk(); #if VERSION == VERSION_JPN int roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif switch(moonType) { case 1: if(roomNo != 0x24) { return 0x314; } break; case 2: if(roomNo != 0x22) { return 0x315; } break; case 3: if(roomNo != 0xA) { return 0x316; } break; case 4: if(roomNo != 0x31) { return 0x317; } break; case 5: if(roomNo != 0x15) { return 0x318; } break; case 6: if(roomNo != 0x17) { return 0x319; } break; case 0: default: if(roomNo != 0x5) { return 0x31A; } break; } return 0x31B; } else { return 0x313; } } else { return 0x312; } } if(!dComIfGs_isGetCollectMap(5)) { if(dComIfGs_isEventBit(0x3E80)) { #if VERSION == VERSION_JPN if (!dComIfGs_isGetCollectMap(0x1C)) { return 0x31E; } else if (!dComIfGs_isCompleteCollectMap(0x1C)) { return 0x323; } else if (!dComIfGs_isCompleteCollectMap(0x1D)) { return 0x31F; } else if (!dComIfGs_isCompleteCollectMap(0x1F)) { return 0x320; } else { return 0x321; } #else return 0x31E; #endif } else { #if VERSION == VERSION_JPN s8 roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif return roomNo == 0x1D ? 0x31C : 0x31D; } } if(!dComIfGs_isCollect(2, 0)) { if(dComIfGs_checkGetItem(dItem_MAGIC_ARROW_e)) { return 0x328; } else { return dComIfGs_isTact(1) ? 0x32A : 0x329; } } if(!dComIfGs_isGetCollectMap(6)) { #if VERSION == VERSION_JPN s8 roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif return roomNo == 0x2C ? 0x325 : 0x324; } if(!dComIfGs_isGetCollectMap(7)) { #if VERSION == VERSION_JPN s8 roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif return roomNo == 0x1F ? 0x327 : 0x326; } if(dComIfGs_checkGetItem(dItem_HOOKSHOT_e)) { #if VERSION == VERSION_JPN s8 roomNo = dComIfGp_roomControl_getStayNo(); #else int roomNo = agb->field_0x66d; #endif return roomNo == 0x7 ? 0x32C : 0x32D; } return 0x32B; } u16 daAgbsw0_c::BeatedMsg[] = { 0x0005, 0x0011, 0x0012, 0x0031, 0x004F, 0x0058, }; u16 daAgbsw0_c::DisposedMsg[] = { 0x0059, 0x005C, }; /* 000017B0-00001AD0 .text ExeSubMW__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubMW() { u8 sw = getSw0(); if((sw != 0xFF && !fopAcM_isSwitch(this, sw)) || !mDoGaC_GbaLink()) { return true; } else { #if VERSION == VERSION_PAL if (dComIfGp_getAgb()->field_0x67d || daPy_getPlayerLinkActorClass()->checkNoControll() || dComIfGp_checkPlayerStatus0(0, 0x08000000) || ( daPy_getPlayerActorClass()->checkPlayerFly() && !dComIfGp_checkPlayerStatus0(0, 0x00100000) && !dComIfGp_checkPlayerStatus0(0, 0x00010000) ) ) { return TRUE; } #endif static bool se_flag = 0; eyePos = current.pos; attention_info.position = current.pos; if(eventInfo.checkCommandDemoAccrpt()) { if(!se_flag) { fopAcM_seStart(this, JA_SE_CV_CHI_MEGAHORN, 0); se_flag = 1; } dComIfGp_evmng_getMyStaffId("AGB_SW0"); fopAc_ac_c* player = dComIfGp_getPlayer(0); cXyz diff = eyePos - player->current.pos; f32 dist = diff.absXZ(); if(dist < 0.001f) { eyePos.x += cM_ssin(player->shape_angle.y) * 10.0f; eyePos.z += cM_scos(player->shape_angle.y) * 10.0f; } if(dComIfGp_evmng_endCheck("DEFAULT_AGB_LOOK_ATTENTION")) { dComIfGp_event_reset(); if(sw == 0xFF || getParamNo() == -1) { fopAcM_delete(this); } else { fopAcM_offSwitch(this, sw); } } } else { fopAcM_orderOtherEvent2(this, "DEFAULT_AGB_LOOK_ATTENTION", dEvtFlag_TALK_e); } } return true; } /* 00000344-0000066C .text ExeSubAT__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubT() { u8 sw = getSw0(); if(sw != 0xFF && fopAcM_isSwitch(this, sw)) { if(mTimer == 0) { if(mDoGaC_GbaLink()) { if(dComIfGp_event_runCheck() || !mDoGac_SendStatusCheck(5)) { return true; } else { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0x7, 0xFF, 0xFF, 0); } } fopAcM_delete(this); } else { mTimer -= 1; } return true; } else { if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(0xF)) { if(mCyl.ChkTgHit() && mCyl.GetTgHitAc() && fopAcM_GetName(mCyl.GetTgHitAc()) == PROC_BOMB && ((daBomb_c*)mCyl.GetTgHitAc())->chk_state(daBomb_c::STATE_8)) { mSE = BigLittleChange(0x12); mDoGac_SendDataSet((u32*)&mSE, 4, 0xF, 0); fopAcM_onSwitch(this, sw); if((fopAcM_GetParam(this) & 0xFFFF) == 0xFFFF) { fopAcM_delete(this); return true; } mTimer = 30; } else { dComIfG_Ccsp()->Set(&mCyl); } } } } return true; } /* 00001CC8-00001FAC .text ExeSubS__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubS() { u8 sw = getSw0(); u8 sw1 = getSw1(); if(sw != 0xFF && fopAcM_isSwitch(this, sw)) { fopAcM_delete(this); return true; } else { #if VERSION != VERSION_JPN if(strcmp(dComIfGp_getStartStageName(), "M_NewD2") == 0 && fopAcM_GetHomeRoomNo(this) == 0xC && dComIfGs_isTbox(0xC)) { fopAcM_delete(this); return true; } else #endif if(field_0x299 == 0 && mDoGaC_GbaLink()) { daAgb_c* agb = dComIfGp_getAgb(); if(getParamNo() < 0) { if(agb && agb->isActive() && (agb->isFree() || agb->getFollowTarget() != 1) && HitCheck(agb)) { if(getMsgNo() == 0xFFFF) { fopAcM_onSwitch(this, sw); if(sw1 != 0xFF) { fopAcM_onSwitch(this, sw1); } fopAcM_delete(this); return true; } else { if(mDoGac_SendStatusCheck(5)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0x9, sw1, sw, 0); field_0x299 = 1; } } } } else if(mTimer == 0) { if((fopAcM_GetParam(this) & 0xFFFF) == 0xFFFF) { fopAcM_onSwitch(this, sw); if(sw1 != 0xFF) { fopAcM_onSwitch(this, sw1); } fopAcM_delete(this); return true; } else { if(mDoGac_SendStatusCheck(5)) { u32 param = fopAcM_GetParam(this); MailSend(BigLittleChange(param & 0xFFFF) >> 0x10, 0x9, sw1, sw, 0); field_0x299 = 1; } } } else { fopAc_ac_c* player = dComIfGp_getPlayer(0); if(agb && HitCheck(player->current.pos, 60.0f)) { mTimer -= 1; } } } } return true; } /* 00001FAC-000021EC .text ExeSubR__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubR() { u8 sw = getSw0(); daAgb_c* agb = dComIfGp_getAgb(); if(mDoGaC_GbaLink() && mDoGac_SendStatusCheck(5)) { if(sw != 0xFF && fopAcM_isSwitch(this, sw)) { s32 itemNo = getParamNo(); if(itemNo < 0 || 0x1E < itemNo) { itemNo = 0; } if(itemNo != RECOVER_FAIRY) { current.pos.y += scale.y / 2.0f; } fopAcM_fastCreateItem(¤t.pos, itemNo, fopAcM_GetHomeRoomNo(this), NULL, NULL, 0.0f, cM_rndF(10.0f) + 40.0f, -7.0f); fopAcM_seStart(agb, JA_SE_CV_CHI_MEGAHORN, 0); MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; fopAcM_delete(this); return TRUE; } else if(agb && agb->isActive()) { if(agb->isFree() && HitCheck(agb)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0xA, 0xFF, getSw0(), 0); field_0x299 = 1; field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } field_0x299 = 0; } } } return TRUE; } /* 000021EC-00002A28 .text ExeSubB__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubB() { u8 sw = getSw0(); s16 restriction = getParamNo(); daAgb_c* agb = dComIfGp_getAgb(); fopAc_ac_c* player = dComIfGp_getPlayer(0); if(restriction == 4) { if(!dComIfGs_isEventBit(0x2E08)) { if(HitCheck(player->current.pos, 60.0f)) { dComIfGs_onEventBit(0x2E08); } } if(agb) { if(HitCheck(agb)) { daAgb_c::mFlags.field_0x3_5 = 1; } else { daAgb_c::mFlags.field_0x3_5 = 0; } if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5)) { if(field_0x299 == mFigureBeat) { MailSend(BigLittleChange(BeatedMsg[field_0x299 - 1]) >> 0x10, 0xB, 0xFF, 0xFF, 0); if(field_0x299 < 6) { field_0x299 += 1; } else { mFigureBeat = 5; } } if((u32)mTimer == mFigureDispose) { MailSend(BigLittleChange(DisposedMsg[mTimer - 1]) >> 0x10, 0xB, 0xFF, 0xFF, 0); if((u32)mTimer < 2) { mTimer += 1; } else { mFigureDispose = 1; } } } } else { mFigureDispose = 0; mFigureBeat = 0; field_0x299 = 1; mTimer = 1; } } } else if(restriction == 5) { if(agb) { if(HitCheck(player->current.pos, 60.0f)) { agb->field_0x67d = true; agb->field_0x662 = fopAcM_GetParam(this); field_0x298 = 1; } else { if(field_0x298 == 1) { agb->field_0x67d = false; field_0x298 = 0; } } } } else if(restriction == 6) { if(HitCheck(player->current.pos, 60.0f)) { fopAcM_delete(this); return true; } else { if(agb && agb->isFree() && HitCheck(agb)) { f32 xzDiff = fopAcM_searchActorDistanceXZ(agb, this); cXyz posDiff = current.pos - agb->current.pos; if(!mNonCircular) { f32 rad = scale.x; if(xzDiff < rad - 100.0f) { if(agb->current.pos.y < current.pos.y + scale.y / 2.0f) { agb->home.pos.y = current.pos.y - 6.0f; } else { agb->home.pos.y = current.pos.y + scale.y + 6.0f; } } else { agb->home.pos.x = current.pos.x - (posDiff.x * (rad + 1.0f) / xzDiff); agb->home.pos.z = current.pos.z - (posDiff.z * (scale.z + 1.0f) / xzDiff); } } else { cXyz rel; fpoAcM_relativePos(this, &agb->current.pos, &rel); rel.y = rel.y - scale.y / 2.0f + 5.0f; f32 x_diff = scale.x - fabsf(rel.x); f32 y_diff = (scale.y / 2.0f) - fabsf(rel.y) + 50.0f; //some register oddity here f32 z_diff = scale.z - fabsf(rel.z); if(y_diff < x_diff && y_diff < z_diff) { if(agb->current.pos.y < current.pos.y + scale.y / 2.0f) { agb->home.pos.y = current.pos.y - 6.0f; } else { agb->home.pos.y = current.pos.y + scale.y + 6.0f; } } else { if(x_diff < z_diff) { if(rel.x >= 0.0f) { agb->home.pos.x = (current.pos.x - posDiff.x) + (x_diff + 1.0f) * cM_scos(shape_angle.y); agb->home.pos.z = (current.pos.z - posDiff.z) - (x_diff + 1.0f) * cM_ssin(shape_angle.y); } else { agb->home.pos.x = (current.pos.x - posDiff.x) - (x_diff + 1.0f) * cM_scos(shape_angle.y); agb->home.pos.z = (current.pos.z - posDiff.z) + (x_diff + 1.0f) * cM_ssin(shape_angle.y); } } else if(rel.z >= 0.0f) { agb->home.pos.x = (current.pos.x - posDiff.x) + (z_diff + 1.0f) * cM_ssin(shape_angle.y); agb->home.pos.z = (current.pos.z - posDiff.z) + (z_diff + 1.0f) * cM_scos(shape_angle.y); } else { agb->home.pos.x = (current.pos.x - posDiff.x) - (z_diff + 1.0f) * cM_ssin(shape_angle.y); agb->home.pos.z = (current.pos.z - posDiff.z) - (z_diff + 1.0f) * cM_scos(shape_angle.y); } } } } } } else if((restriction != 2 && sw != 0xFF && fopAcM_isSwitch(this, sw)) || (restriction == 2 && sw < 0x20 && dComIfGs_isTbox(sw))) { if(agb) { if(restriction == 3) { agb->offBombDeny(); } else if(restriction != 6) { agb->field_0x67b = false; } } fopAcM_delete(this); return true; } else { if(agb) { if(restriction == 3) { if(HitCheck(player->current.pos, 60.0f)) { agb->onBombDeny(); agb->setDenyMessage(fopAcM_GetParam(this)); field_0x298 = 1; } else { if(field_0x298 == 1) { agb->offBombDeny(); field_0x298 = 0; } } } else { if(HitCheck(agb)) { agb->field_0x67b = true; agb->field_0x65e = fopAcM_GetParam(this) & 0xFFFF; field_0x298 = 1; } else { if(field_0x298 == 1) { agb->field_0x67b = false; field_0x298 = 0; } } } } } return true; } /* 00002A28-00002D90 .text ExeSubD__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubD() { u8 sw = getSw0(); daAgb_c* agb = dComIfGp_getAgb(); if(sw != 0xFF && fopAcM_isSwitch(this, sw) && field_0x299 == 0) { if(agb) { agb->resetCursor(true); } fopAcM_delete(this); return true; } else { if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5) && agb) { fopAc_ac_c* player = dComIfGp_getPlayer(0); if(field_0x299 == 0) { if(agb->isActive() && agb->isFree() && HitCheck(agb)) { MailSend(0x5F00, 0xC, 0xFF, 0xFF, 0x19); agb->onHold(); agb->field_0x675 = true; f32 x = current.pos.x; agb->current.pos.x = x; agb->home.pos.x = x; f32 y = current.pos.y; agb->current.pos.y = y; agb->home.pos.y = y; f32 z = current.pos.z; agb->current.pos.z = z; agb->home.pos.z = z; agb->shape_angle.x = -0x3FFF; agb->field_0x67f = true; mOrigScaleX = scale.x; mOrigScaleZ = scale.z; scale.z = 50.0f; scale.x = 50.0f; field_0x299 += 1; } } else if(field_0x299 == 1) { if(agb->isActive() && HitCheck(player->current.pos, 60.0f)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0xC, getSw1(), 0xFF, 0x1B); agb->shape_angle.x = 0x3FFF; agb->home.pos.y += 50.0f; agb->current.pos.y = agb->home.pos.y; agb->field_0x676 = true; field_0x299 += 1; } } else if(field_0x299 == 2 && fopAcM_isSwitch(this, getSw1())) { s32 itemNo = getParamNo(); if(itemNo != RECOVER_FAIRY) { current.pos.y += scale.y / 2; } if(0 <= itemNo && itemNo < 0x1F && itemNo != dItem_HEART_PIECE_e && itemNo != dItem_HEART_CONTAINER_e && itemNo != dItem_SMALL_KEY_e) { s8 roomNo = fopAcM_GetHomeRoomNo(this); f32 rnd = cM_rndF(10.0f) + 40.0f; fopAcM_fastCreateItem(¤t.pos, itemNo, roomNo, NULL, NULL, 0.0f, rnd, -7.0f); MailSend(-1, 0, 0xFF, 0xFF, 0x11); } if(agb) { agb->resetCursor(true); } fopAcM_delete(this); return true; } } } else { if(field_0x299 != 0 && field_0x299 < 3) { scale.x = mOrigScaleX; scale.z = mOrigScaleZ; field_0x299 = 0; } } } return true; } /* 00002D90-000030DC .text ExeSubFA__10daAgbsw0_cFv */ BOOL daAgbsw0_c::ExeSubFA() { u8 sw = getSw0(); s16 condition = getParamNo(); if(sw != 0xFF) { if(condition == 0) { if(!fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { #if VERSION == VERSION_JPN if(mDoGac_SendStatusCheck(5)) { #else if(!mDoGac_SendStatusCheck(5)) { #endif return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } return true; } } else { if(fopAcM_isSwitch(this, sw)) { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } } } else { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } fopAcM_delete(this); return true; } if(MoveCheck(condition)) { #if VERSION != VERSION_JPN if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { return true; } MailSend(-1, 0, 0xFF, 0xFF, 0); } field_0x298 = 0; } #endif return true; } else { if(mDoGaC_GbaLink()) { if(mDoGac_SendStatusCheck(5)) { daAgb_c* agb = dComIfGp_getAgb(); if(agb && (agb->isFree() || agb->getFollowTarget() == 0) && HitCheck(agb)) { MailSend(BigLittleChange(getMsgNo()) >> 0x10, 0xD, getSw1(), sw, 0); field_0x298 = 1; } else { if(field_0x298 == 1) { MailSend(-1, 0, 0xFF, 0xFF, 0); field_0x298 = 0; } } } } } return true; } /* 000030DC-0000320C .text HitCheck__10daAgbsw0_cFP10fopAc_ac_c */ BOOL daAgbsw0_c::HitCheck(fopAc_ac_c* param_1) { if(mNonCircular == false) { f32 y_diff = param_1->current.pos.y - current.pos.y; if(-10.0f <= y_diff && y_diff <= scale.y) { f32 x_diff = fabsf(param_1->current.pos.x - current.pos.x); if(x_diff < scale.x) { f32 z_diff = fabs(param_1->current.pos.z - current.pos.z); if(z_diff < scale.x && x_diff * x_diff + z_diff * z_diff < scale.x * scale.x) { return true; } } } } else { cXyz pos; fpoAcM_relativePos(this, ¶m_1->current.pos, &pos); if(-10.0f <= pos.y && pos.y <= scale.y && fabsf(pos.x) < scale.x && fabsf(pos.z) < scale.z) { return true; } } return false; } /* 0000320C-00003344 .text HitCheck__10daAgbsw0_cF4cXyzf */ BOOL daAgbsw0_c::HitCheck(cXyz param_1, f32 param_2) { if(mNonCircular == false) { f32 y_diff = param_1.y - current.pos.y; if(-param_2 <= y_diff && y_diff <= scale.y) { f32 x_diff = fabs(param_1.x - current.pos.x); if(x_diff < scale.x) { f32 z_diff = fabs(param_1.z - current.pos.z); if(z_diff < scale.x && x_diff * x_diff + z_diff * z_diff < scale.x * scale.x) { return true; } } } } else { cXyz pos; fpoAcM_relativePos(this, ¶m_1, &pos); if(-param_2 <= pos.y && pos.y <= scale.y && (f32)fabs(pos.x) < scale.x && (f32)fabs(pos.z) < scale.z) { return true; } } return false; } /* 00003344-0000476C .text MoveCheck__10daAgbsw0_cFs */ BOOL daAgbsw0_c::MoveCheck(s16 param_1) { switch(param_1) { case 1: if(dComIfGs_isEventBit(0xF80)) { return 0; } break; case 2: if(dComIfGs_isSymbol(0)) { return 0; } break; case 3: if(dComIfGs_isEventBit(0x1E40)) { return 0; } break; case 4: if(dComIfGs_isEventBit(0x1820)) { return 0; } break; case 5: daGhostship_c* gship = (daGhostship_c*)fopAcM_searchFromName("Ayush", 0, 0); if(gship && gship->checkInShip()) { return 0; } break; case 6: if(dComIfGs_isEventBit(0x1A10)) { return 0; } break; case 7: if(dComIfGs_isEventBit(0x1A08)) { return 0; } break; case 8: if(dComIfGs_isEventBit(0x1708)) { return 0; } break; case 9: if(dComIfGs_isStageTbox(dSv_save_c::STAGE_DRC, 0xF)) { return 0; } break; case 0xA: if(dComIfGs_isStageTbox(dSv_save_c::STAGE_FW, 0xF)) { return 0; } break; case 0xB: if(dComIfGs_isStageTbox(dSv_save_c::STAGE_TOTG, 0xF)) { return 0; } break; case 0xC: if(dComIfGs_isStageTbox(dSv_save_c::STAGE_WT, 0xF)) { return 0; } break; case 0xD: if(dComIfGs_isStageTbox(dSv_save_c::STAGE_ET, 0xF)) { return 0; } break; case 0x11: if(dComIfGp_getSelectItem(0) != dItem_BOW_e && dComIfGp_getSelectItem(1) != dItem_BOW_e && dComIfGp_getSelectItem(2) != dItem_BOW_e) { return 0; } break; case 0x12: if(dComIfGp_getSelectItem(0) != dItem_BOOMERANG_e && dComIfGp_getSelectItem(1) != dItem_BOOMERANG_e && dComIfGp_getSelectItem(2) != dItem_BOOMERANG_e) { return 0; } break; case 0x13: if(dComIfGp_getSelectItem(0) != dItem_DEKU_LEAF_e && dComIfGp_getSelectItem(1) != dItem_DEKU_LEAF_e && dComIfGp_getSelectItem(2) != dItem_DEKU_LEAF_e) { return 0; } break; case 0x14: if(dComIfGp_getSelectItem(0) != dItem_GRAPPLING_HOOK_e && dComIfGp_getSelectItem(1) != dItem_GRAPPLING_HOOK_e && dComIfGp_getSelectItem(2) != dItem_GRAPPLING_HOOK_e) { return 0; } break; case 0x15: if(dComIfGp_getSelectItem(0) != dItem_BOMB_BAG_e && dComIfGp_getSelectItem(1) != dItem_BOMB_BAG_e && dComIfGp_getSelectItem(2) != dItem_BOMB_BAG_e) { return 0; } break; case 0x16: if(dComIfGp_getSelectItem(0) != dItem_HOOKSHOT_e && dComIfGp_getSelectItem(1) != dItem_HOOKSHOT_e && dComIfGp_getSelectItem(2) != dItem_HOOKSHOT_e) { return 0; } break; case 0x17: if(dComIfGs_checkGetItem(dItem_MAGIC_ARMOR_e)) { return 0; } break; case 0x18: if(dComIfGs_isCollect(2, 0)) { return 0; } break; case 0x19: if(dComIfGs_getLife() < dComIfGs_getMaxLife()) { return 0; } break; case 0x1A: if(dComIfGs_getItem(12) != dItem_NONE_e && dComIfGs_getArrowNum() < dComIfGs_getArrowMax()) { return 0; } break; case 0x1B: if(dComIfGs_checkGetItem(dItem_BOMB_BAG_e) && dComIfGs_getBombNum() < dComIfGs_getBombMax()) { return 0; } break; case 0x1C: if(dComIfGs_getLife() < 8) { return 0; } break; case 0x1D: if(dComIfGs_getMaxMagic() != 0 && !dComIfGs_getMagic) { return 0; } break; case 0x1E: if(dComIfGs_getItem(12) != dItem_NONE_e && dComIfGs_getArrowNum() == 0) { return 0; } break; case 0x1F: if(dComIfGs_checkGetItem(dItem_BOMB_BAG_e) && dComIfGs_getBombNum() == 0) { return 0; } break; case 0x20: if(dComIfGs_isEventBit(0x1708) && dComIfGs_getItem(12) != dItem_NONE_e && dComIfGs_getArrowNum() == 0) { return 0; } break; case 0x21: if(dComIfGs_isEventBit(0x1708) && dComIfGs_checkGetItem(dItem_BOMB_BAG_e) && dComIfGs_getBombNum() == 0) { return 0; } break; case 0x22: if((u32)dComIfGs_getRupee() <= 10) { return 0; } break; case 0x23: if(dComIfGp_checkPlayerStatus0(0, daPyStts0_SWIM_e)) { return 0; } break; case 0x24: if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)) { return 0; } break; case 0x25: if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e) && dComIfGp_getSelectItem(0) != dItem_BOMB_BAG_e && dComIfGp_getSelectItem(1) != dItem_BOMB_BAG_e && dComIfGp_getSelectItem(2) != dItem_BOMB_BAG_e) { return 0; } break; case 0x26: if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e) && dComIfGp_getSelectItem(0) != dItem_GRAPPLING_HOOK_e && dComIfGp_getSelectItem(1) != dItem_GRAPPLING_HOOK_e && dComIfGp_getSelectItem(2) != dItem_GRAPPLING_HOOK_e) { return 0; } break; case 0x27: if(dComIfGs_getKeyNum() == 0) { return 0; } break; case 0x28: if(!dComIfGs_isDungeonItemBossKey()) { return 0; } break; case 0x29: if(dComIfGs_checkGetItem(dItem_GRAPPLING_HOOK_e)) { return 0; } break; case 0x2A: if(dComIfGs_checkGetItem(dItem_BOOMERANG_e)) { return 0; } break; case 0x2B: if(dComIfGs_checkGetItem(dItem_BOMB_BAG_e)) { return 0; } break; case 0x2C: if(dComIfGs_getItem(12) != dItem_NONE_e) { return 0; } break; case 0x2D: if(!daPy_getPlayerLinkActorClass()->checkGrabWeapon(1)) { return 0; } break; case 0x2E: if(daPy_getPlayerLinkActorClass()->checkGrabWeapon(1)) { return 0; } break; case 0x2F: if(dComIfGs_isSymbol(1) && !dComIfGs_isEventBit(0x1A08)) { return 0; } break; case 0x30: if(dComIfGs_isSymbol(1) && !dComIfGs_isEventBit(0x1A10)) { return 0; } break; case 0x31: if(!dComIfGs_isEventBit(0x1708)) { return 0; } break; case 0x32: if(dComIfGs_isTact(0)) { return 0; } break; case 0x33: if(!dComIfGs_isTact(0)) { return 0; } break; case 0x34: if(!dKyw_get_windsdir()) { return 0; } break; case 0x35: if(dKyw_get_windsdir()) { return 0; } break; case 0x36: if(dKyw_get_windsdir() == 4) { return 0; } break; case 0x37: if(!dKyw_get_windsdir() == 4) { return 0; } break; case 0x38: if(dKyw_get_windsdir() == 2) { return 0; } break; case 0x39: if(!dKyw_get_windsdir() == 2) { return 0; } break; case 0x3A: if(dKyw_get_windsdir() == 6) { return 0; } break; case 0x3B: if(!dKyw_get_windsdir() == 6) { return 0; } break; case 0x3C: if(mFigureDispose == 1) { return 0; } break; case 0x3D: if(mFigureDispose == 2) { return 0; } break; case 0x3E: if(mFigureBeat == 1) { return 0; } break; case 0x3F: if(mFigureBeat == 2) { return 0; } break; case 0x40: if(mFigureBeat == 3) { return 0; } break; case 0x41: if(mFigureBeat == 4) { return 0; } break; case 0x42: for (int i = 0; i < 3; i++) { if(daNpc_Os_c::isPlayerRoom(i)) { return 0; } } break; case 0x43: for (int i = 0; i < 3; i++) { if(daNpc_Os_c::isPlayerRoom(i)) { return 1; } } return 0; case 0x44: if(fopAcM_GetName(dComIfGp_getPlayer(0)) == PROC_NPC_OS) { return 0; } break; case 0x45: if(fopAcM_GetName(dComIfGp_getPlayer(0)) != PROC_NPC_OS) { return 0; } break; case 0x46: if(fopAcM_GetName(dComIfGp_getPlayer(0)) == PROC_NPC_MD) { return 0; } break; case 0x47: if(fopAcM_GetName(dComIfGp_getPlayer(0)) != PROC_NPC_MD) { return 0; } break; case 0x48: if(fopAcM_GetName(dComIfGp_getPlayer(0)) == PROC_NPC_CB1) { return 0; } break; case 0x49: if(fopAcM_GetName(dComIfGp_getPlayer(0)) != PROC_NPC_CB1) { return 0; } break; case 0x4A: if(fopAcM_GetName(dComIfGp_getPlayer(0)) == PROC_NPC_KAM) { return 0; } break; case 0x4B: if(fopAcM_GetName(dComIfGp_getPlayer(0)) != PROC_NPC_KAM) { return 0; } break; case 0x4C: if(dComIfGs_checkGetItem(dItem_SKULL_HAMMER_e)) { return 0; } break; case 0x4D: if(!dComIfGs_checkGetItem(dItem_SKULL_HAMMER_e)) { return 0; } break; case 0x4E: if(dComIfGs_checkGetItem(MIRROR_SHIELD)) { return 0; } break; case 0x4F: if(!dComIfGs_checkGetItem(MIRROR_SHIELD)) { return 0; } break; case 0x50: if(daNpc_Md_c::isPlayerRoom()) { return 0; } break; case 0x51: if(!daNpc_Md_c::isPlayerRoom()) { return 0; } break; case 0x52: if(dComIfGs_checkGetItem(dItem_HOOKSHOT_e)) { return 0; } break; case 0x53: if(!dComIfGs_checkGetItem(dItem_HOOKSHOT_e)) { return 0; } break; case 0x54: if(daNpc_Cb1_c::isPlayerRoom()) { return 0; } break; case 0x55: if(!daNpc_Cb1_c::isPlayerRoom()) { return 0; } break; case 0x56: if(!dComIfGs_isEventBit(0x2E08)) { return 0; } break; case 0x57: if(!dComIfGs_isCollect(2, 0)) { return 0; } break; case 0x58: if(!dComIfGs_checkGetItem(dItem_IRON_BOOTS_e)) { return 0; } break; case 0x59: if(dComIfGs_checkGetItem(LV3_SWORD) || dComIfGs_checkGetItem(MASTER_SWORD_EX)) { return 0; } break; case 0x5A: if(!dComIfGs_checkGetItem(LV3_SWORD) && !dComIfGs_checkGetItem(MASTER_SWORD_EX)) { return 0; } break; case 0x5B: if(dComIfGs_checkGetItem(MASTER_SWORD_EX)) { return 0; } break; case 0x5C: if(!dComIfGs_checkGetItem(MASTER_SWORD_EX)) { return 0; } break; case 0x5D: if((u32)dComIfGs_getRupee() >= 500) { for (int i = 1; i < 9; i++) { if(dComIfGs_isGetCollectMap(i) && !dComIfGs_isCollectMapTriforce(i)) { return 0; } } } break; case 0x5E: if((u32)dComIfGs_getRupee() < 500) { for (int i = 1; i < 9; i++) { if(dComIfGs_isGetCollectMap(i) && !dComIfGs_isCollectMapTriforce(i)) { return 0; } } } break; case 0x5F: if(!dComIfGs_isGetCollectMap(1)) { return 0; } break; case 0x60: if(dComIfGs_isGetCollectMap(1) && dComIfGs_isCollectMapTriforce(1) && !dComIfGs_isTriforce(0)) { return 0; } break; case 0x61: if(dComIfGs_isTriforce(0)) { return 0; } break; case 0x62: if(!dComIfGs_isGetCollectMap(2)) { return 0; } break; case 0x63: if(dComIfGs_isGetCollectMap(2) && dComIfGs_isCollectMapTriforce(2) && !dComIfGs_isTriforce(1)) { return 0; } break; case 0x64: if(dComIfGs_isTriforce(1)) { return 0; } break; case 0x65: if(!dComIfGs_isGetCollectMap(3)) { return 0; } break; case 0x66: if(dComIfGs_isGetCollectMap(3) && dComIfGs_isCollectMapTriforce(3) && !dComIfGs_isTriforce(2)) { return 0; } break; case 0x67: if(dComIfGs_isTriforce(2)) { return 0; } break; case 0x68: if(!dComIfGs_isGetCollectMap(4)) { return 0; } break; case 0x69: if(dComIfGs_isGetCollectMap(4) && dComIfGs_isCollectMapTriforce(4) && !dComIfGs_isTriforce(3)) { return 0; } break; case 0x6A: if(dComIfGs_isTriforce(3)) { return 0; } break; case 0x6B: if(!dComIfGs_isGetCollectMap(5)) { return 0; } break; case 0x6C: if(dComIfGs_isGetCollectMap(5) && dComIfGs_isCollectMapTriforce(5) && !dComIfGs_isTriforce(4)) { return 0; } break; case 0x6D: if(dComIfGs_isTriforce(4)) { return 0; } break; case 0x6E: if(!dComIfGs_isGetCollectMap(6)) { return 0; } break; case 0x6F: if(dComIfGs_isGetCollectMap(6) && dComIfGs_isCollectMapTriforce(6) && !dComIfGs_isTriforce(5)) { return 0; } break; case 0x70: if(dComIfGs_isTriforce(5)) { return 0; } break; case 0x71: if(!dComIfGs_isGetCollectMap(7)) { return 0; } break; case 0x72: if(dComIfGs_isGetCollectMap(7) && dComIfGs_isCollectMapTriforce(7) && !dComIfGs_isTriforce(6)) { return 0; } break; case 0x73: if(dComIfGs_isTriforce(6)) { return 0; } break; case 0x74: if(!dComIfGs_isGetCollectMap(8)) { return 0; } break; case 0x75: if(dComIfGs_isGetCollectMap(8) && dComIfGs_isCollectMapTriforce(8) && !dComIfGs_isTriforce(7)) { return 0; } break; case 0x76: if(dComIfGs_isTriforce(7)) { return 0; } break; case 0x77: if(daPy_dmEcallBack_c::checkCurse()) { return 0; } break; case 0x78: if(!daPy_dmEcallBack_c::checkCurse()) { return 0; } break; case 0x79: if(daPy_getPlayerActorClass()->checkConfuse()) { return 0; } break; case 0x7A: if(!daPy_getPlayerActorClass()->checkConfuse()) { return 0; } break; case 0x7B: if(fopAcM_GetName(dComIfGp_getPlayer(0)) == PROC_NPC_MD && daNpc_Md_c::isFlying()) { return 0; } break; case 0x7C: if(fopAcM_GetName(dComIfGp_getPlayer(0)) != PROC_NPC_MD || !daNpc_Md_c::isFlying()) { return 0; } break; case 0x7F: // Potential bug: This seems to check if the current player is Medli, but that Makar is flying? if(fopAcM_GetName(dComIfGp_getPlayer(0)) == PROC_NPC_MD && daNpc_Cb1_c::isFlying()) { return 0; } break; case 0x80: // Potential bug: This seems to check if the current player is Medli, but that Makar is flying? if(fopAcM_GetName(dComIfGp_getPlayer(0)) != PROC_NPC_MD || !daNpc_Cb1_c::isFlying()) { return 0; } break; case 0x7D: if(!fopAcM_isSwitch(this, 0x7C)) { return 0; } break; case 0x7E: if(dComIfGs_checkGetItem(dItem_SKULL_HAMMER_e) && !dComIfGs_isEventBit(0x2D01)) { return 0; } break; #if VERSION != VERSION_JPN case 0x82: if(field_0x29B == 0) { if(daNpc_Md_c::isPlayerRoom()) { field_0x29B = 1; } } else if(!daNpc_Md_c::isPlayerRoom()) { return 0; } break; case 0x83: if(field_0x29B == 0) { if(daNpc_Cb1_c::isPlayerRoom()) { field_0x29B = 1; } } else if(!daNpc_Cb1_c::isPlayerRoom()) { return 0; } break; #endif default: return 0; } return 1; } /* 0000477C-00004818 .text MailSend__10daAgbsw0_cFUsUcUcUcUc */ void daAgbsw0_c::MailSend(u16 msgNo, u8 reactType, u8 toCheck, u8 toSet, u8 sfx) { mMail.msgNo = msgNo; mMail.swToSet = toSet; mMail.swToCheck = toCheck; mMail.stageSaveTbl = dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()); mMail.roomNo = fopAcM_GetHomeRoomNo(this); mMail.reactType = reactType; mMail.sfx = sfx; mDoGac_SendDataSet((u32*)&mMail, 8, 5, 0); } /* 00004818-00004838 .text daAgbsw0_Draw__FP10daAgbsw0_c */ static BOOL daAgbsw0_Draw(daAgbsw0_c* i_this) { return i_this->draw(); } /* 00004B2C-00004CF8 .text daAgbsw0_Execute__FP10daAgbsw0_c */ static void daAgbsw0_Execute(daAgbsw0_c* i_this) { i_this->execute(); } /* 00004CF8-00004D00 .text daAgbsw0_IsDelete__FP10daAgbsw0_c */ static BOOL daAgbsw0_IsDelete(daAgbsw0_c*) { return TRUE; } /* 00004D00-00004E98 .text daAgbsw0_Delete__FP10daAgbsw0_c */ static BOOL daAgbsw0_Delete(daAgbsw0_c* i_this) { daAgb_c* agb = dComIfGp_getAgb(); u32 id = i_this->current.angle.z & 0xFF; if(agb) { if(id == 0xA) { s16 temp = i_this->current.angle.x & 0xFFFF; if(temp == 3) { agb->offBombDeny(); } else if(temp == 4) { daAgb_c::mFlags.field_0x3_5 = 0; daAgbsw0_c::mFigureDispose = 0; daAgbsw0_c::mFigureBeat = 0; } else if(temp == 5) { agb->field_0x67d = false; } else { agb->field_0x67b = false; } } else if(id == 4) { if(i_this->field_0x299 == 1) { agb->resetCursor(false); } } else if(id == 0xB) { agb->resetCursor(true); } } if((id <= 4 || id == 9 || 0xC <= id) && mDoGaC_GbaLink() && i_this->field_0x298 == 1) { agb_mail_struct info; info.msgNo = 0xFFFF; info.swToSet = 0xFF; info.swToCheck = 0xFF; info.stageSaveTbl = dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()); info.roomNo = fopAcM_GetHomeRoomNo(i_this); info.reactType = 0; info.sfx = 0; mDoGaC_SendEntry(5, *(u32*)&info); } return true; } /* 00004E98-00004F80 .text daAgbsw0_Create__FP10fopAc_ac_c */ static int daAgbsw0_Create(fopAc_ac_c* i_this) { fopAcM_SetupActor(i_this, daAgbsw0_c); return static_cast(i_this)->create(); } static actor_method_class l_daAgbsw0_Method = { (process_method_func)daAgbsw0_Create, (process_method_func)daAgbsw0_Delete, (process_method_func)daAgbsw0_Execute, (process_method_func)daAgbsw0_IsDelete, (process_method_func)daAgbsw0_Draw, }; actor_process_profile_definition g_profile_AGBSW0 = { /* LayerID */ fpcLy_CURRENT_e, /* ListID */ 0x0007, /* ListPrio */ fpcPi_CURRENT_e, /* ProcName */ PROC_AGBSW0, /* Proc SubMtd */ &g_fpcLf_Method.base, /* Size */ sizeof(daAgbsw0_c), /* SizeOther */ 0, /* Parameters */ 0, /* Leaf SubMtd */ &g_fopAc_Method.base, /* Priority */ 0x000D, /* Actor SubMtd */ &l_daAgbsw0_Method, /* Status */ fopAcStts_UNK40000_e, /* Group */ fopAc_ACTOR_e, /* CullType */ fopAc_CULLBOX_0_e, };