mirror of https://github.com/zeldaret/mm.git
Merge 5f83a86d66 into 0877ce4adf
This commit is contained in:
commit
5255d716fa
|
|
@ -1326,12 +1326,12 @@ typedef enum {
|
|||
#define WEEKEVENTREG_73_10 PACK_WEEKEVENTREG_FLAG(73, 0x10)
|
||||
|
||||
#define WEEKEVENTREG_73_20 PACK_WEEKEVENTREG_FLAG(73, 0x20)
|
||||
#define WEEKEVENTREG_73_40 PACK_WEEKEVENTREG_FLAG(73, 0x40)
|
||||
#define WEEKEVENTREG_DEKU_LEARNED_WHERE_BOMBER_JIM_IS PACK_WEEKEVENTREG_FLAG(73, 0x40)
|
||||
#define WEEKEVENTREG_ENTERED_BOMBERS_CODE PACK_WEEKEVENTREG_FLAG(73, 0x80)
|
||||
#define WEEKEVENTREG_74_01 PACK_WEEKEVENTREG_FLAG(74, 0x01)
|
||||
#define WEEKEVENTREG_74_02 PACK_WEEKEVENTREG_FLAG(74, 0x02)
|
||||
#define WEEKEVENTREG_74_04 PACK_WEEKEVENTREG_FLAG(74, 0x04)
|
||||
#define WEEKEVENTREG_74_08 PACK_WEEKEVENTREG_FLAG(74, 0x08)
|
||||
#define WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_2 PACK_WEEKEVENTREG_FLAG(74, 0x01)
|
||||
#define WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_3 PACK_WEEKEVENTREG_FLAG(74, 0x02)
|
||||
#define WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_4 PACK_WEEKEVENTREG_FLAG(74, 0x04)
|
||||
#define WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_5 PACK_WEEKEVENTREG_FLAG(74, 0x08)
|
||||
#define WEEKEVENTREG_74_10 PACK_WEEKEVENTREG_FLAG(74, 0x10)
|
||||
#define WEEKEVENTREG_74_20 PACK_WEEKEVENTREG_FLAG(74, 0x20)
|
||||
#define WEEKEVENTREG_74_40 PACK_WEEKEVENTREG_FLAG(74, 0x40)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ u16 QuestHint_GetTatlTextId(PlayState* play) {
|
|||
return 0x241;
|
||||
}
|
||||
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_86_02) || CHECK_WEEKEVENTREG(WEEKEVENTREG_73_40)) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_86_02) || CHECK_WEEKEVENTREG(WEEKEVENTREG_DEKU_LEARNED_WHERE_BOMBER_JIM_IS)) {
|
||||
return 0x23F;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ void EnBombers_Destroy(Actor* thisx, PlayState* play);
|
|||
void EnBombers_Update(Actor* thisx, PlayState* play);
|
||||
void EnBombers_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80C03ACC(EnBombers* this);
|
||||
void func_80C03AF4(EnBombers* this, PlayState* play);
|
||||
void func_80C03F64(EnBombers* this);
|
||||
void func_80C03FAC(EnBombers* this, PlayState* play);
|
||||
void func_80C042F8(EnBombers* this);
|
||||
void func_80C04354(EnBombers* this, PlayState* play);
|
||||
void func_80C043C8(EnBombers* this, PlayState* play);
|
||||
void EnBombers_SetupNpcBehavior(EnBombers* this);
|
||||
void EnBombers_NpcBehavior(EnBombers* this, PlayState* play);
|
||||
void EnBombers_StartTalking(EnBombers* this);
|
||||
void EnBombers_UpdateTalk(EnBombers* this, PlayState* play);
|
||||
void EnBombers_SetupSitting(EnBombers* this);
|
||||
void EnBombers_Sitting(EnBombers* this, PlayState* play);
|
||||
void EnBombers_TalkWhileSitting(EnBombers* this, PlayState* play);
|
||||
|
||||
ActorProfile En_Bombers_Profile = {
|
||||
/**/ ACTOR_EN_BOMBERS,
|
||||
|
|
@ -54,6 +54,11 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
{ 10, 30, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ENBOMBERS_NPC_WALKING,
|
||||
/* 1 */ ENBOMBERS_NPC_STANDING
|
||||
} EnBombersNpcState;
|
||||
|
||||
typedef enum {
|
||||
/* -1 */ ENBOMBERS_ANIM_NONE = -1,
|
||||
/* 0x00 */ ENBOMBERS_ANIM_0,
|
||||
|
|
@ -145,25 +150,25 @@ void EnBombers_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.attentionRangeType = ATTENTION_RANGE_0;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
||||
this->unk_2BC = ENBOMBERS_GET_F0(&this->actor);
|
||||
this->unk_2BE = ENBOMBERS_GET_F(&this->actor);
|
||||
this->type = ENBOMBERS_GET_TYPE(&this->actor);
|
||||
this->number = ENBOMBERS_GET_NUMBER(&this->actor);
|
||||
|
||||
if (this->unk_2BC == ENBOMBERS_F0_0) {
|
||||
if (this->type == ENBOMBERS_TYPE_NPC) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_73_10) || CHECK_WEEKEVENTREG(WEEKEVENTREG_85_02)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->unk_2BE++;
|
||||
func_80C03ACC(this);
|
||||
this->number++;
|
||||
EnBombers_SetupNpcBehavior(this);
|
||||
} else if ((CHECK_WEEKEVENTREG(WEEKEVENTREG_73_10) || CHECK_WEEKEVENTREG(WEEKEVENTREG_85_02)) &&
|
||||
(((this->unk_2BE == ENBOMBERS_F_0) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_01)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_1) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_02)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_2) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_04)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_3) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_08)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_4) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_10)))) {
|
||||
(((this->number == ENBOMBERS_NO_1) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_01)) ||
|
||||
((this->number == ENBOMBERS_NO_2) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_02)) ||
|
||||
((this->number == ENBOMBERS_NO_3) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_04)) ||
|
||||
((this->number == ENBOMBERS_NO_4) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_08)) ||
|
||||
((this->number == ENBOMBERS_NO_5) && CHECK_WEEKEVENTREG(WEEKEVENTREG_76_10)))) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_40)) {
|
||||
if (this->unk_2BE == ENBOMBERS_F_0) {
|
||||
if (this->number == ENBOMBERS_NO_1) {
|
||||
EnBomBowlMan* bomBowlMan = (EnBomBowlMan*)Actor_Spawn(
|
||||
&play->actorCtx, play, ACTOR_EN_BOM_BOWL_MAN, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0);
|
||||
|
|
@ -187,7 +192,7 @@ void EnBombers_Init(Actor* thisx, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
func_80C042F8(this);
|
||||
EnBombers_SetupSitting(this);
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
|
@ -206,7 +211,7 @@ void EnBombers_ChangeAnim(EnBombers* this, s32 animIndex, f32 playSpeed) {
|
|||
sAnimationModes[this->animIndex], -10.0f);
|
||||
}
|
||||
|
||||
void func_80C038B4(EnBombers* this) {
|
||||
void EnBombers_PlaySfx(EnBombers* this) {
|
||||
if ((this->animIndex == ENBOMBERS_ANIM_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))) {
|
||||
|
|
@ -220,9 +225,9 @@ void func_80C038B4(EnBombers* this) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80C039A8(EnBombers* this, PlayState* play) {
|
||||
void EnBombers_UpdateRegularTextId(EnBombers* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
this->unk_2A6 = TEXT_STATE_EVENT;
|
||||
this->talkState = TEXT_STATE_EVENT;
|
||||
|
||||
switch (player->transformation) {
|
||||
case PLAYER_FORM_HUMAN:
|
||||
|
|
@ -243,12 +248,12 @@ void func_80C039A8(EnBombers* this, PlayState* play) {
|
|||
case PLAYER_FORM_DEKU:
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_73_20)) {
|
||||
this->actor.textId = 0x75A;
|
||||
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_73_40)) {
|
||||
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_DEKU_LEARNED_WHERE_BOMBER_JIM_IS)) {
|
||||
this->actor.textId = 0x749;
|
||||
if (((this->unk_2BE == ENBOMBERS_F_1) && CHECK_WEEKEVENTREG(WEEKEVENTREG_74_01)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_2) && CHECK_WEEKEVENTREG(WEEKEVENTREG_74_02)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_3) && CHECK_WEEKEVENTREG(WEEKEVENTREG_74_04)) ||
|
||||
((this->unk_2BE == ENBOMBERS_F_4) && CHECK_WEEKEVENTREG(WEEKEVENTREG_74_08))) {
|
||||
if (((this->number == ENBOMBERS_NO_2) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_2)) ||
|
||||
((this->number == ENBOMBERS_NO_3) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_3)) ||
|
||||
((this->number == ENBOMBERS_NO_4) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_4)) ||
|
||||
((this->number == ENBOMBERS_NO_5) && CHECK_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_5))) {
|
||||
this->actor.textId = 0x74A;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -261,84 +266,84 @@ void func_80C039A8(EnBombers* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80C03ACC(EnBombers* this) {
|
||||
void EnBombers_SetupNpcBehavior(EnBombers* this) {
|
||||
this->collider.dim.radius = 10;
|
||||
this->collider.dim.height = 30;
|
||||
this->unk_2C0 = 0;
|
||||
this->actionFunc = func_80C03AF4;
|
||||
this->action = 0;
|
||||
this->actionFunc = EnBombers_NpcBehavior;
|
||||
}
|
||||
|
||||
void func_80C03AF4(EnBombers* this, PlayState* play) {
|
||||
void EnBombers_NpcBehavior(EnBombers* this, PlayState* play) {
|
||||
CollisionPoly* colPoly;
|
||||
f32 curFrame = this->skelAnime.curFrame;
|
||||
Vec3f sp6C;
|
||||
Vec3f sp60;
|
||||
Vec3f sp54;
|
||||
Vec3f endPoint;
|
||||
Vec3f walkTarget;
|
||||
Vec3f walkVec;
|
||||
f32 x;
|
||||
f32 z;
|
||||
s32 bgId;
|
||||
s16 abs;
|
||||
|
||||
switch (this->unk_2A0) {
|
||||
case 0:
|
||||
if (this->unk_2A8 == 0) {
|
||||
Math_Vec3f_Copy(&sp60, &this->actor.home.pos);
|
||||
switch (this->npcState) {
|
||||
case ENBOMBERS_NPC_WALKING:
|
||||
if (this->idleTimer == 0) {
|
||||
Math_Vec3f_Copy(&walkTarget, &this->actor.home.pos);
|
||||
|
||||
sp60.x += Rand_CenteredFloat(150.0f);
|
||||
sp60.z += Rand_CenteredFloat(150.0f);
|
||||
walkTarget.x += Rand_CenteredFloat(150.0f);
|
||||
walkTarget.z += Rand_CenteredFloat(150.0f);
|
||||
|
||||
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp60)));
|
||||
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp60, &sp6C,
|
||||
&colPoly, true, false, false, true, &bgId)) {
|
||||
abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &walkTarget)));
|
||||
if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &walkTarget,
|
||||
&endPoint, &colPoly, true, false, false, true, &bgId)) {
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_2, 1.0f);
|
||||
Math_Vec3f_Copy(&this->unk_294, &sp60);
|
||||
this->unk_2AA = Rand_S16Offset(30, 50);
|
||||
this->unk_2A0++;
|
||||
Math_Vec3f_Copy(&this->walkTarget, &walkTarget);
|
||||
this->walkTimer = Rand_S16Offset(30, 50);
|
||||
this->npcState++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case ENBOMBERS_NPC_STANDING:
|
||||
if (curFrame >= 0.0f) {
|
||||
this->unk_2A4 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_294);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2A4, 0xA, 0x7D0, 0x14);
|
||||
this->targetYaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->walkTarget);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetYaw, 0xA, 0x7D0, 0x14);
|
||||
}
|
||||
|
||||
if ((s16)ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->unk_2A4)) < 0x100) {
|
||||
Math_Vec3f_Copy(&sp54, &this->actor.world.pos);
|
||||
sp54.x += Math_SinS(this->actor.world.rot.y) * 60.0f;
|
||||
sp54.z += Math_CosS(this->actor.world.rot.y) * 60.0f;
|
||||
if ((s16)ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->targetYaw)) < 0x100) {
|
||||
Math_Vec3f_Copy(&walkVec, &this->actor.world.pos);
|
||||
walkVec.x += Math_SinS(this->actor.world.rot.y) * 60.0f;
|
||||
walkVec.z += Math_CosS(this->actor.world.rot.y) * 60.0f;
|
||||
|
||||
if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp54, &sp6C, &colPoly, true, false,
|
||||
false, true, &bgId)) {
|
||||
this->unk_2A8 = 0;
|
||||
if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &walkVec, &endPoint, &colPoly, true,
|
||||
false, false, true, &bgId)) {
|
||||
this->idleTimer = 0;
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_16, 1.0f);
|
||||
} else {
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_0, 1.0f);
|
||||
}
|
||||
this->unk_2A0 = 0;
|
||||
this->unk_2B4 = 0.0f;
|
||||
this->npcState = ENBOMBERS_NPC_WALKING;
|
||||
this->walkMaxStep = 0.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
x = this->unk_294.x - this->actor.world.pos.x;
|
||||
z = this->unk_294.z - this->actor.world.pos.z;
|
||||
x = this->walkTarget.x - this->actor.world.pos.x;
|
||||
z = this->walkTarget.z - this->actor.world.pos.z;
|
||||
|
||||
if ((this->unk_2AA == 0) || (sqrtf(SQ(x) + SQ(z)) < 4.0f)) {
|
||||
this->unk_2A8 = Rand_S16Offset(20, 20);
|
||||
if (!(this->unk_2A8 & 1)) {
|
||||
if ((this->walkTimer == 0) || (sqrtf(SQ(x) + SQ(z)) < 4.0f)) {
|
||||
this->idleTimer = Rand_S16Offset(20, 20);
|
||||
if (!(this->idleTimer & 1)) {
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_16, 1.0f);
|
||||
} else {
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_0, 1.0f);
|
||||
}
|
||||
this->unk_2A0 = 0;
|
||||
this->unk_2B4 = 0.0f;
|
||||
this->npcState = 0;
|
||||
this->walkMaxStep = 0.0f;
|
||||
} else if (curFrame >= 0.0f) {
|
||||
Math_ApproachF(&this->actor.world.pos.x, this->unk_294.x, 0.3f, this->unk_2B4);
|
||||
Math_ApproachF(&this->actor.world.pos.z, this->unk_294.z, 0.3f, this->unk_2B4);
|
||||
Math_ApproachF(&this->unk_2B4, 1.0f, 0.3f, 0.5f);
|
||||
Math_ApproachF(&this->actor.world.pos.x, this->walkTarget.x, 0.3f, this->walkMaxStep);
|
||||
Math_ApproachF(&this->actor.world.pos.z, this->walkTarget.z, 0.3f, this->walkMaxStep);
|
||||
Math_ApproachF(&this->walkMaxStep, 1.0f, 0.3f, 0.5f);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -347,136 +352,136 @@ void func_80C03AF4(EnBombers* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (Text_GetFaceReaction(play, FACE_REACTION_SET_BOMBERS) == 0) {
|
||||
func_80C039A8(this, play);
|
||||
EnBombers_UpdateRegularTextId(this, play);
|
||||
} else {
|
||||
this->unk_2A6 = TEXT_STATE_EVENT;
|
||||
this->talkState = TEXT_STATE_EVENT;
|
||||
this->actor.textId = Text_GetFaceReaction(play, FACE_REACTION_SET_BOMBERS);
|
||||
}
|
||||
|
||||
if (Actor_TalkOfferAccepted(&this->actor, &play->state)) {
|
||||
this->unk_2A4 = this->actor.yawTowardsPlayer;
|
||||
this->targetYaw = this->actor.yawTowardsPlayer;
|
||||
this->collider.dim.radius = 20;
|
||||
this->collider.dim.height = 60;
|
||||
func_80C03F64(this);
|
||||
EnBombers_StartTalking(this);
|
||||
} else {
|
||||
Actor_OfferTalk(&this->actor, play, 70.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80C03F64(EnBombers* this) {
|
||||
this->unk_2A4 = this->actor.yawTowardsPlayer;
|
||||
void EnBombers_StartTalking(EnBombers* this) {
|
||||
this->targetYaw = this->actor.yawTowardsPlayer;
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_1, 1.0f);
|
||||
this->unk_2C0 = 1;
|
||||
this->actionFunc = func_80C03FAC;
|
||||
this->action = 1;
|
||||
this->actionFunc = EnBombers_UpdateTalk;
|
||||
}
|
||||
|
||||
void func_80C03FAC(EnBombers* this, PlayState* play) {
|
||||
void EnBombers_UpdateTalk(EnBombers* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s16 sp2A;
|
||||
s16 hasMoreText;
|
||||
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2A4, 1, 0x1388, 0);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetYaw, 1, 0x1388, 0);
|
||||
|
||||
switch (player->transformation) {
|
||||
case PLAYER_FORM_HUMAN:
|
||||
this->unk_28E = -0xFA0;
|
||||
this->headRotTargetZ = -0xFA0;
|
||||
break;
|
||||
|
||||
case PLAYER_FORM_GORON:
|
||||
case PLAYER_FORM_ZORA:
|
||||
this->unk_28E = -0x1770;
|
||||
this->headRotTargetZ = -0x1770;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ((this->unk_2A6 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) {
|
||||
sp2A = 0;
|
||||
if ((this->talkState == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) {
|
||||
hasMoreText = false;
|
||||
Message_CloseTextbox(play);
|
||||
this->unk_2A6 = TEXT_STATE_EVENT;
|
||||
this->talkState = TEXT_STATE_EVENT;
|
||||
|
||||
if ((this->actor.textId == 0x73D) || (this->actor.textId == 0x73E) || (this->actor.textId == 0x73F)) {
|
||||
this->actor.textId = 0x740;
|
||||
this->unk_2A6 = TEXT_STATE_CHOICE;
|
||||
sp2A = 1;
|
||||
this->talkState = TEXT_STATE_CHOICE;
|
||||
hasMoreText = true;
|
||||
} else if (this->actor.textId == 0x740) {
|
||||
if (play->msgCtx.choiceIndex == 0) {
|
||||
Audio_PlaySfx_MessageDecide();
|
||||
this->actor.textId = 0x742;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else {
|
||||
Audio_PlaySfx_MessageCancel();
|
||||
this->actor.textId = 0x741;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
}
|
||||
} else if (this->actor.textId == 0x742) {
|
||||
this->actor.textId = 0x737;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else if (this->actor.textId == 0x737) {
|
||||
this->actor.textId = 0x743;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else if (this->actor.textId == 0x74B) {
|
||||
this->actor.textId = 0x74C;
|
||||
this->unk_2A6 = TEXT_STATE_CHOICE;
|
||||
sp2A = 1;
|
||||
this->talkState = TEXT_STATE_CHOICE;
|
||||
hasMoreText = true;
|
||||
} else if (this->actor.textId == 0x74C) {
|
||||
if (play->msgCtx.choiceIndex == 1) {
|
||||
Audio_PlaySfx_MessageCancel();
|
||||
this->actor.textId = 0x737;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else {
|
||||
Audio_PlaySfx_MessageDecide();
|
||||
this->actor.textId = 0x74D;
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_14, 1.0f);
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
}
|
||||
} else if (this->actor.textId == 0x744) {
|
||||
s32 day = gSaveContext.save.day - 1;
|
||||
|
||||
if (day == 2) {
|
||||
this->actor.textId = 0x746;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else {
|
||||
this->actor.textId = 0x745;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
}
|
||||
} else if ((this->actor.textId == 0x745) || (this->actor.textId == 0x746)) {
|
||||
this->actor.textId = 0x747;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else if (this->actor.textId == 0x747) {
|
||||
this->actor.textId = 0x748;
|
||||
sp2A = 1;
|
||||
hasMoreText = true;
|
||||
} else if (this->actor.textId == 0x748) {
|
||||
switch (this->unk_2BE) {
|
||||
case ENBOMBERS_F_1:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_74_01);
|
||||
switch (this->number) {
|
||||
case ENBOMBERS_NO_2:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_2);
|
||||
break;
|
||||
|
||||
case ENBOMBERS_F_2:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_74_02);
|
||||
case ENBOMBERS_NO_3:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_3);
|
||||
break;
|
||||
|
||||
case ENBOMBERS_F_3:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_74_04);
|
||||
case ENBOMBERS_NO_4:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_4);
|
||||
break;
|
||||
|
||||
case ENBOMBERS_F_4:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_74_08);
|
||||
case ENBOMBERS_NO_5:
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_5);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_73_40);
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_DEKU_LEARNED_WHERE_BOMBER_JIM_IS);
|
||||
}
|
||||
|
||||
switch (sp2A) {
|
||||
case 0:
|
||||
this->unk_28E = 0;
|
||||
func_80C03ACC(this);
|
||||
switch (hasMoreText) {
|
||||
case false:
|
||||
this->headRotTargetZ = 0;
|
||||
EnBombers_SetupNpcBehavior(this);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case true:
|
||||
Message_ContinueTextbox(play, this->actor.textId);
|
||||
break;
|
||||
|
||||
|
|
@ -486,31 +491,31 @@ void func_80C03FAC(EnBombers* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80C042F8(EnBombers* this) {
|
||||
void EnBombers_SetupSitting(EnBombers* this) {
|
||||
if (this->animIndex != ENBOMBERS_ANIM_6) {
|
||||
EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_6, 1.0f);
|
||||
}
|
||||
this->actor.textId = 0x72D;
|
||||
this->unk_28E = 0x1F40;
|
||||
this->unk_2C0 = 2;
|
||||
this->actionFunc = func_80C04354;
|
||||
this->headRotTargetZ = 0x1F40;
|
||||
this->action = 2;
|
||||
this->actionFunc = EnBombers_Sitting;
|
||||
}
|
||||
|
||||
void func_80C04354(EnBombers* this, PlayState* play) {
|
||||
Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 0x3E8, 0);
|
||||
void EnBombers_Sitting(EnBombers* this, PlayState* play) {
|
||||
Math_SmoothStepToS(&this->headRotZ, this->headRotTargetZ, 1, 0x3E8, 0);
|
||||
if (Actor_TalkOfferAccepted(&this->actor, &play->state)) {
|
||||
this->unk_28E = 0;
|
||||
this->actionFunc = func_80C043C8;
|
||||
this->headRotTargetZ = 0;
|
||||
this->actionFunc = EnBombers_TalkWhileSitting;
|
||||
} else {
|
||||
Actor_OfferTalk(&this->actor, play, 70.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80C043C8(EnBombers* this, PlayState* play) {
|
||||
Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 0x3E8, 0);
|
||||
void EnBombers_TalkWhileSitting(EnBombers* this, PlayState* play) {
|
||||
Math_SmoothStepToS(&this->headRotZ, this->headRotTargetZ, 1, 0x3E8, 0);
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
|
||||
Message_CloseTextbox(play);
|
||||
func_80C042F8(this);
|
||||
EnBombers_SetupSitting(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -518,12 +523,12 @@ void EnBombers_Update(Actor* thisx, PlayState* play) {
|
|||
s32 pad;
|
||||
EnBombers* this = (EnBombers*)thisx;
|
||||
|
||||
if (this->unk_2AA != 0) {
|
||||
this->unk_2AA--;
|
||||
if (this->walkTimer != 0) {
|
||||
this->walkTimer--;
|
||||
}
|
||||
|
||||
if (this->unk_2A8 != 0) {
|
||||
this->unk_2A8--;
|
||||
if (this->idleTimer != 0) {
|
||||
this->idleTimer--;
|
||||
}
|
||||
|
||||
if (this->unk_2AC != 0) {
|
||||
|
|
@ -532,18 +537,18 @@ void EnBombers_Update(Actor* thisx, PlayState* play) {
|
|||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
func_80C038B4(this);
|
||||
EnBombers_PlaySfx(this);
|
||||
Actor_SetFocus(&this->actor, 20.0f);
|
||||
this->actionFunc(this, play);
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 0x1388, 0);
|
||||
Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 0x1388, 0);
|
||||
Math_SmoothStepToS(&this->headRotX, this->headRotTargetX, 1, 0x1388, 0);
|
||||
Math_SmoothStepToS(&this->headRotZ, this->headRotTargetZ, 1, 0x1388, 0);
|
||||
|
||||
if (this->unk_2BA == 0) {
|
||||
this->unk_2B8++;
|
||||
if (this->unk_2B8 >= 3) {
|
||||
this->unk_2B8 = 0;
|
||||
this->unk_2BA = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
if (this->blinkTimer == 0) {
|
||||
this->eyeIndex++;
|
||||
if (this->eyeIndex >= 3) {
|
||||
this->eyeIndex = 0;
|
||||
this->blinkTimer = TRUNCF_BINANG(Rand_ZeroFloat(60.0f)) + 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -563,8 +568,8 @@ s32 EnBombers_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
|
|||
}
|
||||
|
||||
if (limbIndex == OBJECT_CS_LIMB_11) {
|
||||
rot->x += this->unk_28A;
|
||||
rot->z += this->unk_288;
|
||||
rot->x += this->headRotX;
|
||||
rot->z += this->headRotZ;
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_CS_LIMB_13) {
|
||||
|
|
@ -582,9 +587,9 @@ void EnBombers_Draw(Actor* thisx, PlayState* play) {
|
|||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80C0482C[this->unk_2B8]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C04838[this->unk_2BE]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0A, Lib_SegmentedToVirtual(D_80C04818[this->unk_2BE]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80C0482C[this->eyeIndex]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C04838[this->number]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0A, Lib_SegmentedToVirtual(D_80C04818[this->number]));
|
||||
|
||||
Scene_SetRenderModeXlu(play, 0, 1);
|
||||
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
|
|
|
|||
|
|
@ -8,18 +8,18 @@ struct EnBombers;
|
|||
|
||||
typedef void (*EnBombersActionFunc)(struct EnBombers*, PlayState*);
|
||||
|
||||
#define ENBOMBERS_GET_F(thisx) ((thisx)->params & 0xF)
|
||||
#define ENBOMBERS_GET_F0(thisx) (((thisx)->params >> 4) & 0xF)
|
||||
#define ENBOMBERS_GET_NUMBER(thisx) ((thisx)->params & 0xF)
|
||||
#define ENBOMBERS_GET_TYPE(thisx) (((thisx)->params >> 4) & 0xF)
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ENBOMBERS_F_0,
|
||||
/* 1 */ ENBOMBERS_F_1,
|
||||
/* 2 */ ENBOMBERS_F_2,
|
||||
/* 3 */ ENBOMBERS_F_3,
|
||||
/* 4 */ ENBOMBERS_F_4
|
||||
} EnBombersParam;
|
||||
/* 0 */ ENBOMBERS_NO_1,
|
||||
/* 1 */ ENBOMBERS_NO_2,
|
||||
/* 2 */ ENBOMBERS_NO_3,
|
||||
/* 3 */ ENBOMBERS_NO_4,
|
||||
/* 4 */ ENBOMBERS_NO_5
|
||||
} EnBombersNumber;
|
||||
|
||||
#define ENBOMBERS_F0_0 0
|
||||
#define ENBOMBERS_TYPE_NPC 0
|
||||
|
||||
typedef struct EnBombers {
|
||||
/* 0x000 */ Actor actor;
|
||||
|
|
@ -27,26 +27,26 @@ typedef struct EnBombers {
|
|||
/* 0x188 */ Vec3s jointTable[OBJECT_CS_LIMB_MAX];
|
||||
/* 0x206 */ Vec3s morphTable[OBJECT_CS_LIMB_MAX];
|
||||
/* 0x284 */ EnBombersActionFunc actionFunc;
|
||||
/* 0x288 */ s16 unk_288;
|
||||
/* 0x28A */ s16 unk_28A;
|
||||
/* 0x288 */ s16 headRotZ;
|
||||
/* 0x28A */ s16 headRotX;
|
||||
/* 0x28C */ UNK_TYPE1 unk28C[2];
|
||||
/* 0x28E */ s16 unk_28E;
|
||||
/* 0x290 */ s16 unk_290;
|
||||
/* 0x294 */ Vec3f unk_294;
|
||||
/* 0x2A0 */ s16 unk_2A0;
|
||||
/* 0x28E */ s16 headRotTargetZ;
|
||||
/* 0x290 */ s16 headRotTargetX;
|
||||
/* 0x294 */ Vec3f walkTarget;
|
||||
/* 0x2A0 */ s16 npcState;
|
||||
/* 0x2A2 */ UNK_TYPE1 unk2A2[2];
|
||||
/* 0x2A4 */ s16 unk_2A4;
|
||||
/* 0x2A6 */ s16 unk_2A6;
|
||||
/* 0x2A8 */ s16 unk_2A8;
|
||||
/* 0x2AA */ s16 unk_2AA;
|
||||
/* 0x2A4 */ s16 targetYaw;
|
||||
/* 0x2A6 */ s16 talkState;
|
||||
/* 0x2A8 */ s16 idleTimer;
|
||||
/* 0x2AA */ s16 walkTimer;
|
||||
/* 0x2AC */ s16 unk_2AC;
|
||||
/* 0x2B0 */ f32 animEndFrame;
|
||||
/* 0x2B4 */ f32 unk_2B4;
|
||||
/* 0x2B8 */ s16 unk_2B8;
|
||||
/* 0x2BA */ s16 unk_2BA;
|
||||
/* 0x2BC */ s16 unk_2BC;
|
||||
/* 0x2BE */ s16 unk_2BE;
|
||||
/* 0x2C0 */ s16 unk_2C0;
|
||||
/* 0x2B4 */ f32 walkMaxStep;
|
||||
/* 0x2B8 */ s16 eyeIndex;
|
||||
/* 0x2BA */ s16 blinkTimer;
|
||||
/* 0x2BC */ s16 type;
|
||||
/* 0x2BE */ s16 number;
|
||||
/* 0x2C0 */ s16 action;
|
||||
/* 0x2C4 */ s32 animIndex;
|
||||
/* 0x2C8 */ ColliderCylinder collider;
|
||||
} EnBombers; // size = 0x314
|
||||
|
|
|
|||
|
|
@ -16507,15 +16507,15 @@ EnBomjimb_Draw = 0x80C05EC8; // type:func size:0x138
|
|||
EnBombers_Init = 0x80C063C0; // type:func size:0x2C8
|
||||
EnBombers_Destroy = 0x80C06688; // type:func size:0x2C
|
||||
EnBombers_ChangeAnim = 0x80C066B4; // type:func size:0x90
|
||||
func_80C038B4 = 0x80C06744; // type:func size:0xF4
|
||||
func_80C039A8 = 0x80C06838; // type:func size:0x124
|
||||
func_80C03ACC = 0x80C0695C; // type:func size:0x28
|
||||
func_80C03AF4 = 0x80C06984; // type:func size:0x470
|
||||
func_80C03F64 = 0x80C06DF4; // type:func size:0x48
|
||||
func_80C03FAC = 0x80C06E3C; // type:func size:0x34C
|
||||
func_80C042F8 = 0x80C07188; // type:func size:0x5C
|
||||
func_80C04354 = 0x80C071E4; // type:func size:0x74
|
||||
func_80C043C8 = 0x80C07258; // type:func size:0x74
|
||||
EnBombers_PlaySfx = 0x80C06744; // type:func size:0xF4
|
||||
EnBombers_UpdateRegularTextId = 0x80C06838; // type:func size:0x124
|
||||
EnBombers_SetupNpcBehavior = 0x80C0695C; // type:func size:0x28
|
||||
EnBombers_NpcBehavior = 0x80C06984; // type:func size:0x470
|
||||
EnBombers_StartTalking = 0x80C06DF4; // type:func size:0x48
|
||||
EnBombers_UpdateTalk = 0x80C06E3C; // type:func size:0x34C
|
||||
EnBombers_SetupSitting = 0x80C07188; // type:func size:0x5C
|
||||
EnBombers_Sitting = 0x80C071E4; // type:func size:0x74
|
||||
EnBombers_TalkWhileSitting = 0x80C07258; // type:func size:0x74
|
||||
EnBombers_Update = 0x80C072CC; // type:func size:0x178
|
||||
EnBombers_OverrideLimbDraw = 0x80C07444; // type:func size:0x60
|
||||
EnBombers_Draw = 0x80C074A4; // type:func size:0x13C
|
||||
|
|
|
|||
|
|
@ -16517,15 +16517,15 @@ EnBomjimb_Draw = 0x80C03034; // type:func
|
|||
EnBombers_Init = 0x80C03530; // type:func
|
||||
EnBombers_Destroy = 0x80C037F8; // type:func
|
||||
EnBombers_ChangeAnim = 0x80C03824; // type:func
|
||||
func_80C038B4 = 0x80C038B4; // type:func
|
||||
func_80C039A8 = 0x80C039A8; // type:func
|
||||
func_80C03ACC = 0x80C03ACC; // type:func
|
||||
func_80C03AF4 = 0x80C03AF4; // type:func
|
||||
func_80C03F64 = 0x80C03F64; // type:func
|
||||
func_80C03FAC = 0x80C03FAC; // type:func
|
||||
func_80C042F8 = 0x80C042F8; // type:func
|
||||
func_80C04354 = 0x80C04354; // type:func
|
||||
func_80C043C8 = 0x80C043C8; // type:func
|
||||
EnBombers_PlaySfx = 0x80C038B4; // type:func
|
||||
EnBombers_UpdateRegularTextId = 0x80C039A8; // type:func
|
||||
EnBombers_SetupNpcBehavior = 0x80C03ACC; // type:func
|
||||
EnBombers_NpcBehavior = 0x80C03AF4; // type:func
|
||||
EnBombers_StartTalking = 0x80C03F64; // type:func
|
||||
EnBombers_UpdateTalk = 0x80C03FAC; // type:func
|
||||
EnBombers_SetupSitting = 0x80C042F8; // type:func
|
||||
EnBombers_Sitting = 0x80C04354; // type:func
|
||||
EnBombers_TalkWhileSitting = 0x80C043C8; // type:func
|
||||
EnBombers_Update = 0x80C0443C; // type:func
|
||||
EnBombers_OverrideLimbDraw = 0x80C045B4; // type:func
|
||||
EnBombers_Draw = 0x80C04614; // type:func
|
||||
|
|
|
|||
|
|
@ -651,12 +651,12 @@ week_event_reg = {
|
|||
(73 << 8) | 0x08: "WEEKEVENTREG_73_08",
|
||||
(73 << 8) | 0x10: "WEEKEVENTREG_73_10",
|
||||
(73 << 8) | 0x20: "WEEKEVENTREG_73_20",
|
||||
(73 << 8) | 0x40: "WEEKEVENTREG_73_40",
|
||||
(73 << 8) | 0x40: "WEEKEVENTREG_DEKU_LEARNED_WHERE_BOMBER_JIM_IS",
|
||||
(73 << 8) | 0x80: "WEEKEVENTREG_ENTERED_BOMBERS_CODE",
|
||||
(74 << 8) | 0x01: "WEEKEVENTREG_74_01",
|
||||
(74 << 8) | 0x02: "WEEKEVENTREG_74_02",
|
||||
(74 << 8) | 0x04: "WEEKEVENTREG_74_04",
|
||||
(74 << 8) | 0x08: "WEEKEVENTREG_74_08",
|
||||
(74 << 8) | 0x01: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_2",
|
||||
(74 << 8) | 0x02: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_3",
|
||||
(74 << 8) | 0x04: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_4",
|
||||
(74 << 8) | 0x08: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_5",
|
||||
(74 << 8) | 0x10: "WEEKEVENTREG_74_10",
|
||||
(74 << 8) | 0x20: "WEEKEVENTREG_74_20",
|
||||
(74 << 8) | 0x40: "WEEKEVENTREG_74_40",
|
||||
|
|
|
|||
|
|
@ -594,12 +594,12 @@ weekEventReg = {
|
|||
(73 << 8) | 0x08: "WEEKEVENTREG_73_08",
|
||||
(73 << 8) | 0x10: "WEEKEVENTREG_73_10",
|
||||
(73 << 8) | 0x20: "WEEKEVENTREG_73_20",
|
||||
(73 << 8) | 0x40: "WEEKEVENTREG_73_40",
|
||||
(73 << 8) | 0x40: "WEEKEVENTREG_DEKU_LEARNED_WHERE_BOMBER_JIM_IS",
|
||||
(73 << 8) | 0x80: "WEEKEVENTREG_ENTERED_BOMBERS_CODE",
|
||||
(74 << 8) | 0x01: "WEEKEVENTREG_74_01",
|
||||
(74 << 8) | 0x02: "WEEKEVENTREG_74_02",
|
||||
(74 << 8) | 0x04: "WEEKEVENTREG_74_04",
|
||||
(74 << 8) | 0x08: "WEEKEVENTREG_74_08",
|
||||
(74 << 8) | 0x01: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_2",
|
||||
(74 << 8) | 0x02: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_3",
|
||||
(74 << 8) | 0x04: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_4",
|
||||
(74 << 8) | 0x08: "WEEKEVENTREG_DEKU_TALKED_TO_BOMBER_5",
|
||||
(74 << 8) | 0x10: "WEEKEVENTREG_74_10",
|
||||
(74 << 8) | 0x20: "WEEKEVENTREG_74_20",
|
||||
(74 << 8) | 0x40: "WEEKEVENTREG_74_40",
|
||||
|
|
|
|||
Loading…
Reference in New Issue