Bombers2 OK (#721)

* OK

* OK

* cleanups

* restore makefile

* format

* format

* format

* Update src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update object_cs.xml

* fixes

* format

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: angie <angheloalf95@gmail.com>
This commit is contained in:
louist103 2022-03-27 10:47:34 -04:00 committed by GitHub
parent f1d1173558
commit 928acac500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 444 additions and 53 deletions

View File

@ -20,7 +20,7 @@
<Animation Name="object_cs_Anim_0057C8" Offset="0x57C8" />
<Animation Name="object_cs_Anim_005DC4" Offset="0x5DC4" />
<Animation Name="object_cs_Anim_0060E8" Offset="0x60E8" />
<Animation Name="object_cs_Anim_0064B8" Offset="0x64B8" />
<Animation Name="gBomberIdleAnim" Offset="0x64B8" />
<DList Name="object_cs_DL_009130" Offset="0x9130" />
<DList Name="object_cs_DL_009478" Offset="0x9478" />
<DList Name="object_cs_DL_009578" Offset="0x9578" />
@ -62,7 +62,7 @@
<Texture Name="object_cs_Tex_00D520" OutName="tex_00D520" Format="rgba16" Width="32" Height="32" Offset="0xD520" />
<Texture Name="object_cs_Tex_00DD20" OutName="tex_00DD20" Format="i8" Width="32" Height="32" Offset="0xDD20" />
<Texture Name="object_cs_Tex_00E120" OutName="tex_00E120" Format="i8" Width="16" Height="16" Offset="0xE120" />
<Blob Name="object_cs_Blob_00E220" Size="0x400" Offset="0xE220" />
<Texture Name="object_cs_Tex_00E220" OutName="tex_00E220" Format="i8" Width="32" Height="32" Offset="0xE220"/>
<Texture Name="object_cs_Tex_00E620" OutName="tex_00E620" Format="i8" Width="32" Height="32" Offset="0xE620" />
<Texture Name="object_cs_Tex_00EA20" OutName="tex_00EA20" Format="i8" Width="32" Height="32" Offset="0xEA20" />
<Texture Name="object_cs_Tex_00EE20" OutName="tex_00EE20" Format="i8" Width="32" Height="32" Offset="0xEE20" />

View File

@ -863,10 +863,8 @@ typedef struct {
/* 0x12046 */ UNK_TYPE1 pad12046[0x2];
/* 0x12048 */ u8 unk12048; // EnKakasi
/* 0x12049 */ UNK_TYPE1 pad12049[0xB];
/* 0x12054 */ s16 unk12054; // First digit in lottery code guess
/* 0x12056 */ s16 unk12056; // Second digit lottery code guess
/* 0x12058 */ s16 unk12058; // Third digit lottery code guess
/* 0x1205A */ UNK_TYPE1 pad1205A[0x10];
/* 0x12054 */ s16 unk12054[5]; // Number entry
/* 0x1205A */ UNK_TYPE1 pad1205A[0xC];
/* 0x1206A */ s16 unk1206A;
/* 0x1206C */ s32 unk1206C;
/* 0x12070 */ s32 unk12070;

3
spec
View File

@ -5003,8 +5003,7 @@ beginseg
name "ovl_En_Bombers2"
compress
include "build/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.o"
include "build/data/ovl_En_Bombers2/ovl_En_Bombers2.data.o"
include "build/data/ovl_En_Bombers2/ovl_En_Bombers2.reloc.o"
include "build/src/overlays/actors/ovl_En_Bombers2/ovl_En_Bombers2_reloc.o"
endseg
beginseg

View File

@ -720,8 +720,8 @@ s16 Inventory_GetSkullTokenCount(s16 sceneIndex) {
void Inventory_SaveLotteryCodeGuess(GlobalContext* globalCtx) {
u16 lotteryCodeGuess;
lotteryCodeGuess = ((globalCtx->msgCtx.unk12054 & 0xF) << 8); // First Digit
lotteryCodeGuess |= ((globalCtx->msgCtx.unk12056 & 0xF) << 4); // Second Digit
lotteryCodeGuess |= (globalCtx->msgCtx.unk12058 & 0xF); // Third Digit
lotteryCodeGuess = ((globalCtx->msgCtx.unk12054[0] & 0xF) << 8); // First Digit
lotteryCodeGuess |= ((globalCtx->msgCtx.unk12054[1] & 0xF) << 4); // Second Digit
lotteryCodeGuess |= (globalCtx->msgCtx.unk12054[2] & 0xF); // Third Digit
gSaveContext.lotteryCodeGuess = (gSaveContext.lotteryCodeGuess & 0xFFFF0000) | (lotteryCodeGuess & 0xFFFF);
}

View File

@ -50,7 +50,7 @@ const ActorInit En_Bom_Bowl_Man_InitVars = {
};
static AnimationHeader* sAnimations[] = {
&object_cs_Anim_0064B8, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
&gBomberIdleAnim, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
&object_cs_Anim_002044, &object_cs_Anim_01007C, &object_cs_Anim_00349C, &object_cs_Anim_004960,
&object_cs_Anim_005128, &object_cs_Anim_004C1C, &object_cs_Anim_001A1C, &object_cs_Anim_003EE4,
&object_cs_Anim_00478C, &object_cs_Anim_00433C, &object_cs_Anim_0060E8, &object_cs_Anim_001708,
@ -76,7 +76,7 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &gBomberIdleAnim, this->jointTable,
this->morphTable, 21);
this->unk_2F6 = ENBOMBOWLMAN_GET_F0(&this->actor);
this->unk_2F4 = ENBOMBOWLMAN_GET_F(&this->actor);

View File

@ -58,7 +58,7 @@ static ColliderCylinderInit sCylinderInit = {
};
AnimationHeader* D_80C0479C[] = {
&object_cs_Anim_0064B8, &object_cs_Anim_0053F4, &object_cs_Anim_01007C, &object_cs_Anim_00349C,
&gBomberIdleAnim, &object_cs_Anim_0053F4, &object_cs_Anim_01007C, &object_cs_Anim_00349C,
&object_cs_Anim_004960, &object_cs_Anim_005128, &object_cs_Anim_004C1C, &object_cs_Anim_001A1C,
&object_cs_Anim_003EE4, &object_cs_Anim_00478C, &object_cs_Anim_00433C, &object_cs_Anim_0060E8,
&object_cs_Anim_001708, &object_cs_Anim_005DC4, &object_cs_Anim_0026B0, &object_cs_Anim_0036B0,
@ -94,7 +94,7 @@ void EnBombers_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
this->actor.gravity = -1.0f;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &gBomberIdleAnim, this->jointTable,
this->morphtable, 21);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.targetMode = 0;

View File

@ -18,8 +18,11 @@ void EnBombers2_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80C04BA0(EnBombers2* this, GlobalContext* globalCtx);
void func_80C04D8C(EnBombers2* this, GlobalContext* globalCtx);
void func_80C0520C(EnBombers2* this, GlobalContext* globalCtx);
void func_80C04B40(EnBombers2* this);
void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed);
void func_80C04D00(EnBombers2* this);
void func_80C050B8(EnBombers2* this, GlobalContext* globalCtx);
#if 0
const ActorInit En_Bombers2_InitVars = {
ACTOR_EN_BOMBERS2,
ACTORCAT_NPC,
@ -32,39 +35,403 @@ const ActorInit En_Bombers2_InitVars = {
(ActorFunc)EnBombers2_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80C058B0 = {
{ COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
static u16 sTextIds[] = {
0x0727, 0x0728, 0x0726, 0x0729, 0x072B, 0x0725, 0x072A, 0x073C,
};
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_NONE,
AC_NONE,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_NONE | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_ON,
},
{ 35, 30, 0, { 0, 0, 0 } },
};
#endif
static AnimationHeader* sAnimations[] = {
&gBomberIdleAnim, &object_cs_Anim_0053F4, &object_cs_Anim_01007C, &object_cs_Anim_00349C,
&object_cs_Anim_0060E8, &object_cs_Anim_005DC4, &object_cs_Anim_0026B0,
};
extern ColliderCylinderInit D_80C058B0;
static u8 sAnimModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
};
extern UNK_TYPE D_060064B8;
static Gfx sSetPrimColorDL[] = {
gsDPSetPrimColor(0, 0xFF, 198, 140, 0, 255),
gsSPEndDisplayList(),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/EnBombers2_Init.s")
static Gfx* sSetPrimColorDlPtr = sSetPrimColorDL;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/EnBombers2_Destroy.s")
static TexturePtr sEyeTextures[] = {
object_cs_Tex_00C520,
object_cs_Tex_00CD20,
object_cs_Tex_00D520,
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C04AAC.s")
static TexturePtr D_80C05920 = object_cs_Tex_00E220;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C04B40.s")
void EnBombers2_Init(Actor* thisx, GlobalContext* globalCtx) {
f32 cos;
EnBombers2* this = (EnBombers2*)thisx;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C04BA0.s")
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &gBomberIdleAnim, this->morphTable,
this->jointTable, OBJECT_CS_LIMB_MAX);
this->actor.targetMode = 6;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
if ((gSaveContext.weekEventReg[0x49] & 0x80) || (gSaveContext.entranceIndex == 0xD220)) {
this->actor.world.pos.x += Math_SinS(this->actor.home.rot.y + 0xC100) * 50.0f;
cos = Math_CosS(this->actor.home.rot.y + 0xC100) * 50.0f;
this->unk_2AC = 1;
this->actor.world.pos.z += cos;
}
this->cutscene = this->actor.cutscene;
if (this->cutscene == 0) {
Actor_MarkForDeath(&this->actor);
}
func_80C04B40(this);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C04D00.s")
void EnBombers2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnBombers2* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C04D8C.s")
Collider_DestroyCylinder(globalCtx, &this->collider);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C050B8.s")
void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed) {
f32 lastFrame;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C0520C.s")
this->animIndex = animIndex;
lastFrame = Animation_GetLastFrame(sAnimations[this->animIndex]);
this->lastAnimFrame = lastFrame;
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], playSpeed, 0.0f, lastFrame,
sAnimModes[this->animIndex], -10.0f);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/EnBombers2_Update.s")
void func_80C04B40(EnBombers2* this) {
if (this->unk_2AC == 0) {
EnBombers2_ChangeAnim(this, 4, 1.0f);
} else {
EnBombers2_ChangeAnim(this, 0, 1.0f);
}
this->unk_2C0 = 0;
this->actionFunc = func_80C04BA0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/func_80C056D4.s")
void func_80C04BA0(EnBombers2* this, GlobalContext* globalCtx) {
s32 yawDiffAbs;
s16 yawDiff;
Player* player;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bombers2/EnBombers2_Draw.s")
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
yawDiffAbs = ABS_ALT(yawDiff);
player = GET_PLAYER(globalCtx);
switch (player->transformation) {
case PLAYER_FORM_GORON:
case PLAYER_FORM_ZORA:
this->textIdIndex = 1;
this->unk_2CE = 5;
break;
case PLAYER_FORM_DEKU:
case PLAYER_FORM_HUMAN:
this->textIdIndex = 2;
this->unk_2CE = 5;
break;
}
if (this->unk_2AC != 0) {
this->textIdIndex = 7;
}
this->actor.textId = sTextIds[this->textIdIndex];
if (Text_GetFaceReaction(globalCtx, 0x15) != 0) {
this->actor.textId = Text_GetFaceReaction(globalCtx, 0x15);
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_2B6 = this->actor.world.rot.y;
gSaveContext.weekEventReg[0x56] |= 2;
func_80C04D00(this);
return;
}
if (yawDiffAbs < 0x3BB5) {
func_800B8614(&this->actor, globalCtx, 70.0f);
}
}
void func_80C04D00(EnBombers2* this) {
if ((this->textIdIndex == 0) || (this->textIdIndex == 1)) {
EnBombers2_ChangeAnim(this, 5, 1.0f);
} else {
EnBombers2_ChangeAnim(this, 1, 1.0f);
}
this->unk_2A8 = 0;
if (this->unk_2AC != 0) {
EnBombers2_ChangeAnim(this, 6, 1.0f);
}
this->unk_2C0 = 1;
this->actionFunc = func_80C04D8C;
}
void func_80C04D8C(EnBombers2* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
f32 temp = this->skelAnime.curFrame;
if ((this->unk_2AC == 0) && (this->lastAnimFrame <= temp)) {
if (!(this->unk_2A8 & 1)) {
EnBombers2_ChangeAnim(this, 1, 1.0f);
} else {
EnBombers2_ChangeAnim(this, 5, 1.0f);
}
this->unk_2A8++;
this->unk_2A8 &= 1;
}
switch (player->transformation) {
case PLAYER_FORM_HUMAN:
this->unk_28E = -0xFA0;
break;
case PLAYER_FORM_GORON:
case PLAYER_FORM_ZORA:
this->unk_28E = -0x1770;
break;
default:
break;
}
if ((this->unk_2CE == Message_GetState(&globalCtx->msgCtx)) && (func_80147624(globalCtx) != 0)) {
if (this->unk_2CE == 0xF) {
s32 i;
s32 correctDigits;
for (i = 0; i < ARRAY_COUNT(this->correctDigitSlots); i++) {
if (!(this->correctDigitSlots[i]) && (globalCtx->msgCtx.unk12054[i] == gSaveContext.bomberCode[i])) {
this->correctDigitSlots[i] = true;
}
}
for (i = 0, correctDigits = 0; i < ARRAY_COUNT(this->correctDigitSlots); i++) {
if (this->correctDigitSlots[i]) {
correctDigits++;
}
}
if (correctDigits >= 5) {
this->textIdIndex = 6;
this->actor.textId = sTextIds[this->textIdIndex];
func_80151938(globalCtx, this->actor.textId);
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART);
this->unk_2CE = 5;
return;
}
}
if (Text_GetFaceReaction(globalCtx, 0x15) != 0) {
this->unk_28E = 0;
func_801477B4(globalCtx);
func_80C04B40(this);
} else {
s32 j;
switch (this->textIdIndex) {
case 0:
case 1:
case 5:
case 7:
this->unk_28E = 0;
func_801477B4(globalCtx);
func_80C04B40(this);
break;
case 2:
this->textIdIndex = 3;
this->actor.textId = sTextIds[this->textIdIndex];
func_80151938(globalCtx, this->actor.textId);
this->unk_2CE = 0xF;
break;
case 3:
for (j = 0; j < ARRAY_COUNT(this->correctDigitSlots); j++) {
this->correctDigitSlots[j] = false;
}
this->textIdIndex = 4;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR);
this->actor.textId = sTextIds[this->textIdIndex];
func_80151938(globalCtx, this->actor.textId);
this->unk_2CE = 5;
break;
case 4:
this->textIdIndex = 5;
this->actor.textId = sTextIds[this->textIdIndex];
func_80151938(globalCtx, this->actor.textId);
this->unk_2CE = 5;
break;
case 6:
globalCtx->msgCtx.unk11F10 = 0;
func_80C050B8(this, globalCtx);
break;
}
}
}
}
void func_80C050B8(EnBombers2* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 homeYawToPlayer;
EnBombers2_ChangeAnim(this, 2, 1.0f);
this->unk_2A8 = 0;
homeYawToPlayer = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos);
Math_Vec3f_Copy(&this->unk_29C, &this->actor.world.pos);
if (this->actor.home.rot.y < homeYawToPlayer) {
this->unk_29C.x += Math_SinS(this->actor.home.rot.y + 0xC100) * 50.0f;
this->unk_29C.z += Math_CosS(this->actor.home.rot.y + 0xC100) * 50.0f;
} else {
this->unk_29C.x += Math_SinS(this->actor.home.rot.y + 0x3F00) * 50.0f;
this->unk_29C.z += Math_CosS(this->actor.home.rot.y + 0x3F00) * 50.0f;
}
this->unk_2B6 = Math_Vec3f_Yaw(&this->actor.home.pos, &this->unk_29C);
this->unk_2C0 = 2;
this->actionFunc = func_80C0520C;
}
void func_80C0520C(EnBombers2* this, GlobalContext* globalCtx) {
if (this->unk_2A8 == 0) {
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
ActorCutscene_Stop(0x7C);
ActorCutscene_SetIntentToPlay(this->cutscene);
} else if (ActorCutscene_GetCanPlayNext(this->cutscene) == 0) {
ActorCutscene_SetIntentToPlay(this->cutscene);
} else {
ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor);
this->unk_2A8 = 1;
}
} else {
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2B6, 1, 0xBB8, 0);
if ((fabsf(this->unk_29C.x - this->actor.world.pos.x) < 3.0f) &&
(fabsf(this->unk_29C.z - this->actor.world.pos.z) < 3.0f)) {
this->unk_2B6 = this->actor.yawTowardsPlayer;
this->actor.speedXZ = 0.0f;
if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) < 100.0f) {
func_801477B4(globalCtx);
this->unk_2CE = 5;
this->textIdIndex = 7;
EnBombers2_ChangeAnim(this, 6, 1.0f);
this->unk_2A8 = 0;
this->unk_2C0 = 1;
gSaveContext.weekEventReg[0x49] |= 0x80;
ActorCutscene_Stop(this->cutscene);
this->unk_2AC = 1;
this->actor.textId = sTextIds[this->textIdIndex];
Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = func_80C04D8C;
}
} else {
Math_ApproachF(&this->actor.world.pos.x, this->unk_29C.x, 0.3f, 1.0f);
Math_ApproachF(&this->actor.world.pos.z, this->unk_29C.z, 0.3f, 1.0f);
}
}
}
void EnBombers2_Update(Actor* thisx, GlobalContext* globalCtx) {
EnBombers2* this = (EnBombers2*)thisx;
f32 temp_f4;
Vec3f sp34;
s32 yawDiffAbs;
SkelAnime_Update(&this->skelAnime);
if (this->unk_2B2 != 0) {
this->unk_2B2--;
}
if ((this->animIndex == 2) &&
(Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) ||
Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK);
}
this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->unk_2C0 != 2) {
yawDiffAbs = ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y));
this->unk_290 = 0;
if (yawDiffAbs < 0x3A98) {
this->unk_290 = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
if (this->unk_290 >= 0x2711) {
this->unk_290 = 0x2710;
} else if (this->unk_290 < -0x2710) {
this->unk_290 = -0x2710;
}
}
}
Actor_SetFocus(&this->actor, 20.0f);
Actor_SetScale(&this->actor, 0.008f);
this->actionFunc(this, globalCtx);
Actor_MoveWithGravity(&this->actor);
Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 0xBB8, 0);
Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 0xBB8, 0);
if (this->unk_2BE == 0) {
this->eyeIndex += 1;
if (this->eyeIndex >= 3) {
this->eyeIndex = 0;
this->unk_2BE = (s16)Rand_ZeroFloat(60.0f) + 0x14;
}
}
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
if (this->unk_2AC == 0) {
this->actor.world.pos.x = (Math_SinS((this->actor.world.rot.y + 0x8000)) * 26.0f) + sp34.x;
temp_f4 = Math_CosS(this->actor.world.rot.y + 0x8000) * 26.0f;
this->actor.world.pos.z = temp_f4 + sp34.z;
this->collider.dim.radius = 0x23;
this->collider.dim.height = 0x1E;
} else {
this->collider.dim.radius = 0xA;
this->collider.dim.height = 0x19;
}
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->unk_2AC == 0) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
}
Math_Vec3f_Copy(&this->actor.world.pos, &sp34);
}
s32 func_80C056D4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnBombers2* this = THIS;
if (limbIndex == OBJECT_CS_LIMB_08) {
rot->x += this->unk_296;
}
if (limbIndex == OBJECT_CS_LIMB_11) {
rot->x += this->unk_28A;
rot->z += this->unk_288;
}
if ((limbIndex == OBJECT_CS_LIMB_0F) || (limbIndex == OBJECT_CS_LIMB_13) || (limbIndex == OBJECT_CS_LIMB_14)) {
*dList = NULL;
}
return false;
}
void EnBombers2_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnBombers2* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex]));
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C05920));
gSPSegment(POLY_OPA_DISP++, 0x0A, Lib_SegmentedToVirtual(sSetPrimColorDlPtr));
Scene_SetRenderModeXlu(globalCtx, 0, 1);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_80C056D4, NULL, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}

