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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
#include "global.h"
#include "constants/direction.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "pokemon.h"
extern void LoadIQSkills(struct DungeonEntity *);
extern struct DungeonEntity *GetPartnerEntity();
extern struct DungeonEntity *xxx_call_GetLeaderEntity(void);
extern struct DungeonEntity *sub_8085680(u32);
extern void SetDefaultIQSkills(u8 *param_1, u8 param_2);
extern void sub_8097FF8(void);
extern u8 sub_8044B28(void);
extern u8 HasRecruitedMon(u32);
extern u8 gUnknown_202E038[];
extern void sub_8083E88(u32);
extern void sub_8085374();
extern void sub_80854D4();
extern void sub_8085930(u32);
extern void sub_80855E4(void *);
extern void sub_8085860(s32 r0, u32 r1);
extern void sub_8068FE0(struct DungeonEntity *, u32, u32);
extern void sub_8097FA8(u32);
extern void sub_80858AC(void *, u32);
extern void DisplayDungeonDialogue(u8 *);
extern void sub_806CDD4(struct DungeonEntity *, u32, u32);
extern void sub_80869E4(struct DungeonEntity *, u32, u32, u32);
extern void sub_8083E88(u32);
extern void sub_803E708(u32, u32);
extern void sub_8086448(void);
extern void sub_80862BC(struct DungeonEntity *);
extern void sub_8086E74(struct DungeonEntity *);
extern void SpriteLookAroundEffect(struct DungeonEntity *);
extern void sub_8086A54(struct DungeonEntity *);
extern void PlaySoundEffect(u32);
extern void sub_808563C(void *);
// X / Y Coords??
struct subStruct_Skarmory
{
int x;
int y;
};
extern u8 gUnknown_8100768;
extern u8 gUnknown_8100798;
extern u8 gUnknown_8100820;
extern u8 gUnknown_8100844;
extern u8 gUnknown_8100880;
extern u8 gUnknown_8100928;
extern u8 gUnknown_8100A04;
extern u8 gUnknown_8100B80;
extern u8 gUnknown_8100BC0;
extern u8 gUnknown_8100C90;
extern u8 gUnknown_8100CBC;
extern u8 gUnknown_8100CDC;
extern u8 gUnknown_8100D3C;
void sub_8086A3C(struct DungeonEntity *param_1)
{
param_1->entityData->unk15C = 1;
param_1->entityData->unk15E = 1;
}
void sub_8086A54(struct DungeonEntity *param_1)
{
param_1->entityData->unk15C = 1;
param_1->entityData->unk15E = 0;
}
void SetupBossFightHP(struct DungeonEntity *param_1, s32 newHP, u16 param_3)
{
// NOTE: needed two of these to match.. very dumb
struct DungeonEntityData *iVar1;
struct DungeonEntityData *iVar2;
iVar1 = param_1->entityData;
iVar2 = param_1->entityData;
iVar1->isBoss = TRUE;
// BUG: Source of the Reviver Seed Boss Glitch
//
// Video to demonstration:
// https://www.youtube.com/watch?v=rHu7EehrZ68
iVar1->originalHP = iVar1->maxHP;
if (newHP != 0) {
iVar1->maxHP = newHP;
iVar1->HP = newHP;
}
gDungeonGlobalData->unk66A = param_3;
SetDefaultIQSkills(iVar2->IQSkillsSelected,iVar2->isBoss);
LoadIQSkills(param_1);
}
void sub_8086AC0(void)
{
if(!sub_8044B28())
if(gDungeonGlobalData->unk2 == 0)
sub_8097FF8();
}
u8 sub_8086AE4(s16 _index)
{
s32 pokeIndex = _index;
if(gDungeonGlobalData->unk65C == 0)
return 1;
else
return HasRecruitedMon(pokeIndex);
}
void sub_8086B14(void)
{
struct DungeonEntity * LeaderEntity;
struct DungeonEntity * DiglettEntity;
struct DungeonEntity * SkarmoryEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
DiglettEntity = sub_8085680(4);
SkarmoryEntity = sub_8085680(3);
sub_8083E88(0x72);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8086A3C(SkarmoryEntity);
DiglettEntity->entityData->unk15C = 1;
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y + -2);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_DIGLETT);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_SKARMORY);
}
void sub_8086B94(void)
{
struct DungeonEntity * LeaderEntity;
struct DungeonEntity * DiglettEntity;
struct DungeonEntity * SkarmoryEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
DiglettEntity = sub_8085680(4);
SkarmoryEntity = sub_8085680(3);
sub_8068FE0(SkarmoryEntity,0x21c,0);
sub_8068FE0(DiglettEntity,0x21c,0);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y);
}
void sub_8086BDC(char param_1, s32 param_2)
{
if ((((param_2 * 0x1000000) - 0x1000000U) >> 0x18 < 2) && (param_1 == 3)) {
sub_8097FA8(1);
gDungeonGlobalData->unk2 = 1;
}
}
void SkarmoryPreFightDialogue(void)
{
struct DungeonEntity *LeaderEntity;
struct DungeonEntity *PartnerEntity;
struct DungeonEntity * DiglettEntity;
struct DungeonEntity * SkarmoryEntity;
struct subStruct_Skarmory local_1c;
struct subStruct_Skarmory local_20;
LeaderEntity = xxx_call_GetLeaderEntity(); // Player
PartnerEntity = GetPartnerEntity(); // Partner
DiglettEntity = sub_8085680(4); // Diglett
SkarmoryEntity = sub_8085680(3); // Skarmory
local_1c.x = DiglettEntity->posPixel.x;
local_1c.y = DiglettEntity->posPixel.y + 0x3000;
local_20.x = SkarmoryEntity->posPixel.x;
local_20.y = SkarmoryEntity->posPixel.y + 0x2000;
sub_8086448();
sub_803E708(10,0x46);
sub_80862BC(PartnerEntity);
sub_803E708(0x20,0x46);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gUnknown_8100768);
sub_80858AC(&local_1c,0x40);
sub_803E708(0x40,0x46);
sub_80858AC(&local_20,0x30);
DisplayDungeonDialogue(&gUnknown_8100798);
sub_803E708(10,0x46);
DiglettEntity->entityData->unk15D = 1;
sub_80858AC(&local_1c,0x30);
DisplayDungeonDialogue(&gUnknown_8100820); // Diglett: ...I...\nI'm scared.
sub_803E708(10,0x46);
sub_80858AC(&local_20,0x20);
sub_803E708(0x20,0x46);
sub_8086E74(SkarmoryEntity);
DisplayDungeonDialogue(&gUnknown_8100844); // Skarmory: You!\nWhat do you think you're doing here?!
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gUnknown_8100880);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gUnknown_8100928);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gUnknown_8100A04);
sub_803E708(10,0x46);
sub_806CDD4(SkarmoryEntity,0xd,0);
DisplayDungeonDialogue(&gUnknown_8100B80);
sub_803E708(10,0x46);
sub_80869E4(PartnerEntity,4,1,2);
sub_80869E4(LeaderEntity,4,2,6);
DisplayDungeonDialogue(&gUnknown_8100BC0);
sub_80869E4(PartnerEntity,4,2,4);
sub_80869E4(LeaderEntity,4,1,4);
sub_803E708(10,0x46);
sub_8083E88(0xb);
sub_80858AC(&LeaderEntity->posPixel.x,0x10);
}
void SkarmoryReFightDialogue(void)
{
struct DungeonEntity * LeaderEntity;
struct DungeonEntity * SkarmoryEntity;
struct subStruct_Skarmory local_14;
LeaderEntity = xxx_call_GetLeaderEntity();
SkarmoryEntity = sub_8085680(3);
local_14.x = SkarmoryEntity->posPixel.x;
local_14.y = SkarmoryEntity->posPixel.y + 0x2000;
sub_8086448();
sub_803E708(10,0x46);
sub_8086E74(SkarmoryEntity);
sub_80858AC(&local_14,0x10);
DisplayDungeonDialogue(&gUnknown_8100C90);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gUnknown_8100CBC);
sub_803E708(10,0x46);
sub_806CDD4(SkarmoryEntity,0xd,0);
DisplayDungeonDialogue(&gUnknown_8100CDC);
sub_803E708(10,0x46);
sub_80858AC(&LeaderEntity->posPixel.x,0x10);
sub_8083E88(0xb);
}
void sub_8086E40(void)
{
SpriteLookAroundEffect(xxx_call_GetLeaderEntity());
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gUnknown_8100D3C);
sub_803E708(10,0x46);
gDungeonGlobalData->unk2 = 1;
}
void sub_8086E74(struct DungeonEntity * param_1)
{
sub_806CDD4(param_1,0xf,0);
sub_8086A54(param_1);
PlaySoundEffect(0x1f8);
sub_803E708(0x44,0x46);
}
void sub_8086E9C(void)
{
struct DungeonEntity * LeaderEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
sub_8083E88(0x72);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_808563C(sub_8086A3C);
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_METAPOD);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_GENGAR);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0xA0, SPECIES_CATERPIE);
}
void sub_8086F00(void)
{
struct DungeonEntity * LeaderEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_METAPOD);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_GENGAR);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0xA0, SPECIES_CATERPIE);
}
|