summaryrefslogtreecommitdiff
path: root/src/npc/simon.c
blob: f5f1aad738e80d3d5cd069f65ca12b8f80f20f91 (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
#include "global.h"
#include "audio.h"
#include "entity.h"
#include "room.h"
#include "flags.h"
#include "script.h"
#include "object.h"
#include "functions.h"

typedef struct {
    u8 filler[4];
    u32 unk;
} struct_0806C2A0;

extern void DoExitTransition(void*);

extern void gUnk_0813AD60;
extern void gUnk_0813AD74;

void Simon(Entity* this) {
    if (this->action == 0) {
        this->action++;
        sub_0807DD50(this);
    } else {
        sub_0807DD94(this, NULL);
    }
}

void sub_0806C224(void) {
    DoExitTransition(&gUnk_0813AD60);
    gScreenTransition.transitionType = 6;
}

void Simon_CreateChest(Entity* this) {
    CreateObjectWithParent(this, SPECIAL_FX, 0x43, 0);
    SetTileType(0x73, COORD_TO_TILE(this), this->collisionLayer);
    SoundReq(SFX_SECRET_BIG);
}

void sub_0806C280(void) {
    SetGlobalFlag(MAROYA_WAKEUP);
    DoExitTransition(&gUnk_0813AD74);
    gScreenTransition.transitionType = 6;
}

void sub_0806C2A0(Entity* this, ScriptExecutionContext* context) {
    switch (context->intVariable) {
        case 0:
            DoFade(0xd, 4);
            break;
        case 1:
            DoFade(0xc, 4);
            break;
    }
}