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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
/**
* @file worldEvent17.c
* @ingroup WorldEvents
*
* @brief World Event 17
*/
#include "fade.h"
#include "manager.h"
#include "menu.h"
#include "npc.h"
#include "room.h"
#include "script.h"
#include "subtask.h"
#include "manager/bombableWallManager.h"
// Called Goron Kinstone Fusion Script
void sub_08054EB8(Entity* this, ScriptExecutionContext* context) {
BombableWallManager* manager = (BombableWallManager*)GetEmptyManager();
if (manager != NULL) {
manager->base.kind = MANAGER;
manager->base.id = BOMBABLE_WALL_MANAGER;
manager->x = this->x.HALF.HI - gRoomControls.origin_x;
manager->y = (this->y.HALF.HI - gRoomControls.origin_y) - 0x10;
manager->field_0x35 = 1;
#if defined(EU) || defined(JP) || defined(DEMO_JP)
manager->field_0x3e = 0x77;
#else
manager->field_0x3e = 0x79;
#endif
AppendEntityToList((Entity*)manager, 6);
}
}
void sub_08054EFC(Entity* this, ScriptExecutionContext* context) {
Entity* effect;
u32 tmp = COORD_TO_TILE(this) - 0x40;
SetBottomTile(0x4074, tmp, 1);
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
effect = CreateFx(this, FX_BIG_EXPLOSION, 0);
if (effect != NULL) {
effect->y.HALF.HI -= 0x10;
SortEntityBelow(this, effect);
}
SoundReq(SFX_ITEM_BOMB_EXPLODE);
}
void sub_08054F64(Entity* this, ScriptExecutionContext* context) {
u32 tmp = this->type2;
if ((gActiveScriptInfo.syncFlags & tmp) != tmp) {
gActiveScriptInfo.commandSize = 0;
} else {
gActiveScriptInfo.syncFlags &= ~tmp;
gActiveScriptInfo.flags |= 1;
}
}
extern Script script_GoronKinstone;
const EntityData gUnk_080FEF48[] = {
{ NPC, 79, GORON, 0, 0, 0x88, 0x368, (u32)&script_GoronKinstone },
#if defined(USA) || defined(DEMO_USA)
// TODO 0x7c is a flag?
{ MANAGER, 15, MOVEABLE_OBJECT_MANAGER, 0, 0x10e82e00, 0xd8, 0x388, 0x7c1388 },
#else
{ MANAGER, 15, MOVEABLE_OBJECT_MANAGER, 0, 0x10e82e00, 0xd8, 0x388, 0x7a1388 },
#endif
{ 0xff, 0, 0, 0, 0, 0x0, 0x0, 0 },
};
extern Script script_Goron1Kinstone2;
extern Script script_Goron2Kinstone2;
const EntityData gUnk_080FEF78[] = {
{ NPC, 79, GORON, 0, 0, 0x68, 0x228, (u32)&script_Goron1Kinstone2 },
{ NPC, 79, GORON, 0, 0, 0x88, 0x288, (u32)&script_Goron2Kinstone2 },
{ 0xff, 0, 0, 0, 0, 0x0, 0x0, 0 },
};
extern Script script_Goron1Kinstone3;
extern Script script_Goron2Kinstone3;
extern Script script_Goron3Kinstone3;
const EntityData gUnk_080FEFA8[] = {
{ NPC, 79, GORON, 0, 4, 0x48, 0x178, (u32)&script_Goron1Kinstone3 },
{ NPC, 79, GORON, 0, 8, 0x68, 0x178, (u32)&script_Goron2Kinstone3 },
{ NPC, 79, GORON, 0, 2, 0x88, 0x1e8, (u32)&script_Goron3Kinstone3 },
{ 0xff, 0, 0, 0, 0, 0x0, 0x0, 0 },
};
extern Script script_Goron1Kinstone4;
extern Script script_Goron2Kinstone4;
extern Script script_Goron4Kinstone4;
const EntityData gUnk_080FEFE8[] = {
{ NPC, 79, GORON, 0, 4, 0x48, 0x178, (u32)&script_Goron1Kinstone4 },
{ NPC, 79, GORON, 0, 8, 0x68, 0x178, (u32)&script_Goron2Kinstone4 },
{ NPC, 79, GORON, 0, 16, 0x88, 0x178, (u32)&script_Goron2Kinstone4 },
{ NPC, 79, GORON, 0, 2, 0x88, 0x1e8, (u32)&script_Goron4Kinstone4 },
{ 0xff, 0, 0, 0, 0, 0x0, 0x0, 0 },
};
extern Script script_Goron1Kinstone5;
extern Script script_Goron2Kinstone5;
extern Script script_Goron5Kinstone5;
const EntityData gUnk_080FF038[] = {
{ NPC, 79, GORON, 0, 4, 0x28, 0xd8, (u32)&script_Goron1Kinstone5 },
{ NPC, 79, GORON, 0, 8, 0x48, 0xd8, (u32)&script_Goron2Kinstone5 },
{ NPC, 79, GORON, 0, 16, 0x68, 0xd8, (u32)&script_Goron2Kinstone5 },
{ NPC, 79, GORON, 0, 32, 0x88, 0xd8, (u32)&script_Goron2Kinstone5 },
{ NPC, 79, GORON, 0, 2, 0x98, 0x178, (u32)&script_Goron5Kinstone5 },
{ 0xff, 0, 0, 0, 0, 0x0, 0x0, 0 },
};
extern Script script_Goron1Kinstone6;
extern Script script_Goron2Kinstone6;
extern Script script_Goron6Kindstone6;
const EntityData gUnk_080FF098[] = {
{ NPC, 79, GORON, 0, 4, 0x28, 0xd8, (u32)&script_Goron1Kinstone6 },
{ NPC, 79, GORON, 0, 8, 0x48, 0xd8, (u32)&script_Goron2Kinstone6 },
{ NPC, 79, GORON, 0, 16, 0x68, 0xd8, (u32)&script_Goron2Kinstone6 },
{ NPC, 79, GORON, 0, 32, 0x88, 0xd8, (u32)&script_Goron2Kinstone6 },
{ NPC, 79, GORON, 0, 64, 0xa8, 0xd8, (u32)&script_Goron2Kinstone6 },
{ NPC, 79, GORON, 0, 2, 0x98, 0x178, (u32)&script_Goron6Kindstone6 },
{ 0xff, 0, 0, 0, 0, 0x0, 0x0, 0 },
};
const EntityData* const gUnk_080FF108[] = {
gUnk_080FEF48, gUnk_080FEF78, gUnk_080FEFA8, gUnk_080FEFE8, gUnk_080FF038, gUnk_080FF098,
};
void WorldEvent_17_0(void);
void WorldEvent_17_1(void);
void (*const WorldEvent_17_Functions[])(void) = {
WorldEvent_17_0,
WorldEvent_17_1,
};
void WorldEvent_17(void) {
WorldEvent_17_Functions[gMenu.overlayType]();
}
void WorldEvent_17_0(void) {
u8* ptr;
u32 tmp;
ptr = gMenu.field_0xc;
LoadRoomEntityList(gUnk_080FF108[ptr[1]]);
if (ptr[1] != 0) {
tmp = 3;
} else {
tmp = 0;
}
sub_08055B70(gMenu.field_0x4, tmp, 0, 0);
gMenu.overlayType++;
gUpdateVisibleTiles = 1;
SetFade(FADE_INSTANT, 0x10);
gMenu.field_0xa = 0;
if (CheckLocalFlagByBank(FLAG_BANK_4, GORON_DOUKUTU_01_T1) && (ptr[2] == 0x2f)) {
gMenu.field_0xa = 1;
}
}
void WorldEvent_17_1(void) {
if (gMenu.field_0xa != 0) {
gMenu.field_0xa = 0;
SetTileType(0x74, 0x407, 1);
}
}
|