diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index a17040401..cd52da105 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -358,15 +358,15 @@ void sub_08028EDC(Entity* this) { } void sub_08028F0C(Entity* this) { - if (this->interactType == 2) { + if (this->interactType == INTERACTION_FUSE) { this->action = 8; - this->interactType = 0; + this->interactType = INTERACTION_NONE; InitializeNPCFusion(this); - } else if (this->interactType != 0) { + } else if (this->interactType != INTERACTION_NONE) { u16 dialog; const struct SalesOffering* offer = (const struct SalesOffering*)this->field_0x7c.WORD; - this->interactType = 0; + this->interactType = INTERACTION_NONE; sub_0804AA1C(this); this->direction = (GetAnimationState(this) << 3); sub_080290E0(this, 3); diff --git a/src/npc/anju.c b/src/npc/anju.c index 721b7f44a..0c0df5a9a 100644 --- a/src/npc/anju.c +++ b/src/npc/anju.c @@ -23,9 +23,9 @@ void Anju(AnjuEntity* this) { InitScriptForNPC(super); return; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4( GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); diff --git a/src/npc/beedle.c b/src/npc/beedle.c index 4ab2e5212..38bcb381c 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -86,7 +86,7 @@ void Beedle_Action1(Entity* this) { (animIndex = Beedle_GetAnimIndexFacingPlayer(this), this->animIndex != animIndex)) { InitializeAnimation(this, animIndex); } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { MessageFromTarget(this->timer + TEXT_INDEX(TEXT_EMPTY, 0x01)); this->action++; } diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c index a0e2c7290..83205c441 100644 --- a/src/npc/bigGoron.c +++ b/src/npc/bigGoron.c @@ -454,7 +454,7 @@ void sub_0806D638(Entity* this) { void sub_0806D640(Entity* this) { this->y.HALF.HI += 0x20; - this->interactType = 0; + this->interactType = INTERACTION_NONE; } void sub_0806D650(Entity* this) { diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 4e862e68a..ecb97fe28 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -275,8 +275,8 @@ void sub_08068A4C(Entity* this) { if (iVar2 == 0) { GetNextFrame(this); } - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; this->action = 2; MessageFromTarget(0); } @@ -311,9 +311,9 @@ void sub_08068AFC(BladeBrothersEntity* this) { void sub_08068b2c(BladeBrothersEntity* this) { u32 animationState; - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; animationState = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)); InitAnimationForceUpdate(super, animationState); InitializeNPCFusion(super); diff --git a/src/npc/brocco.c b/src/npc/brocco.c index 6edb285c1..9236bb607 100644 --- a/src/npc/brocco.c +++ b/src/npc/brocco.c @@ -63,7 +63,7 @@ void sub_08063584(Entity* this) { } } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; InitAnimationForceUpdate(this, GetAnimationState(this) + 4); MessageFromTarget(this->timer + TEXT_INDEX(TEXT_EMPTY, 0x01)); @@ -88,9 +88,9 @@ void sub_0806362C(BroccoEntity* this) { this->animIndex = 0; sub_0807DD64(super); case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4); diff --git a/src/npc/carpenter.c b/src/npc/carpenter.c index 3ddee3001..2157168fa 100644 --- a/src/npc/carpenter.c +++ b/src/npc/carpenter.c @@ -39,9 +39,9 @@ void Carpenter(CarpenterEntity* this) { sub_0807DD64(super); case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4 + (super->type * 8)); diff --git a/src/npc/castleMaid.c b/src/npc/castleMaid.c index 7ce579838..2001f0d22 100644 --- a/src/npc/castleMaid.c +++ b/src/npc/castleMaid.c @@ -89,9 +89,9 @@ void sub_08064570(CastleMaidEntity* this) { InitScriptForNPC(super); case 1: ExecuteScriptAndHandleAnimation(super, NULL); - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action++; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); if (this->dialogFunc != NULL) { this->dialogFunc(); diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index 1c08dd62b..b4b61ccda 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -64,9 +64,9 @@ void sub_080673C0(Entity* this) { } void sub_080673F4(Entity* this) { - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; - this->interactType = 0; + this->interactType = INTERACTION_NONE; } } diff --git a/src/npc/cat.c b/src/npc/cat.c index 149276575..aa2d221e4 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -373,7 +373,7 @@ void sub_08067C44(CatEntity* this) { this->unk_69 = uVar5; - if (super->interactType == 0) { + if (super->interactType == INTERACTION_NONE) { return; } @@ -403,7 +403,7 @@ void sub_08067C44(CatEntity* this) { break; } - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 8; InitializeNPCFusion(super); } else { @@ -411,7 +411,7 @@ void sub_08067C44(CatEntity* this) { sub_08067790(super); SetDefaultPriority(super, PRIO_MESSAGE); } - super->interactType = 0; + super->interactType = INTERACTION_NONE; SoundReq(SFX_VO_CAT); } diff --git a/src/npc/cow.c b/src/npc/cow.c index 9fd35f7d3..8d4f1d4bc 100644 --- a/src/npc/cow.c +++ b/src/npc/cow.c @@ -235,9 +235,9 @@ void sub_0806920C(CowEntity* this) { // Check if player interacting void sub_0806924C(CowEntity* this) { s8 itype = super->interactType; - if (itype != 0) { - if ((gPlayerState.flags & PL_MINISH) != 0) { - if (itype == 2) { + if (itype != INTERACTION_NONE) { + if (gPlayerState.flags & PL_MINISH) { + if (itype == INTERACTION_FUSE) { super->action = 4; InitializeNPCFusion(super); } else { @@ -248,7 +248,7 @@ void sub_0806924C(CowEntity* this) { ResetPlayerAnimationAndAction(); } SoundReq(SFX_VO_COW); - super->interactType = 0; + super->interactType = INTERACTION_NONE; } } diff --git a/src/npc/cucco.c b/src/npc/cucco.c index ab4554495..db9b01ddc 100644 --- a/src/npc/cucco.c +++ b/src/npc/cucco.c @@ -107,9 +107,9 @@ void sub_0806E648(CuccoEntity* this) { } void sub_0806E65C(Entity* this) { - if (this->interactType != 0) { - if ((gPlayerState.flags & PL_MINISH) != 0) { - if (this->interactType == 2) { + if (this->interactType != INTERACTION_NONE) { + if (gPlayerState.flags & PL_MINISH) { + if (this->interactType == INTERACTION_FUSE) { this->action = 4; InitializeNPCFusion(this); } else { @@ -119,7 +119,7 @@ void sub_0806E65C(Entity* this) { ResetPlayerAnimationAndAction(); } SoundReq(SFX_VO_CUCCO_CALL); - this->interactType = 0; + this->interactType = INTERACTION_NONE; } } diff --git a/src/npc/cuccoChick.c b/src/npc/cuccoChick.c index 60ec8829b..fa4da6a62 100644 --- a/src/npc/cuccoChick.c +++ b/src/npc/cuccoChick.c @@ -86,9 +86,9 @@ void sub_0806E824(CuccoChickEntity* this) { } void sub_0806E838(CuccoChickEntity* this) { - if (super->interactType != 0) { - if ((gPlayerState.flags & PL_MINISH) != 0) { - if (super->interactType == 2) { + if (super->interactType != INTERACTION_NONE) { + if (gPlayerState.flags & PL_MINISH) { + if (super->interactType == INTERACTION_FUSE) { super->action = 3; InitializeNPCFusion(super); } else { @@ -98,7 +98,7 @@ void sub_0806E838(CuccoChickEntity* this) { ResetPlayerAnimationAndAction(); } SoundReq(SFX_VO_CHEEP); - super->interactType = 0; + super->interactType = INTERACTION_NONE; } } diff --git a/src/npc/dampe.c b/src/npc/dampe.c index 2426f6f2f..4fd41240f 100644 --- a/src/npc/dampe.c +++ b/src/npc/dampe.c @@ -27,9 +27,9 @@ void Dampe(Entity* this) { InitScriptForNPC(this); return; case 1: - if (this->interactType == 2) { + if (this->interactType == INTERACTION_FUSE) { this->action = 2; - this->interactType = 0; + this->interactType = INTERACTION_NONE; InitAnimationForceUpdate(this, GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity)) + 4); InitializeNPCFusion(this); diff --git a/src/npc/din.c b/src/npc/din.c index ced621416..5ac3114fa 100644 --- a/src/npc/din.c +++ b/src/npc/din.c @@ -22,9 +22,9 @@ void Din(DinEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); this->animIndex = super->animIndex; InitAnimationForceUpdate(super, diff --git a/src/npc/dog.c b/src/npc/dog.c index aa2065d0c..1969c89ae 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -460,9 +460,9 @@ void sub_08069FE8(DogEntity* this) { } void sub_0806A028(DogEntity* this) { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { if ((gPlayerState.flags & PL_MINISH) != 0) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 6; InitializeNPCFusion(super); } else { @@ -474,7 +474,7 @@ void sub_0806A028(DogEntity* this) { SoundReq(SFX_VO_DOG); ResetPlayerAnimationAndAction(); } - super->interactType = 0; + super->interactType = INTERACTION_NONE; } } diff --git a/src/npc/epona.c b/src/npc/epona.c index e165faf94..b467d9009 100644 --- a/src/npc/epona.c +++ b/src/npc/epona.c @@ -94,9 +94,9 @@ void sub_08065A64(EponaEntity* this) { } void sub_08065AA4(EponaEntity* this) { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { if (gPlayerState.flags & PL_MINISH) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 4; InitializeNPCFusion(super); } else { @@ -110,7 +110,7 @@ void sub_08065AA4(EponaEntity* this) { ResetPlayerAnimationAndAction(); } SoundReq(SFX_VO_EPONA); - super->interactType = 0; + super->interactType = INTERACTION_NONE; } } diff --git a/src/npc/farore.c b/src/npc/farore.c index f65a757d9..7c6048033 100644 --- a/src/npc/farore.c +++ b/src/npc/farore.c @@ -22,9 +22,9 @@ void Farore(FaroreEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); this->animIndex = super->animIndex; InitAnimationForceUpdate(super, diff --git a/src/npc/festari.c b/src/npc/festari.c index 0bcc639ef..9d42eb8c0 100644 --- a/src/npc/festari.c +++ b/src/npc/festari.c @@ -44,9 +44,9 @@ void sub_0805FE10(FestariEntity* this) { void sub_0805FE48(FestariEntity* this) { u32 uVar4; - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); } else { diff --git a/src/npc/forestMinish.c b/src/npc/forestMinish.c index a920ccbb9..7943e305f 100644 --- a/src/npc/forestMinish.c +++ b/src/npc/forestMinish.c @@ -532,9 +532,9 @@ void ForestMinish(ForestMinishEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); } else { ExecuteScriptForEntity(super, NULL); diff --git a/src/npc/gentari.c b/src/npc/gentari.c index 331774152..e8621c424 100644 --- a/src/npc/gentari.c +++ b/src/npc/gentari.c @@ -24,9 +24,9 @@ void Gentari(GentariEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); diff --git a/src/npc/ghostBrothers.c b/src/npc/ghostBrothers.c index 1dec3eb56..56597734a 100644 --- a/src/npc/ghostBrothers.c +++ b/src/npc/ghostBrothers.c @@ -78,9 +78,9 @@ void sub_08065C0C(GhostBrothersEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); @@ -240,8 +240,8 @@ void sub_08065EDC(GhostBrothersEntity* this) { void sub_08065F20(GhostBrothersEntity* this) { UpdateAnimationSingleFrame(super); - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; MessageFromTarget(0); super->animIndex++; if (gSpriteAnimations_GhostBrothers[super->animIndex] == 0) { diff --git a/src/npc/gina.c b/src/npc/gina.c index 97667460a..8933653fa 100644 --- a/src/npc/gina.c +++ b/src/npc/gina.c @@ -25,9 +25,9 @@ void Gina(GinaEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); diff --git a/src/npc/gorman.c b/src/npc/gorman.c index e5bfdd866..1b78bc0b6 100644 --- a/src/npc/gorman.c +++ b/src/npc/gorman.c @@ -101,8 +101,8 @@ void sub_080697EC(Entity* this) { this->subtimer--; } } - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; sub_08069888(this); } } @@ -118,8 +118,8 @@ void sub_08069838(GormanEntity* this) { sub_0807DD64(super); } ExecuteScriptAndHandleAnimation(super, NULL); - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; sub_08069888(super); } } diff --git a/src/npc/goron.c b/src/npc/goron.c index f2f2f8bb6..6ed59d266 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -62,7 +62,7 @@ void sub_08069328(Entity* this) { if (this->animIndex != this->animationState) { InitAnimationForceUpdate(this, this->animationState); } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; RequestPriority(this); InitAnimationForceUpdate(this, 8); @@ -74,7 +74,7 @@ void sub_08069390(Entity* this) { UpdateAnimationSingleFrame(this); if ((gMessage.doTextBox & 0x7F) == 0) { this->action = 1; - this->interactType = 0; + this->interactType = INTERACTION_NONE; RevokePriority(this); InitAnimationForceUpdate(this, this->animationState); } diff --git a/src/npc/gregal.c b/src/npc/gregal.c index 35e972c3e..66d89c938 100644 --- a/src/npc/gregal.c +++ b/src/npc/gregal.c @@ -99,9 +99,9 @@ void sub_0806CC08(GregalEntity* this) { SetDefaultPriority(super, PRIO_MESSAGE); sub_0807DD64(super); case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 8); diff --git a/src/npc/guard.c b/src/npc/guard.c index c963285d1..cb1b7060c 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -330,9 +330,9 @@ void sub_08063DC8(Entity* this) { } else { GetNextFrame(this); } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 3; - this->interactType = 0; + this->interactType = INTERACTION_NONE; InitializeAnimation(this, GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity))); sub_08064428(this); } @@ -387,9 +387,9 @@ void sub_08063F20(GuardEntity* this) { ExecuteScriptForEntity(super, 0); HandleEntity0x82Actions(super); GetNextFrame(super); - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action++; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + this->unk_70); sub_08064428(super); diff --git a/src/npc/hurdyGurdyMan.c b/src/npc/hurdyGurdyMan.c index d9dfa77d2..93cb3c369 100644 --- a/src/npc/hurdyGurdyMan.c +++ b/src/npc/hurdyGurdyMan.c @@ -34,9 +34,9 @@ void HurdyGurdyMan(HurdyGurdyManEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->unk_69 = super->animIndex; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); index = GetFuserId(super); diff --git a/src/npc/kid.c b/src/npc/kid.c index dcd2d761e..957b44264 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -238,7 +238,7 @@ void sub_080620F4(KidEntity* this) { } void sub_08062130(KidEntity* this) { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; InitAnimationForceUpdate(super, GetAnimationState(super)); } @@ -258,7 +258,7 @@ void sub_08062130(KidEntity* this) { void sub_08062194(KidEntity* this) { MessageFromTarget(0); super->action = 1; - super->interactType = 0; + super->interactType = INTERACTION_NONE; } void sub_080621AC(KidEntity* this) { @@ -285,24 +285,24 @@ void sub_080621AC(KidEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 3; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); } else { if ((s8)this->unk_68 != 0) { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; } else { sub_080622F4(this); return; } } else { ExecuteScriptAndHandleAnimation(super, NULL); - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; } else { return; } diff --git a/src/npc/kingDaltus.c b/src/npc/kingDaltus.c index b11a8a340..d6496e159 100644 --- a/src/npc/kingDaltus.c +++ b/src/npc/kingDaltus.c @@ -35,8 +35,8 @@ void KingDaltus(KingDaltusEntity* this) { sub_08066718, }; if ((super->flags & ENT_SCRIPTED) != 0) { - if (super->interactType == 2) { - super->interactType = 0; + if (super->interactType == INTERACTION_FUSE) { + super->interactType = INTERACTION_NONE; super->action = 2; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); @@ -71,9 +71,9 @@ void sub_08066688(KingDaltusEntity* this) { if (sub_0806F078(super, tmp) == 0) { UpdateAnimationSingleFrame(super); } - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; } } diff --git a/src/npc/librari.c b/src/npc/librari.c index 0d8773167..f1feaf984 100644 --- a/src/npc/librari.c +++ b/src/npc/librari.c @@ -26,9 +26,9 @@ void Librari(LibrariEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); } else { ExecuteScriptForEntity(super, NULL); diff --git a/src/npc/mailbox.c b/src/npc/mailbox.c index afb295a9e..cde3c6469 100644 --- a/src/npc/mailbox.c +++ b/src/npc/mailbox.c @@ -38,7 +38,7 @@ void sub_08063210(Entity* this) { void sub_08063220(Entity* this) { u8 bVar1; - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; bVar1 = 8; } else { diff --git a/src/npc/malon.c b/src/npc/malon.c index 93365be67..6e75d865f 100644 --- a/src/npc/malon.c +++ b/src/npc/malon.c @@ -60,9 +60,9 @@ void sub_08065888(MalonEntity* this) { } void sub_080658BC(MalonEntity* this) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); } else { diff --git a/src/npc/mama.c b/src/npc/mama.c index 11f40b150..8590e9943 100644 --- a/src/npc/mama.c +++ b/src/npc/mama.c @@ -36,9 +36,9 @@ void Mama(MamaEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); diff --git a/src/npc/mayorHagen.c b/src/npc/mayorHagen.c index 42a69dda6..b817987d5 100644 --- a/src/npc/mayorHagen.c +++ b/src/npc/mayorHagen.c @@ -29,9 +29,9 @@ void MayorHagen(MayorHagenEntity* this) { break; case 1: v = super->interactType; - if (v == 2) { + if (v == INTERACTION_FUSE) { super->action = v; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitAnimationForceUpdate(super, 4 + GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); diff --git a/src/npc/melari.c b/src/npc/melari.c index 43666e8dd..22f303f4d 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -59,8 +59,8 @@ void sub_08068730(Entity* this) { this->subtimer--; } } - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; MessageFromTarget(this->timer + TEXT_INDEX(TEXT_MINISH2, 0x0)); } } @@ -82,9 +82,9 @@ void sub_08068780(Entity* this) { InitScriptForNPC(this); break; case 1: - if (this->interactType == 2) { + if (this->interactType == INTERACTION_FUSE) { this->action = 2; - this->interactType = 0; + this->interactType = INTERACTION_NONE; InitializeNPCFusion(this); } else { ExecuteScriptForEntity(this, NULL); diff --git a/src/npc/ministerPotho.c b/src/npc/ministerPotho.c index c56c67492..9c0454a5b 100644 --- a/src/npc/ministerPotho.c +++ b/src/npc/ministerPotho.c @@ -57,9 +57,9 @@ void sub_08066808(Entity* this) { if (sub_0806F078(this, tmp) == 0) { UpdateAnimationSingleFrame(this); } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; - this->interactType = 0; + this->interactType = INTERACTION_NONE; } } @@ -76,9 +76,9 @@ void sub_08066864(MinisterPothoEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index 0a3358511..15aa1d067 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -92,8 +92,8 @@ void sub_08067E88(Entity* this) { if (sub_0806F078(this, tmp) == 0) { GetNextFrame(this); } - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; this->action = 2; MessageFromTarget(this->timer + TEXT_INDEX(TEXT_MINISH2, 0x0)); } @@ -131,18 +131,18 @@ void sub_08067EF0(MountainMinishEntity* this) { InitializeAnimation(super, gUnk_08111304[super->type2]); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 3; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); } else { ExecuteScriptForEntity(super, 0); HandleEntity0x82Actions(super); - if ((super->type2 == 3) && (super->interactType != 0)) { + if ((super->type2 == 3) && (super->interactType != INTERACTION_NONE)) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); sub_08068190(super); diff --git a/src/npc/mutoh.c b/src/npc/mutoh.c index 833614cd1..afe2d86f8 100644 --- a/src/npc/mutoh.c +++ b/src/npc/mutoh.c @@ -41,9 +41,9 @@ void Mutoh(MutohEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4); InitializeNPCFusion(super); diff --git a/src/npc/nayru.c b/src/npc/nayru.c index d56d6dfad..566c3bb2d 100644 --- a/src/npc/nayru.c +++ b/src/npc/nayru.c @@ -22,9 +22,9 @@ void Nayru(NayruEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); this->animIndex = super->animIndex; InitAnimationForceUpdate(super, diff --git a/src/npc/npc23.c b/src/npc/npc23.c index 2a64ef15a..1092e0a4b 100644 --- a/src/npc/npc23.c +++ b/src/npc/npc23.c @@ -59,8 +59,8 @@ void sub_080662F8(NPC23Entity* this) { } void sub_08066358(NPC23Entity* this) { - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; MessageFromTarget(0); if ((super->type2 & 0x10) != 0) { super->action = 3; diff --git a/src/npc/npc26.c b/src/npc/npc26.c index ff7754eeb..6d5a32218 100644 --- a/src/npc/npc26.c +++ b/src/npc/npc26.c @@ -46,9 +46,9 @@ static void sub_080669DC(Entity* this) { if (sVar2 == 0) { UpdateAnimationSingleFrame(this); } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; - this->interactType = 0; + this->interactType = INTERACTION_NONE; } } diff --git a/src/npc/npc5.c b/src/npc/npc5.c index 2527fdc0a..7cc930e6c 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -912,10 +912,10 @@ void sub_08061B18(NPC5Entity* this) { u16* puVar2; switch (super->interactType) { - case 0: + case INTERACTION_NONE: break; - case 1: - super->interactType = 0; + case INTERACTION_TALK: + super->interactType = INTERACTION_NONE; sub_08061AFC(this); puVar2 = this->unk_68; puVar2 += (super->timer++); diff --git a/src/npc/npc9.c b/src/npc/npc9.c index cf1fd130d..6e66716bd 100644 --- a/src/npc/npc9.c +++ b/src/npc/npc9.c @@ -33,8 +33,8 @@ void sub_08062AF0(Entity* this) { void sub_08062B14(Entity* this) { GetNextFrame(this); - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; this->action++; InitializeAnimation(this, 1); RequestPriority(this); diff --git a/src/npc/percy.c b/src/npc/percy.c index c8647de7c..5c6108cdf 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -58,8 +58,8 @@ void sub_0806B3CC(Entity* this) { AddInteractableWhenBigObject(this); } GetNextFrame(this); - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; MessageFromTarget(0); } sub_0806ED78(this); @@ -81,9 +81,9 @@ void sub_0806B41C(PercyEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4); idx = GetFuserId(super); diff --git a/src/npc/picolyteBottle.c b/src/npc/picolyteBottle.c index 764ee858e..0bb4742ba 100644 --- a/src/npc/picolyteBottle.c +++ b/src/npc/picolyteBottle.c @@ -90,8 +90,8 @@ void PicolyteBottle_Action1(PicolyteBottleEntity* this) { void PicolyteBottle_Action2(PicolyteBottleEntity* this) { Entity* obj; - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; super->parent->timer = super->type2; super->parent->type2 = super->subtimer; } else { diff --git a/src/npc/pina.c b/src/npc/pina.c index 8fed940fd..cb73eabc9 100644 --- a/src/npc/pina.c +++ b/src/npc/pina.c @@ -65,7 +65,7 @@ void sub_08063AC0(Entity* this) { } } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; InitAnimationForceUpdate(this, GetAnimationState(this) + 4); MessageFromTarget(this->timer + TEXT_INDEX(TEXT_EMPTY, 0x01)); @@ -90,9 +90,9 @@ void sub_08063B68(PinaEntity* this) { this->animIndex = 0; sub_0807DD64(super); case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4); diff --git a/src/npc/postman.c b/src/npc/postman.c index 5d910dae5..f8e9b0fab 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -195,8 +195,8 @@ void sub_0806045C(Entity* this) { UpdateAnimationSingleFrame(this); sub_080604DC(this); switch (this->interactType) { - case 1: - case 2: + case INTERACTION_TALK: + case INTERACTION_FUSE: this->action = 2; MessageFromTarget(0); break; @@ -253,16 +253,16 @@ void sub_08060528(PostmanEntity* this) { InitScriptForNPC(super); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 3; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); } else { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; sub_080606D8(super); InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); diff --git a/src/npc/rem.c b/src/npc/rem.c index d1dd03c0c..5470b36b7 100644 --- a/src/npc/rem.c +++ b/src/npc/rem.c @@ -360,13 +360,13 @@ void sub_0806A958(Entity* this) { void sub_0806A96C(Entity* this, ScriptExecutionContext* context) { context->condition = 0; - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { if (this->action != 3) { this->action = 3; this->subAction = 0; } else { if (this->subAction > 1) { - this->interactType = 0; + this->interactType = INTERACTION_NONE; context->condition = 1; gActiveScriptInfo.flags |= 1; } diff --git a/src/npc/sittingPerson.c b/src/npc/sittingPerson.c index f98a036a8..f16d0ea0e 100644 --- a/src/npc/sittingPerson.c +++ b/src/npc/sittingPerson.c @@ -148,9 +148,9 @@ void SittingPersion_Init(SittingPersonEntity* this) { void sub_080637B8(SittingPersonEntity* this) { u32 tmp; - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; tmp = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)); tmp += super->spriteSettings.flipX ? 4 : 0; diff --git a/src/npc/smith.c b/src/npc/smith.c index 19e95758c..61303812c 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -45,9 +45,9 @@ void Smith(SmithEntity* this) { u32 index; if ((super->flags & ENT_SCRIPTED) != 0) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 4; - super->interactType = 0; + super->interactType = INTERACTION_NONE; index = (super->animIndex == 0xc) ? 8 : 0; index += GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)); InitAnimationForceUpdate(super, index); @@ -109,7 +109,7 @@ void sub_08066118(SmithEntity* this) { if (sub_0806F078(super, uVar1) == 0) { UpdateAnimationSingleFrame(super); } - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; MessageFromTarget(0); } diff --git a/src/npc/stamp.c b/src/npc/stamp.c index 220b4c9a6..380e5be49 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -46,8 +46,8 @@ void sub_08062BD4(Entity* this) { void sub_08062BF8(Entity* this) { GetNextFrame(this); - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; this->action++; RequestPriority(this); } diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index f8fd11ed8..3560137bf 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -81,7 +81,7 @@ void sub_080650CC(StockwellEntity* this) { InitScriptExecutionContext(this->context, script_StockwellDogFood); } else { bVar2 = super->frame & 0x20; - if ((bVar2 == 0) && (super->interactType != 0)) { + if ((bVar2 == 0) && (super->interactType != INTERACTION_NONE)) { super->interactType = bVar2; super->action++; InitializeAnimation(super, 7); diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index 830f1c0a8..6367bf76f 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -62,9 +62,9 @@ void Sturgeon(SturgeonEntity* this) { super->action = 1; } } else { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = super->action | 0xff; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitializeNPCFusion(super); @@ -93,7 +93,7 @@ void sub_08064B88(SturgeonEntity* this) { s32 temp2; switch (super->interactType) { - case 0: + case INTERACTION_NONE: temp = sub_0806EE20(super); super->animationState = super->knockbackDirection; if (temp != 0) { @@ -101,7 +101,7 @@ void sub_08064B88(SturgeonEntity* this) { } GetNextFrame(super); break; - case 2: + case INTERACTION_FUSE: super->action = 3; temp2 = GetAnimationState(super); if (temp2 < 0) { @@ -109,10 +109,10 @@ void sub_08064B88(SturgeonEntity* this) { } super->subtimer = super->animIndex; InitializeAnimation(super, temp2); - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); break; - case 1: + case INTERACTION_TALK: default: super->action = 2; temp2 = GetAnimationState(super); @@ -121,7 +121,7 @@ void sub_08064B88(SturgeonEntity* this) { } super->subtimer = super->animIndex; InitializeAnimation(super, temp2); - super->interactType = 0; + super->interactType = INTERACTION_NONE; sub_08064CD8(super); } } diff --git a/src/npc/talon.c b/src/npc/talon.c index 24fbe741e..4b62dd220 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -84,8 +84,8 @@ void sub_0806559C(Entity* this) { GetNextFrame(this); } sub_0806ED78(this); - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; ResetPlayerAnimationAndAction(); } } @@ -101,10 +101,10 @@ void sub_08065608(TalonEntity* this) { } void sub_08065648(TalonEntity* this) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { this->unk_69 = super->action; super->action = 4; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); } else { ExecuteScriptAndHandleAnimation(super, NULL); @@ -127,20 +127,20 @@ void sub_080656A4(TalonEntity* this) { } void sub_080656D4(TalonEntity* this) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { this->unk_69 = super->action; super->action = 4; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); sub_0806574C(this); } else { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { if (GetInventoryValue(ITEM_QST_LONLON_KEY) != 0) { StartCutscene(super, (u16*)&script_TalonGotKey); } else { this->unk_69 = super->action; super->action = 3; - super->interactType = 0; + super->interactType = INTERACTION_NONE; MessageNoOverlap(*(u32*)(*(u32*)&this->unk_84 + 4), super); sub_0806574C(this); return; diff --git a/src/npc/teachers.c b/src/npc/teachers.c index dddb574f4..52ea9b4f7 100644 --- a/src/npc/teachers.c +++ b/src/npc/teachers.c @@ -35,9 +35,9 @@ void Teachers(TeachersEntity* this) { } break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; this->animIndex = super->animIndex; InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4( GetFacingDirection(super, &gPlayerEntity))); diff --git a/src/npc/tingleSiblings.c b/src/npc/tingleSiblings.c index 2d3a20b80..bc9ac0d5f 100644 --- a/src/npc/tingleSiblings.c +++ b/src/npc/tingleSiblings.c @@ -43,7 +43,7 @@ void sub_08064D90(Entity* this) { void sub_08064DA0(Entity* this) { sub_08064EE8(this); - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { this->action = 2; InitAnimationForceUpdate(this, 6); MessageFromTarget(0); @@ -67,9 +67,9 @@ void sub_08064DE4(Entity* this) { InitScriptForNPC(this); break; case 1: - if (this->interactType == 2) { + if (this->interactType == INTERACTION_FUSE) { this->action = 2; - this->interactType = 0; + this->interactType = INTERACTION_NONE; InitAnimationForceUpdate(this, GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity))); InitializeNPCFusion(this); diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index ee8c580a8..d818f4fa5 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -229,16 +229,16 @@ void sub_0806ACC4(TownMinishEntity* this) { InitializeAnimation(super, (super->animationState / 2) + 8); break; case 1: - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 3; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); } else { ExecuteScriptForEntity(super, NULL); sub_0806AEA8(this); if (super->type2 == 10 && super->interactType) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 8); sub_0806AFE8(super, this->context); diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index 0e6f1c368..9feb45ea8 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -73,8 +73,8 @@ void sub_08061C00(Entity* this) { } sub_08061CB4(this, uVar1); sub_0806ED78(this); - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; MessageFromTarget(this->type2 + TEXT_INDEX(TEXT_EMPTY, 0x01)); } } @@ -126,9 +126,9 @@ void sub_08061CEC(TownspersonEntity* this) { } void sub_08061D64(TownspersonEntity* this) { - if (super->interactType == 2) { + if (super->interactType == INTERACTION_FUSE) { super->action = 3; - super->interactType = 0; + super->interactType = INTERACTION_NONE; InitializeNPCFusion(super); this->unk_69 = super->animIndex; InitializeAnimation(super, (super->animIndex & -4) + @@ -140,9 +140,9 @@ void sub_08061D64(TownspersonEntity* this) { super->frameDuration = gUnk_0810B680[super->type].unk2; } GetNextFrame(super); - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; - super->interactType = 0; + super->interactType = INTERACTION_NONE; sub_08062048(super); this->unk_69 = super->animIndex; InitializeAnimation(super, (super->animIndex & -4) + diff --git a/src/npc/windTribespeople.c b/src/npc/windTribespeople.c index d8af4afa2..41eb35679 100644 --- a/src/npc/windTribespeople.c +++ b/src/npc/windTribespeople.c @@ -63,9 +63,9 @@ void sub_0806C7D4(Entity* this) { u32 iVar1; u32 uVar2; - if (this->interactType == 2) { + if (this->interactType == INTERACTION_FUSE) { this->action = 3; - this->interactType = 0; + this->interactType = INTERACTION_NONE; InitializeNPCFusion(this); } else { ExecuteScriptAndHandleAnimation(this, NULL); diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c index 58f24666f..cf18f9376 100644 --- a/src/object/bossDoor.c +++ b/src/object/bossDoor.c @@ -83,7 +83,7 @@ void BossDoor_Init(BossDoorEntity* this) { } void BossDoor_Action1(BossDoorEntity* this) { - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 2; RemoveInteractableObject(super); SetFlag(this->unk_86); diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 7b6f96c14..dd9038db6 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -148,7 +148,7 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) { void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) { sub_0800445C(super); - if (super->interactType != 0) { + if (super->interactType != INTERACTION_NONE) { super->action = 4; super->subtimer = 30; RemoveInteractableObject(super); diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c index 225657e4e..9f604808f 100644 --- a/src/object/cutsceneMiscObject.c +++ b/src/object/cutsceneMiscObject.c @@ -395,8 +395,8 @@ void CutsceneMiscObject_Type6(CutsceneMiscObjectEntity* this) { AddInteractableCheckableObject(super); break; case 1: - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; super->action = 2; RemoveInteractableObject(super); gPlayerState.queued_action = PLAYER_EMPTYBOTTLE; @@ -449,8 +449,8 @@ void CutsceneMiscObject_Type7(CutsceneMiscObjectEntity* this) { AddInteractableCheckableObject(super); break; case 1: - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; super->action = 2; RemoveInteractableObject(super); CreateEzloHint(TEXT_INDEX(TEXT_BELARI, 0x1F), 0); diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index f24170ced..624824ae1 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -125,8 +125,8 @@ void FigurineDevice_Action1(FigurineDeviceEntity* this) { AddInteractableCheckableObject(super); break; case 1: - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; ResetPlayerAnimationAndAction(); if (CheckLocalFlag(SHOP07_TANA)) { this->unk_7a = 2; diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index 8ea4cced8..7dcef6c5e 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -86,15 +86,15 @@ void ItemForSale_Action1(ItemForSaleEntity* this) { gUnk_0200AF00.rActionPlayerState = 2; } else { if (super->type == 0x36) { - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; super->action = 3; gRoomVars.animFlags = 1; gPlayerState.queued_action = PLAYER_08070E9C; } } else { - if (super->interactType != 0) { - super->interactType = 0; + if (super->interactType != INTERACTION_NONE) { + super->interactType = INTERACTION_NONE; super->subAction = 1; sub_08078B48(); ResetActiveItems(); diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index 43d040470..ae3ae8963 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -230,7 +230,7 @@ void LockedDoor_Action7(LockedDoorEntity* this) { } void LockedDoor_Action8(LockedDoorEntity* this) { - if (super->interactType == 0 && !CheckFlags(this->unk_86)) + if (super->interactType == INTERACTION_NONE && !CheckFlags(this->unk_86)) return; super->action = 1; super->timer = 20; diff --git a/src/object/objectA.c b/src/object/objectA.c index 1648250b4..aad2385cc 100644 --- a/src/object/objectA.c +++ b/src/object/objectA.c @@ -44,7 +44,7 @@ void ObjectA(ObjectAEntity* this) { } else { AddInteractableSmallKeyLock(super); } - } else if (super->interactType != 0) { + } else if (super->interactType != INTERACTION_NONE) { SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer); SetFlag(this->unk_86); CreateDust(super); diff --git a/src/object/specialChest.c b/src/object/specialChest.c index 8d8fd2f19..fd57c7fc6 100644 --- a/src/object/specialChest.c +++ b/src/object/specialChest.c @@ -7,6 +7,7 @@ #define NENT_DEPRECATED #include "entity.h" #include "flags.h" +#include "player.h" #include "room.h" extern void AddInteractableChest(Entity*); @@ -21,7 +22,7 @@ void SpecialChest(Entity* this) { this->collisionLayer = 1; AddInteractableChest(this); } - if (this->interactType != 0) { + if (this->interactType != INTERACTION_NONE) { OpenSmallChest(COORD_TO_TILE(this), 2); DeleteThisEntity(); } diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c index 36a2aedff..732927c91 100644 --- a/src/object/swordsmanNewsletter.c +++ b/src/object/swordsmanNewsletter.c @@ -36,8 +36,8 @@ void SwordsmanNewsletter_Action1(Entity* this) { TEXT_INDEX(TEXT_NEWSLETTER, 4), TEXT_INDEX(TEXT_NEWSLETTER, 5), TEXT_INDEX(TEXT_NEWSLETTER, 6), TEXT_INDEX(TEXT_NEWSLETTER, 7), TEXT_INDEX(TEXT_NEWSLETTER, 8), }; - if (this->interactType != 0) { - this->interactType = 0; + if (this->interactType != INTERACTION_NONE) { + this->interactType = INTERACTION_NONE; MessageNoOverlap(messageIndices[this->type], this); } } diff --git a/src/playerUtils.c b/src/playerUtils.c index 43ec882f9..1afef3e15 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -1012,7 +1012,7 @@ void DetermineRButtonInteraction(void) { rAction = gUnk_0200AF00.rActionInteractTile; } else { interaction = sub_080784E4(); - if (interaction->entity->interactType == 0) { + if (interaction->entity->interactType == INTERACTION_NONE) { switch (interaction->type) { case INTERACTION_TALK: @@ -1115,10 +1115,10 @@ bool32 sub_080782C0(void) { AddKinstoneToBag(KINSTONE_NONE); if (gSave.kinstoneAmounts[0] != 0) { gPossibleInteraction.kinstoneId = gPossibleInteraction.currentObject->kinstoneId; - gPossibleInteraction.currentObject->entity->interactType = 2; + gPossibleInteraction.currentObject->entity->interactType = INTERACTION_FUSE; gPlayerState.queued_action = PLAYER_08070E9C; } else { - CreateEzloHint(TEXT_INDEX(TEXT_EZLO, 0x65), 0); + CreateEzloHint(TEXT_INDEX(TEXT_EZLO, 0x65), 0); // "Hey, you don't have any Kinstone Pieces! ..." } ForceSetPlayerState(PL_STATE_TALKEZLO); return TRUE; @@ -1139,12 +1139,12 @@ bool32 sub_080782C0(void) { case INTERACTION_OPEN_CHEST: case INTERACTION_USE_SMALL_KEY: case INTERACTION_TALK_MINISH: - entity->interactType = 1; + entity->interactType = INTERACTION_TALK; gPossibleInteraction.kinstoneId = KINSTONE_NONE; return TRUE; case INTERACTION_LIFT_SHOP_ITEM: if (gRoomVars.shopItemType == 0) { - entity->interactType = 1; + entity->interactType = INTERACTION_TALK; gRoomVars.shopItemType = entity->type; gRoomVars.shopItemType2 = entity->type2; return TRUE; @@ -1161,7 +1161,7 @@ void ResetPossibleInteraction(void) { // determines which (if any) object the player is currently able to interact with InteractableObject* sub_080784E4(void) { - u8 uVar1; + u8 frameState; PlayerFlags r7; s32 r3; PlayerFlags PVar4; @@ -1183,16 +1183,16 @@ InteractableObject* sub_080784E4(void) { } if (gPlayerState.framestate == 0) { - uVar1 = gPlayerState.framestate_last; + frameState = gPlayerState.framestate_last; } else { - uVar1 = gPlayerState.framestate; + frameState = gPlayerState.framestate; } - switch (uVar1) { - case 2: - case 3: - case 0x12: - case 0x15: - case 0x16: + switch (frameState) { + case PL_STATE_SWORD: + case PL_STATE_GUSTJAR: + case PL_STATE_DIE: + case PL_STATE_ITEMGET: + case PL_STATE_DROWN: l: gPossibleInteraction.currentIndex = 0xFF; gPossibleInteraction.currentObject = (InteractableObject*)&gNoInteraction; @@ -1200,7 +1200,7 @@ InteractableObject* sub_080784E4(void) { return gPossibleInteraction.currentObject; } - if ((gPlayerState.flags & PL_MINISH) == 0) { + if (!(gPlayerState.flags & PL_MINISH)) { r7 = HasDungeonSmallKey() ? PL_BUSY : 0; if (HasDungeonBigKey()) { r7 |= PL_FLAGS2; @@ -1221,41 +1221,41 @@ InteractableObject* sub_080784E4(void) { continue; if (entity->interactType < 0) break; - if ((((iObject->ignoreLayer & 1) == 0) && ((gPlayerEntity.collisionLayer & entity->collisionLayer) == 0)) || - ((iObject->interactDirections >> (gPlayerEntity.animationState >> 1) & 1) != 0)) + if (((iObject->ignoreLayer & 1) == 0 && (gPlayerEntity.collisionLayer & entity->collisionLayer) == 0) || + (iObject->interactDirections >> (gPlayerEntity.animationState >> 1) & 1) != 0) continue; switch (iObject->type) { - case 0: + case INTERACTION_NONE: continue; - case 1: - case 3: - case 4: - case 8: - case 9: - if ((gPlayerState.flags & PL_MINISH) != 0) + case INTERACTION_TALK: + case INTERACTION_OPEN_CHEST: + case INTERACTION_UNUSED: + case INTERACTION_LIFT_SHOP_ITEM: + case INTERACTION_CHECK: + if (gPlayerState.flags & PL_MINISH) continue; break; - case 7: + case INTERACTION_TALK_MINISH: PVar4 = gPlayerState.flags & PL_MINISH; - if (PVar4 == 0) + if (!PVar4) continue; break; - case 2: + case INTERACTION_FUSE: PVar4 = (PlayerFlags)iObject->kinstoneId; if (PVar4 == 0) continue; break; - case 5: + case INTERACTION_USE_SMALL_KEY: PVar4 = PL_BUSY & r7; - if (PVar4 == 0) + if (!PVar4) continue; break; - case 6: + case INTERACTION_USE_BIG_KEY: PVar4 = PL_FLAGS2 & r7; - if (PVar4 == 0) + if (!PVar4) continue; break; - case 10: + case INTERACTION_DROP_PEDESTAL: default: break; } @@ -1364,7 +1364,7 @@ void SetInteractableObjectCollision(Entity* arg0, u32 ignoreLayer, u32 interactD s32 AddInteractableObject(Entity* entity, InteractionType type, KinstoneId kinstoneId) { s32 index; - entity->interactType = 0; + entity->interactType = INTERACTION_NONE; index = GetInteractableObjectIndex(entity); if (index < 0) { index = GetInteractableObjectIndex(0); diff --git a/src/script.c b/src/script.c index 29579d77d..33fcbcf25 100644 --- a/src/script.c +++ b/src/script.c @@ -792,7 +792,7 @@ void ScriptCommand_CheckPlayerInRegion2(Entity* entity, ScriptExecutionContext* void ScriptCommand_CheckEntityInteractType(Entity* entity, ScriptExecutionContext* context) { if (entity->interactType) { - entity->interactType = 0; + entity->interactType = INTERACTION_NONE; context->condition = 1; } else { context->condition = 0; @@ -807,7 +807,7 @@ void ScriptCommand_FacePlayerAndCheckDist(Entity* entity, ScriptExecutionContext } context->unk_1A++; if (entity->interactType) { - entity->interactType = 0; + entity->interactType = INTERACTION_NONE; context->condition = 1; entity->animationState = GetAnimationStateForDirection8(GetFacingDirection(entity, &gPlayerEntity)); } else { @@ -1108,7 +1108,7 @@ void ScriptCommand_SetAnimation(Entity* entity, ScriptExecutionContext* context) void ScriptCommand_TriggerInteract(Entity* entity, ScriptExecutionContext* context) { if (entity->interactType) { - entity->interactType = 0; + entity->interactType = INTERACTION_NONE; gActiveScriptInfo.flags |= 1; } else { gActiveScriptInfo.commandSize = 0; @@ -1124,7 +1124,7 @@ void ScriptCommand_0807E974(Entity* entity, ScriptExecutionContext* context) { case 0: if (!entity->interactType) break; - entity->interactType = 0; + entity->interactType = INTERACTION_NONE; context->unk_18++; MessageFromTarget(context->scriptInstructionPointer[1]); break; @@ -1177,9 +1177,9 @@ void ScriptCommand_UpdateFusion(Entity* entity, ScriptExecutionContext* context) } void ScriptCommand_0807EA4C(Entity* entity, ScriptExecutionContext* context) { - if (entity->interactType == 2) { + if (entity->interactType == INTERACTION_FUSE) { InitializeFuseInfo(entity, 0, 0, 0); - entity->interactType = 0; + entity->interactType = INTERACTION_NONE; gActiveScriptInfo.flags |= 1; } else { gActiveScriptInfo.commandSize = 0; @@ -1719,12 +1719,12 @@ void LoadMenu(Entity* entity, ScriptExecutionContext* context) { void CheckInteractType(Entity* entity, ScriptExecutionContext* context) { switch (entity->interactType) { - case 1: - entity->interactType = 0; + case INTERACTION_TALK: + entity->interactType = INTERACTION_NONE; context->intVariable = 1; break; - case 2: - entity->interactType = 0; + case INTERACTION_FUSE: + entity->interactType = INTERACTION_NONE; context->intVariable = 2; break; default: