diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2020-12-01 13:59:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-01 13:59:02 -0500 |
| commit | 4b04e6cb66c035d2a591c45ebacc2ba31feff601 (patch) | |
| tree | fe8e4c929b5c182d46cc0f3a896370eb80ce53fd /src | |
| parent | 5d03824f93f8fe85d806110804c38589e7f3f820 (diff) | |
Decomp En_Niw_Lady, All OK (#462)
* Fixed upstream
* Migrate .data
* Start functions
* Decomp func_80AB9F24
* Add files via upload
Decomp: func_80ABB228(Draw),EnNiwLady_OverrideLimbDraw,func_80ABB0A0
* Matched a few more
* matched more
* progress
* All matched up. Whole file OK
* Format, use reloc, deletet ASM
* Fixed a fake match and removed padding from struct
* Small cleanup
* Small cleanup
* Cleanup and some name changes
* Small cleanup
* Add POLY_OPA_DISP macro
* Fix issue in Draw
* Fix ZAP. hopefully
* PR fixes
* PR fixes
* PR fixes
Co-authored-by: Louis <5883445+louist103@users.noreply.github.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 556 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h | 33 |
2 files changed, 566 insertions, 23 deletions
diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 7fa0264aa..85b107c91 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -1,4 +1,6 @@ #include "z_en_niw_lady.h" +#include "overlays/actors/ovl_En_Niw/z_en_niw.h" +#include "vt.h" #define FLAGS 0x00000019 @@ -8,7 +10,21 @@ void EnNiwLady_Init(Actor* thisx, GlobalContext* globalCtx); void EnNiwLady_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx); -/* +void func_80AB9F24(EnNiwLady* this, GlobalContext* globalCtx); +void EnNiwLady_Draw(Actor* thisx, GlobalContext* globalCtx); +void func_80ABA21C(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABAD38(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABA778(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABA878(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABAB08(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABAA9C(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABAC84(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx); +void func_80ABAD7C(EnNiwLady* this, GlobalContext* globalCtx); + const ActorInit En_Niw_Lady_InitVars = { ACTOR_EN_NIW_LADY, ACTORTYPE_NPC, @@ -20,43 +36,539 @@ const ActorInit En_Niw_Lady_InitVars = { (ActorFunc)EnNiwLady_Update, NULL, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/EnNiwLady_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/EnNiwLady_Destroy.s") +static s16 sMissingCuccoTextIds[] = { + 0x5036, 0x5070, 0x5072, 0x5037, 0x5038, 0x5039, 0x503A, 0x503B, 0x503D, 0x503C, +}; + +static s16 D_80ABB3B4[] = { + 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, +}; + +static ColliderCylinderInit sCylinderInit = { + { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, + { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { 10, 10, 0, { 0, 0, 0 } }, +}; + +extern SkeletonHeader D_060000F0; +extern AnimationHeader D_06000718; +extern AnimationHeader D_060007D0; +extern AnimationHeader D_06009F94; +extern AnimationHeader D_0600A630; + +void EnNiwLady_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnNiwLady* this = THIS; + + this->objectAneIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_ANE); + this->objectOsAnimeIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_OS_ANIME); + if ((this->objectOsAnimeIndex < 0) || (this->objectAneIndex < 0)) { + Actor_Kill(thisx); + return; + } + this->unk_278 = 0; + if (globalCtx->sceneNum == SCENE_LABO) { + this->unk_278 = 1; + } + if ((this->unk_278 != 0) && (gSaveContext.nightFlag == 0)) { + Actor_Kill(thisx); + return; + } + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ねぇちゃんうっふん ☆☆☆☆☆ %d\n" VT_RST, this->unk_278); + osSyncPrintf("\n\n"); + this->actionFunc = func_80AB9F24; + thisx->uncullZoneForward = 600.0f; +} + +void EnNiwLady_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnNiwLady* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); +} + +void EnNiwLady_ChoseAnimation(EnNiwLady* this, GlobalContext* globalCtx, s32 arg2) { + f32 frames; + + if (Text_GetFaceReaction(globalCtx, 8) != 0) { + arg2 = 8; + } + if (arg2 != this->unk_270) { + this->unk_275 = 0; + this->unk_276 = 1; + this->unk_270 = arg2; + switch (arg2) { + case 10: + this->unk_275 = 1; + case 9: + frames = SkelAnime_GetFrameCount(&D_060007D0); + SkelAnime_ChangeAnim(&this->skelAnime, &D_060007D0, 1.0f, 0.0f, frames, 0, -10.0f); + break; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 21: + case 22: + case 24: + case 29: + frames = SkelAnime_GetFrameCount(&D_06009F94); + SkelAnime_ChangeAnim(&this->skelAnime, &D_06009F94, 1.0f, 0.0f, frames, 0, -10.0f); + break; + case 7: + case 20: + case 23: + case 25: + case 26: + case 27: + case 28: + frames = SkelAnime_GetFrameCount(&D_06000718); + SkelAnime_ChangeAnim(&this->skelAnime, &D_06000718, 1.0f, 0.0f, frames, 0, -10.0f); + break; + case 100: + frames = SkelAnime_GetFrameCount(&D_0600A630); + SkelAnime_ChangeAnim(&this->skelAnime, &D_0600A630, 1.0f, 0.0f, frames, 0, -10.0f); + this->unk_276 = 0; + break; + } + return; + } +} + +void func_80AB9F24(EnNiwLady* this, GlobalContext* globalCtx) { + f32 frames; + s32 pad; + + if (Object_IsLoaded(&globalCtx->objectCtx, this->objectAneIndex) && + Object_IsLoaded(&globalCtx->objectCtx, this->objectOsAnimeIndex)) { + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->objectAneIndex].segment); + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, NULL, &this->limbDrawTable, + &this->transitionDrawTable, 16); + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->objectOsAnimeIndex].segment); + this->unk_27E = 1; + this->actor.gravity = -3.0f; + Actor_SetScale(&this->actor, 0.01f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 20.0f); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + this->unk_272 = 0; + this->actor.unk_1F = 6; + this->actor.draw = EnNiwLady_Draw; + switch (this->unk_278) { + case 0: + if (!(gSaveContext.itemGetInf[0] & 0x1000) && LINK_IS_CHILD) { + frames = SkelAnime_GetFrameCount(&D_0600A630); + SkelAnime_ChangeAnim(&this->skelAnime, &D_0600A630, 1.0f, 0.0f, (s16)frames, 0, 0.0f); + } else { + frames = SkelAnime_GetFrameCount(&D_060007D0); + SkelAnime_ChangeAnim(&this->skelAnime, &D_060007D0, 1.0f, 0.0f, (s16)frames, 0, 0.0f); + } + if (LINK_IS_ADULT) { + this->actionFunc = func_80ABA778; + } else { + this->actionFunc = func_80ABA21C; + } + return; + case 1: + frames = SkelAnime_GetFrameCount(&D_060007D0); + SkelAnime_ChangeAnim(&this->skelAnime, &D_060007D0, 1.0f, 0.0f, (s16)frames, 0, 0.0f); + this->actionFunc = func_80ABAD38; + return; + } + } +} + +void func_80ABA21C(EnNiwLady* this, GlobalContext* globalCtx) { + this->actor.textId = sMissingCuccoTextIds[0]; + this->unk_262 = 6; + this->actionFunc = func_80ABA244; +} + +void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx) { + EnNiw* currentCucco; + s32 phi_s1; + + this->cuccosInPen = 0; + currentCucco = (EnNiw*)globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + while (currentCucco != NULL) { + if (currentCucco->actor.id == ACTOR_EN_NIW) { + if ((fabsf(currentCucco->actor.posRot.pos.x - 330.0f) < 90.0f) && + (fabsf(currentCucco->actor.posRot.pos.z - 1610.0f) < 190.0f)) { + if (this->unk_26C == 0) { + gSaveContext.infTable[25] |= D_80ABB3B4[currentCucco->unk_2AA]; + if (BREG(1) != 0) { + // GET inside the chicken fence! + osSyncPrintf(VT_FGCOL(GREEN) "☆ 鶏柵内GET!☆ %x\n" VT_RST, + D_80ABB3B4[currentCucco->unk_2AA]); + } + } + this->cuccosInPen++; + } else if (this->unk_26C == 0) { + gSaveContext.infTable[25] &= ~D_80ABB3B4[currentCucco->unk_2AA]; + } + } + currentCucco = currentCucco->actor.next; + } + if (BREG(7) != 0) { + this->cuccosInPen = BREG(7) - 1; + } + phi_s1 = this->cuccosInPen; + if ((func_8010BDBC(&globalCtx->msgCtx) == 0) || (func_8010BDBC(&globalCtx->msgCtx) == 6)) { + this->unk_26E = 101; + } + if (this->cuccosInPen >= 7) { + phi_s1 = 8; + if ((this->unk_26C < 2) && (this->unk_26C == 0)) { + phi_s1 = 7; + } + } + if ((this->unk_26C != 0) && (phi_s1 < 7)) { + phi_s1 = 9; + } + this->actor.textId = sMissingCuccoTextIds[phi_s1]; + if (Text_GetFaceReaction(globalCtx, 8) != 0) { + this->actor.textId = Text_GetFaceReaction(globalCtx, 8); + this->unk_262 = 6; + } + if ((this->unk_26C != 0) && (phi_s1 != 9)) { + phi_s1 = 10; + this->unk_26E = 11; + } + if (func_8002F194(&this->actor, globalCtx)) { + osSyncPrintf("\n\n"); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃん選択\t ☆☆☆☆ %d\n" VT_RST, phi_s1); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃんハート ☆☆☆☆ %d\n" VT_RST, this->unk_26C); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃん保存 ☆☆☆☆ %d\n" VT_RST, this->unk_26A); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃん今\t ☆☆☆☆ %d\n" VT_RST, this->cuccosInPen); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ this->actor.talk_message ☆☆ %x\n" VT_RST, this->actor.textId); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ this->message_end_code ☆☆ %d\n" VT_RST, this->unk_262); + osSyncPrintf("\n\n"); + if (Text_GetFaceReaction(globalCtx, 8) == 0) { + if (this->actor.textId == 0x503C) { + func_80078884(NA_SE_SY_ERROR); + this->unk_26C = 2; + this->unk_262 = 5; + this->actionFunc = func_80ABA654; + return; + } + this->unk_26E = phi_s1 + 1; + if (phi_s1 == 7) { + func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + this->unk_26C = 1; + this->unk_262 = 5; + this->unk_26A = this->cuccosInPen; + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更前 ☆☆ %x\n" VT_RST, gSaveContext.infTable[25]); + gSaveContext.infTable[25] &= 0x1FF; + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更後 ☆☆ %x\n" VT_RST, gSaveContext.infTable[25]); + osSyncPrintf("\n\n"); + this->actionFunc = func_80ABA654; + return; + } + if (this->unk_26A != this->cuccosInPen) { + if (this->cuccosInPen < this->unk_26A) { + func_80078884(NA_SE_SY_ERROR); + } else if (phi_s1 + 1 < 9) { + func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + } + } + if (this->unk_26A < this->cuccosInPen) { + this->unk_26A = this->cuccosInPen; + return; + } + } + } else { + func_8002F2CC(&this->actor, globalCtx, 100.0f); + } +} + +void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) { + if (this->unk_262 == func_8010BDBC(&globalCtx->msgCtx) && func_80106BC8(globalCtx) != 0) { + func_80106CCC(globalCtx); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ハート ☆☆☆☆☆ %d\n" VT_RST, this->unk_26C); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 爆弾 ☆☆☆☆☆ %d\n" VT_RST, this->unk_272); + osSyncPrintf("\n\n"); + this->unk_26E = 0xB; + if (!(gSaveContext.itemGetInf[0] & 0x1000)) { + this->actor.parent = NULL; + this->unk_284 = 0xF; + func_8002F434(&this->actor, globalCtx, 0xF, 100.0f, 50.0f); + this->actionFunc = func_80ABAC00; + return; + } + if (this->unk_26C == 1) { + this->unk_284 = 0x55; + func_8002F434(&this->actor, globalCtx, 0x55, 100.0f, 50.0f); + this->actionFunc = func_80ABAC00; + } + this->actionFunc = func_80ABA244; + } +} + +static s16 sTradeItemTextIds[] = { 0x503E, 0x503F, 0x5047, 0x5040, 0x5042, 0x5043, + 0x5044, 0x00CF, 0x5045, 0x5042, 0x5027 }; + +void func_80ABA778(EnNiwLady* this, GlobalContext* globalCtx) { + //☆☆☆☆☆ Adult message check ☆☆☆☆☆ + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ アダルトメッセージチェック ☆☆☆☆☆ \n" VT_RST); + this->unk_262 = 6; + this->unk_273 = 0; + if (!(gSaveContext.itemGetInf[2] & 0x1000)) { + if (this->unk_274 != 0) { + this->unk_27A = 1; + } else { + this->unk_27A = 0; + } + this->unk_273 = 1; + this->unk_262 = 4; + } else { + this->unk_27A = 2; + if (!(gSaveContext.itemGetInf[2] & 0x4000)) { + this->unk_27A = 3; + if (gSaveContext.eventChkInf[6] & 0x400) { + this->unk_27A = 9; + if (this->unk_277 != 0) { + this->unk_27A = 10; + } + } else { + this->unk_27A = 4; + } + } + } + this->actor.textId = sTradeItemTextIds[this->unk_27A]; + this->actionFunc = func_80ABA878; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80AB9D60.s") +void func_80ABA878(EnNiwLady* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + s8 playerExchangeItemId; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80AB9F24.s") + if ((func_8010BDBC(&globalCtx->msgCtx) == 0) || (func_8010BDBC(&globalCtx->msgCtx) == 6)) { + this->unk_26E = 11; + } + if (func_8002F194(&this->actor, globalCtx) != 0) { + playerExchangeItemId = func_8002F368(globalCtx); + if ((playerExchangeItemId == 6) && (gSaveContext.eventChkInf[6] & 0x400)) { + func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + player->actor.textId = sTradeItemTextIds[5]; + this->unk_26E = this->unk_27A + 21; + this->unk_262 = 4; + this->actionFunc = func_80ABAB08; + } else if (playerExchangeItemId != 0) { + player->actor.textId = sTradeItemTextIds[7]; + this->unk_26E = this->unk_27A + 21; + } else { + this->unk_274 = 1; + this->unk_26E = this->unk_27A + 21; + this->actionFunc = !this->unk_273 ? func_80ABA778 : func_80ABA9B8; + } + } else { + func_8002F298(&this->actor, globalCtx, 50.0f, 6); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABA21C.s") +void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) { + if ((this->unk_262 == func_8010BDBC(&globalCtx->msgCtx)) && (func_80106BC8(globalCtx) != 0)) { + switch (globalCtx->msgCtx.choiceIndex) { + case 0: + func_80106CCC(globalCtx); + this->actor.parent = NULL; + func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f); + this->actionFunc = func_80ABAC00; + break; + case 1: + this->actor.textId = sTradeItemTextIds[3]; + this->unk_26E = this->unk_27A + 21; + func_8010B720(globalCtx, this->actor.textId); + this->unk_262 = 5; + this->actionFunc = func_80ABAA9C; + break; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABA244.s") +void func_80ABAA9C(EnNiwLady* this, GlobalContext* globalCtx) { + this->unk_26E = 11; + if ((this->unk_262 == func_8010BDBC(&globalCtx->msgCtx)) && (func_80106BC8(globalCtx) != 0)) { + func_80106CCC(globalCtx); + this->actionFunc = func_80ABA778; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABA654.s") +void func_80ABAB08(EnNiwLady* this, GlobalContext* globalCtx) { + if ((this->unk_262 == func_8010BDBC(&globalCtx->msgCtx)) && (func_80106BC8(globalCtx) != 0)) { + switch (globalCtx->msgCtx.choiceIndex) { + case 0: + func_80106CCC(globalCtx); + this->actor.parent = NULL; + func_8002F434(&this->actor, globalCtx, 0xE, 200.0f, 100.0f); + this->actionFunc = func_80ABAC00; + break; + case 1: + func_80106CCC(globalCtx); + this->unk_277 = 1; + this->actor.textId = sTradeItemTextIds[8]; + this->unk_26E = this->unk_27A + 21; + func_8010B720(globalCtx, this->actor.textId); + this->unk_262 = 5; + this->actionFunc = func_80ABAA9C; + break; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABA778.s") +void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) { + s32 getItemId; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABA878.s") + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actionFunc = func_80ABAC84; + } else { + getItemId = this->unk_284; + if (LINK_IS_ADULT) { + getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO; + } + func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABA9B8.s") +void func_80ABAC84(EnNiwLady* this, GlobalContext* globalCtx) { + if ((func_8010BDBC(&globalCtx->msgCtx) != 6) || (func_80106BC8(globalCtx) == 0)) { + return; + } + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); + if (LINK_IS_ADULT) { + if (!(gSaveContext.itemGetInf[2] & 0x1000)) { + gSaveContext.itemGetInf[2] |= 0x1000; + } else { + gSaveContext.itemGetInf[2] |= 0x4000; + } + this->actionFunc = func_80ABA778; + } else { + gSaveContext.itemGetInf[0] |= 0x1000; + this->unk_262 = 6; + this->actionFunc = func_80ABA244; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABAA9C.s") +void func_80ABAD38(EnNiwLady* this, GlobalContext* globalCtx) { + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 通常メッセージチェック ☆☆☆☆☆ \n" VT_RST); + this->unk_262 = 6; + this->actionFunc = func_80ABAD7C; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABAB08.s") +void func_80ABAD7C(EnNiwLady* this, GlobalContext* globalCtx) { + this->actor.textId = 0x503D; + if (Text_GetFaceReaction(globalCtx, 8) != 0) { + this->actor.textId = Text_GetFaceReaction(globalCtx, 8); + } + if ((func_8010BDBC(&globalCtx->msgCtx) == 0) || (func_8010BDBC(&globalCtx->msgCtx) == 6)) { + this->unk_26E = 8; + } + if (func_8002F194(&this->actor, globalCtx) != 0) { + this->unk_274 = 1; + this->unk_26E = this->unk_27A + 9; + this->actionFunc = func_80ABAD38; + } else { + func_8002F2CC(&this->actor, globalCtx, 100.0f); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABAC00.s") +void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnNiwLady* this = THIS; + Player* player = PLAYER; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABAC84.s") + Actor_SetHeight(thisx, 60.0f); + this->unk_288.unk_18 = player->actor.posRot.pos; + if (LINK_IS_CHILD) { + this->unk_288.unk_18.y = player->actor.posRot.pos.y - 10.0f; + } + func_80034A14(thisx, &this->unk_288, 2, 4); + this->unk_254 = this->unk_288.unk_08; + this->unk_25A = this->unk_288.unk_0E; + if (this->unk_276 == 0) { + Math_SmoothScaleMaxMinS(&this->unk_254.y, 0, 5, 3000, 0); + } + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->objectOsAnimeIndex].segment); + if (this->objectOsAnimeIndex >= 0) { + if (this->unk_27E != 0) { + if (this->unk_26E != 0) { + this->unk_26E--; + EnNiwLady_ChoseAnimation(this, globalCtx, this->unk_26E); + this->unk_26E = 0; + } + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + } + this->objectAneIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_ANE); + if (this->objectAneIndex >= 0) { + this->actionFunc(this, globalCtx); + if (this->unusedTimer2 != 0) { + this->unusedTimer2--; + } + if (this->unusedRandomTimer != 0) { + this->unusedRandomTimer--; + } + this->unusedTimer++; + if (this->unusedRandomTimer == 0) { + this->faceState++; + if (this->faceState >= 3) { + this->faceState = 0; + this->unusedRandomTimer = ((s16)Math_Rand_ZeroFloat(60.0f) + 0x14); + } + } + func_8002E4B4(globalCtx, thisx, 20.0f, 20.0f, 60.0f, 0x1D); + Collider_CylinderUpdate(thisx, &this->collider); + if (1) {} + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABAD38.s") +Gfx* func_80ABB0A0(GraphicsContext* gfxCtx) { + Gfx* dList; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABAD7C.s") + dList = Graph_Alloc(gfxCtx, sizeof(Gfx)); + gSPEndDisplayList(dList); + return dList; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/EnNiwLady_Update.s") +s32 EnNiwLady_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { + EnNiwLady* this = THIS; + s32 pad; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABB0A0.s") + if (limbIndex == 15) { + rot->x += this->unk_254.y; + rot->z += this->unk_254.x; + } + if (limbIndex == 8) { + rot->x += this->unk_25A.y; + } + if (this->unk_275 != 0) { + if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) { + rot->y += (Math_Sins((globalCtx->state.frames * ((limbIndex * 0x32) + 0x814))) * 200.0f); + rot->z += (Math_Coss((globalCtx->state.frames * ((limbIndex * 0x32) + 0x940))) * 200.0f); + } + } + return 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABB0CC.s") +void EnNiwLady_Draw(Actor* thisx, GlobalContext* globalCtx) { + static Gfx* D_80ABB408[] = { 0x060008C8, 0x060010C8, 0x060018C8 }; + EnNiwLady* this = THIS; + s32 pad; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Niw_Lady/func_80ABB228.s") + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_niw_lady.c", 1347); + if (this->unk_27E != 0) { + func_80093D18(globalCtx->state.gfxCtx); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80ABB408[this->faceState])); + gSPSegment(POLY_OPA_DISP++, 0x0C, func_80ABB0A0(globalCtx->state.gfxCtx)); + SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, + EnNiwLady_OverrideLimbDraw, 0, thisx); + } + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_niw_lady.c", 1370); +} diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h index 0a4afefaa..cf84a257f 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h @@ -6,9 +6,40 @@ struct EnNiwLady; +typedef void (*EnNiwLadyActionFunc)(struct EnNiwLady*, GlobalContext*); + typedef struct EnNiwLady { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x1B0]; + /* 0x014C */ SkelAnime skelAnime; + /* 0x0190 */ Vec3s limbDrawTable[16]; + /* 0x01F0 */ Vec3s transitionDrawTable[16]; + /* 0x0250 */ EnNiwLadyActionFunc actionFunc; + /* 0x0254 */ Vec3s unk_254; + /* 0x025A */ Vec3s unk_25A; + /* 0x0260 */ s16 unusedTimer; + /* 0x0262 */ s16 unk_262; // "message_end_code" + /* 0x0264 */ s16 unusedTimer2; + /* 0x0266 */ s16 unusedRandomTimer; + /* 0x0268 */ s16 cuccosInPen; + /* 0x026A */ s16 unk_26A; + /* 0x026C */ s16 unk_26C; + /* 0x026E */ s16 unk_26E; + /* 0x0270 */ s16 unk_270; + /* 0x0272 */ u8 unk_272; + /* 0x0273 */ u8 unk_273; + /* 0x0274 */ u8 unk_274; + /* 0x0275 */ u8 unk_275; + /* 0x0276 */ u8 unk_276; + /* 0x0277 */ u8 unk_277; + /* 0x0278 */ s16 unk_278; + /* 0x027A */ s16 unk_27A; + /* 0x027C */ s16 faceState; + /* 0x027E */ s16 unk_27E; + /* 0x0280 */ s8 objectAneIndex; + /* 0x0281 */ s8 objectOsAnimeIndex; + /* 0x0284 */ s32 unk_284; + /* 0x0288 */ struct_80034A14_arg1 unk_288; + /* 0x02B0 */ ColliderCylinder collider; } EnNiwLady; // size = 0x02FC extern const ActorInit En_Niw_Lady_InitVars; |