View File

@ -3,15 +3,42 @@
#include "global.h"
#include "objects/object_cs/object_cs.h"
struct EnBombers2;
typedef void (*EnBombers2ActionFunc)(struct EnBombers2*, GlobalContext*);
typedef struct EnBombers2 {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x140];
/* 0x014C */ SkelAnime skelAnime;
/* 0x0188 */ Vec3s morphTable[OBJECT_CS_LIMB_MAX];
/* 0x0206 */ Vec3s jointTable[OBJECT_CS_LIMB_MAX];
/* 0x0284 */ EnBombers2ActionFunc actionFunc;
/* 0x0288 */ char unk_288[0x94];
/* 0x0288 */ s16 unk_288;
/* 0x028A */ s16 unk_28A;
/* 0x028C */ UNK_TYPE1 pad_28C[2];
/* 0x028E */ s16 unk_28E;
/* 0x0290 */ s16 unk_290;
/* 0x0292 */ UNK_TYPE1 pad_292[4];
/* 0x0296 */ s16 unk_296;
/* 0x0298 */ UNK_TYPE1 pad_298[4];
/* 0x029C */ Vec3f unk_29C;
/* 0x02A8 */ s32 unk_2A8;
/* 0x02AC */ u8 unk_2AC;
/* 0x02AE */ s16 animIndex;
/* 0x02B0 */ s16 cutscene;
/* 0x02B2 */ s16 unk_2B2;
/* 0x02B4 */ s16 unk_2B4;
/* 0x02B6 */ s16 unk_2B6;
/* 0x02B8 */ f32 lastAnimFrame;
/* 0x02BC */ s16 eyeIndex;
/* 0x02BE */ s16 unk_2BE;
/* 0x02C0 */ s16 unk_2C0;
/* 0x02C2 */ s16 textIdIndex;
/* 0x02C4 */ s16 correctDigitSlots[5];
/* 0x02CE */ s16 unk_2CE;
/* 0x02D0 */ ColliderCylinder collider;
} EnBombers2; // size = 0x31C
extern const ActorInit En_Bombers2_InitVars;

