mirror of https://github.com/zeldaret/tmc.git
Applied the enum for interactions (#647)
* Interactions enum applied * Interactions enum applied
This commit is contained in:
parent
aaa4415746
commit
b163ecafc9
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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++);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) +
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
20
src/script.c
20
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:
|
||||
|
|
Loading…
Reference in New Issue