blob: c56a91ea2fc0c59762f34884ce2faff44c761df8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/**
* @file farore.c
* @ingroup NPCs
*
* @brief Farore NPC
*/
#include "npc.h"
#include "kinstone.h"
#include "save.h"
#include "player.h"
#include "script.h"
#include "physics.h"
#include "asm.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 animIndex;
} FaroreEntity;
void Farore(FaroreEntity* this) {
switch (super->action) {
case 0:
super->action = 1;
super->spriteSettings.draw = 1;
InitScriptForNPC(super);
break;
case 1:
if (super->interactType == INTERACTION_FUSE) {
super->action = 2;
super->interactType = INTERACTION_NONE;
InitializeNPCFusion(super);
this->animIndex = super->animIndex;
InitAnimationForceUpdate(
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
} else {
ExecuteScriptAndHandleAnimation(super, NULL);
}
break;
case 2:
if (UpdateFuseInteraction(super) != 0) {
super->action = 1;
InitAnimationForceUpdate(super, this->animIndex);
}
break;
}
}
void Farore_MakeInteractable(Entity* this) {
u32 kinstoneId = GetFusionToOffer(this);
if ((gSave.kinstones.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) {
kinstoneId = KINSTONE_NONE;
}
AddInteractableWhenBigFuser(this, kinstoneId);
}
void Farore_Fusion(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 6);
} else {
UpdateAnimationSingleFrame(this);
}
}
|