View File

@ -89,7 +89,7 @@ u16 D_80C00A70[] = {
u16 D_80C00A8C[] = { 0x736, 0x737, 0x738, 0x74E };
static AnimationHeader* sAnimations[] = {
&object_cs_Anim_0064B8, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
&gBomberIdleAnim, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
&object_cs_Anim_002044, &object_cs_Anim_01007C, &object_cs_Anim_00349C, &object_cs_Anim_004960,
&object_cs_Anim_005128, &object_cs_Anim_004C1C, &object_cs_Anim_001A1C, &object_cs_Anim_003EE4,
&object_cs_Anim_00478C, &object_cs_Anim_00433C, &object_cs_Anim_0060E8, &object_cs_Anim_001708,
@ -114,8 +114,8 @@ void EnBomjima_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable,
this->morphTable, 21);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &gBomberIdleAnim, this->jointTable,
this->morphTable, OBJECT_CS_LIMB_MAX);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
gSaveContext.weekEventReg[83] &= (u8)~4;
this->actor.targetMode = 0;

View File

@ -78,8 +78,8 @@ void EnBomjimb_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
this->actor.gravity = -2.0f;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable,
this->morphTable, 21);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &gBomberIdleAnim, this->jointTable,
this->morphTable, OBJECT_CS_LIMB_MAX);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.targetMode = 6;
Actor_SetScale(&this->actor, 0.01f);
@ -160,7 +160,7 @@ void EnBomjimb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80C0113C(EnBomjimb* this, s32 arg1, f32 arg2) {
static AnimationHeader* sAnimations[] = {
&object_cs_Anim_0064B8, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
&gBomberIdleAnim, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
&object_cs_Anim_002044, &object_cs_Anim_01007C, &object_cs_Anim_00349C, &object_cs_Anim_004960,
&object_cs_Anim_005128, &object_cs_Anim_004C1C, &object_cs_Anim_002930, &object_cs_Anim_001A1C,
&object_cs_Anim_003EE4, &object_cs_Anim_00478C, &object_cs_Anim_00433C, &object_cs_Anim_0060E8,

View File

@ -16534,7 +16534,7 @@
0x80C04614:("EnBombers_Draw",),
0x80C04930:("EnBombers2_Init",),
0x80C04A80:("EnBombers2_Destroy",),
0x80C04AAC:("func_80C04AAC",),
0x80C04AAC:("EnBombers2_ChangeAnim",),
0x80C04B40:("func_80C04B40",),
0x80C04BA0:("func_80C04BA0",),
0x80C04D00:("func_80C04D00",),

View File

@ -16144,9 +16144,9 @@
0x80BE6150:("En_Tanron6_InitVars","UNK_TYPE1","",0x1),
0x80BE6170:("D_80BE6170","UNK_TYPE1","",0x1),
0x80BE78D0:("En_Daiku2_InitVars","UNK_TYPE1","",0x1),
0x80BE78F0:("sTextIds","UNK_TYPE1","",0x1),
0x80BE78F0:("sTextIds","s16","",0x1),
0x80BE7900:("D_80BE7900","UNK_TYPE1","",0x1),
0x80BE792C:("sAnimations","UNK_TYPE1","",0x1),
0x80BE792C:("sAnimations","AnimationHeader*","",0x1),
0x80BE7958:("D_80BE7958","UNK_TYPE1","",0x1),
0x80BE7970:("D_80BE7970","f32","",0x4),
0x80BE7974:("D_80BE7974","f32","",0x4),
@ -16413,13 +16413,13 @@
0x80C0482C:("D_80C0482C","UNK_TYPE1","",0x1),
0x80C04838:("D_80C04838","UNK_TYPE1","",0x1),
0x80C05880:("En_Bombers2_InitVars","UNK_TYPE1","",0x1),
0x80C058A0:("D_80C058A0","UNK_TYPE1","",0x1),
0x80C058B0:("D_80C058B0","UNK_TYPE1","",0x1),
0x80C058DC:("D_80C058DC","UNK_TYPE1","",0x1),
0x80C058F8:("D_80C058F8","UNK_TYPE1","",0x1),
0x80C05900:("D_80C05900","UNK_TYPE1","",0x1),
0x80C05910:("D_80C05910","UNK_PTR","",0x4),
0x80C05914:("D_80C05914","UNK_TYPE1","",0x1),
0x80C058A0:("sTextIds","u16","",0x1),
0x80C058B0:("sCylinderInit","UNK_TYPE1","",0x1),
0x80C058DC:("sAnimations","AnimationHeader*","",0x1),
0x80C058F8:("sAnimModes","u8","",0x1),
0x80C05900:("sSetPrimColorDL","UNK_TYPE1","",0x1),
0x80C05910:("sSetPrimColorDlPtr","Gfx*","",0x4),
0x80C05914:("sEyeTextures","void*","",0x1),
0x80C05920:("D_80C05920","UNK_TYPE4","",0x4),
0x80C05930:("jtbl_80C05930","UNK_PTR","",0x4),
0x80C06440:("En_Bombal_InitVars","UNK_TYPE1","",0x1),