Merge remote-tracking branch 'upstream' into tustin2121-patch-5

This commit is contained in:
Marcus Huderle
2020-01-13 20:26:20 -06:00
1553 changed files with 106038 additions and 112232 deletions
-210
View File
@@ -1,210 +0,0 @@
#include "global.h"
static void *sHeapStart;
static u32 sHeapSize;
static u32 malloc_c_unused_0300000c; // needed to align dma3_manager.o(.bss)
#define MALLOC_SYSTEM_ID 0xA3A3
struct MemBlock {
// Whether this block is currently allocated.
bool16 flag;
// Magic number used for error checking. Should equal MALLOC_SYSTEM_ID.
u16 magic;
// Size of the block (not including this header struct).
u32 size;
// Previous block pointer. Equals sHeapStart if this is the first block.
struct MemBlock *prev;
// Next block pointer. Equals sHeapStart if this is the last block.
struct MemBlock *next;
// Data in the memory block. (Arrays of length 0 are a GNU extension.)
u8 data[0];
};
void PutMemBlockHeader(void *block, struct MemBlock *prev, struct MemBlock *next, u32 size)
{
struct MemBlock *header = (struct MemBlock *)block;
header->flag = FALSE;
header->magic = MALLOC_SYSTEM_ID;
header->size = size;
header->prev = prev;
header->next = next;
}
void PutFirstMemBlockHeader(void *block, u32 size)
{
PutMemBlockHeader(block, (struct MemBlock *)block, (struct MemBlock *)block, size - sizeof(struct MemBlock));
}
void *AllocInternal(void *heapStart, u32 size)
{
struct MemBlock *pos = (struct MemBlock *)heapStart;
struct MemBlock *head = pos;
struct MemBlock *splitBlock;
u32 foundBlockSize;
// Alignment
if (size & 3)
size = 4 * ((size / 4) + 1);
for (;;) {
// Loop through the blocks looking for unused block that's big enough.
if (!pos->flag) {
foundBlockSize = pos->size;
if (foundBlockSize >= size) {
if (foundBlockSize - size < 2 * sizeof(struct MemBlock)) {
// The block isn't much bigger than the requested size,
// so just use it.
pos->flag = TRUE;
} else {
// The block is significantly bigger than the requested
// size, so split the rest into a separate block.
foundBlockSize -= sizeof(struct MemBlock);
foundBlockSize -= size;
splitBlock = (struct MemBlock *)(pos->data + size);
pos->flag = TRUE;
pos->size = size;
PutMemBlockHeader(splitBlock, pos, pos->next, foundBlockSize);
pos->next = splitBlock;
if (splitBlock->next != head)
splitBlock->next->prev = splitBlock;
}
return pos->data;
}
}
if (pos->next == head)
return NULL;
pos = pos->next;
}
}
void FreeInternal(void *heapStart, void *pointer)
{
if (pointer) {
struct MemBlock *head = (struct MemBlock *)heapStart;
struct MemBlock *block = (struct MemBlock *)((u8 *)pointer - sizeof(struct MemBlock));
block->flag = FALSE;
// If the freed block isn't the last one, merge with the next block
// if it's not in use.
if (block->next != head) {
if (!block->next->flag) {
block->size += sizeof(struct MemBlock) + block->next->size;
block->next->magic = 0;
block->next = block->next->next;
if (block->next != head)
block->next->prev = block;
}
}
// If the freed block isn't the first one, merge with the previous block
// if it's not in use.
if (block != head) {
if (!block->prev->flag) {
block->prev->next = block->next;
if (block->next != head)
block->next->prev = block->prev;
block->magic = 0;
block->prev->size += sizeof(struct MemBlock) + block->size;
}
}
}
}
void *AllocZeroedInternal(void *heapStart, u32 size)
{
void *mem = AllocInternal(heapStart, size);
if (mem != NULL) {
if (size & 3)
size = 4 * ((size / 4) + 1);
CpuFill32(0, mem, size);
}
return mem;
}
bool32 CheckMemBlockInternal(void *heapStart, void *pointer)
{
struct MemBlock *head = (struct MemBlock *)heapStart;
struct MemBlock *block = (struct MemBlock *)((u8 *)pointer - sizeof(struct MemBlock));
if (block->magic != MALLOC_SYSTEM_ID)
return FALSE;
if (block->next->magic != MALLOC_SYSTEM_ID)
return FALSE;
if (block->next != head && block->next->prev != block)
return FALSE;
if (block->prev->magic != MALLOC_SYSTEM_ID)
return FALSE;
if (block->prev != head && block->prev->next != block)
return FALSE;
if (block->next != head && block->next != (struct MemBlock *)(block->data + block->size))
return FALSE;
return TRUE;
}
void InitHeap(void *heapStart, u32 heapSize)
{
sHeapStart = heapStart;
sHeapSize = heapSize;
PutFirstMemBlockHeader(heapStart, heapSize);
}
void *Alloc(u32 size)
{
return AllocInternal(sHeapStart, size);
}
void *AllocZeroed(u32 size)
{
return AllocZeroedInternal(sHeapStart, size);
}
void Free(void *pointer)
{
FreeInternal(sHeapStart, pointer);
}
bool32 CheckMemBlock(void *pointer)
{
return CheckMemBlockInternal(sHeapStart, pointer);
}
bool32 CheckHeap()
{
struct MemBlock *pos = (struct MemBlock *)sHeapStart;
do {
if (!CheckMemBlockInternal(sHeapStart, pos->data))
return FALSE;
pos = pos->next;
} while (pos != (struct MemBlock *)sHeapStart);
return TRUE;
}
+1 -1
View File
@@ -84,7 +84,7 @@ const u32 gMonFrontPic_Slowpoke[] = INCBIN_U32("graphics/pokemon/slowpoke/anim_f
const u32 gMonFrontPic_Slowbro[] = INCBIN_U32("graphics/pokemon/slowbro/anim_front.4bpp.lz");
const u32 gMonFrontPic_Magnemite[] = INCBIN_U32("graphics/pokemon/magnemite/anim_front.4bpp.lz");
const u32 gMonFrontPic_Magneton[] = INCBIN_U32("graphics/pokemon/magneton/anim_front.4bpp.lz");
const u32 gMonFrontPic_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetch_d/anim_front.4bpp.lz");
const u32 gMonFrontPic_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetchd/anim_front.4bpp.lz");
const u32 gMonFrontPic_Doduo[] = INCBIN_U32("graphics/pokemon/doduo/anim_front.4bpp.lz");
const u32 gMonFrontPic_Dodrio[] = INCBIN_U32("graphics/pokemon/dodrio/anim_front.4bpp.lz");
const u32 gMonFrontPic_Seel[] = INCBIN_U32("graphics/pokemon/seel/anim_front.4bpp.lz");
+491 -1376
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -787,9 +787,9 @@ static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u
return AI_ITEM_HEAL_HP;
else if (itemEffect[3] & ITEM3_STATUS_ALL)
return AI_ITEM_CURE_CONDITION;
else if (itemEffect[0] & (ITEM0_HIGH_CRIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
return AI_ITEM_X_STAT;
else if (itemEffect[3] & ITEM3_MIST)
else if (itemEffect[3] & ITEM3_GUARD_SPEC)
return AI_ITEM_GUARD_SPECS;
else
return AI_ITEM_NOT_RECOGNIZABLE;
@@ -820,7 +820,7 @@ static bool8 ShouldUseItem(void)
}
}
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_TRAINER_ITEMS; i++)
{
u16 item;
const u8 *itemEffects;
@@ -907,7 +907,7 @@ static bool8 ShouldUseItem(void)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8;
if (itemEffects[2] & ITEM2_X_ACCURACY)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20;
if (itemEffects[0] & ITEM0_HIGH_CRIT)
if (itemEffects[0] & ITEM0_DIRE_HIT)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80;
shouldUse = TRUE;
break;
+76 -76
View File
@@ -114,7 +114,7 @@ EWRAM_DATA u8 gBattleAnimTarget = 0;
EWRAM_DATA u16 gAnimBattlerSpecies[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA u8 gUnknown_02038440 = 0;
const struct OamData gUnknown_08524904 =
const struct OamData gOamData_AffineOff_ObjNormal_8x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -129,7 +129,7 @@ const struct OamData gUnknown_08524904 =
};
const struct OamData gUnknown_0852490C =
const struct OamData gOamData_AffineOff_ObjNormal_16x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -143,7 +143,7 @@ const struct OamData gUnknown_0852490C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524914 =
const struct OamData gOamData_AffineOff_ObjNormal_32x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -157,7 +157,7 @@ const struct OamData gUnknown_08524914 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852491C =
const struct OamData gOamData_AffineOff_ObjNormal_64x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -171,7 +171,7 @@ const struct OamData gUnknown_0852491C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524924 =
const struct OamData gOamData_AffineOff_ObjNormal_16x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -185,7 +185,7 @@ const struct OamData gUnknown_08524924 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852492C =
const struct OamData gOamData_AffineOff_ObjNormal_32x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -199,7 +199,7 @@ const struct OamData gUnknown_0852492C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524934 =
const struct OamData gOamData_AffineOff_ObjNormal_32x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -213,7 +213,7 @@ const struct OamData gUnknown_08524934 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852493C =
const struct OamData gOamData_AffineOff_ObjNormal_64x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -227,7 +227,7 @@ const struct OamData gUnknown_0852493C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524944 =
const struct OamData gOamData_AffineOff_ObjNormal_8x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -241,7 +241,7 @@ const struct OamData gUnknown_08524944 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852494C =
const struct OamData gOamData_AffineOff_ObjNormal_8x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -255,7 +255,7 @@ const struct OamData gUnknown_0852494C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524954 =
const struct OamData gOamData_AffineOff_ObjNormal_16x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -269,7 +269,7 @@ const struct OamData gUnknown_08524954 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852495C =
const struct OamData gOamData_AffineOff_ObjNormal_32x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -283,7 +283,7 @@ const struct OamData gUnknown_0852495C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524964 =
const struct OamData gOamData_AffineNormal_ObjNormal_8x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -297,7 +297,7 @@ const struct OamData gUnknown_08524964 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852496C =
const struct OamData gOamData_AffineNormal_ObjNormal_16x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -311,7 +311,7 @@ const struct OamData gUnknown_0852496C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524974 =
const struct OamData gOamData_AffineNormal_ObjNormal_32x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -325,7 +325,7 @@ const struct OamData gUnknown_08524974 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852497C =
const struct OamData gOamData_AffineNormal_ObjNormal_64x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -339,7 +339,7 @@ const struct OamData gUnknown_0852497C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524984 =
const struct OamData gOamData_AffineNormal_ObjNormal_16x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -353,7 +353,7 @@ const struct OamData gUnknown_08524984 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852498C =
const struct OamData gOamData_AffineNormal_ObjNormal_32x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -367,7 +367,7 @@ const struct OamData gUnknown_0852498C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524994 =
const struct OamData gOamData_AffineNormal_ObjNormal_32x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -381,7 +381,7 @@ const struct OamData gUnknown_08524994 =
.paletteNum = 0,
};
const struct OamData gUnknown_0852499C =
const struct OamData gOamData_AffineNormal_ObjNormal_64x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -395,7 +395,7 @@ const struct OamData gUnknown_0852499C =
.paletteNum = 0,
};
const struct OamData gUnknown_085249A4 =
const struct OamData gOamData_AffineNormal_ObjNormal_8x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -409,7 +409,7 @@ const struct OamData gUnknown_085249A4 =
.paletteNum = 0,
};
const struct OamData gUnknown_085249AC =
const struct OamData gOamData_AffineNormal_ObjNormal_8x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -423,7 +423,7 @@ const struct OamData gUnknown_085249AC =
.paletteNum = 0,
};
const struct OamData gUnknown_085249B4 =
const struct OamData gOamData_AffineNormal_ObjNormal_16x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -437,7 +437,7 @@ const struct OamData gUnknown_085249B4 =
.paletteNum = 0,
};
const struct OamData gUnknown_085249BC =
const struct OamData gOamData_AffineNormal_ObjNormal_32x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -451,7 +451,7 @@ const struct OamData gUnknown_085249BC =
.paletteNum = 0,
};
const struct OamData gUnknown_085249C4 =
const struct OamData gOamData_AffineDouble_ObjNormal_8x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -465,7 +465,7 @@ const struct OamData gUnknown_085249C4 =
.paletteNum = 0,
};
const struct OamData gUnknown_085249CC =
const struct OamData gOamData_AffineDouble_ObjNormal_16x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -479,7 +479,7 @@ const struct OamData gUnknown_085249CC =
.paletteNum = 0,
};
const struct OamData gUnknown_085249D4 =
const struct OamData gOamData_AffineDouble_ObjNormal_32x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -493,7 +493,7 @@ const struct OamData gUnknown_085249D4 =
.paletteNum = 0,
};
const struct OamData gUnknown_085249DC =
const struct OamData gOamData_AffineDouble_ObjNormal_64x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -507,7 +507,7 @@ const struct OamData gUnknown_085249DC =
.paletteNum = 0,
};
const struct OamData gUnknown_085249E4 =
const struct OamData gOamData_AffineDouble_ObjNormal_16x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -521,7 +521,7 @@ const struct OamData gUnknown_085249E4 =
.paletteNum = 0,
};
const struct OamData gUnknown_085249EC =
const struct OamData gOamData_AffineDouble_ObjNormal_32x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -535,7 +535,7 @@ const struct OamData gUnknown_085249EC =
.paletteNum = 0,
};
const struct OamData gUnknown_085249F4 =
const struct OamData gOamData_AffineDouble_ObjNormal_32x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -549,7 +549,7 @@ const struct OamData gUnknown_085249F4 =
.paletteNum = 0,
};
const struct OamData gUnknown_085249FC =
const struct OamData gOamData_AffineDouble_ObjNormal_64x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -563,7 +563,7 @@ const struct OamData gUnknown_085249FC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A04 =
const struct OamData gOamData_AffineDouble_ObjNormal_8x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -577,7 +577,7 @@ const struct OamData gUnknown_08524A04 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A0C =
const struct OamData gOamData_AffineDouble_ObjNormal_8x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -591,7 +591,7 @@ const struct OamData gUnknown_08524A0C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A14 =
const struct OamData gOamData_AffineDouble_ObjNormal_16x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -605,7 +605,7 @@ const struct OamData gUnknown_08524A14 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A1C =
const struct OamData gOamData_AffineDouble_ObjNormal_32x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -619,7 +619,7 @@ const struct OamData gUnknown_08524A1C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A24 =
const struct OamData gOamData_AffineOff_ObjBlend_8x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -633,7 +633,7 @@ const struct OamData gUnknown_08524A24 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A2C =
const struct OamData gOamData_AffineOff_ObjBlend_16x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -647,7 +647,7 @@ const struct OamData gUnknown_08524A2C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A34 =
const struct OamData gOamData_AffineOff_ObjBlend_32x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -661,7 +661,7 @@ const struct OamData gUnknown_08524A34 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A3C =
const struct OamData gOamData_AffineOff_ObjBlend_64x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -675,7 +675,7 @@ const struct OamData gUnknown_08524A3C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A44 =
const struct OamData gOamData_AffineOff_ObjBlend_16x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -689,7 +689,7 @@ const struct OamData gUnknown_08524A44 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A4C =
const struct OamData gOamData_AffineOff_ObjBlend_32x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -703,7 +703,7 @@ const struct OamData gUnknown_08524A4C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A54 =
const struct OamData gOamData_AffineOff_ObjBlend_32x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -717,7 +717,7 @@ const struct OamData gUnknown_08524A54 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A5C =
const struct OamData gOamData_AffineOff_ObjBlend_64x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -731,7 +731,7 @@ const struct OamData gUnknown_08524A5C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A64 =
const struct OamData gOamData_AffineOff_ObjBlend_8x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -745,7 +745,7 @@ const struct OamData gUnknown_08524A64 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A6C =
const struct OamData gOamData_AffineOff_ObjBlend_8x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -759,7 +759,7 @@ const struct OamData gUnknown_08524A6C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A74 =
const struct OamData gOamData_AffineOff_ObjBlend_16x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -773,7 +773,7 @@ const struct OamData gUnknown_08524A74 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A7C =
const struct OamData gOamData_AffineOff_ObjBlend_32x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -787,7 +787,7 @@ const struct OamData gUnknown_08524A7C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A84 =
const struct OamData gOamData_AffineNormal_ObjBlend_8x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -801,7 +801,7 @@ const struct OamData gUnknown_08524A84 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A8C =
const struct OamData gOamData_AffineNormal_ObjBlend_16x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -815,7 +815,7 @@ const struct OamData gUnknown_08524A8C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A94 =
const struct OamData gOamData_AffineNormal_ObjBlend_32x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -829,7 +829,7 @@ const struct OamData gUnknown_08524A94 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524A9C =
const struct OamData gOamData_AffineNormal_ObjBlend_64x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -843,7 +843,7 @@ const struct OamData gUnknown_08524A9C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AA4 =
const struct OamData gOamData_AffineNormal_ObjBlend_16x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -857,7 +857,7 @@ const struct OamData gUnknown_08524AA4 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AAC =
const struct OamData gOamData_AffineNormal_ObjBlend_32x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -871,7 +871,7 @@ const struct OamData gUnknown_08524AAC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AB4 =
const struct OamData gOamData_AffineNormal_ObjBlend_32x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -885,7 +885,7 @@ const struct OamData gUnknown_08524AB4 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524ABC =
const struct OamData gOamData_AffineNormal_ObjBlend_64x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -899,7 +899,7 @@ const struct OamData gUnknown_08524ABC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AC4 =
const struct OamData gOamData_AffineNormal_ObjBlend_8x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -913,7 +913,7 @@ const struct OamData gUnknown_08524AC4 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524ACC =
const struct OamData gOamData_AffineNormal_ObjBlend_8x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -927,7 +927,7 @@ const struct OamData gUnknown_08524ACC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AD4 =
const struct OamData gOamData_AffineNormal_ObjBlend_16x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -941,7 +941,7 @@ const struct OamData gUnknown_08524AD4 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524ADC =
const struct OamData gOamData_AffineNormal_ObjBlend_32x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
@@ -955,7 +955,7 @@ const struct OamData gUnknown_08524ADC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AE4 =
const struct OamData gOamData_AffineDouble_ObjBlend_8x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -969,7 +969,7 @@ const struct OamData gUnknown_08524AE4 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AEC =
const struct OamData gOamData_AffineDouble_ObjBlend_16x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -983,7 +983,7 @@ const struct OamData gUnknown_08524AEC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AF4 =
const struct OamData gOamData_AffineDouble_ObjBlend_32x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -997,7 +997,7 @@ const struct OamData gUnknown_08524AF4 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524AFC =
const struct OamData gOamData_AffineDouble_ObjBlend_64x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1011,7 +1011,7 @@ const struct OamData gUnknown_08524AFC =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B04 =
const struct OamData gOamData_AffineDouble_ObjBlend_16x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1025,7 +1025,7 @@ const struct OamData gUnknown_08524B04 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B0C =
const struct OamData gOamData_AffineDouble_ObjBlend_32x8 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1039,7 +1039,7 @@ const struct OamData gUnknown_08524B0C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B14 =
const struct OamData gOamData_AffineDouble_ObjBlend_32x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1053,7 +1053,7 @@ const struct OamData gUnknown_08524B14 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B1C =
const struct OamData gOamData_AffineDouble_ObjBlend_64x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1067,7 +1067,7 @@ const struct OamData gUnknown_08524B1C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B24 =
const struct OamData gOamData_AffineDouble_ObjBlend_8x16 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1081,7 +1081,7 @@ const struct OamData gUnknown_08524B24 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B2C =
const struct OamData gOamData_AffineDouble_ObjBlend_8x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1095,7 +1095,7 @@ const struct OamData gUnknown_08524B2C =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B34 =
const struct OamData gOamData_AffineDouble_ObjBlend_16x32 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1109,7 +1109,7 @@ const struct OamData gUnknown_08524B34 =
.paletteNum = 0,
};
const struct OamData gUnknown_08524B3C =
const struct OamData gOamData_AffineDouble_ObjBlend_32x64 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
@@ -1355,7 +1355,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
{gBattleAnimSpriteGfx_Spotlight, 0x0800, ANIM_TAG_SPOTLIGHT},
{gBattleAnimSpriteGfx_LetterZ, 0x0200, ANIM_TAG_LETTER_Z},
{gBattleAnimSpriteGfx_RapidSpin, 0x0300, ANIM_TAG_RAPID_SPIN},
{gBattleAnimSpriteGfx_TriForceTriangle, 0x0800, ANIM_TAG_TRI_FORCE_TRIANGLE},
{gBattleAnimSpriteGfx_TriAttackTriangle, 0x0800, ANIM_TAG_TRI_ATTACK_TRIANGLE},
{gBattleAnimSpriteGfx_WispOrb, 0x0380, ANIM_TAG_WISP_ORB},
{gBattleAnimSpriteGfx_WispFire, 0x0800, ANIM_TAG_WISP_FIRE},
{gBattleAnimSpriteGfx_GoldStars, 0x00c0, ANIM_TAG_GOLD_STARS},
@@ -1648,7 +1648,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
{gBattleAnimSpritePal_Pokeball, ANIM_TAG_SPOTLIGHT},
{gBattleAnimSpritePal_LetterZ, ANIM_TAG_LETTER_Z},
{gBattleAnimSpritePal_RapidSpin, ANIM_TAG_RAPID_SPIN},
{gBattleAnimSpritePal_TriForceTriangle, ANIM_TAG_TRI_FORCE_TRIANGLE},
{gBattleAnimSpritePal_TriAttackTriangle, ANIM_TAG_TRI_ATTACK_TRIANGLE},
{gBattleAnimSpritePal_WispOrb, ANIM_TAG_WISP_ORB},
{gBattleAnimSpritePal_WispOrb, ANIM_TAG_WISP_FIRE},
{gBattleAnimSpritePal_GoldStars, ANIM_TAG_GOLD_STARS},
@@ -2808,12 +2808,12 @@ static void LoadMoveBg(u16 bgId)
void *dmaDest;
LZDecompressWram(tilemap, gDecompressionBuffer);
sub_80A4720(sub_80A6D94(), (void*)(gDecompressionBuffer), 0x100, 0);
sub_80A4720(GetBattleBgPaletteNum(), (void*)(gDecompressionBuffer), 0x100, 0);
dmaSrc = gDecompressionBuffer;
dmaDest = (void *)(BG_SCREEN_ADDR(26));
DmaCopy32(3, dmaSrc, dmaDest, 0x800);
LZDecompressVram(gBattleAnimBackgroundTable[bgId].image, (void *)(BG_SCREEN_ADDR(4)));
LoadCompressedPalette(gBattleAnimBackgroundTable[bgId].palette, sub_80A6D94() * 16, 32);
LoadCompressedPalette(gBattleAnimBackgroundTable[bgId].palette, GetBattleBgPaletteNum() * 16, 32);
}
else
{
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -7,7 +7,7 @@
#include "decompress.h"
#include "dma3.h"
#include "gpu_regs.h"
#include "alloc.h"
#include "malloc.h"
#include "palette.h"
#include "pokemon_icon.h"
#include "sprite.h"
@@ -26,11 +26,11 @@
#define IS_DOUBLE_BATTLE() ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
extern const struct OamData gUnknown_0852497C;
extern const struct OamData gOamData_AffineNormal_ObjNormal_64x64;
static void sub_80A6FB4(struct Sprite *sprite);
static void sub_80A7144(struct Sprite *sprite);
static void sub_80A791C(struct Sprite *sprite);
static void AnimThrowProjectile_Step(struct Sprite *sprite);
static void sub_80A8DFC(struct Sprite *sprite);
static void sub_80A8E88(struct Sprite *sprite);
static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId);
@@ -92,7 +92,7 @@ static const struct SpriteTemplate sUnknown_08525F90[] =
{
.tileTag = 55125,
.paletteTag = 55125,
.oam = &gUnknown_0852497C,
.oam = &gOamData_AffineNormal_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -101,7 +101,7 @@ static const struct SpriteTemplate sUnknown_08525F90[] =
{
.tileTag = 55126,
.paletteTag = 55126,
.oam = &gUnknown_0852497C,
.oam = &gOamData_AffineNormal_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -966,7 +966,7 @@ void sub_80A6D60(struct BattleAnimBgData *unk, const void *src, u32 arg2)
CopyBgTilemapBufferToVram(unk->bgId);
}
u8 sub_80A6D94(void)
u8 GetBattleBgPaletteNum(void)
{
if (IsContest())
return 1;
@@ -988,7 +988,7 @@ void sub_80A6DAC(bool8 arg0)
}
}
void sub_80A6DEC(struct Sprite *sprite)
void TradeMenuBouncePartySprites(struct Sprite *sprite)
{
sprite->data[1] = sprite->pos1.x;
sprite->data[3] = sprite->pos1.y;
@@ -1253,7 +1253,7 @@ void ResetSpriteRotScale(u8 spriteId)
{
SetSpriteRotScale(spriteId, 0x100, 0x100, 0);
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].oam.objMode = 0;
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_NORMAL;
gSprites[spriteId].affineAnimPaused = FALSE;
CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode);
}
@@ -1353,7 +1353,7 @@ u32 sub_80A75AC(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner,
if (!IsContest())
selectedPalettes = 0xe;
else
selectedPalettes = 1 << sub_80A6D94();
selectedPalettes = 1 << GetBattleBgPaletteNum();
}
if (attacker)
{
@@ -1456,7 +1456,7 @@ static u8 GetBattlerAtPosition_(u8 position)
return GetBattlerAtPosition(position);
}
void sub_80A77C8(struct Sprite *sprite)
void AnimSpriteOnMonPos(struct Sprite *sprite)
{
bool8 var;
@@ -1513,7 +1513,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
}
void sub_80A78AC(struct Sprite *sprite)
void AnimThrowProjectile(struct Sprite *sprite)
{
InitSpritePosToAnimAttacker(sprite, 1);
if (GetBattlerSide(gBattleAnimAttacker))
@@ -1523,16 +1523,16 @@ void sub_80A78AC(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
sprite->data[5] = gBattleAnimArgs[5];
InitAnimArcTranslation(sprite);
sprite->callback = sub_80A791C;
sprite->callback = AnimThrowProjectile_Step;
}
static void sub_80A791C(struct Sprite *sprite)
static void AnimThrowProjectile_Step(struct Sprite *sprite)
{
if (TranslateAnimHorizontalArc(sprite))
DestroyAnimSprite(sprite);
}
void sub_80A7938(struct Sprite *sprite)
void AnimSnoreZ(struct Sprite *sprite)
{
bool8 r4;
u8 battlerId, coordType;
@@ -2267,7 +2267,7 @@ u8 sub_80A89C8(int battlerId, u8 spriteId, int species)
gSprites[newSpriteId] = gSprites[spriteId];
gSprites[newSpriteId].usingSheet = TRUE;
gSprites[newSpriteId].oam.priority = 0;
gSprites[newSpriteId].oam.objMode = 2;
gSprites[newSpriteId].oam.objMode = ST_OAM_OBJ_WINDOW;
gSprites[newSpriteId].oam.tileNum = gSprites[spriteId].oam.tileNum;
gSprites[newSpriteId].callback = SpriteCallbackDummy;
return newSpriteId;
+16 -16
View File
@@ -238,7 +238,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_POKEBALL,
.paletteTag = TAG_PARTICLES_POKEBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -247,7 +247,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_GREATBALL,
.paletteTag = TAG_PARTICLES_GREATBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -256,7 +256,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_SAFARIBALL,
.paletteTag = TAG_PARTICLES_SAFARIBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -265,7 +265,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_ULTRABALL,
.paletteTag = TAG_PARTICLES_ULTRABALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -274,7 +274,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_MASTERBALL,
.paletteTag = TAG_PARTICLES_MASTERBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -283,7 +283,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_NETBALL,
.paletteTag = TAG_PARTICLES_NETBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -292,7 +292,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_DIVEBALL,
.paletteTag = TAG_PARTICLES_DIVEBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -301,7 +301,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_NESTBALL,
.paletteTag = TAG_PARTICLES_NESTBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -310,7 +310,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_REPEATBALL,
.paletteTag = TAG_PARTICLES_REPEATBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -319,7 +319,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_TIMERBALL,
.paletteTag = TAG_PARTICLES_TIMERBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -328,7 +328,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_LUXURYBALL,
.paletteTag = TAG_PARTICLES_LUXURYBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -337,7 +337,7 @@ const struct SpriteTemplate gBallParticlesSpriteTemplates[] =
{
.tileTag = TAG_PARTICLES_PREMIERBALL,
.paletteTag = TAG_PARTICLES_PREMIERBALL,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -375,7 +375,7 @@ const struct SpriteTemplate gPokeblockSpriteTemplate =
{
.tileTag = ANIM_TAG_POKEBLOCK,
.paletteTag = ANIM_TAG_POKEBLOCK,
.oam = &gUnknown_0852490C,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -396,14 +396,14 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_085E535C =
{
.tileTag = ANIM_TAG_ROCKS,
.paletteTag = ANIM_TAG_ROCKS,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_085E5358,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_817330C,
};
extern const struct SpriteTemplate gUnknown_085CE388;
extern const struct SpriteTemplate gWishStarSpriteTemplate;
extern const struct SpriteTemplate gMiniTwinklingStarSpriteTemplate;
void unref_sub_8170478(u8 taskId)
@@ -2081,7 +2081,7 @@ static void sub_8172FEC(u8 taskId)
state = gTasks[taskId].data[11];
if (state == 0)
{
spriteId = CreateSprite(&gUnknown_085CE388, x, y, 5);
spriteId = CreateSprite(&gWishStarSpriteTemplate, x, y, 5);
}
else if (state >= 0 && gTasks[taskId].data[11] < 4)
{
+44 -16
View File
@@ -14,8 +14,8 @@
extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
extern const u8 *const gBattleAnims_StatusConditions[];
extern const struct OamData gUnknown_08524904;
extern const struct OamData gUnknown_08524A3C;
extern const struct OamData gOamData_AffineOff_ObjNormal_8x8;
extern const struct OamData gOamData_AffineOff_ObjBlend_64x64;
// This file's functions.
static void sub_80A9DB4(u8 taskId);
@@ -46,7 +46,7 @@ const struct SpriteTemplate gUnknown_0853EDFC =
{
.tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB,
.oam = &gUnknown_0852490C,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = sSpriteAnimTable_853EDF8,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -57,7 +57,7 @@ const struct SpriteTemplate gUnknown_0853EE14 =
{
.tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB,
.oam = &gUnknown_0852490C,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = sSpriteAnimTable_853EDF8,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -79,7 +79,7 @@ const struct SpriteTemplate gUnknown_0853EE38 =
{
.tileTag = ANIM_TAG_WEATHER_BALL,
.paletteTag = ANIM_TAG_WEATHER_BALL,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sSpriteAnimTable_853EE34,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -90,7 +90,7 @@ const struct SpriteTemplate gUnknown_0853EE50 =
{
.tileTag = ANIM_TAG_WEATHER_BALL,
.paletteTag = ANIM_TAG_WEATHER_BALL,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sSpriteAnimTable_853EE34,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -116,7 +116,7 @@ const struct SpriteTemplate gUnknown_0853EE84 =
{
.tileTag = ANIM_TAG_SPARKLE_4,
.paletteTag = ANIM_TAG_SPARKLE_4,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sSpriteAnimTable_853EE80,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -127,7 +127,7 @@ const struct SpriteTemplate gUnknown_0853EE9C =
{
.tileTag = ANIM_TAG_MONSTER_FOOT,
.paletteTag = ANIM_TAG_MONSTER_FOOT,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -163,7 +163,7 @@ const struct SpriteTemplate gUnknown_0853EED8 =
{
.tileTag = ANIM_TAG_IMPACT,
.paletteTag = ANIM_TAG_IMPACT,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sSpriteAnimTable_853EECC,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -197,7 +197,7 @@ const struct SpriteTemplate gUnknown_0853EF18 =
{
.tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB,
.oam = &gUnknown_085249CC,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = sSpriteAnimTable_853EEF8,
.images = NULL,
.affineAnims = sSpriteAffineAnimTable_853EEF8,
@@ -206,10 +206,38 @@ const struct SpriteTemplate gUnknown_0853EF18 =
static const struct Subsprite gUnknown_0853EF30[] =
{
{.x = -16, .y = -16, .shape = ST_OAM_SQUARE, .size = 3, .tileOffset = 0, .priority = 2},
{.x = -16, .y = 48, .shape = ST_OAM_H_RECTANGLE, .size = 3, .tileOffset = 64, .priority = 2},
{.x = 48, .y = -16, .shape = ST_OAM_V_RECTANGLE, .size = 3, .tileOffset = 96, .priority = 2},
{.x = 48, .y = 48, .shape = ST_OAM_SQUARE, .size = 2, .tileOffset = 128, .priority = 2},
{
.x = -16,
.y = -16,
.shape = SPRITE_SHAPE(64x64),
.size = SPRITE_SIZE(64x64),
.tileOffset = 0,
.priority = 2
},
{
.x = -16,
.y = 48,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.tileOffset = 64,
.priority = 2
},
{
.x = 48,
.y = -16,
.shape = SPRITE_SHAPE(32x64),
.size = SPRITE_SIZE(32x64),
.tileOffset = 96,
.priority = 2
},
{
.x = 48,
.y = 48,
.shape = SPRITE_SHAPE(32x32),
.size = SPRITE_SIZE(32x32),
.tileOffset = 128,
.priority = 2
},
};
static const struct SubspriteTable gUnknown_0853EF40[] =
@@ -221,7 +249,7 @@ static const struct SpriteTemplate gUnknown_0853EF48 =
{
.tileTag = ANIM_TAG_ICE_CUBE,
.paletteTag = ANIM_TAG_ICE_CUBE,
.oam = &gUnknown_08524A3C,
.oam = &gOamData_AffineOff_ObjBlend_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -232,7 +260,7 @@ static const struct SpriteTemplate gUnknown_0853EF60 =
{
.tileTag = ANIM_TAG_CIRCLE_IMPACT,
.paletteTag = ANIM_TAG_CIRCLE_IMPACT,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
+5 -5
View File
@@ -3,7 +3,7 @@
#include "contest.h"
#include "gpu_regs.h"
#include "graphics.h"
#include "alloc.h"
#include "malloc.h"
#include "palette.h"
#include "sound.h"
#include "sprite.h"
@@ -36,7 +36,7 @@ static void sub_8117500(u8);
static void sub_81175C4(u32, u16);
static void sub_81176D8(u8);
static void sub_8117A60(u8);
static void sub_8117FD0(u8);
static void ExtremSpeedMoveTarget_Step(u8);
const u16 gUnknown_08597418 = RGB(31, 31, 31);
@@ -1036,7 +1036,7 @@ void sub_8117F30(u8 taskId)
DestroyAnimVisualTask(taskId);
}
void sub_8117F60(u8 taskId)
void AnimTask_ExtremeSpeedMoveTarget(u8 taskId)
{
if (IsContest())
{
@@ -1046,12 +1046,12 @@ void sub_8117F60(u8 taskId)
{
gTasks[taskId].data[0] = gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].invisible;
gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].invisible = 1;
gTasks[taskId].func = sub_8117FD0;
gTasks[taskId].func = ExtremSpeedMoveTarget_Step;
gAnimVisualTaskCount--;
}
}
static void sub_8117FD0(u8 taskId)
static void ExtremSpeedMoveTarget_Step(u8 taskId)
{
if (gBattleAnimArgs[7] == 0x1000)
{
+56 -54
View File
@@ -20,8 +20,10 @@
#include "text.h"
#include "util.h"
#include "constants/songs.h"
#include "constants/battle_arena.h"
#include "constants/battle_string_ids.h"
#include "constants/battle_frontier.h"
#include "constants/frontier_util.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/rgb.h"
@@ -30,9 +32,9 @@
static void InitArenaChallenge(void);
static void GetArenaData(void);
static void SetArenaData(void);
static void sub_81A5AC4(void);
static void SetArenaRewardItem(void);
static void GiveArenaRewardItem(void);
static void SaveArenaChallenge(void);
static void SetArenaPrize(void);
static void GiveArenaPrize(void);
static void BufferArenaOpponentName(void);
static void SpriteCb_JudgmentIcon(struct Sprite *sprite);
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
@@ -402,10 +404,10 @@ static const s8 sMindRatings[] =
static const struct OamData sJudgementIconOamData =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
.x = 0,
.matrixNum = 0,
@@ -467,16 +469,16 @@ static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteShee
static void (* const sArenaFunctions[])(void) =
{
InitArenaChallenge,
GetArenaData,
SetArenaData,
sub_81A5AC4,
SetArenaRewardItem,
GiveArenaRewardItem,
BufferArenaOpponentName,
[BATTLE_ARENA_FUNC_INIT] = InitArenaChallenge,
[BATTLE_ARENA_FUNC_GET_DATA] = GetArenaData,
[BATTLE_ARENA_FUNC_SET_DATA] = SetArenaData,
[BATTLE_ARENA_FUNC_SAVE] = SaveArenaChallenge,
[BATTLE_ARENA_FUNC_SET_PRIZE] = SetArenaPrize,
[BATTLE_ARENA_FUNC_GIVE_PRIZE] = GiveArenaPrize,
[BATTLE_ARENA_FUNC_GET_TRAINER_NAME] = BufferArenaOpponentName,
};
static const u16 sShortStreakRewardItems[] =
static const u16 sShortStreakPrizeItems[] =
{
ITEM_HP_UP,
ITEM_PROTEIN,
@@ -486,7 +488,7 @@ static const u16 sShortStreakRewardItems[] =
ITEM_ZINC,
};
static const u16 sLongStreakRewardItems[] =
static const u16 sLongStreakPrizeItems[] =
{
ITEM_BRIGHT_POWDER,
ITEM_WHITE_HERB,
@@ -562,8 +564,8 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
break;
case 4:
PlaySE(SE_HANTEI1);
ShowJudgmentSprite(80, 40, 0, 0);
ShowJudgmentSprite(160, 40, 0, 1);
ShowJudgmentSprite(80, 40, ARENA_CATEGORY_MIND, B_POSITION_PLAYER_LEFT);
ShowJudgmentSprite(160, 40, ARENA_CATEGORY_MIND, B_POSITION_OPPONENT_LEFT);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
(*state)++;
@@ -571,8 +573,8 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
break;
case 5:
PlaySE(SE_HANTEI1);
ShowJudgmentSprite(80, 56, 1, 0);
ShowJudgmentSprite(160, 56, 1, 1);
ShowJudgmentSprite(80, 56, ARENA_CATEGORY_SKILL, B_POSITION_PLAYER_LEFT);
ShowJudgmentSprite(160, 56, ARENA_CATEGORY_SKILL, B_POSITION_OPPONENT_LEFT);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
(*state)++;
@@ -580,8 +582,8 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
break;
case 6:
PlaySE(SE_HANTEI1);
ShowJudgmentSprite(80, 72, 2, 0);
ShowJudgmentSprite(160, 72, 2, 1);
ShowJudgmentSprite(80, 72, ARENA_CATEGORY_BODY, B_POSITION_PLAYER_LEFT);
ShowJudgmentSprite(160, 72, ARENA_CATEGORY_BODY, B_POSITION_OPPONENT_LEFT);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
(*state)++;
@@ -641,15 +643,15 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
switch (category)
{
case 0:
case ARENA_CATEGORY_MIND:
pointsPlayer = mindPoints[battler];
pointsOpponent = mindPoints[BATTLE_OPPOSITE(battler)];
break;
case 1:
case ARENA_CATEGORY_SKILL:
pointsPlayer = skillPoints[battler];
pointsOpponent = skillPoints[BATTLE_OPPOSITE(battler)];
break;
case 2:
case ARENA_CATEGORY_BODY:
pointsPlayer = (gBattleMons[battler].hp * 100) / hpAtStart[battler];
pointsOpponent = (gBattleMons[BATTLE_OPPOSITE(battler)].hp * 100) / hpAtStart[BATTLE_OPPOSITE(battler)];
break;
@@ -786,14 +788,14 @@ static void InitArenaChallenge(void)
bool32 isCurrent;
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE;
if (lvlMode != FRONTIER_LVL_50)
isCurrent = gSaveBlock2Ptr->frontier.field_CDC & 0x80;
isCurrent = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_ARENA_OPEN;
else
isCurrent = gSaveBlock2Ptr->frontier.field_CDC & 0x40;
isCurrent = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_ARENA_50;
if (!isCurrent)
gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] = 0;
@@ -808,17 +810,17 @@ static void GetArenaData(void)
switch (gSpecialVar_0x8005)
{
case 0:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.arenaRewardItem;
case ARENA_DATA_PRIZE:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.arenaPrize;
break;
case 1:
case ARENA_DATA_WIN_STREAK:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode];
break;
case 2:
case ARENA_DATA_WIN_STREAK_ACTIVE:
if (lvlMode != FRONTIER_LVL_50)
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x80;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_ARENA_OPEN;
else
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x40;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_ARENA_50;
break;
}
}
@@ -829,55 +831,55 @@ static void SetArenaData(void)
switch (gSpecialVar_0x8005)
{
case 0:
gSaveBlock2Ptr->frontier.arenaRewardItem = gSpecialVar_0x8006;
case ARENA_DATA_PRIZE:
gSaveBlock2Ptr->frontier.arenaPrize = gSpecialVar_0x8006;
break;
case 1:
case ARENA_DATA_WIN_STREAK:
gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] = gSpecialVar_0x8006;
break;
case 2:
case ARENA_DATA_WIN_STREAK_ACTIVE:
if (lvlMode != FRONTIER_LVL_50)
{
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= 0x80;
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= STREAK_ARENA_OPEN;
else
gSaveBlock2Ptr->frontier.field_CDC &= ~(0x80);
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_ARENA_OPEN);
}
else
{
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= 0x40;
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= STREAK_ARENA_50;
else
gSaveBlock2Ptr->frontier.field_CDC &= ~(0x40);
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_ARENA_50);
}
break;
}
}
static void sub_81A5AC4(void)
static void SaveArenaChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = 1;
sub_81A4C30();
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
SaveGameFrontier();
}
static void SetArenaRewardItem(void)
static void SetArenaPrize(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
if (gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] > 41)
gSaveBlock2Ptr->frontier.arenaRewardItem = sLongStreakRewardItems[Random() % ARRAY_COUNT(sLongStreakRewardItems)];
gSaveBlock2Ptr->frontier.arenaPrize = sLongStreakPrizeItems[Random() % ARRAY_COUNT(sLongStreakPrizeItems)];
else
gSaveBlock2Ptr->frontier.arenaRewardItem = sShortStreakRewardItems[Random() % ARRAY_COUNT(sShortStreakRewardItems)];
gSaveBlock2Ptr->frontier.arenaPrize = sShortStreakPrizeItems[Random() % ARRAY_COUNT(sShortStreakPrizeItems)];
}
static void GiveArenaRewardItem(void)
static void GiveArenaPrize(void)
{
if (AddBagItem(gSaveBlock2Ptr->frontier.arenaRewardItem, 1) == TRUE)
if (AddBagItem(gSaveBlock2Ptr->frontier.arenaPrize, 1) == TRUE)
{
CopyItemName(gSaveBlock2Ptr->frontier.arenaRewardItem, gStringVar1);
gSaveBlock2Ptr->frontier.arenaRewardItem = 0;
CopyItemName(gSaveBlock2Ptr->frontier.arenaPrize, gStringVar1);
gSaveBlock2Ptr->frontier.arenaPrize = ITEM_NONE;
gSpecialVar_Result = TRUE;
}
else
+66 -69
View File
@@ -36,13 +36,13 @@ struct BattleBackground
// .rodata
static const u16 sUnrefArray[] = {0x0300, 0x0000}; //OamData?
static const struct OamData gUnknown_0831A988 =
static const struct OamData sVsLetter_V_OamData =
{
.y = 0,
.affineMode = 3,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
@@ -53,13 +53,13 @@ static const struct OamData gUnknown_0831A988 =
.affineParam = 0,
};
static const struct OamData gUnknown_0831A990 =
static const struct OamData sVsLetter_S_OamData =
{
.y = 0,
.affineMode = 3,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
@@ -70,13 +70,13 @@ static const struct OamData gUnknown_0831A990 =
.affineParam = 0,
};
static const union AffineAnimCmd gUnknown_0831A998[] =
static const union AffineAnimCmd sVsLetterAffineAnimCmds0[] =
{
AFFINEANIMCMD_FRAME(0x0080, 0x0080, 0x00, 0x00),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_0831A9A8[] =
static const union AffineAnimCmd sVsLetterAffineAnimCmds1[] =
{
AFFINEANIMCMD_FRAME(0x0080, 0x0080, 0x00, 0x00),
AFFINEANIMCMD_FRAME(0x0018, 0x0018, 0x00, 0x80),
@@ -84,37 +84,39 @@ static const union AffineAnimCmd gUnknown_0831A9A8[] =
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd * const gUnknown_0831A9C8[] =
static const union AffineAnimCmd *const sVsLetterAffineAnimTable[] =
{
gUnknown_0831A998,
gUnknown_0831A9A8,
sVsLetterAffineAnimCmds0,
sVsLetterAffineAnimCmds1,
};
static const struct SpriteTemplate gUnknown_0831A9D0 =
#define TAG_VS_LETTERS 10000
static const struct SpriteTemplate sVsLetter_V_SpriteTemplate =
{
.tileTag = 0x2710,
.paletteTag = 0x2710,
.oam = &gUnknown_0831A988,
.tileTag = TAG_VS_LETTERS,
.paletteTag = TAG_VS_LETTERS,
.oam = &sVsLetter_V_OamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_0831A9C8,
.affineAnims = sVsLetterAffineAnimTable,
.callback = nullsub_17
};
static const struct SpriteTemplate gUnknown_0831A9E8 =
static const struct SpriteTemplate sVsLetter_S_SpriteTemplate =
{
.tileTag = 0x2710,
.paletteTag = 0x2710,
.oam = &gUnknown_0831A990,
.tileTag = TAG_VS_LETTERS,
.paletteTag = TAG_VS_LETTERS,
.oam = &sVsLetter_S_OamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_0831A9C8,
.affineAnims = sVsLetterAffineAnimTable,
.callback = nullsub_17
};
static const struct CompressedSpriteSheet gUnknown_0831AA00 =
static const struct CompressedSpriteSheet sVsLettersSpriteSheet =
{
gUnknown_08D77B0C, 0x1000, 0x2710
gVsLettersGfx, 0x1000, TAG_VS_LETTERS
};
const struct BgTemplate gBattleBgTemplates[] =
@@ -689,7 +691,6 @@ static const struct BattleBackground gBattleTerrainTable[] =
},
};
// .text
void BattleInitBgsAndWindows(void)
{
ResetBgsAndClearDma3BusyFlags(0);
@@ -710,7 +711,7 @@ void BattleInitBgsAndWindows(void)
DeactivateAllTextPrinters();
}
void sub_80356D0(void)
void InitBattleBgsVideo(void)
{
DisableInterrupts(INTR_FLAG_HBLANK);
EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
@@ -725,10 +726,11 @@ void LoadBattleMenuWindowGfx(void)
{
LoadUserWindowBorderGfx(2, 0x12, 0x10);
LoadUserWindowBorderGfx(2, 0x22, 0x10);
LoadCompressedPalette(gUnknown_08D85600, 0x50, 0x20);
LoadCompressedPalette(gBattleWindowTextPalette, 0x50, 0x20);
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
{
// Load graphics for the Battle Arena referee's mid-battle messages.
Menu_LoadStdPalAt(0x70);
LoadMessageBoxGfx(0, 0x30, 0x70);
gPlttBufferUnfaded[0x76] = 0;
@@ -837,86 +839,81 @@ void DrawMainBattleBackground(void)
void LoadBattleTextboxAndBackground(void)
{
LZDecompressVram(gBattleTextboxTiles, (void*)(VRAM));
LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0)));
CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0);
CopyBgTilemapBufferToVram(0);
LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40);
LoadBattleMenuWindowGfx();
DrawMainBattleBackground();
}
static void sub_8035AE4(u8 taskId, u8 battlerId, u8 bgId, u8 destX, u8 destY)
static void DrawLinkBattleParticipantPokeballs(u8 taskId, u8 multiplayerId, u8 bgId, u8 destX, u8 destY)
{
s32 i;
u16 var = 0;
u16 src[6];
u16 pokeballStatuses = 0;
u16 tiles[6];
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{
if (gTasks[taskId].data[5] != 0)
{
switch (battlerId)
switch (multiplayerId)
{
case 0:
var = 0x3F & gTasks[taskId].data[3];
pokeballStatuses = 0x3F & gTasks[taskId].data[3];
break;
case 1:
var = (0xFC0 & gTasks[taskId].data[4]) >> 6;
pokeballStatuses = (0xFC0 & gTasks[taskId].data[4]) >> 6;
break;
case 2:
var = (0xFC0 & gTasks[taskId].data[3]) >> 6;
pokeballStatuses = (0xFC0 & gTasks[taskId].data[3]) >> 6;
break;
case 3:
var = 0x3F & gTasks[taskId].data[4];
pokeballStatuses = 0x3F & gTasks[taskId].data[4];
break;
}
}
else
{
switch (battlerId)
switch (multiplayerId)
{
case 0:
var = 0x3F & gTasks[taskId].data[3];
pokeballStatuses = 0x3F & gTasks[taskId].data[3];
break;
case 1:
var = 0x3F & gTasks[taskId].data[4];
pokeballStatuses = 0x3F & gTasks[taskId].data[4];
break;
case 2:
var = (0xFC0 & gTasks[taskId].data[3]) >> 6;
pokeballStatuses = (0xFC0 & gTasks[taskId].data[3]) >> 6;
break;
case 3:
var = (0xFC0 & gTasks[taskId].data[4]) >> 6;
pokeballStatuses = (0xFC0 & gTasks[taskId].data[4]) >> 6;
break;
}
}
for (i = 0; i < 3; i++)
{
src[i] = ((var & (3 << (i * 2))) >> (i * 2)) + 0x6001;
}
tiles[i] = ((pokeballStatuses & (3 << (i * 2))) >> (i * 2)) + 0x6001;
CopyToBgTilemapBufferRect_ChangePalette(bgId, src, destX, destY, 3, 1, 0x11);
CopyToBgTilemapBufferRect_ChangePalette(bgId, tiles, destX, destY, 3, 1, 0x11);
CopyBgTilemapBufferToVram(bgId);
}
else
{
if (battlerId == gBattleScripting.multiplayerId)
var = gTasks[taskId].data[3];
if (multiplayerId == gBattleScripting.multiplayerId)
pokeballStatuses = gTasks[taskId].data[3];
else
var = gTasks[taskId].data[4];
pokeballStatuses = gTasks[taskId].data[4];
for (i = 0; i < 6; i++)
{
src[i] = ((var & (3 << (i * 2))) >> (i * 2)) + 0x6001;
}
tiles[i] = ((pokeballStatuses & (3 << (i * 2))) >> (i * 2)) + 0x6001;
CopyToBgTilemapBufferRect_ChangePalette(bgId, src, destX, destY, 6, 1, 0x11);
CopyToBgTilemapBufferRect_ChangePalette(bgId, tiles, destX, destY, 6, 1, 0x11);
CopyBgTilemapBufferToVram(bgId);
}
}
static void sub_8035C4C(void)
static void DrawLinkBattleVsScreenOutcomeText(void)
{
if (gBattleOutcome == B_OUTCOME_DREW)
{
@@ -997,7 +994,7 @@ static void sub_8035C4C(void)
}
}
void sub_8035D74(u8 taskId)
void InitLinkBattleVsScreen(u8 taskId)
{
struct LinkPlayer *linkPlayer;
u8 *name;
@@ -1017,19 +1014,19 @@ void sub_8035D74(u8 taskId)
{
case 0:
BattlePutTextOnWindow(name, 0x11);
sub_8035AE4(taskId, linkPlayer->id, 1, 2, 4);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 1, 2, 4);
break;
case 1:
BattlePutTextOnWindow(name, 0x12);
sub_8035AE4(taskId, linkPlayer->id, 2, 2, 4);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 2, 2, 4);
break;
case 2:
BattlePutTextOnWindow(name, 0x13);
sub_8035AE4(taskId, linkPlayer->id, 1, 2, 8);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 1, 2, 8);
break;
case 3:
BattlePutTextOnWindow(name, 0x14);
sub_8035AE4(taskId, linkPlayer->id, 2, 2, 8);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 2, 2, 8);
break;
}
}
@@ -1049,16 +1046,16 @@ void sub_8035D74(u8 taskId)
name = gLinkPlayers[opponentId].name;
BattlePutTextOnWindow(name, 0x10);
sub_8035AE4(taskId, playerId, 1, 2, 7);
sub_8035AE4(taskId, opponentId, 2, 2, 7);
DrawLinkBattleParticipantPokeballs(taskId, playerId, 1, 2, 7);
DrawLinkBattleParticipantPokeballs(taskId, opponentId, 2, 2, 7);
}
gTasks[taskId].data[0]++;
break;
case 1:
palId = AllocSpritePalette(0x2710);
palId = AllocSpritePalette(TAG_VS_LETTERS);
gPlttBufferUnfaded[palId * 16 + 0x10F] = gPlttBufferFaded[palId * 16 + 0x10F] = 0x7FFF;
gBattleStruct->linkBattleVsSpriteId_V = CreateSprite(&gUnknown_0831A9D0, 111, 80, 0);
gBattleStruct->linkBattleVsSpriteId_S = CreateSprite(&gUnknown_0831A9E8, 129, 80, 0);
gBattleStruct->linkBattleVsSpriteId_V = CreateSprite(&sVsLetter_V_SpriteTemplate, 111, 80, 0);
gBattleStruct->linkBattleVsSpriteId_S = CreateSprite(&sVsLetter_S_SpriteTemplate, 129, 80, 0);
gSprites[gBattleStruct->linkBattleVsSpriteId_V].invisible = TRUE;
gSprites[gBattleStruct->linkBattleVsSpriteId_S].invisible = TRUE;
gTasks[taskId].data[0]++;
@@ -1087,7 +1084,7 @@ void sub_8035D74(u8 taskId)
else
{
if (gTasks[taskId].data[5] != 0)
sub_8035C4C();
DrawLinkBattleVsScreenOutcomeText();
PlaySE(SE_W231);
DestroyTask(taskId);
@@ -1110,7 +1107,7 @@ void DrawBattleEntryBackground(void)
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{
LZDecompressVram(gUnknown_08D778F0, (void*)(BG_CHAR_ADDR(1)));
LZDecompressVram(gUnknown_08D77B0C, (void*)(VRAM + 0x10000));
LZDecompressVram(gVsLettersGfx, (void*)(VRAM + 0x10000));
LoadCompressedPalette(gUnknown_08D77AE4, 0x60, 0x20);
SetBgAttribute(1, BG_ATTR_SCREENSIZE, 1);
SetGpuReg(REG_OFFSET_BG1CNT, 0x5C04);
@@ -1122,7 +1119,7 @@ void DrawBattleEntryBackground(void)
SetGpuReg(REG_OFFSET_WINOUT, 0x36);
gBattle_BG1_Y = 0xFF5C;
gBattle_BG2_Y = 0xFF5C;
LoadCompressedSpriteSheetUsingHeap(&gUnknown_0831AA00);
LoadCompressedSpriteSheetUsingHeap(&sVsLettersSpriteSheet);
}
else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER))
{
@@ -1195,7 +1192,7 @@ bool8 LoadChosenBattleElement(u8 caseId)
switch (caseId)
{
case 0:
LZDecompressVram(gBattleTextboxTiles, (void*)(VRAM));
LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0)));
break;
case 1:
CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0);
+3 -3
View File
@@ -1429,7 +1429,7 @@ static void LinkOpponentDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1438,7 +1438,7 @@ static void LinkOpponentDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
@@ -1846,7 +1846,7 @@ static void LinkOpponentHandleCmd55(void)
else
gBattleOutcome = gBattleBufferA[gActiveBattler][1] ^ B_OUTCOME_DREW;
gSaveBlock2Ptr->frontier.field_CA9_b = gBattleBufferA[gActiveBattler][2];
gSaveBlock2Ptr->frontier.disableRecordBattle = gBattleBufferA[gActiveBattler][2];
FadeOutMapMusic(5);
BeginFastPaletteFade(3);
LinkOpponentBufferExecCompleted();
+3 -3
View File
@@ -1253,7 +1253,7 @@ static void LinkPartnerDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1262,7 +1262,7 @@ static void LinkPartnerDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
@@ -1676,7 +1676,7 @@ static void LinkPartnerHandleCmd55(void)
{
sub_81851A8(&gBattleBufferA[gActiveBattler][4]);
gBattleOutcome = gBattleBufferA[gActiveBattler][1];
gSaveBlock2Ptr->frontier.field_CA9_b = gBattleBufferA[gActiveBattler][2];
gSaveBlock2Ptr->frontier.disableRecordBattle = gBattleBufferA[gActiveBattler][2];
FadeOutMapMusic(5);
BeginFastPaletteFade(3);
LinkPartnerBufferExecCompleted();
+2 -2
View File
@@ -1465,7 +1465,7 @@ static void OpponentDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1474,7 +1474,7 @@ static void OpponentDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
+19 -17
View File
@@ -31,6 +31,7 @@
#include "constants/battle_anim.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/party_menu.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/rgb.h"
@@ -664,7 +665,7 @@ u32 sub_8057FBC(void) // unused
static void HandleMoveSwitching(void)
{
u8 perMovePPBonuses[4];
u8 perMovePPBonuses[MAX_MON_MOVES];
struct ChooseMoveStruct moveStruct;
u8 totalPPBonuses;
@@ -1341,10 +1342,10 @@ static void WaitForMonSelection(void)
{
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{
if (gUnknown_0203CEE8 == 1)
BtlController_EmitChosenMonReturnValue(1, gUnknown_0203CEE9, gUnknown_0203CF00);
if (gPartyMenuUseExitCallback == TRUE)
BtlController_EmitChosenMonReturnValue(1, gSelectedMonPartyId, gBattlePartyCurrentOrder);
else
BtlController_EmitChosenMonReturnValue(1, 6, NULL);
BtlController_EmitChosenMonReturnValue(1, PARTY_SIZE, NULL);
if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1)
PrintLinkStandbyMsg();
@@ -1531,12 +1532,12 @@ void ActionSelectionDestroyCursorAt(u8 cursorPosition)
CopyBgTilemapBufferToVram(0);
}
void SetCB2ToReshowScreenAfterMenu(void)
void CB2_SetUpReshowBattleScreenAfterMenu(void)
{
SetMainCallback2(ReshowBattleScreenAfterMenu);
}
void SetCB2ToReshowScreenAfterMenu2(void)
void CB2_SetUpReshowBattleScreenAfterMenu2(void)
{
SetMainCallback2(ReshowBattleScreenAfterMenu);
}
@@ -2312,7 +2313,7 @@ static void PlayerHandleDrawTrainerPic(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2;
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = 0;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF;
gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1;
}
// Use the back pic in any other scenario.
@@ -2484,7 +2485,7 @@ static void PlayerDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -2493,7 +2494,7 @@ static void PlayerDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
@@ -2632,20 +2633,20 @@ static void PlayerHandleChooseItem(void)
gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem;
gBattlerInMenuId = gActiveBattler;
for (i = 0; i < 3; i++)
gUnknown_0203CF00[i] = gBattleBufferA[gActiveBattler][1 + i];
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][1 + i];
}
static void PlayerHandleChoosePokemon(void)
{
s32 i;
for (i = 0; i < 3; i++)
gUnknown_0203CF00[i] = gBattleBufferA[gActiveBattler][4 + i];
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][4 + i];
if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_CANT_SWITCH)
if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH)
{
BtlController_EmitChosenMonReturnValue(1, gBattlerPartyIndexes[gActiveBattler] + 1, gUnknown_0203CF00);
BtlController_EmitChosenMonReturnValue(1, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder);
PlayerBufferExecCompleted();
}
else
@@ -2675,8 +2676,9 @@ static void PlayerHandleHealthBarUpdate(void)
LoadBattleBarGfx(0);
hpVal = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
// gPlayerPartyLostHP used by Battle Dome, but never read
if (hpVal > 0)
gUnknown_0203CD70 += hpVal;
gPlayerPartyLostHP += hpVal;
if (hpVal != INSTANT_HP_BAR_DROP)
{
@@ -3092,7 +3094,7 @@ static void PlayerHandleCmd55(void)
{
sub_81851A8(&gBattleBufferA[gActiveBattler][4]);
gBattleOutcome = gBattleBufferA[gActiveBattler][1];
gSaveBlock2Ptr->frontier.field_CA9_b = gBattleBufferA[gActiveBattler][2];
gSaveBlock2Ptr->frontier.disableRecordBattle = gBattleBufferA[gActiveBattler][2];
FadeOutMapMusic(5);
BeginFastPaletteFade(3);
PlayerBufferExecCompleted();
+3 -3
View File
@@ -1334,7 +1334,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2;
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = 0;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF;
gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1;
}
@@ -1444,7 +1444,7 @@ static void PlayerPartnerDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1453,7 +1453,7 @@ static void PlayerPartnerDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
+2 -2
View File
@@ -1355,7 +1355,7 @@ static void RecordedOpponentDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1364,7 +1364,7 @@ static void RecordedOpponentDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
+3 -3
View File
@@ -1238,7 +1238,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2;
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = 0;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF;
gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1;
}
else
@@ -1359,7 +1359,7 @@ static void RecordedPlayerDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1368,7 +1368,7 @@ static void RecordedPlayerDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
+2 -2
View File
@@ -1134,7 +1134,7 @@ static void WallyDoMoveAnimation(void)
case 1:
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
sub_805EB9C(0);
sub_805EB9C(ST_OAM_AFFINE_OFF);
DoMoveAnim(move);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2;
}
@@ -1143,7 +1143,7 @@ static void WallyDoMoveAnimation(void)
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_805EB9C(1);
sub_805EB9C(ST_OAM_AFFINE_NORMAL);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute)
{
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE);
+25 -25
View File
@@ -95,7 +95,7 @@ void sub_8032768(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{
for (i = 0; i < gBattlersCount; i++)
sub_81B8D64(i, 0);
BufferBattlePartyCurrentOrderBySide(i, 0);
}
for (i = 0; i < sizeof(gBattleStruct->tvMovePoints); i++)
@@ -144,10 +144,10 @@ static void InitSinglePlayerBtlControllers(void)
gBattlersCount = MAX_BATTLERS_COUNT;
sub_81B8D64(0, 0);
sub_81B8D64(1, 0);
sub_81B8D64(2, 1);
sub_81B8D64(3, 1);
BufferBattlePartyCurrentOrderBySide(0, 0);
BufferBattlePartyCurrentOrderBySide(1, 0);
BufferBattlePartyCurrentOrderBySide(2, 1);
BufferBattlePartyCurrentOrderBySide(3, 1);
gBattlerPartyIndexes[0] = 0;
gBattlerPartyIndexes[1] = 0;
@@ -247,10 +247,10 @@ static void InitSinglePlayerBtlControllers(void)
gBattlersCount = MAX_BATTLERS_COUNT;
sub_81B8D64(0, 0);
sub_81B8D64(1, 0);
sub_81B8D64(2, 1);
sub_81B8D64(3, 1);
BufferBattlePartyCurrentOrderBySide(0, 0);
BufferBattlePartyCurrentOrderBySide(1, 0);
BufferBattlePartyCurrentOrderBySide(2, 1);
BufferBattlePartyCurrentOrderBySide(3, 1);
gBattlerPartyIndexes[0] = 0;
gBattlerPartyIndexes[1] = 0;
@@ -267,11 +267,11 @@ static void InitSinglePlayerBtlControllers(void)
{
case 0:
case 3:
sub_81B8D64(gLinkPlayers[i].id, 0);
BufferBattlePartyCurrentOrderBySide(gLinkPlayers[i].id, 0);
break;
case 1:
case 2:
sub_81B8D64(gLinkPlayers[i].id, 1);
BufferBattlePartyCurrentOrderBySide(gLinkPlayers[i].id, 1);
break;
}
@@ -487,10 +487,10 @@ static void InitLinkBtlControllers(void)
gBattlersCount = MAX_BATTLERS_COUNT;
}
sub_81B8D64(0, 0);
sub_81B8D64(1, 0);
sub_81B8D64(2, 1);
sub_81B8D64(3, 1);
BufferBattlePartyCurrentOrderBySide(0, 0);
BufferBattlePartyCurrentOrderBySide(1, 0);
BufferBattlePartyCurrentOrderBySide(2, 1);
BufferBattlePartyCurrentOrderBySide(3, 1);
gBattlerPartyIndexes[0] = 0;
gBattlerPartyIndexes[1] = 0;
gBattlerPartyIndexes[2] = 3;
@@ -509,11 +509,11 @@ static void InitLinkBtlControllers(void)
{
case 0:
case 3:
sub_81B8D64(gLinkPlayers[i].id, 0);
BufferBattlePartyCurrentOrderBySide(gLinkPlayers[i].id, 0);
break;
case 1:
case 2:
sub_81B8D64(gLinkPlayers[i].id, 1);
BufferBattlePartyCurrentOrderBySide(gLinkPlayers[i].id, 1);
break;
}
@@ -1175,13 +1175,13 @@ void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8 *arg4)
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8 *arg4)
{
s32 i;
sBattleBuffersTransferData[0] = CONTROLLER_CHOOSEPOKEMON;
sBattleBuffersTransferData[1] = caseId;
sBattleBuffersTransferData[2] = arg2;
sBattleBuffersTransferData[2] = slotId;
sBattleBuffersTransferData[3] = abilityId;
for (i = 0; i < 3; i++)
sBattleBuffersTransferData[4 + i] = arg4[i];
@@ -1311,14 +1311,14 @@ void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c)
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder)
{
s32 i;
sBattleBuffersTransferData[0] = CONTROLLER_CHOSENMONRETURNVALUE;
sBattleBuffersTransferData[1] = b;
for (i = 0; i < 3; i++)
sBattleBuffersTransferData[2 + i] = c[i];
sBattleBuffersTransferData[1] = partyId;
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
sBattleBuffersTransferData[2 + i] = battlePartyOrder[i];
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 5);
}
@@ -1509,8 +1509,8 @@ void BtlController_EmitCmd55(u8 bufferId, u8 battleOutcome)
{
sBattleBuffersTransferData[0] = CONTROLLER_55;
sBattleBuffersTransferData[1] = battleOutcome;
sBattleBuffersTransferData[2] = gSaveBlock2Ptr->frontier.field_CA9_b;
sBattleBuffersTransferData[3] = gSaveBlock2Ptr->frontier.field_CA9_b;
sBattleBuffersTransferData[2] = gSaveBlock2Ptr->frontier.disableRecordBattle;
sBattleBuffersTransferData[3] = gSaveBlock2Ptr->frontier.disableRecordBattle;
sBattleBuffersTransferData[5] = sBattleBuffersTransferData[4] = sub_81850DC(&sBattleBuffersTransferData[6]);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sBattleBuffersTransferData[4] + 6);
}
+2680 -2684
View File
File diff suppressed because it is too large Load Diff
+83 -78
View File
@@ -10,7 +10,10 @@
#include "random.h"
#include "constants/species.h"
#include "constants/battle_ai.h"
#include "constants/battle_factory.h"
#include "constants/battle_frontier.h"
#include "constants/battle_frontier_mons.h"
#include "constants/frontier_util.h"
#include "constants/layouts.h"
#include "constants/trainers.h"
#include "constants/moves.h"
@@ -22,7 +25,7 @@ static bool8 sPerformedRentalSwap;
static void InitFactoryChallenge(void);
static void GetBattleFactoryData(void);
static void SetBattleFactoryData(void);
static void sub_81A613C(void);
static void SaveFactoryChallenge(void);
static void nullsub_75(void);
static void nullsub_123(void);
static void SelectInitialRentalMons(void);
@@ -48,14 +51,14 @@ static const u16 sMoves_TotalPreparation[] =
MOVE_MINIMIZE, MOVE_WITHDRAW, MOVE_DEFENSE_CURL, MOVE_BARRIER, MOVE_FOCUS_ENERGY, MOVE_AMNESIA,
MOVE_ACID_ARMOR, MOVE_SHARPEN, MOVE_CONVERSION, MOVE_CONVERSION_2, MOVE_BELLY_DRUM, MOVE_PSYCH_UP,
MOVE_CHARGE, MOVE_SNATCH, MOVE_TAIL_GLOW, MOVE_COSMIC_POWER, MOVE_IRON_DEFENSE, MOVE_HOWL, MOVE_BULK_UP, MOVE_CALM_MIND, MOVE_DRAGON_DANCE,
0
MOVE_NONE
};
static const u16 sMoves_ImpossibleToPredict[] =
{
MOVE_MIMIC, MOVE_METRONOME, MOVE_MIRROR_MOVE, MOVE_TRANSFORM, MOVE_SUBSTITUTE, MOVE_SKETCH, MOVE_CURSE,
MOVE_PRESENT, MOVE_FOLLOW_ME, MOVE_TRICK, MOVE_ROLE_PLAY, MOVE_ASSIST, MOVE_SKILL_SWAP, MOVE_CAMOUFLAGE,
0
MOVE_NONE
};
static const u16 sMoves_WeakeningTheFoe[] =
@@ -63,7 +66,7 @@ static const u16 sMoves_WeakeningTheFoe[] =
MOVE_SAND_ATTACK, MOVE_TAIL_WHIP, MOVE_LEER, MOVE_GROWL, MOVE_STRING_SHOT, MOVE_SCREECH, MOVE_SMOKESCREEN, MOVE_KINESIS,
MOVE_FLASH, MOVE_COTTON_SPORE, MOVE_SPITE, MOVE_SCARY_FACE, MOVE_CHARM, MOVE_KNOCK_OFF, MOVE_SWEET_SCENT, MOVE_FEATHER_DANCE,
MOVE_FAKE_TEARS, MOVE_METAL_SOUND, MOVE_TICKLE,
0
MOVE_NONE
};
static const u16 sMoves_HighRiskHighReturn[] =
@@ -72,7 +75,7 @@ static const u16 sMoves_HighRiskHighReturn[] =
MOVE_BIDE, MOVE_SELF_DESTRUCT, MOVE_SKY_ATTACK, MOVE_EXPLOSION, MOVE_FLAIL, MOVE_REVERSAL, MOVE_DESTINY_BOND,
MOVE_PERISH_SONG, MOVE_PAIN_SPLIT, MOVE_MIRROR_COAT, MOVE_MEMENTO, MOVE_GRUDGE, MOVE_FACADE, MOVE_FOCUS_PUNCH,
MOVE_BLAST_BURN, MOVE_HYDRO_CANNON, MOVE_OVERHEAT, MOVE_FRENZY_PLANT, MOVE_PSYCHO_BOOST, MOVE_VOLT_TACKLE,
0
MOVE_NONE
};
static const u16 sMoves_Endurance[] =
@@ -81,7 +84,7 @@ static const u16 sMoves_Endurance[] =
MOVE_DETECT, MOVE_ENDURE, MOVE_MILK_DRINK, MOVE_HEAL_BELL, MOVE_SAFEGUARD, MOVE_BATON_PASS, MOVE_MORNING_SUN,
MOVE_SYNTHESIS, MOVE_MOONLIGHT, MOVE_SWALLOW, MOVE_WISH, MOVE_INGRAIN, MOVE_MAGIC_COAT, MOVE_RECYCLE, MOVE_REFRESH,
MOVE_MUD_SPORT, MOVE_SLACK_OFF, MOVE_AROMATHERAPY, MOVE_WATER_SPORT,
0
MOVE_NONE
};
static const u16 sMoves_SlowAndSteady[] =
@@ -90,57 +93,58 @@ static const u16 sMoves_SlowAndSteady[] =
MOVE_THUNDER_WAVE, MOVE_TOXIC, MOVE_HYPNOSIS, MOVE_CONFUSE_RAY, MOVE_GLARE, MOVE_POISON_GAS, MOVE_LOVELY_KISS, MOVE_SPORE,
MOVE_SPIDER_WEB, MOVE_SWEET_KISS, MOVE_SPIKES, MOVE_SWAGGER, MOVE_MEAN_LOOK, MOVE_ATTRACT, MOVE_ENCORE, MOVE_TORMENT,
MOVE_FLATTER, MOVE_WILL_O_WISP, MOVE_TAUNT, MOVE_YAWN, MOVE_IMPRISON, MOVE_SNATCH, MOVE_TEETER_DANCE, MOVE_GRASS_WHISTLE, MOVE_BLOCK,
0
MOVE_NONE
};
static const u16 sMoves_DependsOnTheBattlesFlow[] =
{
MOVE_SANDSTORM, MOVE_RAIN_DANCE, MOVE_SUNNY_DAY, MOVE_HAIL, MOVE_WEATHER_BALL,
0
MOVE_NONE
};
static const u16 *const sMoveStyles[] =
// Excludes FACTORY_STYLE_NONE
static const u16 *const sMoveStyles[FACTORY_NUM_STYLES - 1] =
{
sMoves_TotalPreparation,
sMoves_SlowAndSteady,
sMoves_Endurance,
sMoves_HighRiskHighReturn,
sMoves_WeakeningTheFoe,
sMoves_ImpossibleToPredict,
sMoves_DependsOnTheBattlesFlow,
[FACTORY_STYLE_PREPARATION - 1] = sMoves_TotalPreparation,
[FACTORY_STYLE_SLOW_STEADY - 1] = sMoves_SlowAndSteady,
[FACTORY_STYLE_ENDURANCE - 1] = sMoves_Endurance,
[FACTORY_STYLE_HIGH_RISK - 1] = sMoves_HighRiskHighReturn,
[FACTORY_STYLE_WEAKENING - 1] = sMoves_WeakeningTheFoe,
[FACTORY_STYLE_UNPREDICTABLE - 1] = sMoves_ImpossibleToPredict,
[FACTORY_STYLE_WEATHER - 1] = sMoves_DependsOnTheBattlesFlow,
};
static void (* const sBattleFactoryFunctions[])(void) =
{
InitFactoryChallenge,
GetBattleFactoryData,
SetBattleFactoryData,
sub_81A613C,
nullsub_75,
nullsub_123,
SelectInitialRentalMons,
SwapRentalMons,
SetPerformedRentalSwap,
SetRentalsToOpponentParty,
SetPlayerAndOpponentParties,
SetOpponentGfxVar,
GenerateOpponentMons,
GenerateInitialRentalMons,
GetOpponentMostCommonMonType,
GetOpponentBattleStyle,
RestorePlayerPartyHeldItems,
[BATTLE_FACTORY_FUNC_INIT] = InitFactoryChallenge,
[BATTLE_FACTORY_FUNC_GET_DATA] = GetBattleFactoryData,
[BATTLE_FACTORY_FUNC_SET_DATA] = SetBattleFactoryData,
[BATTLE_FACTORY_FUNC_SAVE] = SaveFactoryChallenge,
[BATTLE_FACTORY_FUNC_NULL] = nullsub_75,
[BATTLE_FACTORY_FUNC_NULL2] = nullsub_123,
[BATTLE_FACTORY_FUNC_SELECT_RENT_MONS] = SelectInitialRentalMons,
[BATTLE_FACTORY_FUNC_SWAP_RENT_MONS] = SwapRentalMons,
[BATTLE_FACTORY_FUNC_SET_SWAPPED] = SetPerformedRentalSwap,
[BATTLE_FACTORY_FUNC_SET_OPPONENT_MONS] = SetRentalsToOpponentParty,
[BATTLE_FACTORY_FUNC_SET_PARTIES] = SetPlayerAndOpponentParties,
[BATTLE_FACTORY_FUNC_SET_OPPONENT_GFX] = SetOpponentGfxVar,
[BATTLE_FACTORY_FUNC_GENERATE_OPPONENT_MONS] = GenerateOpponentMons,
[BATTLE_FACTORY_FUNC_GENERATE_RENTAL_MONS] = GenerateInitialRentalMons,
[BATTLE_FACTORY_FUNC_GET_OPPONENT_MON_TYPE] = GetOpponentMostCommonMonType,
[BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE] = GetOpponentBattleStyle,
[BATTLE_FACTORY_FUNC_RESET_HELD_ITEMS] = RestorePlayerPartyHeldItems,
};
static const u32 gUnknown_08612164[][2] =
static const u32 sWinStreakFlags[][2] =
{
{0x100, 0x200},
{0x1000000, 0x2000000},
{STREAK_FACTORY_SINGLES_50, STREAK_FACTORY_SINGLES_OPEN},
{STREAK_FACTORY_DOUBLES_50, STREAK_FACTORY_DOUBLES_OPEN},
};
static const u32 gUnknown_08612174[][2] =
static const u32 sWinStreakMasks[][2] =
{
{0xfffffeff, 0xfffffdff},
{0xfeffffff, 0xfdffffff},
{~(STREAK_FACTORY_SINGLES_50), ~(STREAK_FACTORY_SINGLES_OPEN)},
{~(STREAK_FACTORY_DOUBLES_50), ~(STREAK_FACTORY_DOUBLES_OPEN)},
};
static const u8 sFixedIVTable[][2] =
@@ -187,11 +191,11 @@ static void InitFactoryChallenge(void)
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_08612164[battleMode][lvlMode]))
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE;
if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode]))
{
gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] = 0;
gSaveBlock2Ptr->frontier.factoryRentsCount[battleMode][lvlMode] = 0;
@@ -200,7 +204,7 @@ static void InitFactoryChallenge(void)
sPerformedRentalSwap = FALSE;
for (i = 0; i < 6; i++)
gSaveBlock2Ptr->frontier.rentalMons[i].monId = 0xFFFF;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
gUnknown_03006298[i] = 0xFFFF;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
@@ -214,13 +218,13 @@ static void GetBattleFactoryData(void)
switch (gSpecialVar_0x8005)
{
case 1:
case FACTORY_DATA_WIN_STREAK:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode];
break;
case 2:
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_08612164[battleMode][lvlMode]) != 0);
case FACTORY_DATA_WIN_STREAK_ACTIVE:
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode]) != 0);
break;
case 3:
case FACTORY_DATA_WIN_STREAK_SWAPS:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.factoryRentsCount[battleMode][lvlMode];
break;
}
@@ -233,16 +237,16 @@ static void SetBattleFactoryData(void)
switch (gSpecialVar_0x8005)
{
case 1:
case FACTORY_DATA_WIN_STREAK:
gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] = gSpecialVar_0x8006;
break;
case 2:
case FACTORY_DATA_WIN_STREAK_ACTIVE:
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= gUnknown_08612164[battleMode][lvlMode];
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= sWinStreakFlags[battleMode][lvlMode];
else
gSaveBlock2Ptr->frontier.field_CDC &= gUnknown_08612174[battleMode][lvlMode];
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= sWinStreakMasks[battleMode][lvlMode];
break;
case 3:
case FACTORY_DATA_WIN_STREAK_SWAPS:
if (sPerformedRentalSwap == TRUE)
{
gSaveBlock2Ptr->frontier.factoryRentsCount[battleMode][lvlMode] = gSpecialVar_0x8006;
@@ -252,12 +256,12 @@ static void SetBattleFactoryData(void)
}
}
static void sub_81A613C(void)
static void SaveFactoryChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = 1;
sub_81A4C30();
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
SaveGameFrontier();
}
static void nullsub_75(void)
@@ -289,8 +293,8 @@ static void SetPerformedRentalSwap(void)
static void GenerateOpponentMons(void)
{
int i, j, k;
u16 species[3];
u16 heldItems[3];
u16 species[FRONTIER_PARTY_SIZE];
u16 heldItems[FRONTIER_PARTY_SIZE];
int firstMonId = 0;
u16 trainerId = 0;
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
@@ -301,7 +305,7 @@ static void GenerateOpponentMons(void)
do
{
trainerId = sub_8162548(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -314,7 +318,7 @@ static void GenerateOpponentMons(void)
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = trainerId;
i = 0;
while (i != 3)
while (i != FRONTIER_PARTY_SIZE)
{
u16 monSetId = GetMonSetId(lvlMode, challengeNum, FALSE);
if (gFacilityTrainerMons[monSetId].species == SPECIES_UNOWN)
@@ -328,7 +332,7 @@ static void GenerateOpponentMons(void)
if (j != 6)
continue;
if (lvlMode == FRONTIER_LVL_50 && monSetId > 849)
if (lvlMode == FRONTIER_LVL_50 && monSetId > FRONTIER_MONS_HIGH_TIER)
continue;
for (k = firstMonId; k < firstMonId + i; k++)
@@ -368,7 +372,7 @@ static void SetRentalsToOpponentParty(void)
else
gFacilityTrainerMons = gSlateportBattleTentMons;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId = gUnknown_03006298[i];
gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ATK_IV, NULL);
@@ -406,7 +410,7 @@ static void SetPlayerAndOpponentParties(void)
if (gSpecialVar_0x8005 < 2)
{
ZeroPlayerPartyMons();
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
monSetId = gSaveBlock2Ptr->frontier.rentalMons[i].monId;
ivs = gSaveBlock2Ptr->frontier.rentalMons[i].ivs;
@@ -447,7 +451,7 @@ static void SetPlayerAndOpponentParties(void)
{
case 0:
case 2:
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
monSetId = gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId;
ivs = gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs;
@@ -587,7 +591,7 @@ static void GetOpponentMostCommonMonType(void)
gFacilityTrainerMons = gBattleFrontierMons;
for (i = 0; i < NUMBER_OF_MON_TYPES; i++)
typesCount[i] = 0;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
u32 species = gFacilityTrainerMons[gUnknown_03006298[i]].species;
@@ -616,14 +620,14 @@ static void GetOpponentMostCommonMonType(void)
static void GetOpponentBattleStyle(void)
{
u8 i, j, count;
u8 stylePoints[8];
u8 stylePoints[FACTORY_NUM_STYLES];
count = 0;
gFacilityTrainerMons = gBattleFrontierMons;
for (i = 0; i < 8; i++)
for (i = 0; i < FACTORY_NUM_STYLES; i++)
stylePoints[i] = 0;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
u16 monSetId = gUnknown_03006298[i];
for (j = 0; j < MAX_MON_MOVES; j++)
@@ -634,7 +638,7 @@ static void GetOpponentBattleStyle(void)
}
gSpecialVar_Result = 0;
for (i = 1; i < 8; i++)
for (i = 1; i < FACTORY_NUM_STYLES; i++)
{
if (stylePoints[i] >= sRequiredMoveCounts[i - 1])
{
@@ -643,8 +647,9 @@ static void GetOpponentBattleStyle(void)
}
}
// Has no singular style
if (count > 2)
gSpecialVar_Result = 8;
gSpecialVar_Result = FACTORY_NUM_STYLES;
}
static u8 GetMoveBattleStyle(u16 move)
@@ -654,13 +659,13 @@ static u8 GetMoveBattleStyle(u16 move)
for (i = 0; i < ARRAY_COUNT(sMoveStyles); i++)
{
for (j = 0, moves = sMoveStyles[i]; moves[j] != 0; j++)
for (j = 0, moves = sMoveStyles[i]; moves[j] != MOVE_NONE; j++)
{
if (moves[j] == move)
return i + 1;
}
}
return 0;
return FACTORY_STYLE_NONE;
}
bool8 InBattleFactory(void)
@@ -678,7 +683,7 @@ static void RestorePlayerPartyHeldItems(void)
else
gFacilityTrainerMons = gSlateportBattleTentMons;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
SetMonData(&gPlayerParty[i],
MON_DATA_HELD_ITEM,
@@ -702,8 +707,8 @@ u8 GetFactoryMonFixedIV(u8 arg0, u8 arg1)
void FillFactoryBrainParty(void)
{
int i, j, k;
u16 species[3];
u16 heldItems[3];
u16 species[FRONTIER_PARTY_SIZE];
u16 heldItems[FRONTIER_PARTY_SIZE];
u8 friendship;
int monLevel;
u8 fixedIV;
@@ -717,13 +722,13 @@ void FillFactoryBrainParty(void)
i = 0;
otId = T1_READ_32(gSaveBlock2Ptr->playerTrainerId);
while (i != 3)
while (i != FRONTIER_PARTY_SIZE)
{
u16 monSetId = GetMonSetId(lvlMode, challengeNum, FALSE);
if (gFacilityTrainerMons[monSetId].species == SPECIES_UNOWN)
continue;
if (monLevel == 50 && monSetId > 849)
if (monLevel == 50 && monSetId > FRONTIER_MONS_HIGH_TIER)
continue;
for (j = 0; j < 6; j++)
+53 -53
View File
@@ -11,7 +11,7 @@
#include "palette.h"
#include "task.h"
#include "main.h"
#include "alloc.h"
#include "malloc.h"
#include "bg.h"
#include "gpu_regs.h"
#include "string_util.h"
@@ -375,16 +375,16 @@ static const struct WindowTemplate sSelect_WindowTemplates[] =
static const u16 gUnknown_0861046C[] = INCBIN_U16("graphics/unknown/unknown_61046C.gbapal");
static const u8 gUnknown_08610476[] = {0x00, 0x02, 0x00};
static const u8 gUnknown_08610479[] = {0x00, 0x04, 0x00};
static const u8 sMenuOptionTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_TRANSPARENT};
static const u8 sSpeciesNameTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_TRANSPARENT};
static const struct OamData gUnknown_0861047C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.matrixNum = 0,
@@ -398,10 +398,10 @@ static const struct OamData gUnknown_0861047C =
static const struct OamData gUnknown_08610484 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
.x = 0,
.matrixNum = 0,
@@ -415,10 +415,10 @@ static const struct OamData gUnknown_08610484 =
static const struct OamData gUnknown_0861048C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
.x = 0,
.matrixNum = 0,
@@ -432,10 +432,10 @@ static const struct OamData gUnknown_0861048C =
static const struct OamData gUnknown_08610494 =
{
.y = 0,
.affineMode = 3,
.objMode = 1,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
@@ -632,14 +632,14 @@ static const struct SpritePalette gUnknown_086106B0[] =
static const struct OamData gUnknown_086106D8 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.matrixNum = 0,
.size = 2,
.size = SPRITE_SIZE(32x32),
.tileNum = 0,
.priority = 3,
.paletteNum = 0,
@@ -649,14 +649,14 @@ static const struct OamData gUnknown_086106D8 =
static const struct OamData gUnknown_086106E0 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
.x = 0,
.matrixNum = 0,
.size = 1,
.size = SPRITE_SIZE(16x16),
.tileNum = 0,
.priority = 3,
.paletteNum = 0,
@@ -666,14 +666,14 @@ static const struct OamData gUnknown_086106E0 =
static const struct OamData gUnknown_086106E8 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.shape = 1,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
.x = 0,
.matrixNum = 0,
.size = 2,
.size = SPRITE_SIZE(32x16),
.tileNum = 0,
.priority = 2,
.paletteNum = 0,
@@ -683,14 +683,14 @@ static const struct OamData gUnknown_086106E8 =
static const struct OamData gUnknown_086106F0 =
{
.y = 0,
.affineMode = 3,
.objMode = 1,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
.size = 3,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
@@ -985,8 +985,8 @@ static const struct WindowTemplate sSwap_WindowTemplates[] =
};
static const u16 gUnknown_08610918[] = {RGB_BLACK, RGB_BLACK, RGB_WHITE, RGB_BLACK, RGB_RED}; // Palette.
static const u8 gUnknown_08610922[] = {0x0, 0x02, 0x0};
static const u8 gUnknown_08610925[] = {0x0, 0x04, 0x0};
static const u8 sSwapMenuOptionsTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_TRANSPARENT};
static const u8 sSwapSpeciesNameTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_TRANSPARENT};
static const struct SwapActionIdAndFunc sSwap_PlayerScreenActions[] =
{
@@ -1808,7 +1808,7 @@ static void Select_PrintMonSpecies(void)
species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(1, gStringVar4, 86);
AddTextPrinterParameterized3(1, 1, x, 1, gUnknown_08610479, 0, gStringVar4);
AddTextPrinterParameterized3(1, 1, x, 1, sSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(1, 2);
}
@@ -1843,13 +1843,13 @@ static void Select_PrintMenuOptions(void)
PutWindowTilemap(3);
FillWindowPixelBuffer(3, PIXEL_FILL(0));
AddTextPrinterParameterized3(3, 1, 7, 1, gUnknown_08610476, 0, gText_Summary);
AddTextPrinterParameterized3(3, 1, 7, 1, sMenuOptionTextColors, 0, gText_Summary);
if (selectedId != 0)
AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Deselect);
AddTextPrinterParameterized3(3, 1, 7, 17, sMenuOptionTextColors, 0, gText_Deselect);
else
AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Rent);
AddTextPrinterParameterized3(3, 1, 7, 17, sMenuOptionTextColors, 0, gText_Rent);
AddTextPrinterParameterized3(3, 1, 7, 33, gUnknown_08610476, 0, gText_Others2);
AddTextPrinterParameterized3(3, 1, 7, 33, sMenuOptionTextColors, 0, gText_Others2);
CopyWindowToVram(3, 3);
}
@@ -1857,8 +1857,8 @@ static void Select_PrintYesNoOptions(void)
{
PutWindowTilemap(4);
FillWindowPixelBuffer(4, PIXEL_FILL(0));
AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610476, 0, gText_Yes2);
AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610476, 0, gText_No2);
AddTextPrinterParameterized3(4, 1, 7, 1, sMenuOptionTextColors, 0, gText_Yes2);
AddTextPrinterParameterized3(4, 1, 7, 17, sMenuOptionTextColors, 0, gText_No2);
CopyWindowToVram(4, 3);
}
@@ -3599,7 +3599,7 @@ static void Swap_PrintMonSpecies(void)
species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(1, gStringVar4, 86);
AddTextPrinterParameterized3(1, 1, x, 1, gUnknown_08610925, 0, gStringVar4);
AddTextPrinterParameterized3(1, 1, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(1, 3);
}
}
@@ -3615,9 +3615,9 @@ static void Swap_PrintMenuOptions(void)
{
PutWindowTilemap(3);
FillWindowPixelBuffer(3, PIXEL_FILL(0));
AddTextPrinterParameterized3(3, 1, 15, 1, gUnknown_08610922, 0, gText_Summary2);
AddTextPrinterParameterized3(3, 1, 15, 17, gUnknown_08610922, 0, gText_Swap);
AddTextPrinterParameterized3(3, 1, 15, 33, gUnknown_08610922, 0, gText_Rechoose);
AddTextPrinterParameterized3(3, 1, 15, 1, sSwapMenuOptionsTextColors, 0, gText_Summary2);
AddTextPrinterParameterized3(3, 1, 15, 17, sSwapMenuOptionsTextColors, 0, gText_Swap);
AddTextPrinterParameterized3(3, 1, 15, 33, sSwapMenuOptionsTextColors, 0, gText_Rechoose);
CopyWindowToVram(3, 3);
}
@@ -3625,15 +3625,15 @@ static void Swap_PrintYesNoOptions(void)
{
PutWindowTilemap(4);
FillWindowPixelBuffer(4, PIXEL_FILL(0));
AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610922, 0, gText_Yes3);
AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610922, 0, gText_No3);
AddTextPrinterParameterized3(4, 1, 7, 1, sSwapMenuOptionsTextColors, 0, gText_Yes3);
AddTextPrinterParameterized3(4, 1, 7, 17, sSwapMenuOptionsTextColors, 0, gText_No3);
CopyWindowToVram(4, 3);
}
static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId)
{
s32 x = GetStringRightAlignXOffset(0, str, 0x46);
AddTextPrinterParameterized3(windowId, 0, x, y, gUnknown_08610922, 0, str);
AddTextPrinterParameterized3(windowId, 0, x, y, sSwapMenuOptionsTextColors, 0, str);
}
static void Swap_PrintActionStrings(void)
@@ -3707,7 +3707,7 @@ static void Swap_PrintMonSpecies2(void)
species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(1, gStringVar4, 86);
AddTextPrinterParameterized3(7, 1, x, 1, gUnknown_08610925, 0, gStringVar4);
AddTextPrinterParameterized3(7, 1, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(7, 3);
}
}
@@ -3733,7 +3733,7 @@ static void Swap_PrintMonSpecies3(void)
species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(1, gStringVar4, 86);
AddTextPrinterParameterized3(1, 1, x, 1, gUnknown_08610925, 0, gStringVar4);
AddTextPrinterParameterized3(1, 1, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
CopyWindowToVram(1, 3);
}
}
+4 -4
View File
@@ -6,7 +6,7 @@
#include "constants/battle_anim.h"
#include "battle_interface.h"
#include "main.h"
#include "alloc.h"
#include "malloc.h"
#include "graphics.h"
#include "random.h"
#include "util.h"
@@ -811,7 +811,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId)
break;
case 6:
LoadAndCreateEnemyShadowSprites();
sub_81B8C68();
BufferBattlePartyCurrentOrder();
retVal = TRUE;
break;
}
@@ -1061,8 +1061,8 @@ void HandleBattleLowHpMusicChange(void)
{
u8 playerBattler1 = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
u8 playerBattler2 = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
u8 battler1PartyId = pokemon_order_func(gBattlerPartyIndexes[playerBattler1]);
u8 battler2PartyId = pokemon_order_func(gBattlerPartyIndexes[playerBattler2]);
u8 battler1PartyId = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[playerBattler1]);
u8 battler2PartyId = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[playerBattler2]);
if (GetMonData(&gPlayerParty[battler1PartyId], MON_DATA_HP) != 0)
HandleLowHpMusicChange(&gPlayerParty[battler1PartyId], playerBattler1);
+286 -323
View File
@@ -202,10 +202,10 @@ static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2);
static const struct OamData sUnknown_0832C138 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.matrixNum = 0,
@@ -274,10 +274,10 @@ static const struct SpriteTemplate sHealthboxSafariSpriteTemplate =
static const struct OamData sOamData_Healthbar =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
.x = 0,
.matrixNum = 0,
@@ -330,45 +330,178 @@ static const struct SpriteTemplate sHealthbarSpriteTemplates[MAX_BATTLERS_COUNT]
static const struct Subsprite sUnknown_0832C220[] =
{
{240, 0, 1, 3, 0, 1},
{48, 0, 0, 2, 32, 1},
{240, 32, 1, 1, 48, 1},
{16, 32, 1, 1, 52, 1},
{48, 32, 1, 1, 56, 1}
{
.x = 240,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.tileOffset = 0,
.priority = 1
},
{
.x = 48,
.y = 0,
.shape = SPRITE_SHAPE(32x32),
.size = SPRITE_SIZE(32x32),
.tileOffset = 32,
.priority = 1
},
{
.x = 240,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 48,
.priority = 1
},
{
.x = 16,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 52,
.priority = 1
},
{
.x = 48,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 56,
.priority = 1
}
};
static const struct Subsprite sUnknown_0832C234[] =
{
{240, 0, 1, 3, 64, 1},
{48, 0, 0, 2, 96, 1},
{240, 32, 1, 1, 112, 1},
{16, 32, 1, 1, 116, 1},
{48, 32, 1, 1, 120, 1}
{
.x = 240,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.tileOffset = 64,
.priority = 1
},
{
.x = 48,
.y = 0,
.shape = SPRITE_SHAPE(32x32),
.size = SPRITE_SIZE(32x32),
.tileOffset = 96,
.priority = 1
},
{
.x = 240,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 112,
.priority = 1
},
{
.x = 16,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 116,
.priority = 1
},
{
.x = 48,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 120,
.priority = 1
}
};
static const struct Subsprite sUnknown_0832C248[] =
{
{240, 0, 1, 3, 0, 1},
{48, 0, 0, 2, 32, 1}
{
.x = 240,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.tileOffset = 0,
.priority = 1
},
{
.x = 48,
.y = 0,
.shape = SPRITE_SHAPE(32x32),
.size = SPRITE_SIZE(32x32),
.tileOffset = 32,
.priority = 1
}
};
static const struct Subsprite sUnknown_0832C250[] =
{
{240, 0, 1, 3, 0, 1},
{48, 0, 0, 2, 32, 1}
{
.x = 240,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.tileOffset = 0,
.priority = 1
},
{
.x = 48,
.y = 0,
.shape = SPRITE_SHAPE(32x32),
.size = SPRITE_SIZE(32x32),
.tileOffset = 32,
.priority = 1
}
};
static const struct Subsprite sUnknown_0832C258[] =
{
{240, 0, 1, 1, 0, 1},
{16, 0, 1, 1, 4, 1}
{
.x = 240,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 0,
.priority = 1
},
{
.x = 16,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 4,
.priority = 1
}
};
static const struct Subsprite sUnknown_0832C260[] =
{
{240, 0, 1, 1, 0, 1},
{16, 0, 1, 1, 4, 1},
{224, 0, 0, 0, 8, 1}
{
.x = 240,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 0,
.priority = 1
},
{
.x = 16,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 4,
.priority = 1
},
{
.x = 224,
.y = 0,
.shape = SPRITE_SHAPE(8x8),
.size = SPRITE_SIZE(8x8),
.tileOffset = 8,
.priority = 1
}
};
// unused subsprite table
@@ -388,20 +521,90 @@ static const struct SubspriteTable sUnknown_0832C28C[] =
static const struct Subsprite sStatusSummaryBar_Subsprites_0[] =
{
{160, 0, 1, 1, 0, 1},
{192, 0, 1, 1, 4, 1},
{224, 0, 1, 1, 8, 1},
{0, 0, 1, 1, 12, 1}
{
.x = 160,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 0,
.priority = 1
},
{
.x = 192,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 4,
.priority = 1
},
{
.x = 224,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 8,
.priority = 1
},
{
.x = 0,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 12,
.priority = 1
}
};
static const struct Subsprite sUnknown_0832C2AC[] =
{
{160, 0, 1, 1, 0, 1},
{192, 0, 1, 1, 4, 1},
{224, 0, 1, 1, 8, 1},
{0, 0, 1, 1, 8, 1},
{32, 0, 1, 1, 8, 1},
{64, 0, 1, 1, 12, 1}
{
.x = 160,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 0,
.priority = 1
},
{
.x = 192,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 4,
.priority = 1
},
{
.x = 224,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 8,
.priority = 1
},
{
.x = 0,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 8,
.priority = 1
},
{
.x = 32,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 8,
.priority = 1
},
{
.x = 64,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 12,
.priority = 1
}
};
static const struct SubspriteTable sStatusSummaryBar_SubspriteTable[] =
@@ -441,10 +644,10 @@ static const struct SpriteSheet sStatusSummaryBallsSpriteSheet =
static const struct OamData sUnknown_0832C354 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.matrixNum = 0,
@@ -458,10 +661,10 @@ static const struct OamData sUnknown_0832C354 =
static const struct OamData sOamData_StatusSummaryBalls =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
.x = 0,
.matrixNum = 0,
@@ -558,62 +761,52 @@ static s32 DummiedOutFunction(s16 unused1, s16 unused2, s32 unused3)
{
return 9;
}
#ifdef NONMATCHING
static void sub_8072308(s16 arg0, u16 *arg1, u8 arg2)
void sub_8072308(s16 number, u16 *dest, bool8 unk)
{
s8 i, j;
u8 array[4];
u8 *arrayPtr;
s32 r9, vaaa;
u8 buff[4];
for (i = 0; i < 4; i++)
array[i] = 0;
i = 3;
r9 = -1;
arrayPtr = array;
while (1)
{
if (arg0 > 0)
buff[i] = 0;
}
for (i = 3; ; i--)
{
if (number > 0)
{
array[i] = arg0 % 10;
arg0 = arg0 / 10;
i--;
buff[i] = number % 10;
number /= 10;
}
else
{
for (; i > -1; i--)
{
buff[i] = 0xFF;
}
if (buff[3] == 0xFF)
buff[3] = 0;
break;
}
}
for (; i > -1; i--)
{
array[i] = 0xFF;
}
if (arrayPtr[3] == 0xFF)
arrayPtr[3] = 0;
if (arg2 == 0)
if (!unk)
{
for (i = 0, j = 0; i < 4; i++)
{
if (array[j] == 0xFF)
if (buff[j] == 0xFF)
{
arg1[j] &= 0xFC00;
arg1[j] |= 0x1E;
arg1[i + 0x20] &= 0xFC00;
arg1[i + 0x20] |= 0x1E;
dest[j + 0x00] &= 0xFC00;
dest[j + 0x00] |= 0x1E;
dest[i + 0x20] &= 0xFC00;
dest[i + 0x20] |= 0x1E;
}
else
{
arg1[j] &= 0xFC00;
arg1[j] |= array[j] + 0x14;
arg1[i + 0x20] &= 0xFC00;
arg1[i + 0x20] |= array[i] + 0x34;
dest[j + 0x00] &= 0xFC00;
dest[j + 0x00] |= 0x14 + buff[j];
dest[i + 0x20] &= 0xFC00;
dest[i + 0x20] |= 0x34 + buff[i];
}
j++;
}
@@ -622,254 +815,24 @@ static void sub_8072308(s16 arg0, u16 *arg1, u8 arg2)
{
for (i = 0; i < 4; i++)
{
if (array[i] == 0xFF)
if (buff[i] == 0xFF)
{
arg1[i] &= 0xFC00;
arg1[i] |= 0x1E;
arg1[i + 0x20] &= 0xFC00;
arg1[i + 0x20] |= 0x1E;
dest[i + 0x00] &= 0xFC00;
dest[i + 0x00] |= 0x1E;
dest[i + 0x20] &= 0xFC00;
dest[i + 0x20] |= 0x1E;
}
else
{
arg1[i] &= 0xFC00;
arg1[i] |= array[i] + 0x14;
arg1[i + 0x20] &= 0xFC00;
arg1[i + 0x20] |= array[i] + 0x34;
dest[i + 0x00] &= 0xFC00;
dest[i + 0x00] |= 0x14 + buff[i];
dest[i + 0x20] &= 0xFC00;
dest[i + 0x20] |= 0x34 + buff[i];
}
}
}
}
#else
NAKED
static void sub_8072308(s16 arg0, u16 *arg1, u8 arg2)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
adds r7, r1, 0\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
lsls r2, 24\n\
lsrs r2, 24\n\
mov r10, r2\n\
movs r3, 0\n\
movs r2, 0\n\
_08072324:\n\
lsls r0, r3, 24\n\
asrs r0, 24\n\
mov r3, sp\n\
adds r1, r3, r0\n\
strb r2, [r1]\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _08072324\n\
movs r3, 0x3\n\
movs r0, 0x1\n\
negs r0, r0\n\
mov r9, r0\n\
mov r8, sp\n\
_08072344:\n\
lsls r0, r5, 16\n\
asrs r6, r0, 16\n\
cmp r6, 0\n\
ble _08072372\n\
lsls r4, r3, 24\n\
asrs r4, 24\n\
mov r1, sp\n\
adds r5, r1, r4\n\
adds r0, r6, 0\n\
movs r1, 0xA\n\
bl __modsi3\n\
strb r0, [r5]\n\
adds r0, r6, 0\n\
movs r1, 0xA\n\
bl __divsi3\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
subs r4, 0x1\n\
lsls r4, 24\n\
lsrs r3, r4, 24\n\
b _08072344\n\
_08072372:\n\
lsls r1, r3, 24\n\
asrs r0, r1, 24\n\
cmp r0, r9\n\
ble _08072396\n\
movs r4, 0xFF\n\
movs r3, 0x1\n\
negs r3, r3\n\
_08072380:\n\
asrs r2, r1, 24\n\
mov r5, sp\n\
adds r1, r5, r2\n\
ldrb r0, [r1]\n\
orrs r0, r4\n\
strb r0, [r1]\n\
subs r2, 0x1\n\
lsls r1, r2, 24\n\
asrs r0, r1, 24\n\
cmp r0, r3\n\
bgt _08072380\n\
_08072396:\n\
mov r1, r8\n\
ldrb r0, [r1, 0x3]\n\
cmp r0, 0xFF\n\
bne _080723A2\n\
movs r0, 0\n\
strb r0, [r1, 0x3]\n\
_080723A2:\n\
mov r2, r10\n\
cmp r2, 0\n\
bne _08072432\n\
movs r3, 0\n\
movs r1, 0\n\
movs r6, 0xFC\n\
lsls r6, 8\n\
movs r5, 0x1E\n\
mov r12, r5\n\
_080723B4:\n\
lsls r1, 24\n\
asrs r2, r1, 24\n\
mov r0, sp\n\
adds r5, r0, r2\n\
ldrb r0, [r5]\n\
mov r8, r1\n\
cmp r0, 0xFF\n\
bne _080723EA\n\
lsls r1, r2, 1\n\
adds r1, r7\n\
ldrh r2, [r1]\n\
adds r0, r6, 0\n\
ands r0, r2\n\
mov r2, r12\n\
orrs r0, r2\n\
strh r0, [r1]\n\
lsls r3, 24\n\
asrs r1, r3, 23\n\
adds r1, r7\n\
adds r1, 0x40\n\
ldrh r2, [r1]\n\
adds r0, r6, 0\n\
ands r0, r2\n\
mov r5, r12\n\
orrs r0, r5\n\
strh r0, [r1]\n\
b _0807241A\n\
_080723EA:\n\
lsls r2, 1\n\
adds r2, r7\n\
ldrh r0, [r2]\n\
adds r1, r6, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x14\n\
orrs r1, r0\n\
strh r1, [r2]\n\
lsls r4, r3, 24\n\
asrs r3, r4, 24\n\
lsls r2, r3, 1\n\
adds r2, r7\n\
adds r2, 0x40\n\
ldrh r0, [r2]\n\
adds r1, r6, 0\n\
ands r1, r0\n\
mov r5, sp\n\
adds r0, r5, r3\n\
ldrb r0, [r0]\n\
adds r0, 0x34\n\
orrs r1, r0\n\
strh r1, [r2]\n\
adds r3, r4, 0\n\
_0807241A:\n\
movs r0, 0x80\n\
lsls r0, 17\n\
add r0, r8\n\
lsrs r1, r0, 24\n\
movs r2, 0x80\n\
lsls r2, 17\n\
adds r0, r3, r2\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _080723B4\n\
b _08072496\n\
_08072432:\n\
movs r3, 0\n\
movs r4, 0xFC\n\
lsls r4, 8\n\
movs r6, 0x1E\n\
_0807243A:\n\
lsls r1, r3, 24\n\
asrs r2, r1, 24\n\
mov r3, sp\n\
adds r5, r3, r2\n\
ldrb r0, [r5]\n\
adds r3, r1, 0\n\
cmp r0, 0xFF\n\
bne _08072466\n\
lsls r1, r2, 1\n\
adds r1, r7\n\
ldrh r2, [r1]\n\
adds r0, r4, 0\n\
ands r0, r2\n\
orrs r0, r6\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r2, [r1]\n\
adds r0, r4, 0\n\
ands r0, r2\n\
orrs r0, r6\n\
strh r0, [r1]\n\
b _08072488\n\
_08072466:\n\
lsls r2, 1\n\
adds r2, r7\n\
ldrh r0, [r2]\n\
adds r1, r4, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x14\n\
orrs r1, r0\n\
strh r1, [r2]\n\
adds r2, 0x40\n\
ldrh r0, [r2]\n\
adds r1, r4, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x34\n\
orrs r1, r0\n\
strh r1, [r2]\n\
_08072488:\n\
movs r5, 0x80\n\
lsls r5, 17\n\
adds r0, r3, r5\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _0807243A\n\
_08072496:\n\
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.syntax divided");
}
#endif // NONMATCHING
void sub_80724A8(s16 arg0, s16 arg1, u16 *arg2)
{
@@ -910,9 +873,9 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId)
healthboxLeftSpriteId = CreateSprite(&sHealthboxPlayerSpriteTemplates[0], 240, 160, 1);
healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[0], 240, 160, 1);
gSprites[healthboxLeftSpriteId].oam.shape = 0;
gSprites[healthboxLeftSpriteId].oam.shape = ST_OAM_SQUARE;
gSprites[healthboxRightSpriteId].oam.shape = 0;
gSprites[healthboxRightSpriteId].oam.shape = ST_OAM_SQUARE;
gSprites[healthboxRightSpriteId].oam.tileNum += 64;
}
else
@@ -962,7 +925,7 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId)
healthbarSpriteId = CreateSpriteAtEnd(&sHealthbarSpriteTemplates[gBattlerPositions[battlerId]], 140, 60, 0);
healthBarSpritePtr = &gSprites[healthbarSpriteId];
SetSubspriteTables(healthBarSpritePtr, &sUnknown_0832C28C[GetBattlerSide(battlerId)]);
healthBarSpritePtr->subspriteMode = 2;
healthBarSpritePtr->subspriteMode = SUBSPRITES_IGNORE_PRIORITY;
healthBarSpritePtr->oam.priority = 1;
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void*)(OBJ_VRAM0 + healthBarSpritePtr->oam.tileNum * TILE_SIZE_4BPP), 64);
@@ -987,8 +950,8 @@ u8 CreateSafariPlayerHealthboxSprites(void)
healthboxLeftSpriteId = CreateSprite(&sHealthboxSafariSpriteTemplate, 240, 160, 1);
healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxSafariSpriteTemplate, 240, 160, 1);
gSprites[healthboxLeftSpriteId].oam.shape = 0;
gSprites[healthboxRightSpriteId].oam.shape = 0;
gSprites[healthboxLeftSpriteId].oam.shape = ST_OAM_SQUARE;
gSprites[healthboxRightSpriteId].oam.shape = ST_OAM_SQUARE;
gSprites[healthboxRightSpriteId].oam.tileNum += 64;
@@ -1711,9 +1674,9 @@ void Task_HidePartyStatusSummary(u8 taskId)
gTasks[taskId].tData15 = 16;
for (i = 0; i < PARTY_SIZE; i++)
gSprites[ballIconSpriteIds[i]].oam.objMode = 1;
gSprites[ballIconSpriteIds[i]].oam.objMode = ST_OAM_OBJ_BLEND;
gSprites[summaryBarSpriteId].oam.objMode = 1;
gSprites[summaryBarSpriteId].oam.objMode = ST_OAM_OBJ_BLEND;
if (isBattleStart)
{
+76 -75
View File
@@ -26,7 +26,7 @@
#include "link_rfu.h"
#include "load_save.h"
#include "main.h"
#include "alloc.h"
#include "malloc.h"
#include "m4a.h"
#include "palette.h"
#include "party_menu.h"
@@ -54,6 +54,7 @@
#include "constants/hold_effects.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/party_menu.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/species.h"
@@ -166,8 +167,8 @@ EWRAM_DATA static u32 sUnusedUnknownArray[25] = {0};
EWRAM_DATA u32 gBattleTypeFlags = 0;
EWRAM_DATA u8 gBattleTerrain = 0;
EWRAM_DATA u32 gUnknown_02022FF4 = 0;
EWRAM_DATA struct UnknownPokemonStruct4 gUnknown_02022FF8[3] = {0}; // what is it used for?
EWRAM_DATA struct UnknownPokemonStruct4* gUnknown_02023058 = NULL; // what is it used for?
EWRAM_DATA struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE] = {0};
EWRAM_DATA static struct UnknownPokemonStruct4* sMultiPartnerPartyBuffer = NULL;
EWRAM_DATA u8 *gUnknown_0202305C = NULL;
EWRAM_DATA u8 *gUnknown_02023060 = NULL;
EWRAM_DATA u8 gBattleBufferA[MAX_BATTLERS_COUNT][0x200] = {0};
@@ -453,7 +454,7 @@ const u8 gTypeEffectiveness[336] =
TYPE_ENDTABLE, TYPE_ENDTABLE, TYPE_MUL_NO_EFFECT
};
const u8 gTypeNames[][TYPE_NAME_LENGTH + 1] =
const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1] =
{
_("NORMAL"),
_("FIGHT"),
@@ -686,7 +687,7 @@ static void CB2_InitBattleInternal(void)
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
gBattleTerrain = BATTLE_TERRAIN_BUILDING;
sub_80356D0();
InitBattleBgsVideo();
LoadBattleTextboxAndBackground();
ResetSpriteData();
ResetTasks();
@@ -714,7 +715,7 @@ static void CB2_InitBattleInternal(void)
}
gMain.inBattle = TRUE;
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE;
for (i = 0; i < PARTY_SIZE; i++)
AdjustFriendship(&gPlayerParty[i], 3);
@@ -1023,7 +1024,7 @@ static void CB2_HandleStartBattle(void)
ResetBlockReceivedFlags();
sub_8036EB8(2, playerMultiplayerId);
SetAllPlayersBerryData();
taskId = CreateTask(sub_8035D74, 0);
taskId = CreateTask(InitLinkBattleVsScreen, 0);
gTasks[taskId].data[1] = 0x10E;
gTasks[taskId].data[2] = 0x5A;
gTasks[taskId].data[5] = 0;
@@ -1225,7 +1226,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
ResetBlockReceivedFlags();
sub_8036EB8(2, playerMultiplayerId);
SetAllPlayersBerryData();
taskId = CreateTask(sub_8035D74, 0);
taskId = CreateTask(InitLinkBattleVsScreen, 0);
gTasks[taskId].data[1] = 0x10E;
gTasks[taskId].data[2] = 0x5A;
gTasks[taskId].data[5] = 0;
@@ -1248,12 +1249,12 @@ static void CB2_HandleStartMultiPartnerBattle(void)
if (gLinkPlayers[playerMultiplayerId].id != 0)
{
memcpy(gPlayerParty, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
memcpy(gPlayerParty + 3, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2);
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2);
}
else
{
memcpy(gPlayerParty, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2);
memcpy(gPlayerParty + 3, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
}
gBattleCommunication[MULTIUSE_STATE]++;
}
@@ -1396,22 +1397,22 @@ static void sub_80379F8(u8 arrayIdPlus)
{
s32 i;
for (i = 0; i < 3; i++)
for (i = 0; i < (int)ARRAY_COUNT(gMultiPartnerParty); i++)
{
gUnknown_02022FF8[i].species = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_SPECIES);
gUnknown_02022FF8[i].heldItem = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_HELD_ITEM);
GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_NICKNAME, gUnknown_02022FF8[i].nickname);
gUnknown_02022FF8[i].level = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_LEVEL);
gUnknown_02022FF8[i].hp = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_HP);
gUnknown_02022FF8[i].maxhp = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_MAX_HP);
gUnknown_02022FF8[i].status = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_STATUS);
gUnknown_02022FF8[i].personality = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_PERSONALITY);
gUnknown_02022FF8[i].gender = GetMonGender(&gPlayerParty[arrayIdPlus + i]);
StripExtCtrlCodes(gUnknown_02022FF8[i].nickname);
gMultiPartnerParty[i].species = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_SPECIES);
gMultiPartnerParty[i].heldItem = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_HELD_ITEM);
GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_NICKNAME, gMultiPartnerParty[i].nickname);
gMultiPartnerParty[i].level = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_LEVEL);
gMultiPartnerParty[i].hp = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_HP);
gMultiPartnerParty[i].maxhp = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_MAX_HP);
gMultiPartnerParty[i].status = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_STATUS);
gMultiPartnerParty[i].personality = GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_PERSONALITY);
gMultiPartnerParty[i].gender = GetMonGender(&gPlayerParty[arrayIdPlus + i]);
StripExtCtrlCodes(gMultiPartnerParty[i].nickname);
if (GetMonData(&gPlayerParty[arrayIdPlus + i], MON_DATA_LANGUAGE) != LANGUAGE_JAPANESE)
PadNameString(gUnknown_02022FF8[i].nickname, CHAR_SPACE);
PadNameString(gMultiPartnerParty[i].nickname, CHAR_SPACE);
}
memcpy(gUnknown_02023058, gUnknown_02022FF8, sizeof(gUnknown_02022FF8));
memcpy(sMultiPartnerPartyBuffer, gMultiPartnerParty, sizeof(gMultiPartnerParty));
}
static void CB2_PreInitMultiBattle(void)
@@ -1443,9 +1444,9 @@ static void CB2_PreInitMultiBattle(void)
case 0:
if (gReceivedRemoteLinkPlayers != 0 && IsLinkTaskFinished())
{
gUnknown_02023058 = Alloc(sizeof(struct UnknownPokemonStruct4) * 3);
sMultiPartnerPartyBuffer = Alloc(sizeof(struct UnknownPokemonStruct4) * ARRAY_COUNT(gMultiPartnerParty));
sub_80379F8(0);
SendBlock(bitmask_all_link_players_but_self(), gUnknown_02023058, sizeof(struct UnknownPokemonStruct4) * 3);
SendBlock(bitmask_all_link_players_but_self(), sMultiPartnerPartyBuffer, sizeof(struct UnknownPokemonStruct4) * ARRAY_COUNT(gMultiPartnerParty));
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
@@ -1458,24 +1459,24 @@ static void CB2_PreInitMultiBattle(void)
if (i == playerMultiplierId)
continue;
if (numPlayers == 4)
if (numPlayers == MAX_LINK_PLAYERS)
{
if ((!(gLinkPlayers[i].id & 1) && !(gLinkPlayers[playerMultiplierId].id & 1))
|| (gLinkPlayers[i].id & 1 && gLinkPlayers[playerMultiplierId].id & 1))
{
memcpy(gUnknown_02022FF8, gBlockRecvBuffer[i], sizeof(struct UnknownPokemonStruct4) * 3);
memcpy(gMultiPartnerParty, gBlockRecvBuffer[i], sizeof(struct UnknownPokemonStruct4) * ARRAY_COUNT(gMultiPartnerParty));
}
}
else
{
memcpy(gUnknown_02022FF8, gBlockRecvBuffer[i], sizeof(struct UnknownPokemonStruct4) * 3);
memcpy(gMultiPartnerParty, gBlockRecvBuffer[i], sizeof(struct UnknownPokemonStruct4) * ARRAY_COUNT(gMultiPartnerParty));
}
}
gBattleCommunication[MULTIUSE_STATE]++;
*savedCallback = gMain.savedCallback;
*savedBattleTypeFlags = gBattleTypeFlags;
gMain.savedCallback = CB2_PreInitMultiBattle;
sub_81B9150();
ShowPartyMenuToShowcaseMultiBattleParty();
}
break;
case 2:
@@ -1491,13 +1492,13 @@ static void CB2_PreInitMultiBattle(void)
case 3:
if (gWirelessCommType)
{
if (sub_8010500())
if (IsLinkRfuTaskFinished())
{
gBattleTypeFlags = *savedBattleTypeFlags;
gMain.savedCallback = *savedCallback;
SetMainCallback2(CB2_InitBattleInternal);
Free(gUnknown_02023058);
gUnknown_02023058 = NULL;
Free(sMultiPartnerPartyBuffer);
sMultiPartnerPartyBuffer = NULL;
}
}
else if (gReceivedRemoteLinkPlayers == 0)
@@ -1505,8 +1506,8 @@ static void CB2_PreInitMultiBattle(void)
gBattleTypeFlags = *savedBattleTypeFlags;
gMain.savedCallback = *savedCallback;
SetMainCallback2(CB2_InitBattleInternal);
Free(gUnknown_02023058);
gUnknown_02023058 = NULL;
Free(sMultiPartnerPartyBuffer);
sMultiPartnerPartyBuffer = NULL;
}
break;
}
@@ -1527,13 +1528,13 @@ static void CB2_PreInitIngamePlayerPartnerBattle(void)
switch (gBattleCommunication[MULTIUSE_STATE])
{
case 0:
gUnknown_02023058 = Alloc(sizeof(struct UnknownPokemonStruct4) * 3);
sMultiPartnerPartyBuffer = Alloc(sizeof(struct UnknownPokemonStruct4) * ARRAY_COUNT(gMultiPartnerParty));
sub_80379F8(3);
gBattleCommunication[MULTIUSE_STATE]++;
*savedCallback = gMain.savedCallback;
*savedBattleTypeFlags = gBattleTypeFlags;
gMain.savedCallback = CB2_PreInitIngamePlayerPartnerBattle;
sub_81B9150();
ShowPartyMenuToShowcaseMultiBattleParty();
break;
case 1:
if (!gPaletteFade.active)
@@ -1542,8 +1543,8 @@ static void CB2_PreInitIngamePlayerPartnerBattle(void)
gBattleTypeFlags = *savedBattleTypeFlags;
gMain.savedCallback = *savedCallback;
SetMainCallback2(CB2_InitBattleInternal);
Free(gUnknown_02023058);
gUnknown_02023058 = NULL;
Free(sMultiPartnerPartyBuffer);
sMultiPartnerPartyBuffer = NULL;
}
break;
}
@@ -1611,7 +1612,7 @@ static void CB2_HandleStartMultiBattle(void)
sub_8036EB8(4, playerMultiplayerId);
SetAllPlayersBerryData();
SetDeoxysStats();
var = CreateTask(sub_8035D74, 0);
var = CreateTask(InitLinkBattleVsScreen, 0);
gTasks[var].data[1] = 0x10E;
gTasks[var].data[2] = 0x5A;
gTasks[var].data[5] = 0;
@@ -1666,7 +1667,7 @@ static void CB2_HandleStartMultiBattle(void)
break;
case 1:
case 2:
memcpy(gPlayerParty + 3, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
break;
}
}
@@ -1683,7 +1684,7 @@ static void CB2_HandleStartMultiBattle(void)
break;
case 1:
case 2:
memcpy(gPlayerParty + 3, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
break;
}
}
@@ -1697,7 +1698,7 @@ static void CB2_HandleStartMultiBattle(void)
break;
case 1:
case 2:
memcpy(gEnemyParty + 3, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
memcpy(gEnemyParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
break;
}
}
@@ -1790,9 +1791,9 @@ static void CB2_HandleStartMultiBattle(void)
gBattleCommunication[SPRITES_INIT_STATE2] = 0;
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{
for (id = 0; id < 4 && (gLinkPlayers[id].version & 0xFF) == 3; id++);
for (id = 0; id < MAX_LINK_PLAYERS && (gLinkPlayers[id].version & 0xFF) == VERSION_EMERALD; id++);
if (id == 4)
if (id == MAX_LINK_PLAYERS)
gBattleCommunication[MULTIUSE_STATE] = 8;
else
gBattleCommunication[MULTIUSE_STATE] = 10;
@@ -2249,7 +2250,7 @@ void sub_8038D64(void)
gBattle_BG3_X = 0;
gBattle_BG3_Y = 0;
sub_80356D0();
InitBattleBgsVideo();
LoadCompressedPalette(gBattleTextboxPalette, 0, 64);
LoadBattleMenuWindowGfx();
ResetSpriteData();
@@ -2260,7 +2261,7 @@ void sub_8038D64(void)
gReservedSpritePaletteCount = 4;
SetVBlankCallback(VBlankCB_Battle);
taskId = CreateTask(sub_8035D74, 0);
taskId = CreateTask(InitLinkBattleVsScreen, 0);
gTasks[taskId].data[1] = 0x10E;
gTasks[taskId].data[2] = 0x5A;
gTasks[taskId].data[5] = 1;
@@ -2314,7 +2315,7 @@ static void sub_8038F34(void)
for (i = 0; i < monsCount && (gLinkPlayers[i].version & 0xFF) == VERSION_EMERALD; i++);
if (!gSaveBlock2Ptr->frontier.field_CA9_b && i == monsCount)
if (!gSaveBlock2Ptr->frontier.disableRecordBattle && i == monsCount)
{
if (FlagGet(FLAG_SYS_FRONTIER_PASS))
{
@@ -2445,7 +2446,7 @@ static void sub_80392A8(void)
gBattle_BG2_Y = 0;
gBattle_BG3_X = 0;
gBattle_BG3_Y = 0;
sub_80356D0();
InitBattleBgsVideo();
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
LoadBattleMenuWindowGfx();
@@ -2593,7 +2594,7 @@ static void sub_803939C(void)
}
else
{
BattleStringExpandPlaceholdersToDisplayedString(gText_BattleRecordCouldntBeSaved);
BattleStringExpandPlaceholdersToDisplayedString(BattleFrontier_BattleTowerBattleRoom_Text_RecordCouldntBeSaved);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
gBattleCommunication[1] = 0x80;
gBattleCommunication[MULTIUSE_STATE]++;
@@ -3953,7 +3954,7 @@ static void TryDoEventsBeforeFirstTurn(void)
*(&gBattleStruct->turnEffectsBattlerId) = 0;
*(&gBattleStruct->wishPerishSongState) = 0;
*(&gBattleStruct->wishPerishSongBattlerId) = 0;
gBattleScripting.atk49_state = 0;
gBattleScripting.moveendState = 0;
gBattleStruct->faintedActionsState = 0;
gBattleStruct->turnCountersTracker = 0;
gMoveResultFlags = 0;
@@ -4016,7 +4017,7 @@ void BattleTurnPassed(void)
gHitMarker &= ~(HITMARKER_x100000);
gBattleScripting.animTurn = 0;
gBattleScripting.animTargetsHit = 0;
gBattleScripting.atk49_state = 0;
gBattleScripting.moveendState = 0;
gBattleMoveDamage = 0;
gMoveResultFlags = 0;
@@ -4121,34 +4122,34 @@ u8 IsRunningFromBattleImpossible(void)
return 0;
}
void sub_803BDA0(u8 battler)
void SwitchPartyOrder(u8 battler)
{
s32 i;
u8 r4;
u8 r1;
u8 partyId1;
u8 partyId2;
// gBattleStruct->field_60[battler][i]
for (i = 0; i < 3; i++)
gUnknown_0203CF00[i] = *(battler * 3 + i + (u8*)(gBattleStruct->field_60));
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8*)(gBattleStruct->field_60));
r4 = pokemon_order_func(gBattlerPartyIndexes[battler]);
r1 = pokemon_order_func(*(gBattleStruct->monToSwitchIntoId + battler));
sub_81B8FB0(r4, r1);
partyId1 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]);
partyId2 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler));
SwitchPartyMonSlots(partyId1, partyId2);
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
{
for (i = 0; i < 3; i++)
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
{
*(battler * 3 + i + (u8*)(gBattleStruct->field_60)) = gUnknown_0203CF00[i];
*(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->field_60)) = gUnknown_0203CF00[i];
*(battler * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
*(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
}
}
else
{
for (i = 0; i < 3; i++)
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
{
*(battler * 3 + i + (u8*)(gBattleStruct->field_60)) = gUnknown_0203CF00[i];
*(battler * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
}
}
}
@@ -4244,7 +4245,7 @@ static void HandleTurnActionSelectionState(void)
moveInfo.monType1 = gBattleMons[gActiveBattler].type1;
moveInfo.monType2 = gBattleMons[gActiveBattler].type2;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
moveInfo.moves[i] = gBattleMons[gActiveBattler].moves[i];
moveInfo.currentPp[i] = gBattleMons[gActiveBattler].pp[i];
@@ -4283,7 +4284,7 @@ static void HandleTurnActionSelectionState(void)
|| gBattleTypeFlags & BATTLE_TYPE_ARENA
|| gStatuses3[gActiveBattler] & STATUS3_ROOTED)
{
BtlController_EmitChoosePokemon(0, PARTY_CANT_SWITCH, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
}
else if ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_SHADOW_TAG))
|| ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_ARENA_TRAP))
@@ -4292,16 +4293,16 @@ static void HandleTurnActionSelectionState(void)
|| ((i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0))
&& IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL)))
{
BtlController_EmitChoosePokemon(0, ((i - 1) << 4) | PARTY_ABILITY_PREVENTS, 6, gLastUsedAbility, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gLastUsedAbility, gBattleStruct->field_60[gActiveBattler]);
}
else
{
if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH)
BtlController_EmitChoosePokemon(0, PARTY_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
else if (gActiveBattler == 3 && gChosenActionByBattler[1] == B_ACTION_SWITCH)
BtlController_EmitChoosePokemon(0, PARTY_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
else
BtlController_EmitChoosePokemon(0, PARTY_CHOOSE_MON, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, PARTY_SIZE, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
}
MarkBattlerForControllerExec(gActiveBattler);
break;
@@ -4589,7 +4590,7 @@ static void HandleTurnActionSelectionState(void)
for (i = 0; i < gBattlersCount; i++)
{
if (gChosenActionByBattler[i] == B_ACTION_SWITCH)
sub_80571DC(i, *(gBattleStruct->monToSwitchIntoId + i));
SwitchPartyOrderInGameMulti(i, *(gBattleStruct->monToSwitchIntoId + i));
}
}
}
@@ -5069,7 +5070,7 @@ static void HandleEndTurn_BattleLost(void)
{
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeitedLinkBattle;
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
gSaveBlock2Ptr->frontier.field_CA9_b = 1;
gSaveBlock2Ptr->frontier.disableRecordBattle = TRUE;
}
else
{
@@ -5101,7 +5102,7 @@ static void HandleEndTurn_RanFromBattle(void)
{
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeited;
gBattleOutcome = B_OUTCOME_FORFEITED;
gSaveBlock2Ptr->frontier.field_CA9_b = 1;
gSaveBlock2Ptr->frontier.disableRecordBattle = TRUE;
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
@@ -5720,7 +5721,7 @@ static void HandleAction_Run(void)
}
gBattleOutcome |= B_OUTCOME_LINK_BATTLE_RAN;
gSaveBlock2Ptr->frontier.field_CA9_b = 1;
gSaveBlock2Ptr->frontier.disableRecordBattle = TRUE;
}
else
{
@@ -5884,7 +5885,7 @@ static void HandleAction_ActionFinished(void)
gLastHitByType[gBattlerAttacker] = 0;
gBattleStruct->dynamicMoveType = 0;
gDynamicBasePower = 0;
gBattleScripting.atk49_state = 0;
gBattleScripting.moveendState = 0;
gBattleCommunication[3] = 0;
gBattleCommunication[4] = 0;
gBattleScripting.multihitMoveEffect = 0;
+10 -8
View File
@@ -20,9 +20,11 @@
#include "trainer_hill.h"
#include "window.h"
#include "constants/battle_string_ids.h"
#include "constants/frontier_util.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/trainers.h"
#include "constants/trainer_hill.h"
struct BattleWindowText
{
@@ -874,8 +876,8 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_FORFEITEDMATCH - 12] = sText_ForfeitedMatch,
[STRINGID_PKMNTRANSFERREDSOMEONESPC - 12] = gText_PkmnTransferredSomeonesPC,
[STRINGID_PKMNTRANSFERREDLANETTESPC - 12] = gText_PkmnTransferredLanettesPC,
[STRINGID_PKMNBOXSOMEONESPCFULL - 12] = gText_PkmnBoxSomeonesPCFull,
[STRINGID_PKMNBOXLANETTESPCFULL - 12] = gText_PkmnBoxLanettesPCFull,
[STRINGID_PKMNBOXSOMEONESPCFULL - 12] = gText_PkmnTransferredSomeonesPCBoxFull,
[STRINGID_PKMNBOXLANETTESPCFULL - 12] = gText_PkmnTransferredLanettesPCBoxFull,
[STRINGID_TRAINER1WINTEXT - 12] = sText_Trainer1WinText,
[STRINGID_TRAINER2WINTEXT - 12] = sText_Trainer2WinText,
};
@@ -1193,7 +1195,7 @@ const u8 gText_Love[] = _("love");
const u8 gText_SpaceAndSpace[] = _(" and ");
const u8 gText_CommaSpace[] = _(", ");
const u8 gText_Space2[] = _(" ");
const u8 gText_ScrollTextUp[] = _("\l");
const u8 gText_LineBreak[] = _("\l");
const u8 gText_NewLine[] = _("\n");
const u8 gText_Are[] = _("are");
const u8 gText_Are2[] = _("are");
@@ -2573,7 +2575,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(4, gTrainerBattleOpponent_A);
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_WON, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
}
else
@@ -2589,7 +2591,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(3, gTrainerBattleOpponent_A);
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_LOST, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
}
break;
@@ -2670,7 +2672,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(4, gTrainerBattleOpponent_B);
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_WON, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
}
else
@@ -2686,7 +2688,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(3, gTrainerBattleOpponent_B);
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_LOST, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
}
break;
@@ -2759,7 +2761,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
value = T1_READ_32(&src[srcID + 3]);
break;
}
ConvertIntToDecimalStringN(dst, value, 0, src[srcID + 2]);
ConvertIntToDecimalStringN(dst, value, STR_CONV_MODE_LEFT_ALIGN, src[srcID + 2]);
srcID += src[srcID + 1] + 3;
break;
case B_BUFF_MOVE: // move name
+88 -64
View File
@@ -8,47 +8,71 @@
#include "item.h"
#include "string_util.h"
#include "constants/items.h"
#include "constants/battle_frontier.h"
#include "constants/battle_palace.h"
#include "constants/frontier_util.h"
#include "constants/trainers.h"
// This file's functions.
static void sub_8195980(void);
static void sub_8195A38(void);
static void sub_8195AE4(void);
static void sub_8195BB0(void);
static void sub_8195C20(void);
static void sub_8195C50(void);
static void sub_8195C7C(void);
static void sub_8195CE4(void);
static void sub_8195D28(void);
static void sub_8195DB8(void);
static void InitPalaceChallenge(void);
static void GetPalaceData(void);
static void SetPalaceData(void);
static void GetPalaceCommentId(void);
static void SetPalaceOpponent(void);
static void BufferOpponentIntroSpeech(void);
static void IncrementPalaceStreak(void);
static void SavePalaceChallenge(void);
static void SetRandomPalacePrize(void);
static void GivePalacePrize(void);
// Const rom data.
static void (* const sBattlePalaceFunctions[])(void) =
{
sub_8195980,
sub_8195A38,
sub_8195AE4,
sub_8195BB0,
sub_8195C20,
sub_8195C50,
sub_8195C7C,
sub_8195CE4,
sub_8195D28,
sub_8195DB8,
[BATTLE_PALACE_FUNC_INIT] = InitPalaceChallenge,
[BATTLE_PALACE_FUNC_GET_DATA] = GetPalaceData,
[BATTLE_PALACE_FUNC_SET_DATA] = SetPalaceData,
[BATTLE_PALACE_FUNC_GET_COMMENT_ID] = GetPalaceCommentId,
[BATTLE_PALACE_FUNC_SET_OPPONENT] = SetPalaceOpponent,
[BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO] = BufferOpponentIntroSpeech,
[BATTLE_PALACE_FUNC_INCREMENT_STREAK] = IncrementPalaceStreak,
[BATTLE_PALACE_FUNC_SAVE] = SavePalaceChallenge,
[BATTLE_PALACE_FUNC_SET_PRIZE] = SetRandomPalacePrize,
[BATTLE_PALACE_FUNC_GIVE_PRIZE] = GivePalacePrize,
};
static const u16 gUnknown_0860DE78[] = {ITEM_HP_UP, ITEM_PROTEIN, ITEM_IRON, ITEM_CALCIUM, ITEM_CARBOS, ITEM_ZINC};
static const u16 gUnknown_0860DE84[] = {ITEM_BRIGHT_POWDER, ITEM_WHITE_HERB, ITEM_QUICK_CLAW, ITEM_LEFTOVERS, ITEM_MENTAL_HERB, ITEM_KINGS_ROCK, ITEM_FOCUS_BAND, ITEM_SCOPE_LENS, ITEM_CHOICE_BAND};
static const u32 gUnknown_0860DE98[][2] =
static const u16 sBattlePalaceEarlyPrizes[] =
{
{0x10, 0x20},
{0x400000, 0x800000},
ITEM_HP_UP,
ITEM_PROTEIN,
ITEM_IRON,
ITEM_CALCIUM,
ITEM_CARBOS,
ITEM_ZINC
};
static const u32 gUnknown_0860DEA8[][2] =
static const u16 sBattlePalaceLatePrizes[] =
{
{~0x10, ~0x20},
{~0x400000, ~0x800000},
ITEM_BRIGHT_POWDER,
ITEM_WHITE_HERB,
ITEM_QUICK_CLAW,
ITEM_LEFTOVERS,
ITEM_MENTAL_HERB,
ITEM_KINGS_ROCK,
ITEM_FOCUS_BAND,
ITEM_SCOPE_LENS,
ITEM_CHOICE_BAND
};
static const u32 sWinStreakFlags[][2] =
{
{STREAK_PALACE_SINGLES_50, STREAK_PALACE_SINGLES_OPEN},
{STREAK_PALACE_DOUBLES_50, STREAK_PALACE_DOUBLES_OPEN},
};
static const u32 sWinStreakMasks[][2] =
{
{~(STREAK_PALACE_SINGLES_50), ~(STREAK_PALACE_SINGLES_OPEN)},
{~(STREAK_PALACE_DOUBLES_50), ~(STREAK_PALACE_DOUBLES_OPEN)},
};
// code
@@ -57,64 +81,64 @@ void CallBattlePalaceFunction(void)
sBattlePalaceFunctions[gSpecialVar_0x8004]();
}
static void sub_8195980(void)
static void InitPalaceChallenge(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860DE98[battleMode][lvlMode]))
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE;
if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode]))
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] = 0;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
gTrainerBattleOpponent_A = 0;
}
static void sub_8195A38(void)
static void GetPalaceData(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
switch (gSpecialVar_0x8005)
{
case 0:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_DC6;
case PALACE_DATA_PRIZE:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.palacePrize;
break;
case 1:
case PALACE_DATA_WIN_STREAK:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode];
break;
case 2:
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860DE98[battleMode][lvlMode]) != 0);
case PALACE_DATA_WIN_STREAK_ACTIVE:
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode]) != 0);
break;
}
}
static void sub_8195AE4(void)
static void SetPalaceData(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
switch (gSpecialVar_0x8005)
{
case 0:
gSaveBlock2Ptr->frontier.field_DC6 = gSpecialVar_0x8006;
case PALACE_DATA_PRIZE:
gSaveBlock2Ptr->frontier.palacePrize = gSpecialVar_0x8006;
break;
case 1:
case PALACE_DATA_WIN_STREAK:
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] = gSpecialVar_0x8006;
break;
case 2:
case PALACE_DATA_WIN_STREAK_ACTIVE:
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= gUnknown_0860DE98[battleMode][lvlMode];
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= sWinStreakFlags[battleMode][lvlMode];
else
gSaveBlock2Ptr->frontier.field_CDC &= gUnknown_0860DEA8[battleMode][lvlMode];
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= sWinStreakMasks[battleMode][lvlMode];
break;
}
}
static void sub_8195BB0(void)
static void GetPalaceCommentId(void)
{
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
@@ -127,24 +151,24 @@ static void sub_8195BB0(void)
gSpecialVar_Result = 4;
}
static void sub_8195C20(void)
static void SetPalaceOpponent(void)
{
gTrainerBattleOpponent_A = 5 *(Random() % 255) / 64u;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
}
static void sub_8195C50(void)
static void BufferOpponentIntroSpeech(void)
{
if (gTrainerBattleOpponent_A < 300)
if (gTrainerBattleOpponent_A < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
}
static void sub_8195C7C(void)
static void IncrementPalaceStreak(void)
{
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] < 9999)
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] < MAX_STREAK)
{
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode]++;
@@ -154,31 +178,31 @@ static void sub_8195C7C(void)
}
}
static void sub_8195CE4(void)
static void SavePalaceChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = 1;
sub_81A4C30();
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
SaveGameFrontier();
}
static void sub_8195D28(void)
static void SetRandomPalacePrize(void)
{
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] > 41)
gSaveBlock2Ptr->frontier.field_DC6 = gUnknown_0860DE84[Random() % ARRAY_COUNT(gUnknown_0860DE84)];
gSaveBlock2Ptr->frontier.palacePrize = sBattlePalaceLatePrizes[Random() % ARRAY_COUNT(sBattlePalaceLatePrizes)];
else
gSaveBlock2Ptr->frontier.field_DC6 = gUnknown_0860DE78[Random() % ARRAY_COUNT(gUnknown_0860DE78)];
gSaveBlock2Ptr->frontier.palacePrize = sBattlePalaceEarlyPrizes[Random() % ARRAY_COUNT(sBattlePalaceEarlyPrizes)];
}
static void sub_8195DB8(void)
static void GivePalacePrize(void)
{
if (AddBagItem(gSaveBlock2Ptr->frontier.field_DC6, 1) == TRUE)
if (AddBagItem(gSaveBlock2Ptr->frontier.palacePrize, 1) == TRUE)
{
CopyItemName(gSaveBlock2Ptr->frontier.field_DC6, gStringVar1);
gSaveBlock2Ptr->frontier.field_DC6 = 0;
CopyItemName(gSaveBlock2Ptr->frontier.palacePrize, gStringVar1);
gSaveBlock2Ptr->frontier.palacePrize = 0;
gSpecialVar_Result = TRUE;
}
else
+176 -189
View File
@@ -9,12 +9,13 @@
#include "task.h"
#include "battle_tower.h"
#include "party_menu.h"
#include "alloc.h"
#include "malloc.h"
#include "palette.h"
#include "script.h"
#include "battle_setup.h"
#include "constants/event_objects.h"
#include "constants/battle_frontier.h"
#include "constants/frontier_util.h"
#include "constants/abilities.h"
#include "constants/easy_chat.h"
#include "constants/layouts.h"
@@ -22,20 +23,8 @@
#include "constants/trainers.h"
#include "constants/species.h"
#include "constants/moves.h"
#define PIKE_ROOM_SINGLE_BATTLE 0
#define PIKE_ROOM_HEAL_FULL 1
#define PIKE_ROOM_NPC 2
#define PIKE_ROOM_STATUS 3
#define PIKE_ROOM_HEAL_PART 4
#define PIKE_ROOM_WILD_MONS 5
#define PIKE_ROOM_HARD_BATTLE 6
#define PIKE_ROOM_DOUBLE_BATTLE 7
#define PIKE_ROOM_BRAIN 8
// For the room with a status effect.
#define PIKE_STATUS_KIRLIA 0
#define PIKE_STATUS_DUSCLOPS 1
#include "constants/party_menu.h"
#include "constants/battle_pike.h"
struct PikeRoomNPC
{
@@ -49,13 +38,13 @@ struct PikeWildMon
{
u16 species;
u8 levelDelta;
u16 moves[4];
u16 moves[MAX_MON_MOVES];
};
// IWRAM bss
static u8 sRoomType;
static u8 sStatusMon;
static bool8 sUnknown_0300128E;
static bool8 sInWildMonRoom;
static u32 sStatusFlags;
static u8 sNpcId;
@@ -63,30 +52,30 @@ static u8 sNpcId;
static void SetRoomType(void);
static void GetBattlePikeData(void);
static void SetBattlePikeData(void);
static void GetInFinalRoom(void);
static void IsNextRoomFinal(void);
static void SetupRoomEventObjects(void);
static void GetRoomType(void);
static void sub_81A7400(void);
static void sub_81A740C(void);
static void sub_81A7418(void);
static void SetInWildMonRoom(void);
static void ClearInWildMonRoom(void);
static void SavePikeChallenge(void);
static void nullsub_76(void);
static void nullsub_124(void);
static void GetRoomInflictedStatus(void);
static void GetRoomInflictedStatusMon(void);
static void HealOneOrTwoMons(void);
static void BufferNPCMessage(void);
static void StatusInflictionScreenFade(void);
static void StatusInflictionScreenFlash(void);
static void GetInBattlePike(void);
static void SetHintedRoom(void);
static void GetHintedRoomIndex(void);
static void GetRoomTypeHint(void);
static void ClearPikeTrainerIds(void);
static void BufferRecordMixingTrainerMessage(void);
static void BufferTrainerIntro(void);
static void GetCurrentRoomPikeQueenFightType(void);
static void HealSomeMonsBeforePikeQueen(void);
static void SetHealingRoomsDisabled(void);
static void CanAnyPartyMonsBeHealed(void);
static void BackupMonHeldItems(void);
static void SetHealingroomTypesDisabled(void);
static void IsPartyFullHealed(void);
static void SaveMonHeldItems(void);
static void RestoreMonHeldItems(void);
static void InitPikeChallenge(void);
static u8 GetNextRoomType(void);
@@ -94,7 +83,7 @@ static void PrepareOneTrainer(bool8 difficult);
static u16 GetNPCRoomGraphicsId(void);
static void PrepareTwoTrainers(void);
static void TryHealMons(u8 healCount);
static void Task_DoStatusInflictionScreenFade(u8 taskId);
static void Task_DoStatusInflictionScreenFlash(u8 taskId);
static bool8 AtLeastTwoAliveMons(void);
static u8 SpeciesToPikeMonId(u16 species);
static bool8 CanEncounterWildMon(u8 monLevel);
@@ -431,7 +420,7 @@ static const struct PikeRoomNPC sNPCTable[] =
}
};
static const u16 sNPCSpeeches[][6] =
static const u16 sNPCSpeeches[][EASY_CHAT_BATTLE_WORDS_COUNT] =
{
{EC_WORD_I_AM, EC_WORD_LOST, EC_WORD_I, EC_WORD_NEED, EC_WORD_A, EC_MOVE2(HELPING_HAND)},
{EC_WORD_I_VE, EC_WORD_NO, EC_WORD_SENSE, EC_WORD_OF, EC_WORD_WHERE, EC_WORD_I_AM},
@@ -477,61 +466,61 @@ static const u16 sNPCSpeeches[][6] =
{EC_MOVE2(TOXIC), EC_WORD_IS, EC_WORD_A, EC_WORD_TERRIBLE, EC_WORD_THING, EC_WORD_ISN_T_IT_QUES},
};
// Only the 5th array in this data is used by the code.
static const u8 sPikeQueenWinStreakAppearances[][4] =
// Table duplicated from frontier_util, only Battle Pike entry used
static const u8 sFrontierBrainStreakAppearances[NUM_FRONTIER_FACILITIES][4] =
{
{35, 70, 35, 1},
{ 4, 9, 5, 0},
{21, 42, 21, 1},
{28, 56, 28, 1},
{21, 42, 21, 1},
{28, 140, 56, 1},
{21, 70, 35, 0},
[FRONTIER_FACILITY_TOWER] = {35, 70, 35, 1},
[FRONTIER_FACILITY_DOME] = { 4, 9, 5, 0},
[FRONTIER_FACILITY_PALACE] = {21, 42, 21, 1},
[FRONTIER_FACILITY_ARENA] = {28, 56, 28, 1},
[FRONTIER_FACILITY_FACTORY] = {21, 42, 21, 1},
[FRONTIER_FACILITY_PIKE] = {28, 140, 56, 1},
[FRONTIER_FACILITY_PYRAMID] = {21, 70, 35, 0},
};
static void (* const sBattlePikeFunctions[])(void) =
{
SetRoomType,
GetBattlePikeData,
SetBattlePikeData,
GetInFinalRoom,
SetupRoomEventObjects,
GetRoomType,
sub_81A7400,
sub_81A740C,
sub_81A7418,
nullsub_76,
nullsub_124,
GetRoomInflictedStatus,
GetRoomInflictedStatusMon,
HealOneOrTwoMons,
BufferNPCMessage,
StatusInflictionScreenFade,
GetInBattlePike,
SetHintedRoom,
GetHintedRoomIndex,
GetRoomTypeHint,
ClearPikeTrainerIds,
BufferRecordMixingTrainerMessage,
GetCurrentRoomPikeQueenFightType,
HealSomeMonsBeforePikeQueen,
SetHealingRoomsDisabled,
CanAnyPartyMonsBeHealed,
BackupMonHeldItems,
RestoreMonHeldItems,
InitPikeChallenge
[BATTLE_PIKE_FUNC_SET_ROOM_TYPE] = SetRoomType,
[BATTLE_PIKE_FUNC_GET_DATA] = GetBattlePikeData,
[BATTLE_PIKE_FUNC_SET_DATA] = SetBattlePikeData,
[BATTLE_PIKE_FUNC_IS_FINAL_ROOM] = IsNextRoomFinal,
[BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS] = SetupRoomEventObjects,
[BATTLE_PIKE_FUNC_GET_ROOM_TYPE] = GetRoomType,
[BATTLE_PIKE_FUNC_SET_IN_WILD_MON_ROOM] = SetInWildMonRoom,
[BATTLE_PIKE_FUNC_CLEAR_IN_WILD_MON_ROOM] = ClearInWildMonRoom,
[BATTLE_PIKE_FUNC_SAVE] = SavePikeChallenge,
[BATTLE_PIKE_FUNC_NULL_9] = nullsub_76,
[BATTLE_PIKE_FUNC_NULL_10] = nullsub_124,
[BATTLE_PIKE_FUNC_GET_ROOM_STATUS] = GetRoomInflictedStatus,
[BATTLE_PIKE_FUNC_GET_ROOM_STATUS_MON] = GetRoomInflictedStatusMon,
[BATTLE_PIKE_FUNC_HEAL_ONE_TWO_MONS] = HealOneOrTwoMons,
[BATTLE_PIKE_FUNC_BUFFER_NPC_MSG] = BufferNPCMessage,
[BATTLE_PIKE_FUNC_STATUS_SCREEN_FLASH] = StatusInflictionScreenFlash,
[BATTLE_PIKE_FUNC_IS_IN] = GetInBattlePike,
[BATTLE_PIKE_FUNC_SET_HINT_ROOM] = SetHintedRoom,
[BATTLE_PIKE_FUNC_GET_HINT_ROOM_ID] = GetHintedRoomIndex,
[BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT] = GetRoomTypeHint,
[BATTLE_PIKE_FUNC_CLEAR_TRAINER_IDS] = ClearPikeTrainerIds,
[BATTLE_PIKE_FUNC_GET_TRAINER_INTRO] = BufferTrainerIntro,
[BATTLE_PIKE_FUNC_GET_QUEEN_FIGHT_TYPE] = GetCurrentRoomPikeQueenFightType,
[BATTLE_PIKE_FUNC_HEAL_MONS_BEFORE_QUEEN] = HealSomeMonsBeforePikeQueen,
[BATTLE_PIKE_FUNC_SET_HEAL_ROOMS_DISABLED] = SetHealingroomTypesDisabled,
[BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH] = IsPartyFullHealed,
[BATTLE_PIKE_FUNC_SAVE_HELD_ITEMS] = SaveMonHeldItems,
[BATTLE_PIKE_FUNC_RESET_HELD_ITEMS] = RestoreMonHeldItems,
[BATTLE_PIKE_FUNC_INIT] = InitPikeChallenge
};
static const u8 sRoomTypeHints[] = {
3, // PIKE_ROOM_SINGLE_BATTLE
3, // PIKE_ROOM_HEAL_FULL
1, // PIKE_ROOM_NPC
0, // PIKE_ROOM_STATUS
0, // PIKE_ROOM_HEAL_PART
2, // PIKE_ROOM_WILD_MONS
2, // PIKE_ROOM_HARD_BATTLE
1, // PIKE_ROOM_DOUBLE_BATTLE
4, // PIKE_ROOM_BRAIN
PIKE_HINT_PEOPLE, // PIKE_ROOM_SINGLE_BATTLE
PIKE_HINT_PEOPLE, // PIKE_ROOM_HEAL_FULL
PIKE_HINT_WHISPERING, // PIKE_ROOM_NPC
PIKE_HINT_NOSTALGIA, // PIKE_ROOM_STATUS
PIKE_HINT_NOSTALGIA, // PIKE_ROOM_HEAL_PART
PIKE_HINT_POKEMON, // PIKE_ROOM_WILD_MONS
PIKE_HINT_POKEMON, // PIKE_ROOM_HARD_BATTLE
PIKE_HINT_WHISPERING, // PIKE_ROOM_DOUBLE_BATTLE
PIKE_HINT_BRAIN, // PIKE_ROOM_BRAIN
};
static const u8 sNumMonsToHealBeforePikeQueen[][3] =
@@ -544,12 +533,12 @@ static const u8 sNumMonsToHealBeforePikeQueen[][3] =
{0, 1, 2},
};
static bool8 (* const sStatusInflictionScreenFadeFuncs[])(struct Task *) =
static bool8 (* const sStatusInflictionScreenFlashFuncs[])(struct Task *) =
{
StatusInflictionFadeOut, StatusInflictionFadeIn
};
static const u32 gUnknown_08612690[] = {0x400, 0x800};
static const u32 sWinStreakFlags[] = {STREAK_PIKE_50, STREAK_PIKE_OPEN};
// code
void CallBattlePikeFunction(void)
@@ -590,7 +579,7 @@ static void SetupRoomEventObjects(void)
break;
case PIKE_ROOM_STATUS:
objGfx1 = EVENT_OBJ_GFX_GENTLEMAN;
if (sStatusMon == PIKE_STATUS_DUSCLOPS)
if (sStatusMon == PIKE_STATUSMON_DUSCLOPS)
objGfx2 = EVENT_OBJ_GFX_DUSCLOPS;
else
objGfx2 = EVENT_OBJ_GFX_KIRLIA;
@@ -634,23 +623,23 @@ static void GetBattlePikeData(void)
switch (gSpecialVar_0x8005)
{
case 0:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_E02;
case PIKE_DATA_PRIZE:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pikePrize;
break;
case 1:
case PIKE_DATA_WIN_STREAK:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pikeWinStreaks[gSaveBlock2Ptr->frontier.lvlMode];
break;
case 2:
case PIKE_DATA_RECORD_STREAK:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pikeRecordStreaks[gSaveBlock2Ptr->frontier.lvlMode];
break;
case 3:
case PIKE_DATA_TOTAL_STREAKS:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pikeTotalStreaks[gSaveBlock2Ptr->frontier.lvlMode];
break;
case 4:
case PIKE_DATA_WIN_STREAK_ACTIVE:
if (lvlMode != FRONTIER_LVL_50)
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x800;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PIKE_OPEN;
else
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x400;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PIKE_50;
break;
}
}
@@ -661,41 +650,41 @@ static void SetBattlePikeData(void)
switch (gSpecialVar_0x8005)
{
case 0:
gSaveBlock2Ptr->frontier.field_E02 = gSpecialVar_0x8006;
case PIKE_DATA_PRIZE:
gSaveBlock2Ptr->frontier.pikePrize = gSpecialVar_0x8006;
break;
case 1:
if (gSpecialVar_0x8006 <= 9999)
case PIKE_DATA_WIN_STREAK:
if (gSpecialVar_0x8006 <= MAX_STREAK)
gSaveBlock2Ptr->frontier.pikeWinStreaks[gSaveBlock2Ptr->frontier.lvlMode] = gSpecialVar_0x8006;
break;
case 2:
if (gSpecialVar_0x8006 <= 9999 && gSaveBlock2Ptr->frontier.pikeRecordStreaks[gSaveBlock2Ptr->frontier.lvlMode] < gSpecialVar_0x8006)
case PIKE_DATA_RECORD_STREAK:
if (gSpecialVar_0x8006 <= MAX_STREAK && gSaveBlock2Ptr->frontier.pikeRecordStreaks[gSaveBlock2Ptr->frontier.lvlMode] < gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.pikeRecordStreaks[gSaveBlock2Ptr->frontier.lvlMode] = gSpecialVar_0x8006;
break;
case 3:
if (gSpecialVar_0x8006 <= 9999)
case PIKE_DATA_TOTAL_STREAKS:
if (gSpecialVar_0x8006 <= MAX_STREAK)
gSaveBlock2Ptr->frontier.pikeTotalStreaks[gSaveBlock2Ptr->frontier.lvlMode] = gSpecialVar_0x8006;
break;
case 4:
case PIKE_DATA_WIN_STREAK_ACTIVE:
if (lvlMode != FRONTIER_LVL_50)
{
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= 0x800;
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= STREAK_PIKE_OPEN;
else
gSaveBlock2Ptr->frontier.field_CDC &= ~(0x800);
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_PIKE_OPEN);
}
else
{
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= 0x400;
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= STREAK_PIKE_50;
else
gSaveBlock2Ptr->frontier.field_CDC &= ~(0x400);
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_PIKE_50);
}
break;
}
}
static void GetInFinalRoom(void)
static void IsNextRoomFinal(void)
{
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > 14)
gSpecialVar_Result = TRUE;
@@ -708,21 +697,21 @@ static void GetRoomType(void)
gSpecialVar_Result = sRoomType;
}
static void sub_81A7400(void)
static void SetInWildMonRoom(void)
{
sUnknown_0300128E = TRUE;
sInWildMonRoom = TRUE;
}
static void sub_81A740C(void)
static void ClearInWildMonRoom(void)
{
sUnknown_0300128E = FALSE;
sInWildMonRoom = FALSE;
}
static void sub_81A7418(void)
static void SavePikeChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = 1;
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
save_serialize_map();
TrySavingData(SAVE_LINK);
}
@@ -742,19 +731,19 @@ static void GetRoomInflictedStatus(void)
switch (sStatusFlags)
{
case STATUS1_FREEZE:
gSpecialVar_Result = 0;
gSpecialVar_Result = PIKE_STATUS_FREEZE;
break;
case STATUS1_BURN:
gSpecialVar_Result = 1;
gSpecialVar_Result = PIKE_STATUS_BURN;
break;
case STATUS1_TOXIC_POISON:
gSpecialVar_Result = 2;
gSpecialVar_Result = PIKE_STATUS_TOXIC;
break;
case STATUS1_PARALYSIS:
gSpecialVar_Result = 3;
gSpecialVar_Result = PIKE_STATUS_PARALYSIS;
break;
case STATUS1_SLEEP:
gSpecialVar_Result = 4;
gSpecialVar_Result = PIKE_STATUS_SLEEP;
break;
}
}
@@ -785,9 +774,9 @@ static void BufferNPCMessage(void)
FrontierSpeechToString(sNPCSpeeches[speechId]);
}
static void StatusInflictionScreenFade(void)
static void StatusInflictionScreenFlash(void)
{
CreateTask(Task_DoStatusInflictionScreenFade, 2);
CreateTask(Task_DoStatusInflictionScreenFlash, 2);
}
static void HealMon(struct Pokemon *mon)
@@ -935,7 +924,7 @@ static bool8 TryInflictRandomStatus(void)
for (i = 0; i < 3; i++)
{
mon = &gPlayerParty[indices[i]];
if (pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS)) == 0
if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE
&& GetMonData(mon, MON_DATA_HP) != 0)
{
j++;
@@ -957,19 +946,19 @@ static bool8 TryInflictRandomStatus(void)
switch (sStatusFlags)
{
case STATUS1_FREEZE:
sStatusMon = PIKE_STATUS_DUSCLOPS;
sStatusMon = PIKE_STATUSMON_DUSCLOPS;
break;
case STATUS1_BURN:
if (Random() % 2 != 0)
sStatusMon = PIKE_STATUS_DUSCLOPS;
sStatusMon = PIKE_STATUSMON_DUSCLOPS;
else
sStatusMon = PIKE_STATUS_KIRLIA;
sStatusMon = PIKE_STATUSMON_KIRLIA;
break;
case STATUS1_PARALYSIS:
case STATUS1_SLEEP:
case STATUS1_TOXIC_POISON:
default:
sStatusMon = PIKE_STATUS_KIRLIA;
sStatusMon = PIKE_STATUSMON_KIRLIA;
break;
}
@@ -977,7 +966,7 @@ static bool8 TryInflictRandomStatus(void)
for (i = 0; i < 3; i++)
{
mon = &gPlayerParty[indices[i]];
if (pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS)) == 0
if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE
&& GetMonData(mon, MON_DATA_HP) != 0)
{
j++;
@@ -1009,7 +998,7 @@ static bool8 AtLeastOneHealthyMon(void)
for (i = 0; i < 3; i++)
{
struct Pokemon *mon = &gPlayerParty[i];
if (pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS)) == 0
if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE
&& GetMonData(mon, MON_DATA_HP) != 0)
{
healthyMonsCount++;
@@ -1026,10 +1015,10 @@ static bool8 AtLeastOneHealthyMon(void)
static u8 GetNextRoomType(void)
{
u8 roomTypesAvailability[8];
bool8 roomTypesDisabled[NUM_PIKE_ROOM_TYPES - 1]; // excludes Brain room, which cant be disabled
u8 i;
u8 nextRoomType;
u8 roomTypeGroup;
u8 roomHint;
u8 numRoomCandidates;
u8 *roomCandidates;
u8 id;
@@ -1045,54 +1034,54 @@ static u8 GetNextRoomType(void)
return gSaveBlock2Ptr->frontier.pikeHintedRoomType;
}
for (i = 0; i < 8; i++)
roomTypesAvailability[i] = 0;
for (i = 0; i < ARRAY_COUNT(roomTypesDisabled); i++)
roomTypesDisabled[i] = FALSE;
numRoomCandidates = 8;
numRoomCandidates = NUM_PIKE_ROOM_TYPES - 1;
// The room types associated with the lady's hint cannot be in the other two rooms.
roomTypeGroup = sRoomTypeHints[gSaveBlock2Ptr->frontier.pikeHintedRoomType];
for (i = 0; i < 8; i++)
// The other two room types cannot be the same type as the one associated with the lady's hint
roomHint = sRoomTypeHints[gSaveBlock2Ptr->frontier.pikeHintedRoomType];
for (i = 0; i < ARRAY_COUNT(roomTypesDisabled); i++)
{
if (sRoomTypeHints[i] == roomTypeGroup)
if (sRoomTypeHints[i] == roomHint)
{
roomTypesAvailability[i] = 1;
roomTypesDisabled[i] = TRUE;
numRoomCandidates--;
}
}
// Remove room type candidates that would have no effect on the player's party.
if (roomTypesAvailability[PIKE_ROOM_DOUBLE_BATTLE] != 1 && !AtLeastTwoAliveMons())
if (roomTypesDisabled[PIKE_ROOM_DOUBLE_BATTLE] != TRUE && !AtLeastTwoAliveMons())
{
roomTypesAvailability[PIKE_ROOM_DOUBLE_BATTLE] = 1;
roomTypesDisabled[PIKE_ROOM_DOUBLE_BATTLE] = TRUE;
numRoomCandidates--;
}
if (roomTypesAvailability[PIKE_ROOM_STATUS] != 1 && !AtLeastOneHealthyMon())
if (roomTypesDisabled[PIKE_ROOM_STATUS] != TRUE && !AtLeastOneHealthyMon())
{
roomTypesAvailability[PIKE_ROOM_STATUS] = 1;
roomTypesDisabled[PIKE_ROOM_STATUS] = TRUE;
numRoomCandidates--;
}
// Remove healing room type candidates if healing rooms are disabled.
if (gSaveBlock2Ptr->frontier.pikeHealingRoomsDisabled)
{
if (roomTypesAvailability[PIKE_ROOM_HEAL_FULL] != 1)
if (roomTypesDisabled[PIKE_ROOM_HEAL_FULL] != TRUE)
{
roomTypesAvailability[PIKE_ROOM_HEAL_FULL] = 1;
roomTypesDisabled[PIKE_ROOM_HEAL_FULL] = TRUE;
numRoomCandidates--;
}
if (roomTypesAvailability[PIKE_ROOM_HEAL_PART] != 1)
if (roomTypesDisabled[PIKE_ROOM_HEAL_PART] != TRUE)
{
roomTypesAvailability[PIKE_ROOM_HEAL_PART] = 1;
roomTypesDisabled[PIKE_ROOM_HEAL_PART] = TRUE;
numRoomCandidates--;
}
}
roomCandidates = AllocZeroed(numRoomCandidates);
id = 0;
for (i = 0; i < 8; i++)
for (i = 0; i < ARRAY_COUNT(roomTypesDisabled); i++)
{
if (roomTypesAvailability[i] == 0)
if (roomTypesDisabled[i] == FALSE)
roomCandidates[id++] = i;
}
@@ -1110,9 +1099,10 @@ static u16 GetNPCRoomGraphicsId(void)
return sNPCTable[sNpcId].graphicsId;
}
static u8 sub_81A7B84(void)
// Unused
static u8 GetInWildMonRoom(void)
{
return sUnknown_0300128E;
return sInWildMonRoom;
}
bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate)
@@ -1182,9 +1172,9 @@ u8 GetBattlePikeWildMonHeaderId(void)
return headerId;
}
static void DoStatusInflictionScreenFade(u8 taskId)
static void DoStatusInflictionScreenFlash(u8 taskId)
{
while (sStatusInflictionScreenFadeFuncs[gTasks[taskId].data[0]](&gTasks[taskId]));
while (sStatusInflictionScreenFlashFuncs[gTasks[taskId].data[0]](&gTasks[taskId]));
}
static bool8 StatusInflictionFadeOut(struct Task *task)
@@ -1221,7 +1211,7 @@ static bool8 StatusInflictionFadeIn(struct Task *task)
{
if (--task->data[3] == 0)
{
DestroyTask(FindTaskIdByFunc(DoStatusInflictionScreenFade));
DestroyTask(FindTaskIdByFunc(DoStatusInflictionScreenFlash));
}
else
{
@@ -1232,9 +1222,9 @@ static bool8 StatusInflictionFadeIn(struct Task *task)
return FALSE;
}
static void StartStatusInflictionScreenFade(s16 fadeOutDelay, s16 fadeInDelay, s16 numFades, s16 fadeOutSpeed, s16 fadeInSpped)
static void StartStatusInflictionScreenFlash(s16 fadeOutDelay, s16 fadeInDelay, s16 numFades, s16 fadeOutSpeed, s16 fadeInSpped)
{
u8 taskId = CreateTask(DoStatusInflictionScreenFade, 3);
u8 taskId = CreateTask(DoStatusInflictionScreenFlash, 3);
gTasks[taskId].data[1] = fadeOutDelay;
gTasks[taskId].data[2] = fadeInDelay;
@@ -1244,24 +1234,24 @@ static void StartStatusInflictionScreenFade(s16 fadeOutDelay, s16 fadeInDelay, s
gTasks[taskId].data[6] = fadeOutDelay;
}
static bool8 IsStatusInflictionScreenFadeTaskFinished(void)
static bool8 IsStatusInflictionScreenFlashTaskFinished(void)
{
if (FindTaskIdByFunc(DoStatusInflictionScreenFade) == 0xFF)
if (FindTaskIdByFunc(DoStatusInflictionScreenFlash) == 0xFF)
return TRUE;
else
return FALSE;
}
static void Task_DoStatusInflictionScreenFade(u8 taskId)
static void Task_DoStatusInflictionScreenFlash(u8 taskId)
{
if (gTasks[taskId].data[0] == 0)
{
gTasks[taskId].data[0]++;
StartStatusInflictionScreenFade(0, 0, 3, 2, 2);
StartStatusInflictionScreenFlash(0, 0, 3, 2, 2);
}
else
{
if (IsStatusInflictionScreenFadeTaskFinished())
if (IsStatusInflictionScreenFlashTaskFinished())
{
EnableBothScriptContexts();
DestroyTask(taskId);
@@ -1298,7 +1288,7 @@ static void TryHealMons(u8 healCount)
{
canBeHealed = TRUE;
}
else if (pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS)) != 0)
else if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) != AILMENT_NONE)
{
canBeHealed = TRUE;
}
@@ -1335,8 +1325,8 @@ static void GetInBattlePike(void)
bool8 InBattlePike(void)
{
return gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM1
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS
|| gMapHeader.mapLayoutId == LAYOUT_UNKNOWN_084693AC;
}
@@ -1345,10 +1335,10 @@ static void SetHintedRoom(void)
u8 i, count, id;
u8 *roomCandidates;
gSpecialVar_Result = 0;
gSpecialVar_Result = FALSE;
if (GetPikeQueenFightType(1))
{
gSpecialVar_Result = 1;
gSpecialVar_Result = TRUE;
gSaveBlock2Ptr->frontier.pikeHintedRoomIndex = Random() % 6;
gSaveBlock2Ptr->frontier.pikeHintedRoomType = PIKE_ROOM_BRAIN;
}
@@ -1356,9 +1346,9 @@ static void SetHintedRoom(void)
{
gSaveBlock2Ptr->frontier.pikeHintedRoomIndex = Random() % 3;
if (gSaveBlock2Ptr->frontier.pikeHealingRoomsDisabled)
count = 6;
count = NUM_PIKE_ROOM_TYPES - 3; // exclude healing rooms and Brain room
else
count = 8;
count = NUM_PIKE_ROOM_TYPES - 1; // exclude Brain room
roomCandidates = AllocZeroed(count);
for (i = 0, id = 0; i < count; i++)
@@ -1385,9 +1375,6 @@ static void SetHintedRoom(void)
static void GetHintedRoomIndex(void)
{
// 0 = left room
// 1 = center room
// 2 = right room
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pikeHintedRoomIndex;
}
@@ -1413,7 +1400,7 @@ static void PrepareOneTrainer(bool8 difficult)
challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14;
do
{
trainerId = sub_8162548(challengeNum, battleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -1438,7 +1425,7 @@ static void PrepareTwoTrainers(void)
gFacilityTrainers = gBattleFrontierTrainers;
do
{
trainerId = sub_8162548(challengeNum, 1);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 1);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -1453,7 +1440,7 @@ static void PrepareTwoTrainers(void)
do
{
trainerId = sub_8162548(challengeNum, 1);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 1);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -1475,16 +1462,16 @@ static void ClearPikeTrainerIds(void)
gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
}
static void BufferRecordMixingTrainerMessage(void)
static void BufferTrainerIntro(void)
{
if (gSpecialVar_0x8005 == 0)
{
if (gTrainerBattleOpponent_A < TRAINER_RECORD_MIXING_FRIEND)
if (gTrainerBattleOpponent_A < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
}
else if (gSpecialVar_0x8005 == 1)
{
if (gTrainerBattleOpponent_B < TRAINER_RECORD_MIXING_FRIEND)
if (gTrainerBattleOpponent_B < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_B].speechBefore);
}
}
@@ -1512,8 +1499,8 @@ static u8 GetPikeQueenFightType(u8 nextRoom)
{
u8 numPikeSymbols;
u8 var = 5;
u8 ret = 0;
u8 facility = FRONTIER_FACILITY_PIKE;
u8 ret = FRONTIER_BRAIN_NOT_READY;
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
u16 winStreak = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode];
winStreak += nextRoom;
@@ -1523,17 +1510,17 @@ static u8 GetPikeQueenFightType(u8 nextRoom)
{
case 0:
case 1:
if (winStreak == sPikeQueenWinStreakAppearances[var][numPikeSymbols] - sPikeQueenWinStreakAppearances[var][3])
ret = numPikeSymbols + 1;
if (winStreak == sFrontierBrainStreakAppearances[facility][numPikeSymbols] - sFrontierBrainStreakAppearances[facility][3])
ret = numPikeSymbols + 1; // FRONTIER_BRAIN_SILVER and FRONTIER_BRAIN_GOLD
break;
case 2:
default:
if (winStreak == sPikeQueenWinStreakAppearances[var][0] - sPikeQueenWinStreakAppearances[var][3])
ret = 3;
else if (winStreak == sPikeQueenWinStreakAppearances[var][1] - sPikeQueenWinStreakAppearances[var][3]
|| (winStreak > sPikeQueenWinStreakAppearances[var][1]
&& (winStreak - sPikeQueenWinStreakAppearances[var][1] + sPikeQueenWinStreakAppearances[var][3]) % sPikeQueenWinStreakAppearances[var][2] == 0))
ret = 4;
if (winStreak == sFrontierBrainStreakAppearances[facility][0] - sFrontierBrainStreakAppearances[facility][3])
ret = FRONTIER_BRAIN_STREAK;
else if (winStreak == sFrontierBrainStreakAppearances[facility][1] - sFrontierBrainStreakAppearances[facility][3]
|| (winStreak > sFrontierBrainStreakAppearances[facility][1]
&& (winStreak - sFrontierBrainStreakAppearances[facility][1] + sFrontierBrainStreakAppearances[facility][3]) % sFrontierBrainStreakAppearances[facility][2] == 0))
ret = FRONTIER_BRAIN_STREAK_LONG;
break;
}
@@ -1553,23 +1540,23 @@ static void HealSomeMonsBeforePikeQueen(void)
gSpecialVar_Result = toHealCount;
}
static void SetHealingRoomsDisabled(void)
static void SetHealingroomTypesDisabled(void)
{
gSaveBlock2Ptr->frontier.pikeHealingRoomsDisabled = gSpecialVar_0x8005;
}
static void CanAnyPartyMonsBeHealed(void)
static void IsPartyFullHealed(void)
{
u8 i, j;
gSpecialVar_Result = TRUE;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
bool32 canBeHealed = FALSE;
struct Pokemon *mon = &gPlayerParty[i];
u16 curr = GetMonData(mon, MON_DATA_HP);
u16 max = GetMonData(mon, MON_DATA_MAX_HP);
if (curr >= max && pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS)) == 0)
if (curr >= max && GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE)
{
u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES);
for (j = 0; j < MAX_MON_MOVES; j++)
@@ -1597,11 +1584,11 @@ static void CanAnyPartyMonsBeHealed(void)
}
}
static void BackupMonHeldItems(void)
static void SaveMonHeldItems(void)
{
u8 i;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
int heldItem = GetMonData(&gSaveBlock1Ptr->playerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1],
MON_DATA_HELD_ITEM);
@@ -1613,7 +1600,7 @@ static void RestoreMonHeldItems(void)
{
u8 i;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
SetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1],
MON_DATA_HELD_ITEM,
@@ -1625,10 +1612,10 @@ static void InitPikeChallenge(void)
{
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_08612690[lvlMode]))
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[lvlMode]))
gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] = 0;
gTrainerBattleOpponent_A = 0;
+210 -236
View File
@@ -23,12 +23,14 @@
#include "main.h"
#include "load_save.h"
#include "script.h"
#include "alloc.h"
#include "malloc.h"
#include "overworld.h"
#include "event_scripts.h"
#include "constants/battle_frontier.h"
#include "constants/battle_pyramid.h"
#include "constants/event_objects.h"
#include "constants/event_object_movement_constants.h"
#include "constants/frontier_util.h"
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/maps.h"
@@ -39,45 +41,14 @@
extern const struct MapLayout *const gMapLayouts[];
extern const u16 gUnknown_08D856C8[][16];
#define TOTAL_ROUNDS 20
#define PICKUP_ITEMS_PER_ROUND 10
#define FLOOR_WALKABLE_METATILE 0x28D
#define FLOOR_EXIT_METATILE 0x28E
enum
{
HINT_EXIT_DIRECTION,
HINT_REMAINING_ITEMS,
HINT_REMAINING_TRAINERS,
HINT_EXIT_SHORT_REMAINING_TRAINERS,
HINT_EXIT_SHORT_REMAINING_ITEMS,
HINT_EXIT_MEDIUM_REMAINING_TRAINERS,
HINT_EXIT_MEDIUM_REMAINING_ITEMS,
HINT_EXIT_FAR_REMAINING_TRAINERS,
HINT_EXIT_FAR_REMAINING_ITEMS,
};
enum
{
OBJ_TRAINERS,
OBJ_ITEMS,
};
enum
{
OBJ_POSITIONS_UNIFORM,
OBJ_POSITIONS_IN_AND_NEAR_ENTRANCE,
OBJ_POSITIONS_IN_AND_NEAR_EXIT,
OBJ_POSITIONS_NEAR_ENTRANCE,
OBJ_POSITIONS_NEAR_EXIT,
};
struct PyramidWildMon
{
u16 species;
u8 lvl;
u8 abilityNum;
u16 moves[4];
u16 moves[MAX_MON_MOVES];
};
struct PyramidFloorTemplate
@@ -100,20 +71,20 @@ struct PyramidTrainerEncounterMusic
static void InitPyramidChallenge(void);
static void GetBattlePyramidData(void);
static void SetBattlePyramidData(void);
static void sub_81A9134(void);
static void SetBattlePyramidRewardItem(void);
static void GiveBattlePyramidRewardItem(void);
static void SavePyramidChallenge(void);
static void SetBattlePyramidPrize(void);
static void GiveBattlePyramidPrize(void);
static void SeedPyramidFloor(void);
static void SetPickupItem(void);
static void HidePyramidItem(void);
static void InitPyramidFacilityTrainers(void);
static void SetPyramidFacilityTrainers(void);
static void ShowPostBattleHintText(void);
static void UpdatePyramidWinStreak(void);
static void GetInBattlePyramid(void);
static void UpdatePyramidLightRadius(void);
static void ClearPyramidPartyHeldItems(void);
static void SetPyramidFloorPalette(void);
static void sub_81A9828(void);
static void BattlePyramidStartMenu(void);
static void RestorePyramidPlayerParty(void);
static void InitPyramidBagItems(u8 lvlMode);
static u8 GetPyramidFloorTemplateId(void);
@@ -544,7 +515,7 @@ static const u8 sTrainerTextGroups[50][2] =
{FACILITY_CLASS_SAILOR, 2},
{FACILITY_CLASS_COLLECTOR, 2},
{FACILITY_CLASS_PKMN_BREEDER_M, 2},
{FACILITY_CLASS_POKEMON_BREEDER_F, 3},
{FACILITY_CLASS_PKMN_BREEDER_F, 3},
{FACILITY_CLASS_PKMN_RANGER_M, 2},
{FACILITY_CLASS_PKMN_RANGER_F, 3},
{FACILITY_CLASS_LASS, 3},
@@ -554,200 +525,200 @@ static const u8 sTrainerTextGroups[50][2] =
static const u8 *const sExitDirectionHintTexts1[] =
{
BattlePyramid_ExitHintUp_Text1,
BattlePyramid_ExitHintLeft_Text1,
BattlePyramid_ExitHintRight_Text1,
BattlePyramid_ExitHintDown_Text1,
BattlePyramid_Text_ExitHintUp1,
BattlePyramid_Text_ExitHintLeft1,
BattlePyramid_Text_ExitHintRight1,
BattlePyramid_Text_ExitHintDown1,
};
static const u8 *const sRemainingItemsHintTexts1[] =
{
BattlePyramid_ZeroItemsRemaining_Text1,
BattlePyramid_OneItemRemaining_Text1,
BattlePyramid_TwoItemsRemaining_Text1,
BattlePyramid_ThreeItemsRemaining_Text1,
BattlePyramid_FourItemsRemaining_Text1,
BattlePyramid_FiveItemsRemaining_Text1,
BattlePyramid_SixItemsRemaining_Text1,
BattlePyramid_SevenItemsRemaining_Text1,
BattlePyramid_EightItemsRemaining_Text1,
BattlePyramid_Text_ZeroItemsRemaining1,
BattlePyramid_Text_OneItemRemaining1,
BattlePyramid_Text_TwoItemsRemaining1,
BattlePyramid_Text_ThreeItemsRemaining1,
BattlePyramid_Text_FourItemsRemaining1,
BattlePyramid_Text_FiveItemsRemaining1,
BattlePyramid_Text_SixItemsRemaining1,
BattlePyramid_Text_SevenItemsRemaining1,
BattlePyramid_Text_EightItemsRemaining1,
};
static const u8 *const sRemainingTrainersHintTexts1[] =
{
BattlePyramid_ZeroTrainersRemaining_Text1,
BattlePyramid_OneTrainersRemaining_Text1,
BattlePyramid_TwoTrainersRemaining_Text1,
BattlePyramid_ThreeTrainersRemaining_Text1,
BattlePyramid_FourTrainersRemaining_Text1,
BattlePyramid_FiveTrainersRemaining_Text1,
BattlePyramid_SixTrainersRemaining_Text1,
BattlePyramid_SevenTrainersRemaining_Text1,
BattlePyramid_Text_ZeroTrainersRemaining1,
BattlePyramid_Text_OneTrainersRemaining1,
BattlePyramid_Text_TwoTrainersRemaining1,
BattlePyramid_Text_ThreeTrainersRemaining1,
BattlePyramid_Text_FourTrainersRemaining1,
BattlePyramid_Text_FiveTrainersRemaining1,
BattlePyramid_Text_SixTrainersRemaining1,
BattlePyramid_Text_SevenTrainersRemaining1,
};
static const u8 *const sExitDirectionHintTexts2[] =
{
BattlePyramid_ExitHintUp_Text2,
BattlePyramid_ExitHintLeft_Text2,
BattlePyramid_ExitHintRight_Text2,
BattlePyramid_ExitHintDown_Text2,
BattlePyramid_Text_ExitHintUp2,
BattlePyramid_Text_ExitHintLeft2,
BattlePyramid_Text_ExitHintRight2,
BattlePyramid_Text_ExitHintDown2,
};
static const u8 *const sRemainingItemsHintTexts2[] =
{
BattlePyramid_ZeroItemsRemaining_Text2,
BattlePyramid_OneItemRemaining_Text2,
BattlePyramid_TwoItemsRemaining_Text2,
BattlePyramid_ThreeItemsRemaining_Text2,
BattlePyramid_FourItemsRemaining_Text2,
BattlePyramid_FiveItemsRemaining_Text2,
BattlePyramid_SixItemsRemaining_Text2,
BattlePyramid_SevenItemsRemaining_Text2,
BattlePyramid_EightItemsRemaining_Text2,
BattlePyramid_Text_ZeroItemsRemaining2,
BattlePyramid_Text_OneItemRemaining2,
BattlePyramid_Text_TwoItemsRemaining2,
BattlePyramid_Text_ThreeItemsRemaining2,
BattlePyramid_Text_FourItemsRemaining2,
BattlePyramid_Text_FiveItemsRemaining2,
BattlePyramid_Text_SixItemsRemaining2,
BattlePyramid_Text_SevenItemsRemaining2,
BattlePyramid_Text_EightItemsRemaining2,
};
static const u8 *const sRemainingTrainersHintTexts2[] =
{
BattlePyramid_ZeroTrainersRemaining_Text2,
BattlePyramid_OneTrainersRemaining_Text2,
BattlePyramid_TwoTrainersRemaining_Text2,
BattlePyramid_ThreeTrainersRemaining_Text2,
BattlePyramid_FourTrainersRemaining_Text2,
BattlePyramid_FiveTrainersRemaining_Text2,
BattlePyramid_SixTrainersRemaining_Text2,
BattlePyramid_SevenTrainersRemaining_Text2,
BattlePyramid_Text_ZeroTrainersRemaining2,
BattlePyramid_Text_OneTrainersRemaining2,
BattlePyramid_Text_TwoTrainersRemaining2,
BattlePyramid_Text_ThreeTrainersRemaining2,
BattlePyramid_Text_FourTrainersRemaining2,
BattlePyramid_Text_FiveTrainersRemaining2,
BattlePyramid_Text_SixTrainersRemaining2,
BattlePyramid_Text_SevenTrainersRemaining2,
};
static const u8 *const sExitDirectionHintTexts3[] =
{
BattlePyramid_ExitHintUp_Text3,
BattlePyramid_ExitHintLeft_Text3,
BattlePyramid_ExitHintRight_Text3,
BattlePyramid_ExitHintDown_Text3,
BattlePyramid_Text_ExitHintUp3,
BattlePyramid_Text_ExitHintLeft3,
BattlePyramid_Text_ExitHintRight3,
BattlePyramid_Text_ExitHintDown3,
};
static const u8 *const sRemainingItemsHintTexts3[] =
{
BattlePyramid_ZeroItemsRemaining_Text3,
BattlePyramid_OneItemRemaining_Text3,
BattlePyramid_TwoItemsRemaining_Text3,
BattlePyramid_ThreeItemsRemaining_Text3,
BattlePyramid_FourItemsRemaining_Text3,
BattlePyramid_FiveItemsRemaining_Text3,
BattlePyramid_SixItemsRemaining_Text3,
BattlePyramid_SevenItemsRemaining_Text3,
BattlePyramid_EightItemsRemaining_Text3,
BattlePyramid_Text_ZeroItemsRemaining3,
BattlePyramid_Text_OneItemRemaining3,
BattlePyramid_Text_TwoItemsRemaining3,
BattlePyramid_Text_ThreeItemsRemaining3,
BattlePyramid_Text_FourItemsRemaining3,
BattlePyramid_Text_FiveItemsRemaining3,
BattlePyramid_Text_SixItemsRemaining3,
BattlePyramid_Text_SevenItemsRemaining3,
BattlePyramid_Text_EightItemsRemaining3,
};
static const u8 *const sRemainingTrainersHintTexts3[] =
{
BattlePyramid_ZeroTrainersRemaining_Text3,
BattlePyramid_OneTrainersRemaining_Text3,
BattlePyramid_TwoTrainersRemaining_Text3,
BattlePyramid_ThreeTrainersRemaining_Text3,
BattlePyramid_FourTrainersRemaining_Text3,
BattlePyramid_FiveTrainersRemaining_Text3,
BattlePyramid_SixTrainersRemaining_Text3,
BattlePyramid_SevenTrainersRemaining_Text3,
BattlePyramid_Text_ZeroTrainersRemaining3,
BattlePyramid_Text_OneTrainersRemaining3,
BattlePyramid_Text_TwoTrainersRemaining3,
BattlePyramid_Text_ThreeTrainersRemaining3,
BattlePyramid_Text_FourTrainersRemaining3,
BattlePyramid_Text_FiveTrainersRemaining3,
BattlePyramid_Text_SixTrainersRemaining3,
BattlePyramid_Text_SevenTrainersRemaining3,
};
static const u8 *const sExitDirectionHintTexts4[] =
{
BattlePyramid_ExitHintUp_Text4,
BattlePyramid_ExitHintLeft_Text4,
BattlePyramid_ExitHintRight_Text4,
BattlePyramid_ExitHintDown_Text4,
BattlePyramid_Text_ExitHintUp4,
BattlePyramid_Text_ExitHintLeft4,
BattlePyramid_Text_ExitHintRight4,
BattlePyramid_Text_ExitHintDown4,
};
static const u8 *const sRemainingItemsHintTexts4[] =
{
BattlePyramid_ZeroItemsRemaining_Text4,
BattlePyramid_OneItemRemaining_Text4,
BattlePyramid_TwoItemsRemaining_Text4,
BattlePyramid_ThreeItemsRemaining_Text4,
BattlePyramid_FourItemsRemaining_Text4,
BattlePyramid_FiveItemsRemaining_Text4,
BattlePyramid_SixItemsRemaining_Text4,
BattlePyramid_SevenItemsRemaining_Text4,
BattlePyramid_EightItemsRemaining_Text4,
BattlePyramid_Text_ZeroItemsRemaining4,
BattlePyramid_Text_OneItemRemaining4,
BattlePyramid_Text_TwoItemsRemaining4,
BattlePyramid_Text_ThreeItemsRemaining4,
BattlePyramid_Text_FourItemsRemaining4,
BattlePyramid_Text_FiveItemsRemaining4,
BattlePyramid_Text_SixItemsRemaining4,
BattlePyramid_Text_SevenItemsRemaining4,
BattlePyramid_Text_EightItemsRemaining4,
};
static const u8 *const sRemainingTrainersHintTexts4[] =
{
BattlePyramid_ZeroTrainersRemaining_Text4,
BattlePyramid_OneTrainersRemaining_Text4,
BattlePyramid_TwoTrainersRemaining_Text4,
BattlePyramid_ThreeTrainersRemaining_Text4,
BattlePyramid_FourTrainersRemaining_Text4,
BattlePyramid_FiveTrainersRemaining_Text4,
BattlePyramid_SixTrainersRemaining_Text4,
BattlePyramid_SevenTrainersRemaining_Text4,
BattlePyramid_Text_ZeroTrainersRemaining4,
BattlePyramid_Text_OneTrainersRemaining4,
BattlePyramid_Text_TwoTrainersRemaining4,
BattlePyramid_Text_ThreeTrainersRemaining4,
BattlePyramid_Text_FourTrainersRemaining4,
BattlePyramid_Text_FiveTrainersRemaining4,
BattlePyramid_Text_SixTrainersRemaining4,
BattlePyramid_Text_SevenTrainersRemaining4,
};
static const u8 *const sExitDirectionHintTexts5[] =
{
BattlePyramid_ExitHintUp_Text5,
BattlePyramid_ExitHintLeft_Text5,
BattlePyramid_ExitHintRight_Text5,
BattlePyramid_ExitHintDown_Text5,
BattlePyramid_Text_ExitHintUp5,
BattlePyramid_Text_ExitHintLeft5,
BattlePyramid_Text_ExitHintRight5,
BattlePyramid_Text_ExitHintDown5,
};
static const u8 *const sRemainingItemsHintTexts5[] =
{
BattlePyramid_ZeroItemsRemaining_Text5,
BattlePyramid_OneItemRemaining_Text5,
BattlePyramid_TwoItemsRemaining_Text5,
BattlePyramid_ThreeItemsRemaining_Text5,
BattlePyramid_FourItemsRemaining_Text5,
BattlePyramid_FiveItemsRemaining_Text5,
BattlePyramid_SixItemsRemaining_Text5,
BattlePyramid_SevenItemsRemaining_Text5,
BattlePyramid_EightItemsRemaining_Text5,
BattlePyramid_Text_ZeroItemsRemaining5,
BattlePyramid_Text_OneItemRemaining5,
BattlePyramid_Text_TwoItemsRemaining5,
BattlePyramid_Text_ThreeItemsRemaining5,
BattlePyramid_Text_FourItemsRemaining5,
BattlePyramid_Text_FiveItemsRemaining5,
BattlePyramid_Text_SixItemsRemaining5,
BattlePyramid_Text_SevenItemsRemaining5,
BattlePyramid_Text_EightItemsRemaining5,
};
static const u8 *const sRemainingTrainersHintTexts5[] =
{
BattlePyramid_ZeroTrainersRemaining_Text5,
BattlePyramid_OneTrainersRemaining_Text5,
BattlePyramid_TwoTrainersRemaining_Text5,
BattlePyramid_ThreeTrainersRemaining_Text5,
BattlePyramid_FourTrainersRemaining_Text5,
BattlePyramid_FiveTrainersRemaining_Text5,
BattlePyramid_SixTrainersRemaining_Text5,
BattlePyramid_SevenTrainersRemaining_Text5,
BattlePyramid_Text_ZeroTrainersRemaining5,
BattlePyramid_Text_OneTrainersRemaining5,
BattlePyramid_Text_TwoTrainersRemaining5,
BattlePyramid_Text_ThreeTrainersRemaining5,
BattlePyramid_Text_FourTrainersRemaining5,
BattlePyramid_Text_FiveTrainersRemaining5,
BattlePyramid_Text_SixTrainersRemaining5,
BattlePyramid_Text_SevenTrainersRemaining5,
};
static const u8 *const sExitDirectionHintTexts6[] =
{
BattlePyramid_ExitHintUp_Text6,
BattlePyramid_ExitHintLeft_Text6,
BattlePyramid_ExitHintRight_Text6,
BattlePyramid_ExitHintDown_Text6,
BattlePyramid_Text_ExitHintUp6,
BattlePyramid_Text_ExitHintLeft6,
BattlePyramid_Text_ExitHintRight6,
BattlePyramid_Text_ExitHintDown6,
};
static const u8 *const sRemainingItemsHintTexts6[] =
{
BattlePyramid_ZeroItemsRemaining_Text6,
BattlePyramid_OneItemRemaining_Text6,
BattlePyramid_TwoItemsRemaining_Text6,
BattlePyramid_ThreeItemsRemaining_Text6,
BattlePyramid_FourItemsRemaining_Text6,
BattlePyramid_FiveItemsRemaining_Text6,
BattlePyramid_SixItemsRemaining_Text6,
BattlePyramid_SevenItemsRemaining_Text6,
BattlePyramid_EightItemsRemaining_Text6,
BattlePyramid_Text_ZeroItemsRemaining6,
BattlePyramid_Text_OneItemRemaining6,
BattlePyramid_Text_TwoItemsRemaining6,
BattlePyramid_Text_ThreeItemsRemaining6,
BattlePyramid_Text_FourItemsRemaining6,
BattlePyramid_Text_FiveItemsRemaining6,
BattlePyramid_Text_SixItemsRemaining6,
BattlePyramid_Text_SevenItemsRemaining6,
BattlePyramid_Text_EightItemsRemaining6,
};
static const u8 *const sRemainingTrainersHintTexts6[] =
{
BattlePyramid_ZeroTrainersRemaining_Text6,
BattlePyramid_OneTrainersRemaining_Text6,
BattlePyramid_TwoTrainersRemaining_Text6,
BattlePyramid_ThreeTrainersRemaining_Text6,
BattlePyramid_FourTrainersRemaining_Text6,
BattlePyramid_FiveTrainersRemaining_Text6,
BattlePyramid_SixTrainersRemaining_Text6,
BattlePyramid_SevenTrainersRemaining_Text6,
BattlePyramid_Text_ZeroTrainersRemaining6,
BattlePyramid_Text_OneTrainersRemaining6,
BattlePyramid_Text_TwoTrainersRemaining6,
BattlePyramid_Text_ThreeTrainersRemaining6,
BattlePyramid_Text_FourTrainersRemaining6,
BattlePyramid_Text_FiveTrainersRemaining6,
BattlePyramid_Text_SixTrainersRemaining6,
BattlePyramid_Text_SevenTrainersRemaining6,
};
static const u8 *const *const sPostBattleHintTexts1[] =
@@ -816,24 +787,24 @@ static const u8 sHintTextTypes[] =
static void (* const sBattlePyramidFunctions[])(void) =
{
InitPyramidChallenge,
GetBattlePyramidData,
SetBattlePyramidData,
sub_81A9134,
SetBattlePyramidRewardItem,
GiveBattlePyramidRewardItem,
SeedPyramidFloor,
SetPickupItem,
HidePyramidItem,
InitPyramidFacilityTrainers,
ShowPostBattleHintText,
UpdatePyramidWinStreak,
GetInBattlePyramid,
UpdatePyramidLightRadius,
ClearPyramidPartyHeldItems,
SetPyramidFloorPalette,
sub_81A9828,
RestorePyramidPlayerParty,
[BATTLE_PYRAMID_FUNC_INIT] = InitPyramidChallenge,
[BATTLE_PYRAMID_FUNC_GET_DATA] = GetBattlePyramidData,
[BATTLE_PYRAMID_FUNC_SET_DATA] = SetBattlePyramidData,
[BATTLE_PYRAMID_FUNC_SAVE] = SavePyramidChallenge,
[BATTLE_PYRAMID_FUNC_SET_PRIZE] = SetBattlePyramidPrize,
[BATTLE_PYRAMID_FUNC_GIVE_PRIZE] = GiveBattlePyramidPrize,
[BATTLE_PYRAMID_FUNC_SEED_FLOOR] = SeedPyramidFloor,
[BATTLE_PYRAMID_FUNC_SET_ITEM] = SetPickupItem,
[BATTLE_PYRAMID_FUNC_HIDE_ITEM] = HidePyramidItem,
[BATTLE_PYRAMID_FUNC_SET_TRAINERS] = SetPyramidFacilityTrainers,
[BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT] = ShowPostBattleHintText,
[BATTLE_PYRAMID_FUNC_UPDATE_STREAK] = UpdatePyramidWinStreak,
[BATTLE_PYRAMID_FUNC_IS_IN] = GetInBattlePyramid,
[BATTLE_PYRAMID_FUNC_UPDATE_LIGHT] = UpdatePyramidLightRadius,
[BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS] = ClearPyramidPartyHeldItems,
[BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE] = SetPyramidFloorPalette,
[BATTLE_PYRAMID_FUNC_START_MENU] = BattlePyramidStartMenu,
[BATTLE_PYRAMID_FUNC_RESTORE_PARTY] = RestorePyramidPlayerParty,
};
static const u16 sShortStreakRewardItems[] = {ITEM_HP_UP, ITEM_PROTEIN, ITEM_IRON, ITEM_CALCIUM, ITEM_CARBOS, ITEM_ZINC};
@@ -872,13 +843,13 @@ static void InitPyramidChallenge(void)
bool32 isCurrent;
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
if (lvlMode != FRONTIER_LVL_50)
isCurrent = gSaveBlock2Ptr->frontier.field_CDC & 0x2000;
isCurrent = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_OPEN;
else
isCurrent = gSaveBlock2Ptr->frontier.field_CDC & 0x1000;
isCurrent = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_50;
if (!isCurrent)
{
@@ -897,29 +868,29 @@ static void GetBattlePyramidData(void)
switch (gSpecialVar_0x8005)
{
case 0:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidRewardItem;
case PYRAMID_DATA_PRIZE:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidPrize;
break;
case 1:
case PYRAMID_DATA_WIN_STREAK:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode];
break;
case 2:
case PYRAMID_DATA_WIN_STREAK_ACTIVE:
if (lvlMode != FRONTIER_LVL_50)
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x2000;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_OPEN;
else
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x1000;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_50;
break;
case 3:
case PYRAMID_DATA_WIN_STREAK_50:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidWinStreaks[FRONTIER_LVL_50];
break;
case 4:
case PYRAMID_DATA_WIN_STREAK_OPEN:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.pyramidWinStreaks[FRONTIER_LVL_OPEN];
break;
case 5:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x1000;
case PYRAMID_DATA_WIN_STREAK_ACTIVE_50:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_50;
break;
case 6:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_CDC & 0x2000;
case PYRAMID_DATA_WIN_STREAK_ACTIVE_OPEN:
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_PYRAMID_OPEN;
break;
}
}
@@ -930,59 +901,59 @@ static void SetBattlePyramidData(void)
switch (gSpecialVar_0x8005)
{
case 0:
gSaveBlock2Ptr->frontier.pyramidRewardItem = gSpecialVar_0x8006;
case PYRAMID_DATA_PRIZE:
gSaveBlock2Ptr->frontier.pyramidPrize = gSpecialVar_0x8006;
break;
case 1:
case PYRAMID_DATA_WIN_STREAK:
gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] = gSpecialVar_0x8006;
break;
case 2:
case PYRAMID_DATA_WIN_STREAK_ACTIVE:
if (lvlMode != FRONTIER_LVL_50)
{
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= 0x2000;
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= STREAK_PYRAMID_OPEN;
else
gSaveBlock2Ptr->frontier.field_CDC &= ~(0x2000);
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_PYRAMID_OPEN);
}
else
{
if (gSpecialVar_0x8006)
gSaveBlock2Ptr->frontier.field_CDC |= 0x1000;
gSaveBlock2Ptr->frontier.winStreakActiveFlags |= STREAK_PYRAMID_50;
else
gSaveBlock2Ptr->frontier.field_CDC &= ~(0x1000);
gSaveBlock2Ptr->frontier.winStreakActiveFlags &= ~(STREAK_PYRAMID_50);
}
break;
case 7:
case PYRAMID_DATA_TRAINER_FLAGS:
gSaveBlock2Ptr->frontier.pyramidTrainerFlags = gSpecialVar_0x8006;
break;
}
}
static void sub_81A9134(void)
static void SavePyramidChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = 1;
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
save_serialize_map();
TrySavingData(SAVE_LINK);
}
static void SetBattlePyramidRewardItem(void)
static void SetBattlePyramidPrize(void)
{
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] > 41)
gSaveBlock2Ptr->frontier.pyramidRewardItem = sLongStreakRewardItems[Random() % ARRAY_COUNT(sLongStreakRewardItems)];
gSaveBlock2Ptr->frontier.pyramidPrize = sLongStreakRewardItems[Random() % ARRAY_COUNT(sLongStreakRewardItems)];
else
gSaveBlock2Ptr->frontier.pyramidRewardItem = sShortStreakRewardItems[Random() % ARRAY_COUNT(sShortStreakRewardItems)];
gSaveBlock2Ptr->frontier.pyramidPrize = sShortStreakRewardItems[Random() % ARRAY_COUNT(sShortStreakRewardItems)];
}
static void GiveBattlePyramidRewardItem(void)
static void GiveBattlePyramidPrize(void)
{
if (AddBagItem(gSaveBlock2Ptr->frontier.pyramidRewardItem, 1) == TRUE)
if (AddBagItem(gSaveBlock2Ptr->frontier.pyramidPrize, 1) == TRUE)
{
CopyItemName(gSaveBlock2Ptr->frontier.pyramidRewardItem, gStringVar1);
gSaveBlock2Ptr->frontier.pyramidRewardItem = 0;
CopyItemName(gSaveBlock2Ptr->frontier.pyramidPrize, gStringVar1);
gSaveBlock2Ptr->frontier.pyramidPrize = 0;
gSpecialVar_Result = TRUE;
}
else
@@ -1033,6 +1004,7 @@ static void SetPickupItem(void)
else
gSpecialVar_0x8000 = sPickupItemsLvl50[round][sPickupItemSlots[i][1]];
// Quantity of item to give
gSpecialVar_0x8001 = 1;
}
@@ -1057,7 +1029,7 @@ static void HidePyramidItem(void)
}
}
static void InitPyramidFacilityTrainers(void)
static void SetPyramidFacilityTrainers(void)
{
gFacilityTrainers = gBattleFrontierTrainers;
}
@@ -1151,10 +1123,10 @@ static void UpdatePyramidLightRadius(void)
{
switch (gSpecialVar_0x8006)
{
case 0:
case PYRAMID_LIGHT_SET_RADIUS:
gSaveBlock2Ptr->frontier.pyramidLightRadius = gSpecialVar_0x8005;
break;
case 1:
case PYRAMID_LIGHT_INCR_RADIUS:
switch (gSpecialVar_Result)
{
case 0:
@@ -1199,7 +1171,7 @@ static void ClearPyramidPartyHeldItems(void)
for (i = 0; i < PARTY_SIZE; i++)
{
for (j = 0; j < 4; j++)
for (j = 0; j < MAX_FRONTIER_PARTY_SIZE; j++)
{
if (gSaveBlock2Ptr->frontier.selectedPartyMons[j] != 0 && gSaveBlock2Ptr->frontier.selectedPartyMons[j] - 1 == i)
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &item);
@@ -1221,19 +1193,20 @@ static void Task_SetPyramidFloorPalette(u8 taskId)
}
}
static void sub_81A9828(void)
// Unused. Handled by BuildStartMenuActions
static void BattlePyramidStartMenu(void)
{
sub_809FDD4();
ShowBattlePyramidStartMenu();
}
static void RestorePyramidPlayerParty(void)
{
int i, j, k, l;
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
int partyIndex = gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1;
for (j = 0; j < 3; j++)
for (j = 0; j < FRONTIER_PARTY_SIZE; j++)
{
if (GetMonData(&gSaveBlock1Ptr->playerParty[partyIndex], MON_DATA_SPECIES, NULL) == GetMonData(&gPlayerParty[j], MON_DATA_SPECIES, NULL))
{
@@ -1254,7 +1227,7 @@ static void RestorePyramidPlayerParty(void)
}
}
for (i = 0; i < 3; i++)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
gSaveBlock2Ptr->frontier.selectedPartyMons[i] = gSelectedOrderFromParty[i];
}
@@ -1445,7 +1418,7 @@ u8 GetPyramidRunMultiplier(void)
u8 InBattlePyramid(void)
{
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR)
return 1;
else if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP)
return 2;
@@ -1455,16 +1428,16 @@ u8 InBattlePyramid(void)
bool8 InBattlePyramid_(void)
{
return gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE
return gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP;
}
void sub_81A9E90(void)
void PausePyramidChallenge(void)
{
if (InBattlePyramid())
{
RestorePyramidPlayerParty();
gSaveBlock2Ptr->frontier.field_CA8 = 2;
gSaveBlock2Ptr->frontier.challengeStatus = CHALLENGE_STATUS_PAUSED;
VarSet(VAR_TEMP_E, 0);
LoadPlayerParty();
}
@@ -1503,9 +1476,10 @@ u8 GetBattlePyramindTrainerEncounterMusicId(u16 trainerId)
return TRAINER_ENCOUNTER_MUSIC_MALE;
}
void sub_81A9F80(void)
// Unused
static void BattlePyramidRetireChallenge(void)
{
ScriptContext1_SetupScript(BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88);
ScriptContext1_SetupScript(BattlePyramid_Retire);
}
static u16 GetUniqueTrainerId(u8 eventObjectId)
@@ -1519,7 +1493,7 @@ static u16 GetUniqueTrainerId(u8 eventObjectId)
{
do
{
trainerId = sub_8162548(challengeNum + 1, battleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, battleNum);
for (i = 0; i < eventObjectId; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -1531,7 +1505,7 @@ static u16 GetUniqueTrainerId(u8 eventObjectId)
{
do
{
trainerId = sub_8162548(challengeNum, battleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum);
for (i = 0; i < eventObjectId; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -1556,7 +1530,7 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
{
u16 *map;
int yOffset, xOffset;
const struct MapLayout *mapLayout = gMapLayouts[floorLayoutOffsets[i] + LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE];
const struct MapLayout *mapLayout = gMapLayouts[floorLayoutOffsets[i] + LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR];
const u16 *layoutMap = mapLayout->map;
gBackupMapLayout.map = backupMapData;
+34 -33
View File
@@ -17,7 +17,7 @@
#include "list_menu.h"
#include "mail.h"
#include "main.h"
#include "alloc.h"
#include "malloc.h"
#include "menu.h"
#include "menu_helpers.h"
#include "overworld.h"
@@ -39,7 +39,7 @@ EWRAM_DATA struct PyramidBagCursorData gPyramidBagCursorData = {0};
// This file's functions.
static void Task_HandlePyramidBagInput(u8 taskId);
static void sub_81C4F44(u8 taskId);
static void Task_ChooseItemsToTossFromPyramidBag(u8 taskId);
static void sub_81C5B4C(u8 taskId);
static void Task_BeginItemSwap(u8 taskId);
static void sub_81C5D20(u8 taskId);
@@ -67,7 +67,7 @@ static void sub_81C700C(void);
static void sub_81C6E98(void);
static void sub_81C6F20(void);
static void sub_81C6404(void);
static void sub_81C6E1C(void);
static void CloseBattlePyramidBagTextWindow(void);
static bool8 sub_81C5238(void);
static bool8 sub_81C5078(void);
static void ShowItemImage(u16 itemId, u8 itemSpriteArrayId);
@@ -278,10 +278,10 @@ static const struct WindowTemplate gUnknown_0861F350[] =
static const struct OamData gOamData_861F378 =
{
.y = 0,
.affineMode = 1,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_NORMAL,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
@@ -346,38 +346,38 @@ void InitBattlePyramidBagCursorPosition(void)
void CB2_PyramidBagMenuFromStartMenu(void)
{
sub_81C4F98(0, CB2_ReturnToFieldWithOpenMenu);
GoToBattlePyramidBagMenu(0, CB2_ReturnToFieldWithOpenMenu);
}
static void sub_81C4F10(void)
{
sub_81C4F98(1, SetCB2ToReshowScreenAfterMenu2);
GoToBattlePyramidBagMenu(1, CB2_SetUpReshowBattleScreenAfterMenu2);
}
void sub_81C4F24(void)
void ChooseItemsToTossFromPyramidBag(void)
{
ScriptContext2_Enable();
FadeScreen(1, 0);
CreateTask(sub_81C4F44, 10);
FadeScreen(FADE_TO_BLACK, 0);
CreateTask(Task_ChooseItemsToTossFromPyramidBag, 10);
}
static void sub_81C4F44(u8 taskId)
static void Task_ChooseItemsToTossFromPyramidBag(u8 taskId)
{
if (!gPaletteFade.active)
{
CleanupOverworldWindowsAndTilemaps();
gFieldCallback2 = hm_add_c3_without_phase_2;
sub_81C4F98(3, CB2_ReturnToField);
gFieldCallback2 = CB2_FadeFromPartyMenu;
GoToBattlePyramidBagMenu(3, CB2_ReturnToField);
DestroyTask(taskId);
}
}
void sub_81C4F84(void)
void CB2_ReturnToPyramidBagMenu(void)
{
sub_81C4F98(4, gPyramidBagCursorData.callback);
GoToBattlePyramidBagMenu(4, gPyramidBagCursorData.callback);
}
void sub_81C4F98(u8 a0, void (*callback)(void))
void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void))
{
gPyramidBagResources = AllocZeroed(sizeof(*gPyramidBagResources));
@@ -589,7 +589,7 @@ static void PyramidBag_CopyItemName(u8 *dst, u16 itemId)
{
ConvertIntToDecimalStringN(gStringVar1, ITEM_TO_BERRY(itemId), STR_CONV_MODE_LEADING_ZEROS, 2);
CopyItemName(itemId, gStringVar2);
StringExpandPlaceholders(dst, gText_UnkF908Var1Clear7Var2);
StringExpandPlaceholders(dst, gText_NumberVar1Clear7Var2);
}
else
{
@@ -809,7 +809,7 @@ static void sub_81C5AB8(u8 y, u8 arg1)
PrintOnWindow_Font1(0, gText_SelectorArrow2, 0, y, 0, 0, 0, arg1);
}
void sub_81C5B14(u8 taskId)
void CloseBattlePyramidBagAndSetCallback(u8 taskId)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = sub_81C5B4C;
@@ -862,7 +862,7 @@ static void Task_HandlePyramidBagInput(u8 taskId)
case LIST_CANCEL:
PlaySE(SE_SELECT);
gSpecialVar_ItemId = 0;
sub_81C5B14(taskId);
CloseBattlePyramidBagAndSetCallback(taskId);
break;
default:
PlaySE(SE_SELECT);
@@ -981,7 +981,7 @@ static void HandleMenuActionInput(u8 taskId)
sub_8199134(0, 1);
}
}
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1)
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
{
if (id & 1 && IsValidMenuAction(id - 1))
{
@@ -989,7 +989,7 @@ static void HandleMenuActionInput(u8 taskId)
sub_8199134(-1, 0);
}
}
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysState() == 2)
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
{
if (!(id & 1) && IsValidMenuAction(id + 1))
{
@@ -1043,7 +1043,7 @@ static void BagAction_UseOnField(u8 taskId)
|| ItemIsMail(gSpecialVar_ItemId) == TRUE)
{
sub_81C61A8();
DisplayItemMessageInBattlePyramid(taskId, gText_DadsAdvice, sub_81C6714);
DisplayItemMessageInBattlePyramid(taskId, gText_DadsAdvice, Task_CloseBattlePyramidBagMessage);
}
else if (ItemId_GetFieldFunc(gSpecialVar_ItemId) != NULL)
{
@@ -1202,8 +1202,8 @@ static void BagAction_Give(u8 taskId)
}
else if (!ItemId_GetImportance(gSpecialVar_ItemId))
{
gPyramidBagResources->callback2 = sub_81B7F60;
sub_81C5B14(taskId);
gPyramidBagResources->callback2 = CB2_ChooseMonToGiveItem;
CloseBattlePyramidBagAndSetCallback(taskId);
}
else
{
@@ -1223,15 +1223,15 @@ static void sub_81C66EC(u8 taskId)
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
sub_81C6714(taskId);
Task_CloseBattlePyramidBagMessage(taskId);
}
}
void sub_81C6714(u8 taskId)
void Task_CloseBattlePyramidBagMessage(u8 taskId)
{
s16 *data = gTasks[taskId].data;
sub_81C6E1C();
CloseBattlePyramidBagTextWindow();
PrintItemDescription(data[1]);
sub_81C5A98(data[0], 0);
SetTaskToMainPyramidBagInputHandler(taskId);
@@ -1242,7 +1242,7 @@ static void sub_81C674C(u8 taskId)
if (!itemid_80BF6D8_mail_related(gSpecialVar_ItemId))
DisplayItemMessageInBattlePyramid(taskId, gText_CantWriteMail, sub_81C66EC);
else if (!ItemId_GetImportance(gSpecialVar_ItemId))
sub_81C5B14(taskId);
CloseBattlePyramidBagAndSetCallback(taskId);
else
sub_81C66AC(taskId);
}
@@ -1350,7 +1350,7 @@ static void sub_81C6A14(u8 taskId)
SetTaskToMainPyramidBagInputHandler(taskId);
}
void sub_81C6A94(void)
void TryStoreHeldItemsInPyramidBag(void)
{
u8 i;
struct Pokemon *party = gPlayerParty;
@@ -1363,8 +1363,9 @@ void sub_81C6A94(void)
for (i = 0; i < 3; i++)
{
heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM);
if (heldItem != 0 && !AddBagItem(heldItem, 1))
if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1))
{
// Cant store party held items in pyramid bag because bag is full
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], newItems, PYRAMID_BAG_ITEMS_COUNT * sizeof(u16));
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(u8));
Free(newItems);
@@ -1374,7 +1375,7 @@ void sub_81C6A94(void)
}
}
heldItem = 0;
heldItem = ITEM_NONE;
for (i = 0; i < 3; i++)
{
SetMonData(&party[i], MON_DATA_HELD_ITEM, &heldItem);
@@ -1461,7 +1462,7 @@ void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback
schedule_bg_copy_tilemap_to_vram(1);
}
static void sub_81C6E1C(void)
static void CloseBattlePyramidBagTextWindow(void)
{
ClearDialogWindowAndFrameToTransparent(2, FALSE);
// This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it.
+1 -1
View File
@@ -18,7 +18,7 @@
#include "international_string_util.h"
#include "sound.h"
#include "constants/songs.h"
#include "alloc.h"
#include "malloc.h"
#include "gpu_regs.h"
#include "constants/game_stat.h"
#include "trainer_hill.h"
File diff suppressed because it is too large Load Diff
+56 -55
View File
@@ -1,25 +1,18 @@
#include "global.h"
#include "constants/trainers.h"
#include "battle.h"
#include "constants/battle_setup.h"
#include "battle_setup.h"
#include "battle_transition.h"
#include "main.h"
#include "task.h"
#include "safari_zone.h"
#include "script.h"
#include "constants/game_stat.h"
#include "event_data.h"
#include "constants/species.h"
#include "constants/songs.h"
#include "metatile_behavior.h"
#include "constants/maps.h"
#include "field_player_avatar.h"
#include "fieldmap.h"
#include "random.h"
#include "starter_choose.h"
#include "script_pokemon_80F8.h"
#include "constants/items.h"
#include "palette.h"
#include "window.h"
#include "event_object_movement.h"
@@ -42,10 +35,18 @@
#include "fldeff_misc.h"
#include "field_control_avatar.h"
#include "mirage_tower.h"
#include "constants/map_types.h"
#include "constants/battle_frontier.h"
#include "field_screen_effect.h"
#include "data.h"
#include "constants/battle_frontier.h"
#include "constants/battle_setup.h"
#include "constants/game_stat.h"
#include "constants/items.h"
#include "constants/songs.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/species.h"
#include "constants/trainers.h"
#include "constants/trainer_hill.h"
enum
{
@@ -72,8 +73,8 @@ static void CB2_EndWildBattle(void);
static void CB2_EndScriptedWildBattle(void);
static u8 GetWildBattleTransition(void);
static u8 GetTrainerBattleTransition(void);
static void sub_80B1218(void);
static void sub_80B1234(void);
static void TryUpdateGymLeaderRematchFromWild(void);
static void TryUpdateGymLeaderRematchFromTrainer(void);
static void CB2_GiveStarter(void);
static void CB2_StartFirstBattle(void);
static void CB2_EndFirstBattle(void);
@@ -304,7 +305,7 @@ const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] =
[REMATCH_TRENT] = REMATCH(TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5, ROUTE112),
[REMATCH_SAWYER] = REMATCH(TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5, MT_CHIMNEY),
[REMATCH_KIRA_AND_DAN] = REMATCH(TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5, ABANDONED_SHIP_ROOMS2_1F),
[REMATCH_WALLY_3] = REMATCH(TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6, VICTORY_ROAD_1F),
[REMATCH_WALLY_3] = REMATCH(TRAINER_WALLY_VR_2, TRAINER_WALLY_VR_3, TRAINER_WALLY_VR_4, TRAINER_WALLY_VR_5, TRAINER_WALLY_VR_5, VICTORY_ROAD_1F),
[REMATCH_ROXANNE] = REMATCH(TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5, RUSTBORO_CITY),
[REMATCH_BRAWLY] = REMATCH(TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5, DEWFORD_TOWN),
[REMATCH_WATTSON] = REMATCH(TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5, MAUVILLE_CITY),
@@ -395,8 +396,8 @@ static void DoStandardWildBattle(void)
CreateBattleStartTask(GetWildBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
void BattleSetup_StartRoamerBattle(void)
@@ -409,8 +410,8 @@ void BattleSetup_StartRoamerBattle(void)
CreateBattleStartTask(GetWildBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
static void DoSafariBattle(void)
@@ -433,8 +434,8 @@ static void DoBattlePikeWildBattle(void)
CreateBattleStartTask(GetWildBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
static void DoTrainerBattle(void)
@@ -442,7 +443,7 @@ static void DoTrainerBattle(void)
CreateBattleStartTask(GetTrainerBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_TRAINER_BATTLES);
sub_80B1234();
TryUpdateGymLeaderRematchFromTrainer();
}
static void sub_80B0828(void)
@@ -454,7 +455,7 @@ static void sub_80B0828(void)
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_TRAINER_BATTLES);
sub_80B1234();
TryUpdateGymLeaderRematchFromTrainer();
}
// Initiates battle where Wally catches Ralts
@@ -475,8 +476,8 @@ void BattleSetup_StartScriptedWildBattle(void)
CreateBattleStartTask(GetWildBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
void BattleSetup_StartLatiBattle(void)
@@ -487,8 +488,8 @@ void BattleSetup_StartLatiBattle(void)
CreateBattleStartTask(GetWildBattleTransition(), 0);
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
void BattleSetup_StartLegendaryBattle(void)
@@ -526,8 +527,8 @@ void BattleSetup_StartLegendaryBattle(void)
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
void StartGroudonKyogreBattle(void)
@@ -543,8 +544,8 @@ void StartGroudonKyogreBattle(void)
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
void StartRegiBattle(void)
@@ -576,8 +577,8 @@ void StartRegiBattle(void)
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
static void CB2_EndWildBattle(void)
@@ -897,7 +898,7 @@ static void CB2_GiveStarter(void)
*GetVarPointer(VAR_STARTER_MON) = gSpecialVar_Result;
starterMon = GetStarterPokemon(gSpecialVar_Result);
ScriptGiveMon(starterMon, 5, 0, 0, 0, 0);
ScriptGiveMon(starterMon, 5, ITEM_NONE, 0, 0, 0);
ResetTasks();
PlayBattleBGM();
SetMainCallback2(CB2_StartFirstBattle);
@@ -919,8 +920,8 @@ static void CB2_StartFirstBattle(void)
ClearPoisonStepCounter();
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
IncrementGameStat(GAME_STAT_WILD_BATTLES);
sub_80EECC8();
sub_80B1218();
IncrementDailyWildBattles();
TryUpdateGymLeaderRematchFromWild();
}
}
@@ -930,13 +931,13 @@ static void CB2_EndFirstBattle(void)
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
}
static void sub_80B1218(void)
static void TryUpdateGymLeaderRematchFromWild(void)
{
if (GetGameStat(GAME_STAT_WILD_BATTLES) % 60 == 0)
UpdateGymLeaderRematch();
}
static void sub_80B1234(void)
static void TryUpdateGymLeaderRematchFromTrainer(void)
{
if (GetGameStat(GAME_STAT_TRAINER_BATTLES) % 20 == 0)
UpdateGymLeaderRematch();
@@ -960,12 +961,12 @@ static u8 TrainerBattleLoadArg8(const u8 *ptr)
static u16 GetTrainerAFlag(void)
{
return FLAG_TRAINER_FLAG_START + gTrainerBattleOpponent_A;
return TRAINER_FLAGS_START + gTrainerBattleOpponent_A;
}
static u16 GetTrainerBFlag(void)
{
return FLAG_TRAINER_FLAG_START + gTrainerBattleOpponent_B;
return TRAINER_FLAGS_START + gTrainerBattleOpponent_B;
}
static bool32 IsPlayerDefeated(u32 battleOutcome)
@@ -1140,7 +1141,7 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data)
case TRAINER_BATTLE_SET_TRAINER_B:
TrainerBattleLoadArgs(sTrainerBOrdinaryBattleParams, data);
return NULL;
case TRAINER_BATTLE_12:
case TRAINER_BATTLE_HILL:
if (gApproachingTrainerId == 0)
{
TrainerBattleLoadArgs(sOrdinaryBattleParams, data);
@@ -1192,7 +1193,7 @@ void SetUpTwoTrainersBattle(void)
bool32 GetTrainerFlagFromScriptPointer(const u8 *data)
{
u32 flag = TrainerBattleLoadArg16(data + 2);
return FlagGet(FLAG_TRAINER_FLAG_START + flag);
return FlagGet(TRAINER_FLAGS_START + flag);
}
void SetUpTrainerMovement(void)
@@ -1231,17 +1232,17 @@ static void SetBattledTrainerFlag(void)
bool8 HasTrainerBeenFought(u16 trainerId)
{
return FlagGet(FLAG_TRAINER_FLAG_START + trainerId);
return FlagGet(TRAINER_FLAGS_START + trainerId);
}
void SetTrainerFlag(u16 trainerId)
{
FlagSet(FLAG_TRAINER_FLAG_START + trainerId);
FlagSet(TRAINER_FLAGS_START + trainerId);
}
void ClearTrainerFlag(u16 trainerId)
{
FlagClear(FLAG_TRAINER_FLAG_START + trainerId);
FlagClear(TRAINER_FLAGS_START + trainerId);
}
void BattleSetup_StartTrainerBattle(void)
@@ -1273,7 +1274,7 @@ void BattleSetup_StartTrainerBattle(void)
MarkApproachingPyramidTrainersAsBattled();
}
else if (sub_81D5C18())
else if (InTrainerHillChallenge())
{
gBattleTypeFlags |= BATTLE_TYPE_TRAINER_HILL;
@@ -1288,10 +1289,10 @@ void BattleSetup_StartTrainerBattle(void)
sNoOfPossibleTrainerRetScripts = gNoOfApproachingTrainers;
gNoOfApproachingTrainers = 0;
sShouldCheckTrainerBScript = FALSE;
gUnknown_03006080 = 0;
gWhichTrainerToFaceAfterBattle = 0;
gMain.savedCallback = CB2_EndTrainerBattle;
if (InBattlePyramid() || sub_81D5C18())
if (InBattlePyramid() || InTrainerHillChallenge())
sub_80B0828();
else
DoTrainerBattle();
@@ -1307,7 +1308,7 @@ static void CB2_EndTrainerBattle(void)
}
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
{
if (InBattlePyramid() || sub_81D5C18())
if (InBattlePyramid() || InTrainerHillChallenge())
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
else
SetMainCallback2(CB2_WhiteOut);
@@ -1315,7 +1316,7 @@ static void CB2_EndTrainerBattle(void)
else
{
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
if (!InBattlePyramid() && !sub_81D5C18())
if (!InBattlePyramid() && !InTrainerHillChallenge())
{
RegisterTrainerInMatchCall();
SetBattledTrainersFlags();
@@ -1361,12 +1362,12 @@ void ShowTrainerIntroSpeech(void)
sub_80982B8();
}
else if (sub_81D5C18())
else if (InTrainerHillChallenge())
{
if (gNoOfApproachingTrainers == 0 || gNoOfApproachingTrainers == 1)
CopyTrainerHillTrainerText(2, LocalIdToHillTrainerId(gSpecialVar_LastTalked));
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_INTRO, LocalIdToHillTrainerId(gSpecialVar_LastTalked));
else
CopyTrainerHillTrainerText(2, LocalIdToHillTrainerId(gEventObjects[gApproachingTrainers[gApproachingTrainerId].eventObjectId].localId));
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_INTRO, LocalIdToHillTrainerId(gEventObjects[gApproachingTrainers[gApproachingTrainerId].eventObjectId].localId));
sub_80982B8();
}
@@ -1391,7 +1392,7 @@ const u8 *BattleSetup_GetTrainerPostBattleScript(void)
sShouldCheckTrainerBScript = FALSE;
if (sTrainerBBattleScriptRetAddr != NULL)
{
gUnknown_03006080 = 1;
gWhichTrainerToFaceAfterBattle = 1;
return sTrainerBBattleScriptRetAddr;
}
}
@@ -1399,7 +1400,7 @@ const u8 *BattleSetup_GetTrainerPostBattleScript(void)
{
if (sTrainerABattleScriptRetAddr != NULL)
{
gUnknown_03006080 = 0;
gWhichTrainerToFaceAfterBattle = 0;
return sTrainerABattleScriptRetAddr;
}
}
@@ -1581,7 +1582,7 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u
s32 i;
bool32 ret = FALSE;
for (i = 0; i <= REMATCH_WALLY_3; i++)
for (i = 0; i <= REMATCH_SPECIAL_TRAINER_START; i++)
{
if (table[i].mapGroup == mapGroup && table[i].mapNum == mapNum && !sub_80B1D94(i))
{
@@ -1640,7 +1641,7 @@ static bool8 IsFirstTrainerIdReadyForRematch(const struct RematchTrainer *table,
if (tableId == -1)
return FALSE;
if (tableId >= 100)
if (tableId >= MAX_REMATCH_ENTRIES)
return FALSE;
if (gSaveBlock1Ptr->trainerRematches[tableId] == 0)
return FALSE;
@@ -1654,7 +1655,7 @@ static bool8 IsTrainerReadyForRematch_(const struct RematchTrainer *table, u16 t
if (tableId == -1)
return FALSE;
if (tableId >= 100)
if (tableId >= MAX_REMATCH_ENTRIES)
return FALSE;
if (gSaveBlock1Ptr->trainerRematches[tableId] == 0)
return FALSE;
+145 -131
View File
@@ -11,140 +11,154 @@
#include "battle_factory_screen.h"
#include "frontier_util.h"
#include "string_util.h"
#include "constants/battle_tent.h"
#include "constants/battle_tent_trainers.h"
#include "constants/battle_tent_mons.h"
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/region_map_sections.h"
#include "constants/species.h"
#include "constants/trainers.h"
// This file's functions.
static void sub_81B99D4(void);
static void sub_81B9A28(void);
static void sub_81B9A44(void);
static void sub_81B9A60(void);
static void sub_81B9A90(void);
static void sub_81B9ABC(void);
static void sub_81B9B00(void);
static void sub_81B9B28(void);
static void sub_81B9BA0(void);
static void sub_81B9BF4(void);
static void sub_81B9C10(void);
static void sub_81B9C2C(void);
static void sub_81B9C70(void);
static void sub_81B9C98(void);
static void sub_81B9CF0(void);
static void sub_81B9D28(void);
static void sub_81B9D7C(void);
static void sub_81B9D98(void);
static void sub_81B9DB4(void);
static void sub_81B9DF8(void);
static void sub_81B9E20(void);
static void sub_81B9E78(void);
static void sub_81B9E88(void);
static void sub_81BA040(void);
static void sub_81B9EC0(void);
static void InitVerdanturfTentChallenge(void);
static void GetVerdanturfTentPrize(void);
static void SetVerdanturfTentPrize(void);
static void SetVerdanturfTentTrainerGfx(void);
static void BufferVerdanturfTentTrainerIntro(void);
static void SaveVerdanturfTentChallenge(void);
static void SetRandomVerdanturfTentPrize(void);
static void GiveVerdanturfTentPrize(void);
static void InitFallarborTentChallenge(void);
static void GetFallarborTentPrize(void);
static void SetFallarborTentPrize(void);
static void SaveFallarborTentChallenge(void);
static void SetRandomFallarborTentPrize(void);
static void GiveFallarborTentPrize(void);
static void BufferFallarborTentTrainerName(void);
static void InitSlateportTentChallenge(void);
static void GetSlateportTentPrize(void);
static void SetSlateportTentPrize(void);
static void SaveSlateportTentChallenge(void);
static void SetRandomSlateportTentPrize(void);
static void GiveSlateportTentPrize(void);
static void SelectInitialRentalMons(void);
static void SwapRentalMons(void);
static void GenerateOpponentMons(void);
static void GenerateInitialRentalMons(void);
/*
* Battle Tents are mini versions of particular Battle Frontier facilities
* As such they each share some scripts and functions with their counterpart
*
* Verdanturf Battle Tent: Battle Palace
* Fallarbor Battle Tent: Battle Arena
* Slateport Battle Tent: Battle Factory
*
*/
// IWRAM bss
static u16 sRandMonSetId;
// const rom data
void static (*const gUnknown_086160B4[])(void) =
void static (*const sVerdanturfTentFuncs[])(void) =
{
sub_81B99D4,
sub_81B9A28,
sub_81B9A44,
sub_81B9A60,
sub_81B9A90,
sub_81B9ABC,
sub_81B9B00,
sub_81B9B28
[VERDANTURF_TENT_FUNC_INIT] = InitVerdanturfTentChallenge,
[VERDANTURF_TENT_FUNC_GET_PRIZE] = GetVerdanturfTentPrize,
[VERDANTURF_TENT_FUNC_SET_PRIZE] = SetVerdanturfTentPrize,
[VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX] = SetVerdanturfTentTrainerGfx,
[VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO] = BufferVerdanturfTentTrainerIntro,
[VERDANTURF_TENT_FUNC_SAVE] = SaveVerdanturfTentChallenge,
[VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE] = SetRandomVerdanturfTentPrize,
[VERDANTURF_TENT_FUNC_GIVE_PRIZE] = GiveVerdanturfTentPrize
};
static const u16 sVerdanturfTentRewards[] = {ITEM_NEST_BALL};
void static (*const gUnknown_086160D8[])(void) =
void static (*const sFallarborTentFuncs[])(void) =
{
sub_81B9BA0,
sub_81B9BF4,
sub_81B9C10,
sub_81B9C2C,
sub_81B9C70,
sub_81B9C98,
sub_81B9CF0
[FALLARBOR_TENT_FUNC_INIT] = InitFallarborTentChallenge,
[FALLARBOR_TENT_FUNC_GET_PRIZE] = GetFallarborTentPrize,
[FALLARBOR_TENT_FUNC_SET_PRIZE] = SetFallarborTentPrize,
[FALLARBOR_TENT_FUNC_SAVE] = SaveFallarborTentChallenge,
[FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE] = SetRandomFallarborTentPrize,
[FALLARBOR_TENT_FUNC_GIVE_PRIZE] = GiveFallarborTentPrize,
[FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME] = BufferFallarborTentTrainerName
};
static const u16 sFallarborTentRewards[] = {ITEM_HYPER_POTION};
void static (*const gUnknown_086160F8[])(void) =
void static (*const sSlateportTentFuncs[])(void) =
{
sub_81B9D28,
sub_81B9D7C,
sub_81B9D98,
sub_81B9DB4,
sub_81B9DF8,
sub_81B9E20,
sub_81B9E78,
sub_81B9E88,
sub_81BA040,
sub_81B9EC0
[SLATEPORT_TENT_FUNC_INIT] = InitSlateportTentChallenge,
[SLATEPORT_TENT_FUNC_GET_PRIZE] = GetSlateportTentPrize,
[SLATEPORT_TENT_FUNC_SET_PRIZE] = SetSlateportTentPrize,
[SLATEPORT_TENT_FUNC_SAVE] = SaveSlateportTentChallenge,
[SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE] = SetRandomSlateportTentPrize,
[SLATEPORT_TENT_FUNC_GIVE_PRIZE] = GiveSlateportTentPrize,
[SLATEPORT_TENT_FUNC_SELECT_RENT_MONS] = SelectInitialRentalMons,
[SLATEPORT_TENT_FUNC_SWAP_RENT_MONS] = SwapRentalMons,
[SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS] = GenerateOpponentMons,
[SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS] = GenerateInitialRentalMons
};
static const u16 sSlateportTentRewards[] = {ITEM_FULL_HEAL};
// code
void sub_81B99B4(void)
void CallVerdanturfTentFunction(void)
{
gUnknown_086160B4[gSpecialVar_0x8004]();
sVerdanturfTentFuncs[gSpecialVar_0x8004]();
}
static void sub_81B99D4(void)
static void InitVerdanturfTentChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = FALSE;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
}
static void sub_81B9A28(void)
static void GetVerdanturfTentPrize(void)
{
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_E6A;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.verdanturfTentPrize;
}
static void sub_81B9A44(void)
static void SetVerdanturfTentPrize(void)
{
gSaveBlock2Ptr->frontier.field_E6A = gSpecialVar_0x8006;
gSaveBlock2Ptr->frontier.verdanturfTentPrize = gSpecialVar_0x8006;
}
static void sub_81B9A60(void)
static void SetVerdanturfTentTrainerGfx(void)
{
gTrainerBattleOpponent_A = (u32)((Random() % 255) * 5) / 64;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
}
static void sub_81B9A90(void)
static void BufferVerdanturfTentTrainerIntro(void)
{
if (gTrainerBattleOpponent_A < 300)
if (gTrainerBattleOpponent_A < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
}
static void sub_81B9ABC(void)
static void SaveVerdanturfTentChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = TRUE;
sub_81A4C30();
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
SaveGameFrontier();
}
static void sub_81B9B00(void)
static void SetRandomVerdanturfTentPrize(void)
{
gSaveBlock2Ptr->frontier.field_E6A = sVerdanturfTentRewards[Random() % ARRAY_COUNT(sVerdanturfTentRewards)];
gSaveBlock2Ptr->frontier.verdanturfTentPrize = sVerdanturfTentRewards[Random() % ARRAY_COUNT(sVerdanturfTentRewards)];
}
static void sub_81B9B28(void)
static void GiveVerdanturfTentPrize(void)
{
if (AddBagItem(gSaveBlock2Ptr->frontier.field_E6A, 1) == TRUE)
if (AddBagItem(gSaveBlock2Ptr->frontier.verdanturfTentPrize, 1) == TRUE)
{
CopyItemName(gSaveBlock2Ptr->frontier.field_E6A, gStringVar1);
gSaveBlock2Ptr->frontier.field_E6A = ITEM_NONE;
CopyItemName(gSaveBlock2Ptr->frontier.verdanturfTentPrize, gStringVar1);
gSaveBlock2Ptr->frontier.verdanturfTentPrize = ITEM_NONE;
gSpecialVar_Result = TRUE;
}
else
@@ -153,48 +167,48 @@ static void sub_81B9B28(void)
}
}
void sub_81B9B80(void)
void CallFallarborTentFunction(void)
{
gUnknown_086160D8[gSpecialVar_0x8004]();
sFallarborTentFuncs[gSpecialVar_0x8004]();
}
static void sub_81B9BA0(void)
static void InitFallarborTentChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = FALSE;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
}
static void sub_81B9BF4(void)
static void GetFallarborTentPrize(void)
{
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_E6C;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.fallarborTentPrize;
}
static void sub_81B9C10(void)
static void SetFallarborTentPrize(void)
{
gSaveBlock2Ptr->frontier.field_E6C = gSpecialVar_0x8006;
gSaveBlock2Ptr->frontier.fallarborTentPrize = gSpecialVar_0x8006;
}
static void sub_81B9C2C(void)
static void SaveFallarborTentChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = TRUE;
sub_81A4C30();
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
SaveGameFrontier();
}
static void sub_81B9C70(void)
static void SetRandomFallarborTentPrize(void)
{
gSaveBlock2Ptr->frontier.field_E6C = sFallarborTentRewards[Random() % ARRAY_COUNT(sFallarborTentRewards)];
gSaveBlock2Ptr->frontier.fallarborTentPrize = sFallarborTentRewards[Random() % ARRAY_COUNT(sFallarborTentRewards)];
}
static void sub_81B9C98(void)
static void GiveFallarborTentPrize(void)
{
if (AddBagItem(gSaveBlock2Ptr->frontier.field_E6C, 1) == TRUE)
if (AddBagItem(gSaveBlock2Ptr->frontier.fallarborTentPrize, 1) == TRUE)
{
CopyItemName(gSaveBlock2Ptr->frontier.field_E6C, gStringVar1);
gSaveBlock2Ptr->frontier.field_E6C = ITEM_NONE;
CopyItemName(gSaveBlock2Ptr->frontier.fallarborTentPrize, gStringVar1);
gSaveBlock2Ptr->frontier.fallarborTentPrize = ITEM_NONE;
gSpecialVar_Result = TRUE;
}
else
@@ -203,53 +217,53 @@ static void sub_81B9C98(void)
}
}
static void sub_81B9CF0(void)
static void BufferFallarborTentTrainerName(void)
{
GetFrontierTrainerName(gStringVar1, gTrainerBattleOpponent_A);
}
void sub_81B9D08(void)
void CallSlateportTentFunction(void)
{
gUnknown_086160F8[gSpecialVar_0x8004]();
sSlateportTentFuncs[gSpecialVar_0x8004]();
}
static void sub_81B9D28(void)
static void InitSlateportTentChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = 0;
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.field_CA9_a = FALSE;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
}
static void sub_81B9D7C(void)
static void GetSlateportTentPrize(void)
{
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_E6E;
gSpecialVar_Result = gSaveBlock2Ptr->frontier.slateportTentPrize;
}
static void sub_81B9D98(void)
static void SetSlateportTentPrize(void)
{
gSaveBlock2Ptr->frontier.field_E6E = gSpecialVar_0x8006;
gSaveBlock2Ptr->frontier.slateportTentPrize = gSpecialVar_0x8006;
}
static void sub_81B9DB4(void)
static void SaveSlateportTentChallenge(void)
{
gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005;
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.field_CA9_a = TRUE;
sub_81A4C30();
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
SaveGameFrontier();
}
static void sub_81B9DF8(void)
static void SetRandomSlateportTentPrize(void)
{
gSaveBlock2Ptr->frontier.field_E6E = sSlateportTentRewards[Random() % ARRAY_COUNT(sSlateportTentRewards)];
gSaveBlock2Ptr->frontier.slateportTentPrize = sSlateportTentRewards[Random() % ARRAY_COUNT(sSlateportTentRewards)];
}
static void sub_81B9E20(void)
static void GiveSlateportTentPrize(void)
{
if (AddBagItem(gSaveBlock2Ptr->frontier.field_E6E, 1) == TRUE)
if (AddBagItem(gSaveBlock2Ptr->frontier.slateportTentPrize, 1) == TRUE)
{
CopyItemName(gSaveBlock2Ptr->frontier.field_E6E, gStringVar1);
gSaveBlock2Ptr->frontier.field_E6E = ITEM_NONE;
CopyItemName(gSaveBlock2Ptr->frontier.slateportTentPrize, gStringVar1);
gSaveBlock2Ptr->frontier.slateportTentPrize = ITEM_NONE;
gSpecialVar_Result = TRUE;
}
else
@@ -258,13 +272,13 @@ static void sub_81B9E20(void)
}
}
static void sub_81B9E78(void)
static void SelectInitialRentalMons(void)
{
ZeroPlayerPartyMons();
DoBattleFactorySelectScreen();
}
static void sub_81B9E88(void)
static void SwapRentalMons(void)
{
DoBattleFactorySwapScreen();
}
@@ -275,7 +289,7 @@ bool8 InSlateportBattleTent(void)
&& (gMapHeader.mapLayoutId == LAYOUT_BATTLE_TENT_CORRIDOR || gMapHeader.mapLayoutId == LAYOUT_BATTLE_TENT_BATTLE_ROOM);
}
static void sub_81B9EC0(void)
static void GenerateInitialRentalMons(void)
{
s32 i, j;
u8 firstMonId;
@@ -299,7 +313,7 @@ static void sub_81B9EC0(void)
while (i != PARTY_SIZE)
{
// Cannot have two pokemon of the same species.
monSetId = Random() % 70;
monSetId = Random() % NUM_SLATEPORT_TENT_MONS;
for (j = firstMonId; j < firstMonId + i; j++)
{
u16 monId = monIds[j];
@@ -337,14 +351,14 @@ static void sub_81B9EC0(void)
}
}
static void sub_81BA040(void)
static void GenerateOpponentMons(void)
{
u16 trainerId;
s32 i, j, k;
register const u16 *monSets asm("r9"); // Fix me. Compiler insists on moving that variable into stack.
u16 species[3];
u16 heldItems[3];
s32 setsCount = 0;
register const u16 *monSet asm("r9"); // Fix me. Compiler insists on moving that variable into stack.
u16 species[FRONTIER_PARTY_SIZE];
u16 heldItems[FRONTIER_PARTY_SIZE];
s32 monId = 0;
gFacilityTrainers = gSlateportBattleTentTrainers;
gFacilityTrainerMons = gSlateportBattleTentMons;
@@ -353,7 +367,7 @@ static void sub_81BA040(void)
{
do
{
trainerId = Random() % 30;
trainerId = Random() % NUM_BATTLE_TENT_TRAINERS;
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@@ -362,21 +376,21 @@ static void sub_81BA040(void)
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
gTrainerBattleOpponent_A = trainerId;
while (gFacilityTrainers[gTrainerBattleOpponent_A].monSets[setsCount] != 0xFFFF)
setsCount++;
if (setsCount > 8)
while (gFacilityTrainers[gTrainerBattleOpponent_A].monSet[monId] != 0xFFFF)
monId++;
if (monId > 8)
break;
setsCount = 0;
monId = 0;
}
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 2)
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
monSets = gFacilityTrainers[gTrainerBattleOpponent_A].monSets;
monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet;
i = 0;
while (i != 3)
while (i != FRONTIER_PARTY_SIZE)
{
sRandMonSetId = monSets[Random() % setsCount];
sRandMonSetId = monSet[Random() % monId];
for (j = 0; j < 6; j++)
{
if (gFacilityTrainerMons[sRandMonSetId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
+671 -898
View File
File diff suppressed because it is too large Load Diff
+16 -15
View File
@@ -9,7 +9,7 @@
#include "field_weather.h"
#include "gpu_regs.h"
#include "main.h"
#include "alloc.h"
#include "malloc.h"
#include "overworld.h"
#include "palette.h"
#include "random.h"
@@ -760,10 +760,10 @@ static const struct SpriteTemplate gUnknown_085C8E68 =
static const struct OamData gOamData_85C8E80 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
@@ -1672,7 +1672,7 @@ bool8 FldEff_Pokeball(void)
{
u8 spriteId = CreateSpriteAtEnd(&gUnknown_085C8E68, gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
gSprites[spriteId].oam.priority = 0;
gSprites[spriteId].oam.affineMode = 1;
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].data[0] = gFieldEffectArguments[2];
gSprites[spriteId].data[1] = gFieldEffectArguments[3];
gSprites[spriteId].data[2] = -1;
@@ -1961,9 +1961,10 @@ static bool8 Phase2_Ripple_Func2(struct Task *task)
for (i = 0; i < 160; i++, r4 += r8)
{
// todo: fix the asm
s16 var = r4 >> 8;
asm("");
var++;
var--;
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(var, r3);
}
@@ -2393,20 +2394,20 @@ static void Mugshots_CreateOpponentPlayerSprites(struct Task *task)
opponentSprite->callback = sub_8148380;
playerSprite->callback = sub_8148380;
opponentSprite->oam.affineMode = 3;
playerSprite->oam.affineMode = 3;
opponentSprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE;
playerSprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE;
opponentSprite->oam.matrixNum = AllocOamMatrix();
playerSprite->oam.matrixNum = AllocOamMatrix();
opponentSprite->oam.shape = 1;
playerSprite->oam.shape = 1;
opponentSprite->oam.shape = SPRITE_SHAPE(64x32);
playerSprite->oam.shape = SPRITE_SHAPE(64x32);
opponentSprite->oam.size = 3;
playerSprite->oam.size = 3;
opponentSprite->oam.size = SPRITE_SIZE(64x32);
playerSprite->oam.size = SPRITE_SIZE(64x32);
CalcCenterToCornerVec(opponentSprite, 1, 3, 3);
CalcCenterToCornerVec(playerSprite, 1, 3, 3);
CalcCenterToCornerVec(opponentSprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE);
CalcCenterToCornerVec(playerSprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE);
SetOamMatrixRotationScaling(opponentSprite->oam.matrixNum, sMugshotsOpponentRotationScales[mugshotId][0], sMugshotsOpponentRotationScales[mugshotId][1], 0);
SetOamMatrixRotationScaling(playerSprite->oam.matrixNum, -512, 512, 0);
+15 -15
View File
@@ -1,30 +1,30 @@
#include "global.h"
#include "battle.h"
#include "battle_anim.h"
#include "constants/battle_script_commands.h"
#include "constants/abilities.h"
#include "constants/moves.h"
#include "constants/hold_effects.h"
#include "constants/battle_anim.h"
#include "pokemon.h"
#include "constants/species.h"
#include "item.h"
#include "constants/items.h"
#include "util.h"
#include "constants/battle_move_effects.h"
#include "battle_scripts.h"
#include "random.h"
#include "text.h"
#include "string_util.h"
#include "battle_message.h"
#include "constants/battle_string_ids.h"
#include "constants/weather.h"
#include "battle_ai_script_commands.h"
#include "battle_controllers.h"
#include "event_data.h"
#include "link.h"
#include "berry.h"
#include "field_weather.h"
#include "constants/abilities.h"
#include "constants/battle_anim.h"
#include "constants/battle_move_effects.h"
#include "constants/battle_script_commands.h"
#include "constants/battle_string_ids.h"
#include "constants/berry.h"
#include "constants/hold_effects.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/species.h"
#include "constants/weather.h"
// rom const data
static const u16 sSoundMovesTable[] =
@@ -1830,9 +1830,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
{
switch (GetCurrentWeather())
{
case WEATHER_RAIN_LIGHT:
case WEATHER_RAIN_MED:
case WEATHER_RAIN_HEAVY:
case WEATHER_RAIN:
case WEATHER_RAIN_THUNDERSTORM:
case WEATHER_DOWNPOUR:
if (!(gBattleWeather & WEATHER_RAIN_ANY))
{
gBattleWeather = (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_PERMANENT);
@@ -2084,7 +2084,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
}
}
break;
case ABILITYEFFECT_MOVE_END: // Think contact abilities.
case ABILITYEFFECT_ON_DAMAGE: // Contact abilities and Color Change
switch (gLastUsedAbility)
{
case ABILITY_COLOR_CHANGE:
+7 -7
View File
@@ -2,7 +2,7 @@
#include "battle.h"
#include "battle_anim.h"
#include "battle_controllers.h"
#include "alloc.h"
#include "malloc.h"
#include "pokemon.h"
#include "trainer_hill.h"
#include "party_menu.h"
@@ -102,7 +102,7 @@ void AdjustFriendshipOnBattleFaint(u8 battlerId)
}
}
void sub_80571DC(u8 battlerId, u8 arg1)
void SwitchPartyOrderInGameMulti(u8 battlerId, u8 arg1)
{
if (GetBattlerSide(battlerId) != B_SIDE_OPPONENT)
{
@@ -110,13 +110,13 @@ void sub_80571DC(u8 battlerId, u8 arg1)
// gBattleStruct->field_60[0][i]
for (i = 0; i < 3; i++)
gUnknown_0203CF00[i] = *(0 * 3 + i + (u8*)(gBattleStruct->field_60));
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8*)(gBattleStruct->field_60));
sub_81B8FB0(pokemon_order_func(gBattlerPartyIndexes[battlerId]), pokemon_order_func(arg1));
SwitchPartyMonSlots(GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battlerId]), GetPartyIdFromBattlePartyId(arg1));
for (i = 0; i < 3; i++)
*(0 * 3 + i + (u8*)(gBattleStruct->field_60)) = gUnknown_0203CF00[i];
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
*(0 * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
}
}
+1
View File
@@ -11,6 +11,7 @@
#include "random.h"
#include "string_util.h"
#include "text.h"
#include "constants/berry.h"
#include "constants/event_object_movement_constants.h"
#include "constants/items.h"
+24 -23
View File
@@ -12,7 +12,7 @@
#include "bg.h"
#include "palette.h"
#include "decompress.h"
#include "alloc.h"
#include "malloc.h"
#include "gpu_regs.h"
#include "text.h"
#include "text_window.h"
@@ -36,6 +36,7 @@
#include "new_game.h"
#include "save.h"
#include "link.h"
#include "constants/berry.h"
#include "constants/rgb.h"
#define BLENDER_SCORE_BEST 0
@@ -401,10 +402,10 @@ static const TaskFunc sUnknown_083399EC[] =
static const struct OamData sOamData_8216314 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.matrixNum = 0,
@@ -544,10 +545,10 @@ static const struct SpriteTemplate sBlenderSyncArrow_SpriteTemplate =
static const struct OamData sOamData_821640C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
.x = 0,
.matrixNum = 0,
@@ -613,10 +614,10 @@ static const struct SpriteTemplate sUnknown_08339B40 =
static const struct OamData sOamData_8216474 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
.x = 0,
.matrixNum = 0,
@@ -700,10 +701,10 @@ static const struct SpriteTemplate sUnknown_08339BE0 =
static const struct OamData sOamData_8216514 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.matrixNum = 0,
@@ -758,10 +759,10 @@ static const struct SpriteTemplate sUnknown_08339C2C =
static const struct OamData sOamData_8216560 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.matrixNum = 0,
@@ -1029,7 +1030,7 @@ static void sub_807FAC8(void)
UnsetBgTilemapBuffer(2);
UnsetBgTilemapBuffer(1);
SetVBlankCallback(NULL);
sub_81AABF0(sub_807FFA4);
ChooseBerrySetCallback(sub_807FFA4);
sBerryBlenderData->mainState = 0;
}
@@ -1108,7 +1109,7 @@ static void Blender_SetPlayerNamesLocal(u8 opponentsNum)
sBerryBlenderData->playersNo = 2;
StringCopy(gLinkPlayers[0].name, gSaveBlock2Ptr->playerName);
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_ONLOOKERS))
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER))
StringCopy(gLinkPlayers[1].name, sBlenderOpponentsNames[BLENDER_MASTER]);
else
StringCopy(gLinkPlayers[1].name, sBlenderOpponentsNames[BLENDER_MISTER]);
@@ -1173,7 +1174,7 @@ static void sub_8080018(void)
{
case 0:
sub_8080588();
gLinkType = 0x4422;
gLinkType = LINKTYPE_BERRY_BLENDER;
sBerryBlenderData->field_72 = 0;
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
{
@@ -1431,7 +1432,7 @@ static void Blender_SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum,
{
opponentBerryId = sOpponentBerrySets[opponentSetId][i];
var = playerBerryItemId - 163;
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_ONLOOKERS) && gSpecialVar_0x8004 == 1)
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER) && gSpecialVar_0x8004 == 1)
{
opponentSetId %= 5;
opponentBerryId = sSpecialOpponentBerrySets[opponentSetId];
@@ -1516,7 +1517,7 @@ static void sub_80808D4(void)
sBerryBlenderData->playAgainState = 0;
sBerryBlenderData->loadGfxState = 0;
gLinkType = 0x4422;
gLinkType = LINKTYPE_BERRY_BLENDER;
sBerryBlenderData->mainState++;
break;
case 1:
@@ -1631,7 +1632,7 @@ static void sub_80808D4(void)
if (gSpecialVar_0x8004 == 1)
{
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_ONLOOKERS))
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER))
sBerryBlenderData->field_120[0] = CreateTask(sub_8081224, 10);
else
sBerryBlenderData->field_120[0] = CreateTask(sUnknown_083399EC[0], 10);
@@ -3338,7 +3339,7 @@ static bool8 Blender_PrintBlendingResults(void)
TryAddContestLinkTvShow(&pokeblock, &sBerryBlenderData->tvBlender);
CreateTask(sub_8083F3C, 6);
sub_80EECEC();
IncrementDailyBerryBlender();
RemoveBagItem(gSpecialVar_ItemId, 1);
AddPokeblock(&pokeblock);
+2517 -159
View File
File diff suppressed because it is too large Load Diff
+28 -28
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "gpu_regs.h"
#include "multiboot.h"
#include "alloc.h"
#include "malloc.h"
#include "bg.h"
#include "graphics.h"
#include "main.h"
@@ -36,16 +36,16 @@ static void berry_fix_bg_hide(void);
// .rodata
static const u8 sUnknown_08617E78[] = _("Berry Program Update");
static const u8 sUnknown_08617E8D[] = _("Ruby/Sapphire");
static const u8 sUnknown_08617E9B[] = _("Emerald");
static const u8 sText_BerryProgramUpdate[] = _("Berry Program Update");
static const u8 sText_RubySapphire[] = _("Ruby/Sapphire");
static const u8 sText_Emerald[] = _("Emerald");
static const u8 Unknown_08617EA3[] = _("The Berry Program on your POKéMON\nRuby/Sapphire Game Pak will be updated.\n{COLOR RED}{SHADOW LIGHT_RED}Press the A Button.");
static const u8 Unknown_08617F07[] = _("Please ensure the connection of your\nGame Boy Advance system matches this.\n{COLOR RED}{SHADOW LIGHT_RED}YES: Press the A Button.\nNO: Turn off the power and try again.");
static const u8 Unknown_08617F97[] = _("Please turn on the power of POKéMON\nRuby/Sapphire while holding START and\nSELECT simultaneously. Then, ensure\nthe picture above appears.");
static const u8 Unknown_08618020[] = _("Transmitting. Please wait.\n{COLOR RED}{SHADOW LIGHT_RED}Please do not turn off the power or\nunplug the Game Boy Advance Game\nLink Cable.");
static const u8 Unknown_08618092[] = _("Please follow the instructions on your\nPOKéMON Ruby/Sapphire screen.");
static const u8 Unknown_086180D7[] = _("Transmission failure.\n{COLOR RED}{SHADOW LIGHT_RED}Please try again.");
static const u8 sText_BerryProgramWillBeUpdatedPressA[] = _("The Berry Program on your POKéMON\nRuby/Sapphire Game Pak will be updated.\n{COLOR RED}{SHADOW LIGHT_RED}Press the A Button.");
static const u8 sText_EnsureGBAConnectionMatches[] = _("Please ensure the connection of your\nGame Boy Advance system matches this.\n{COLOR RED}{SHADOW LIGHT_RED}YES: Press the A Button.\nNO: Turn off the power and try again.");
static const u8 sText_TurnOffPowerHoldingStartSelect[] = _("Please turn on the power of POKéMON\nRuby/Sapphire while holding START and\nSELECT simultaneously. Then, ensure\nthe picture above appears.");
static const u8 sText_TransmittingPleaseWait[] = _("Transmitting. Please wait.\n{COLOR RED}{SHADOW LIGHT_RED}Please do not turn off the power or\nunplug the Game Boy Advance Game\nLink Cable.");
static const u8 sText_PleaseFollowInstructionsOnScreen[] = _("Please follow the instructions on your\nPOKéMON Ruby/Sapphire screen.");
static const u8 sText_TransmissionFailureTryAgain[] = _("Transmission failure.\n{COLOR RED}{SHADOW LIGHT_RED}Please try again.");
static const struct BgTemplate gUnknown_08618108[] = {
{
@@ -70,16 +70,16 @@ static const u16 sUnknown_08618138[] = {
0x675a, 0, 0, 0
};
static const u8 sUnknown_08618158[] = {10, 11, 12};
static const u8 sUnknown_0861815B[] = { 0, 10, 13};
static const u8 sBerryProgramTextColors[] = {TEXT_DYNAMIC_COLOR_1, TEXT_DYNAMIC_COLOR_2, TEXT_DYNAMIC_COLOR_3};
static const u8 sGameTitleTextColors[] = { TEXT_COLOR_TRANSPARENT, TEXT_DYNAMIC_COLOR_1, TEXT_DYNAMIC_COLOR_4};
static const u8 *const gUnknown_08618160[] = {
Unknown_08617F07,
Unknown_08617F97,
Unknown_08618020,
Unknown_08618092,
Unknown_086180D7,
Unknown_08617EA3
static const u8 *const sBerryProgramTexts[] = {
sText_EnsureGBAConnectionMatches,
sText_TurnOffPowerHoldingStartSelect,
sText_TransmittingPleaseWait,
sText_PleaseFollowInstructionsOnScreen,
sText_TransmissionFailureTryAgain,
sText_BerryProgramWillBeUpdatedPressA
};
static const void *const gUnknown_08618178[][3] = {
@@ -230,21 +230,21 @@ static void berry_fix_gpu_set(void)
FillWindowPixelBuffer(3, PIXEL_FILL(0));
FillWindowPixelBuffer(0, PIXEL_FILL(0xA));
width = GetStringWidth(0, sUnknown_08617E9B, 0);
width = GetStringWidth(0, sText_Emerald, 0);
left = (0x78 - width) / 2;
AddTextPrinterParameterized3(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E9B);
AddTextPrinterParameterized3(2, 0, left, 3, sGameTitleTextColors, TEXT_SPEED_FF, sText_Emerald);
width = GetStringWidth(0, sUnknown_08617E8D, 0);
width = GetStringWidth(0, sText_RubySapphire, 0);
left = (0x78 - width) / 2 + 0x78;
AddTextPrinterParameterized3(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D);
AddTextPrinterParameterized3(2, 0, left, 3, sGameTitleTextColors, TEXT_SPEED_FF, sText_RubySapphire);
width = GetStringWidth(0, sUnknown_08617E8D, 0);
width = GetStringWidth(0, sText_RubySapphire, 0);
left = (0x70 - width) / 2;
AddTextPrinterParameterized3(3, 0, left, 0, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D);
AddTextPrinterParameterized3(3, 0, left, 0, sGameTitleTextColors, TEXT_SPEED_FF, sText_RubySapphire);
width = GetStringWidth(1, sUnknown_08617E78, 0);
width = GetStringWidth(1, sText_BerryProgramUpdate, 0);
left = (0xD0 - width) / 2;
AddTextPrinterParameterized3(0, 1, left, 2, sUnknown_08618158, TEXT_SPEED_FF, sUnknown_08617E78);
AddTextPrinterParameterized3(0, 1, left, 2, sBerryProgramTextColors, TEXT_SPEED_FF, sText_BerryProgramUpdate);
CopyWindowToVram(2, 2);
CopyWindowToVram(3, 2);
@@ -274,7 +274,7 @@ static void berry_fix_text_print(int scene)
{
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
FillWindowPixelBuffer(1, PIXEL_FILL(0xA));
AddTextPrinterParameterized3(1, 1, 0, 0, sUnknown_08618158, -1, gUnknown_08618160[scene]);
AddTextPrinterParameterized3(1, 1, 0, 0, sBerryProgramTextColors, -1, sBerryProgramTexts[scene]);
PutWindowTilemap(1);
CopyWindowToVram(1, 2);
switch (scene)
+9 -8
View File
@@ -4,7 +4,6 @@
#include "decompress.h"
#include "event_object_movement.h"
#include "item_menu.h"
#include "constants/items.h"
#include "item.h"
#include "item_use.h"
#include "main.h"
@@ -15,20 +14,22 @@
#include "menu_helpers.h"
#include "palette.h"
#include "overworld.h"
#include "constants/songs.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "strings.h"
#include "bg.h"
#include "alloc.h"
#include "malloc.h"
#include "scanline_effect.h"
#include "gpu_regs.h"
#include "graphics.h"
#include "item_menu_icons.h"
#include "decompress.h"
#include "international_string_util.h"
#include "constants/berry.h"
#include "constants/items.h"
#include "constants/rgb.h"
#include "constants/songs.h"
// There are 4 windows used in berry tag screen.
enum
@@ -400,9 +401,9 @@ static void PrintAllBerryData(void)
static void PrintBerryNumberAndName(void)
{
const struct Berry *berry = GetBerryInfo(sBerryTag->berryId);
ConvertIntToDecimalStringN(gStringVar1, sBerryTag->berryId, 2, 2);
ConvertIntToDecimalStringN(gStringVar1, sBerryTag->berryId, STR_CONV_MODE_LEADING_ZEROS, 2);
StringCopy(gStringVar2, berry->name);
StringExpandPlaceholders(gStringVar4, gText_UnkF908Var1Var2);
StringExpandPlaceholders(gStringVar4, gText_NumberVar1Var2);
PrintTextInBerryTagScreen(WIN_BERRY_NAME, gStringVar4, 0, 1, 0, 0);
}
@@ -420,8 +421,8 @@ static void PrintBerrySize(void)
fraction = (inches % 100) / 10;
inches /= 100;
ConvertIntToDecimalStringN(gStringVar1, inches, 0, 2);
ConvertIntToDecimalStringN(gStringVar2, fraction, 0, 2);
ConvertIntToDecimalStringN(gStringVar1, inches, STR_CONV_MODE_LEFT_ALIGN, 2);
ConvertIntToDecimalStringN(gStringVar2, fraction, STR_CONV_MODE_LEFT_ALIGN, 2);
StringExpandPlaceholders(gStringVar4, gText_Var1DotVar2);
AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, gStringVar4, 0x28, 1, 0, NULL);
}
@@ -526,7 +527,7 @@ static void Task_CloseBerryTagScreen(u8 taskId)
DestroyFlavorCircleSprites();
Free(sBerryTag);
FreeAllWindowBuffers();
SetMainCallback2(bag_menu_mail_related);
SetMainCallback2(CB2_ReturnToBagMenuPocket);
DestroyTask(taskId);
}
}
-1305
View File
File diff suppressed because it is too large Load Diff
+48 -51
View File
@@ -45,8 +45,8 @@ static u8 AcroBike_GetJumpDirection(void);
static void Bike_UpdateDirTimerHistory(u8);
static void Bike_UpdateABStartSelectHistory(u8);
static u8 Bike_DPadToDirection(u16);
static u8 get_some_collision(u8);
static u8 Bike_CheckCollisionTryAdvanceCollisionCount(struct EventObject *, s16, s16, u8, u8);
static u8 GetBikeCollision(u8);
static u8 GetBikeCollisionAt(struct EventObject *, s16, s16, u8, u8);
static bool8 IsRunningDisallowedByMetatile(u8);
static void Bike_TryAdvanceCyclingRoadCollisions();
static u8 CanBikeFaceDirOnMetatile(u8, u8);
@@ -214,8 +214,8 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
}
else
{
collision = get_some_collision(direction);
if (collision > 0 && collision < 12)
collision = GetBikeCollision(direction);
if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{
// we hit a solid object, but check to see if its a ledge and then jump.
if (collision == COLLISION_LEDGE_JUMP)
@@ -226,9 +226,9 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
{
// we hit a solid object that is not a ledge, so perform the collision.
Bike_SetBikeStill();
if (collision == 4 && IsPlayerCollidingWithFarawayIslandMew(direction))
if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
PlayerOnBikeCollideWithFarawayIslandMew(direction);
else if (collision < 5 || collision > 8)
else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerOnBikeCollide(direction);
}
}
@@ -250,9 +250,9 @@ static void MachBikeTransition_TrySlowDown(u8 direction)
if (gPlayerAvatar.bikeSpeed != SPEED_STANDING)
gPlayerAvatar.bikeFrameCounter = --gPlayerAvatar.bikeSpeed;
collision = get_some_collision(direction);
collision = GetBikeCollision(direction);
if (collision > 0 && collision < 12)
if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{
if (collision == COLLISION_LEDGE_JUMP)
{
@@ -261,9 +261,9 @@ static void MachBikeTransition_TrySlowDown(u8 direction)
else
{
Bike_SetBikeStill();
if (collision == 4 && IsPlayerCollidingWithFarawayIslandMew(direction))
if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
PlayerOnBikeCollideWithFarawayIslandMew(direction);
else if (collision < 5 || collision > 8)
else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerOnBikeCollide(direction);
}
}
@@ -552,14 +552,14 @@ static void AcroBikeTransition_Moving(u8 direction)
AcroBikeTransition_FaceDirection(playerEventObj->movementDirection);
return;
}
collision = get_some_collision(direction);
if (collision > 0 && collision < 12)
collision = GetBikeCollision(direction);
if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{
if (collision == COLLISION_LEDGE_JUMP)
PlayerJumpLedge(direction);
else if (collision == 4 && IsPlayerCollidingWithFarawayIslandMew(direction))
else if (collision == COLLISION_EVENT_OBJECT && IsPlayerCollidingWithFarawayIslandMew(direction))
PlayerOnBikeCollideWithFarawayIslandMew(direction);
else if (collision < 5 || collision > 8)
else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerOnBikeCollide(direction);
}
else
@@ -614,19 +614,19 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction)
AcroBikeTransition_WheelieHoppingStanding(playerEventObj->movementDirection);
return;
}
collision = get_some_collision(direction);
collision = GetBikeCollision(direction);
// TODO: Try to get rid of this goto
if (collision == 0 || collision == 9)
if (collision == 0 || collision == COLLISION_WHEELIE_HOP)
{
goto derp;
}
else if (collision == 6)
else if (collision == COLLISION_LEDGE_JUMP)
{
PlayerLedgeHoppingWheelie(direction);
}
else if (collision < 5 || collision > 8)
else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
{
if (collision <= 11)
if (collision < COLLISION_VERTICAL_RAIL)
{
AcroBikeTransition_WheelieHoppingStanding(direction);
}
@@ -643,12 +643,12 @@ static void AcroBikeTransition_SideJump(u8 direction)
u8 collision;
struct EventObject *playerEventObj;
collision = get_some_collision(direction);
if (collision != 0)
collision = GetBikeCollision(direction);
if (collision)
{
if (collision == 7)
if (collision == COLLISION_PUSHED_BOULDER)
return;
if (collision < 10)
if (collision < COLLISION_ISOLATED_VERTICAL_RAIL)
{
AcroBikeTransition_TurnDirection(direction);
return;
@@ -680,18 +680,18 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
PlayerIdleWheelie(playerEventObj->movementDirection);
return;
}
collision = get_some_collision(direction);
if (collision > 0 && collision < 12)
collision = GetBikeCollision(direction);
if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{
if (collision == 6)
if (collision == COLLISION_LEDGE_JUMP)
{
PlayerLedgeHoppingWheelie(direction);
}
else if (collision == 9)
else if (collision == COLLISION_WHEELIE_HOP)
{
PlayerIdleWheelie(direction);
}
else if (collision <= 4)
else if (collision < COLLISION_STOP_SURFING)
{
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
PlayerIdleWheelie(direction);
@@ -714,18 +714,18 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
PlayerStartWheelie(playerEventObj->movementDirection);
return;
}
collision = get_some_collision(direction);
if (collision > 0 && collision < 12)
collision = GetBikeCollision(direction);
if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{
if (collision == 6)
if (collision == COLLISION_LEDGE_JUMP)
{
PlayerLedgeHoppingWheelie(direction);
}
else if (collision == 9)
else if (collision == COLLISION_WHEELIE_HOP)
{
PlayerIdleWheelie(direction);
}
else if (collision <= 4)
else if (collision < COLLISION_STOP_SURFING)
{
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
PlayerIdleWheelie(direction);
@@ -748,12 +748,12 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
PlayerEndWheelie(playerEventObj->movementDirection);
return;
}
collision = get_some_collision(direction);
if (collision > 0 && collision < 12)
collision = GetBikeCollision(direction);
if (collision > 0 && collision < COLLISION_VERTICAL_RAIL)
{
if (collision == 6)
if (collision == COLLISION_LEDGE_JUMP)
PlayerJumpLedge(direction);
else if (collision < 5 || collision > 8)
else if (collision < COLLISION_STOP_SURFING || collision > COLLISION_ROTATING_GATE)
PlayerEndWheelie(direction);
return;
}
@@ -865,29 +865,26 @@ static u8 Bike_DPadToDirection(u16 heldKeys)
return DIR_NONE;
}
static u8 get_some_collision(u8 direction)
static u8 GetBikeCollision(u8 direction)
{
s16 x;
s16 y;
u8 metatitleBehavior;
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
x = playerEventObj->currentCoords.x;
y = playerEventObj->currentCoords.y;
s16 x = playerEventObj->currentCoords.x;
s16 y = playerEventObj->currentCoords.y;
MoveCoords(direction, &x, &y);
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
return Bike_CheckCollisionTryAdvanceCollisionCount(playerEventObj, x, y, direction, metatitleBehavior);
return GetBikeCollisionAt(playerEventObj, x, y, direction, metatitleBehavior);
}
static u8 Bike_CheckCollisionTryAdvanceCollisionCount(struct EventObject *eventObject, s16 x, s16 y, u8 direction, u8 metatitleBehavior)
static u8 GetBikeCollisionAt(struct EventObject *eventObject, s16 x, s16 y, u8 direction, u8 metatitleBehavior)
{
u8 collision = CheckForEventObjectCollision(eventObject, x, y, direction, metatitleBehavior);
if (collision > 4)
if (collision > COLLISION_EVENT_OBJECT)
return collision;
if (collision == 0 && IsRunningDisallowedByMetatile(metatitleBehavior))
collision = 2;
if (collision == COLLISION_NONE && IsRunningDisallowedByMetatile(metatitleBehavior))
collision = COLLISION_IMPASSABLE;
if (collision)
Bike_TryAdvanceCyclingRoadCollisions();
@@ -941,10 +938,10 @@ static bool8 WillPlayerCollideWithCollision(u8 newTileCollision, u8 direction)
{
if (direction == DIR_NORTH || direction == DIR_SOUTH)
{
if (newTileCollision == 10 || newTileCollision == 12)
if (newTileCollision == COLLISION_ISOLATED_VERTICAL_RAIL || newTileCollision == COLLISION_VERTICAL_RAIL)
return FALSE;
}
else if (newTileCollision == 11 || newTileCollision == 13)
else if (newTileCollision == COLLISION_ISOLATED_HORIZONTAL_RAIL || newTileCollision == COLLISION_HORIZONTAL_RAIL)
{
return FALSE;
}
@@ -1059,7 +1056,7 @@ void Bike_HandleBumpySlopeJump(void)
bool32 IsRunningDisallowed(u8 metatile)
{
if (!(gMapHeader.flags & 4) || IsRunningDisallowedByMetatile(metatile) == TRUE)
if (!(gMapHeader.flags & MAP_ALLOW_RUN) || IsRunningDisallowedByMetatile(metatile) == TRUE)
return TRUE;
else
return FALSE;
+4 -4
View File
@@ -9,13 +9,13 @@ bool16 ScriptGetPokedexInfo(void)
{
if (gSpecialVar_0x8004 == 0) // is national dex not present?
{
gSpecialVar_0x8005 = GetHoennPokedexCount(0);
gSpecialVar_0x8006 = GetHoennPokedexCount(1);
gSpecialVar_0x8005 = GetHoennPokedexCount(FLAG_GET_SEEN);
gSpecialVar_0x8006 = GetHoennPokedexCount(FLAG_GET_CAUGHT);
}
else
{
gSpecialVar_0x8005 = GetNationalPokedexCount(0);
gSpecialVar_0x8006 = GetNationalPokedexCount(1);
gSpecialVar_0x8005 = GetNationalPokedexCount(FLAG_GET_SEEN);
gSpecialVar_0x8006 = GetNationalPokedexCount(FLAG_GET_CAUGHT);
}
return IsNationalPokedexEnabled();
-209
View File
@@ -1,209 +0,0 @@
#include "global.h"
#include "blit.h"
void BlitBitmapRect4BitWithoutColorKey(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
{
BlitBitmapRect4Bit(src, dst, srcX, srcY, dstX, dstY, width, height, 0xFF);
}
void BlitBitmapRect4Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey)
{
s32 xEnd;
s32 yEnd;
s32 multiplierSrcY;
s32 multiplierDstY;
s32 loopSrcY, loopDstY;
s32 loopSrcX, loopDstX;
const u8 *pixelsSrc;
u8 *pixelsDst;
s32 toOrr;
s32 toAnd;
s32 toShift;
if (dst->width - dstX < width)
xEnd = (dst->width - dstX) + srcX;
else
xEnd = srcX + width;
if (dst->height - dstY < height)
yEnd = (dst->height - dstY) + srcY;
else
yEnd = height + srcY;
multiplierSrcY = (src->width + (src->width & 7)) >> 3;
multiplierDstY = (dst->width + (dst->width & 7)) >> 3;
if (colorKey == 0xFF)
{
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{
for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++)
{
pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1B);
pixelsDst = dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + (((loopDstY >> 3) * multiplierDstY) << 5) + ((u32)(loopDstY << 0x1d) >> 0x1B);
toOrr = ((*pixelsSrc >> ((loopSrcX & 1) << 2)) & 0xF);
toShift = ((loopDstX & 1) << 2);
toOrr <<= toShift;
toAnd = 0xF0 >> (toShift);
*pixelsDst = toOrr | (*pixelsDst & toAnd);
}
}
}
else
{
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{
for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++)
{
pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1B);
pixelsDst = dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + (((loopDstY >> 3) * multiplierDstY) << 5) + ((u32)(loopDstY << 0x1d) >> 0x1B);
toOrr = ((*pixelsSrc >> ((loopSrcX & 1) << 2)) & 0xF);
if (toOrr != colorKey)
{
toShift = ((loopDstX & 1) << 2);
toOrr <<= toShift;
toAnd = 0xF0 >> (toShift);
*pixelsDst = toOrr | (*pixelsDst & toAnd);
}
}
}
}
}
void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
{
s32 xEnd;
s32 yEnd;
s32 multiplierY;
s32 loopX, loopY;
s32 toOrr1, toOrr2;
xEnd = x + width;
if (xEnd > surface->width)
xEnd = surface->width;
yEnd = y + height;
if (yEnd > surface->height)
yEnd = surface->height;
multiplierY = (surface->width + (surface->width & 7)) >> 3;
toOrr1 = (u32)(fillValue << 0x1C) >> 0x18;
toOrr2 = (fillValue & 0xF);
for (loopY = y; loopY < yEnd; loopY++)
{
for (loopX = x; loopX < xEnd; loopX++)
{
u8 *pixels = surface->pixels + ((loopX >> 1) & 3) + ((loopX >> 3) << 5) + (((loopY >> 3) * multiplierY) << 5) + ((u32)(loopY << 0x1d) >> 0x1B);
if ((loopX << 0x1F) != 0)
*pixels = toOrr1 | (*pixels & 0xF);
else
*pixels = toOrr2 | (*pixels & 0xF0);
}
}
}
void BlitBitmapRect4BitTo8Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey, u8 paletteOffset)
{
s32 palOffsetBits;
s32 xEnd;
s32 yEnd;
s32 multiplierSrcY;
s32 multiplierDstY;
s32 loopSrcY, loopDstY;
s32 loopSrcX, loopDstX;
const u8 *pixelsSrc;
u8 *pixelsDst;
s32 colorKeyBits;
palOffsetBits = (u32)(paletteOffset << 0x1C) >> 0x18;
colorKeyBits = (u32)(colorKey << 0x1C) >> 0x18;
if (dst->width - dstX < width)
xEnd = (dst->width - dstX) + srcX;
else
xEnd = width + srcX;
if (dst->height - dstY < height)
yEnd = (srcY + dst->height) - dstY;
else
yEnd = srcY + height;
multiplierSrcY = (src->width + (src->width & 7)) >> 3;
multiplierDstY = (dst->width + (dst->width & 7)) >> 3;
if (colorKey == 0xFF)
{
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{
pixelsSrc = src->pixels + ((srcX >> 1) & 3) + ((srcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1b);
for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++)
{
pixelsDst = dst->pixels + (loopDstX & 7) + ((loopDstX >> 3) << 6) + (((loopDstY >> 3) * multiplierDstY) << 6) + ((u32)(loopDstY << 0x1d) >> 0x1a);
if (loopSrcX & 1)
{
*pixelsDst = palOffsetBits + (*pixelsSrc >> 4);
}
else
{
pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1b);
*pixelsDst = palOffsetBits + (*pixelsSrc & 0xF);
}
}
}
}
else
{
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{
pixelsSrc = src->pixels + ((srcX >> 1) & 3) + ((srcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1b);
for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++)
{
if (loopSrcX & 1)
{
if ((*pixelsSrc & 0xF0) != colorKeyBits)
{
pixelsDst = dst->pixels + (loopDstX & 7) + ((loopDstX >> 3) << 6) + (((loopDstY >> 3) * multiplierDstY) << 6) + ((u32)(loopDstY << 0x1d) >> 0x1a);
*pixelsDst = palOffsetBits + (*pixelsSrc >> 4);
}
}
else
{
pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1b);
if ((*pixelsSrc & 0xF) != colorKey)
{
pixelsDst = dst->pixels + (loopDstX & 7) + ((loopDstX >> 3) << 6) + (((loopDstY >> 3) * multiplierDstY) << 6) + ((u32)(loopDstY << 0x1d) >> 0x1a);
*pixelsDst = palOffsetBits + (*pixelsSrc & 0xF);
}
}
}
}
}
}
void FillBitmapRect8Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
{
s32 xEnd;
s32 yEnd;
s32 multiplierY;
s32 loopX, loopY;
xEnd = x + width;
if (xEnd > surface->width)
xEnd = surface->width;
yEnd = y + height;
if (yEnd > surface->height)
yEnd = surface->height;
multiplierY = (surface->width + (surface->width & 7)) >> 3;
for (loopY = y; loopY < yEnd; loopY++)
{
for (loopX = x; loopX < xEnd; loopX++)
{
u8 *pixels = surface->pixels + (loopX & 7) + ((loopX >> 3) << 6) + (((loopY >> 3) * multiplierY) << 6) + ((u32)(loopY << 0x1d) >> 0x1a);
*pixels = fillValue;
}
}
}
+9 -9
View File
@@ -47,7 +47,7 @@ const struct SpriteTemplate gUnknown_08596974 =
{
.tileTag = ANIM_TAG_HORN_HIT_2,
.paletteTag = ANIM_TAG_HORN_HIT_2,
.oam = &gUnknown_085249F4,
.oam = &gOamData_AffineDouble_ObjNormal_32x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_08596968,
@@ -83,7 +83,7 @@ const struct SpriteTemplate gUnknown_085969C8 =
{
.tileTag = ANIM_TAG_NEEDLE,
.paletteTag = ANIM_TAG_NEEDLE,
.oam = &gUnknown_0852496C,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_085969BC,
@@ -94,7 +94,7 @@ const struct SpriteTemplate gWebThreadSpriteTemplate =
{
.tileTag = ANIM_TAG_WEB_THREAD,
.paletteTag = ANIM_TAG_WEB_THREAD,
.oam = &gUnknown_08524904,
.oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -105,7 +105,7 @@ const struct SpriteTemplate gUnknown_085969F8 =
{
.tileTag = ANIM_TAG_STRING,
.paletteTag = ANIM_TAG_STRING,
.oam = &gUnknown_0852493C,
.oam = &gOamData_AffineOff_ObjNormal_64x32,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -128,7 +128,7 @@ const struct SpriteTemplate gSpiderWebSpriteTemplate =
{
.tileTag = ANIM_TAG_SPIDER_WEB,
.paletteTag = ANIM_TAG_SPIDER_WEB,
.oam = &gUnknown_08524AFC,
.oam = &gOamData_AffineDouble_ObjBlend_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_08596A28,
@@ -139,7 +139,7 @@ const struct SpriteTemplate gLinearStingerSpriteTemplate =
{
.tileTag = ANIM_TAG_NEEDLE,
.paletteTag = ANIM_TAG_NEEDLE,
.oam = &gUnknown_0852496C,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -150,7 +150,7 @@ const struct SpriteTemplate gPinMissileSpriteTemplate =
{
.tileTag = ANIM_TAG_NEEDLE,
.paletteTag = ANIM_TAG_NEEDLE,
.oam = &gUnknown_0852496C,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -161,7 +161,7 @@ const struct SpriteTemplate gIcicleSpearSpriteTemplate =
{
.tileTag = ANIM_TAG_ICICLE_SPEAR,
.paletteTag = ANIM_TAG_ICICLE_SPEAR,
.oam = &gUnknown_08524974,
.oam = &gOamData_AffineNormal_ObjNormal_32x32,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -188,7 +188,7 @@ const struct SpriteTemplate gUnknown_08596AC8 =
{
.tileTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.oam = &gUnknown_08524A9C,
.oam = &gOamData_AffineNormal_ObjBlend_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_08596AC4,
+5 -5
View File
@@ -6,7 +6,7 @@
#include "field_weather.h"
#include "gpu_regs.h"
#include "graphics.h"
#include "alloc.h"
#include "malloc.h"
#include "main.h"
#include "menu.h"
#include "overworld.h"
@@ -307,7 +307,7 @@ static void CableCarMainCallback_Setup(void)
gMain.state++;
break;
case 5:
if (sCableCar->weather == WEATHER_ASH)
if (sCableCar->weather == WEATHER_VOLCANIC_ASH)
{
gMain.state++;
}
@@ -425,7 +425,7 @@ static void sub_81503E4(u8 taskId)
case 1:
switch (sCableCar->weather)
{
case WEATHER_ASH:
case WEATHER_VOLCANIC_ASH:
if (gWeatherPtr->sprites.s2.ashSprites[0] != NULL && gWeatherPtr->sprites.s2.ashSprites[0]->oam.priority != 0)
{
for (; i < NUM_ASH_SPRITES; i++)
@@ -815,7 +815,7 @@ static void LoadCableCarSprites(void)
gSprites[spriteId].pos2.y = 4;
gSprites[spriteId].data[0] = 200;
gSprites[spriteId].data[1] = 99;
sCableCar->weather = WEATHER_ASH;
sCableCar->weather = WEATHER_VOLCANIC_ASH;
sCableCar->unk4 = 0x15e;
SetCurrentAndNextWeatherNoDelay(WEATHER_SUNNY);
break;
@@ -841,7 +841,7 @@ static void LoadCableCarSprites(void)
gSprites[spriteId].data[1] = 0x41;
sCableCar->weather = WEATHER_SUNNY;
sCableCar->unk4 = 0x109;
SetCurrentAndNextWeatherNoDelay(WEATHER_ASH);
SetCurrentAndNextWeatherNoDelay(WEATHER_VOLCANIC_ASH);
break;
}
for (i = 0; i < 9; i++)
+75 -72
View File
@@ -30,6 +30,8 @@
#include "trainer_card.h"
#include "party_menu.h"
#include "window.h"
#include "constants/battle_frontier.h"
#include "constants/cable_club.h"
#include "constants/songs.h"
static const struct WindowTemplate gUnknown_08550594 = {
@@ -123,9 +125,9 @@ static u32 sub_80B2478(u8 lower, u8 upper)
return 1;
case EXCHANGE_IN_PROGRESS:
return 3;
case EXCHANGE_STAT_4:
case EXCHANGE_PLAYER_NOT_READY:
return 7;
case EXCHANGE_STAT_5:
case EXCHANGE_PARTNER_NOT_READY:
return 9;
case EXCHANGE_STAT_6:
ConvertIntToDecimalStringN(gStringVar1, GetLinkPlayerCount_2(), STR_CONV_MODE_LEFT_ALIGN, 1);
@@ -201,7 +203,7 @@ static void sub_80B2634(u8 taskId)
if (data[0] == 0)
{
OpenLinkTimed();
sub_800AB98();
ResetLinkPlayerCount();
ResetLinkPlayers();
data[5] = AddWindow(&gUnknown_08550594);
}
@@ -457,7 +459,7 @@ static void task_map_chg_seq_0807EC34(u16 *a0, u32 taskId)
if (*a0 == 1)
{
if (gLinkType == 0x2266 || gLinkType == 0x2277)
if (gLinkType == LINKTYPE_BATTLE_TOWER_50 || gLinkType == LINKTYPE_BATTLE_TOWER_OPEN)
{
if (sub_80B2AF4(trainerCards[0].monSpecies, trainerCards[1].monSpecies))
{
@@ -550,53 +552,50 @@ static bool8 sub_80B2D6C(u8 taskId)
return FALSE;
}
void sub_80B2DA4(u8 arg0)
void TryBattleLinkup(u8 arg0)
{
u8 r3 = 2;
u8 r2 = 2;
switch (gSpecialVar_0x8004)
{
case 1:
case USING_SINGLE_BATTLE:
r3 = 2;
gLinkType = 0x2233;
gLinkType = LINKTYPE_SINGLE_BATTLE;
break;
case 2:
case USING_DOUBLE_BATTLE:
r3 = 2;
gLinkType = 0x2244;
gLinkType = LINKTYPE_DOUBLE_BATTLE;
break;
case 5:
case USING_MULTI_BATTLE:
r3 = 4;
r2 = 4;
gLinkType = 0x2255;
gLinkType = LINKTYPE_MULTI_BATTLE;
break;
case 9:
case USING_BATTLE_TOWER:
r3 = 2;
if (gSaveBlock2Ptr->frontier.lvlMode == 0)
{
gLinkType = 0x2266;
}
if (gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_50)
gLinkType = LINKTYPE_BATTLE_TOWER_50;
else
{
gLinkType = 0x2277;
}
gLinkType = LINKTYPE_BATTLE_TOWER_OPEN;
break;
}
sub_80B236C(r3, r2);
}
void sub_80B2E4C(void)
void TryTradeLinkup(void)
{
gLinkType = 0x1133;
gLinkType = LINKTYPE_0x1133;
gBattleTypeFlags = 0;
sub_80B236C(2, 2);
}
void sub_80B2E74(void)
void TryRecordMixLinkup(void)
{
gSpecialVar_Result = 0;
gLinkType = 0x3311;
gLinkType = LINKTYPE_0x3311;
gBattleTypeFlags = 0;
sub_80B236C(2, 4);
}
@@ -679,23 +678,23 @@ static void sub_80B2EE4(u8 taskId)
}
}
void sub_80B2FD8(void)
void TryBerryBlenderLinkup(void)
{
gLinkType = 0x4411;
gLinkType = LINKTYPE_BERRY_BLENDER_SETUP;
gBattleTypeFlags = 0;
sub_80B236C(2, 4);
}
void sub_80B3000(void)
void TryContestGModeLinkup(void)
{
gLinkType = 0x6601;
gLinkType = LINKTYPE_CONTEST_GMODE;
gBattleTypeFlags = 0;
sub_80B236C(4, 4);
}
void sub_80B3028(void)
void TryContestEModeLinkup(void)
{
gLinkType = 0x6602;
gLinkType = LINKTYPE_CONTEST_EMODE;
gBattleTypeFlags = 0;
sub_80B236C(2, 4);
}
@@ -707,30 +706,30 @@ u8 sub_80B3050(void)
switch (gSpecialVar_0x8004)
{
case 1:
gLinkType = 0x2233;
case USING_SINGLE_BATTLE:
gLinkType = LINKTYPE_SINGLE_BATTLE;
break;
case 2:
gLinkType = 0x2244;
case USING_DOUBLE_BATTLE:
gLinkType = LINKTYPE_DOUBLE_BATTLE;
break;
case 5:
gLinkType = 0x2255;
case USING_MULTI_BATTLE:
gLinkType = LINKTYPE_MULTI_BATTLE;
break;
case 9:
if (gSaveBlock2Ptr->frontier.lvlMode == 0)
case USING_BATTLE_TOWER:
if (gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_50)
{
gLinkType = 0x2266;
gLinkType = LINKTYPE_BATTLE_TOWER_50;
}
else
{
gLinkType = 0x2277;
gLinkType = LINKTYPE_BATTLE_TOWER_OPEN;
}
break;
case 3:
gLinkType = 0x1111;
case USING_TRADE_CENTER:
gLinkType = LINKTYPE_0x1111;
break;
case 4:
gLinkType = 0x3322;
case USING_RECORD_CORNER:
gLinkType = LINKTYPE_0x3322;
break;
}
@@ -785,26 +784,27 @@ static void sub_80B3220(u8 taskId)
}
}
void sub_80B3254(void)
// Unused
void CableClubSaveGame(void)
{
SaveGame();
}
static void sub_80B3260(int a0)
static void SetLinkBattleTypeFlags(int linkService)
{
switch (a0)
switch (linkService)
{
case 1:
case USING_SINGLE_BATTLE:
gBattleTypeFlags = BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER;
break;
case 2:
case USING_DOUBLE_BATTLE:
gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER;
break;
case 5:
case USING_MULTI_BATTLE:
ReducePlayerPartyToSelectedMons();
gBattleTypeFlags = BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER | BATTLE_TYPE_MULTI;
break;
case 9:
case USING_BATTLE_TOWER:
gBattleTypeFlags = BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER | BATTLE_TYPE_MULTI;
break;
}
@@ -817,8 +817,8 @@ static void sub_80B32B4(u8 taskId)
switch (task->data[0])
{
case 0:
FadeScreen(1, 0);
gLinkType = 0x2211;
FadeScreen(FADE_TO_BLACK, 0);
gLinkType = LINKTYPE_BATTLE;
ClearLinkCallback_2();
task->data[0]++;
break;
@@ -845,7 +845,7 @@ static void sub_80B32B4(u8 taskId)
else
PlayMapChosenOrBattleBGM(MUS_BATTLE20);
sub_80B3260(gSpecialVar_0x8004);
SetLinkBattleTypeFlags(gSpecialVar_0x8004);
CleanupOverworldWindowsAndTilemaps();
gTrainerBattleOpponent_A = 0x800;
SetMainCallback2(CB2_InitBattle);
@@ -863,8 +863,8 @@ static void sub_80B33BC(u8 taskId)
switch (data[0])
{
case 0:
FadeScreen(1, 0);
gLinkType = 0x2211;
FadeScreen(FADE_TO_BLACK, 0);
gLinkType = LINKTYPE_BATTLE;
ClearLinkCallback_2();
data[0] = 1;
break;
@@ -910,8 +910,8 @@ static void sub_80B33BC(u8 taskId)
else
PlayMapChosenOrBattleBGM(MUS_BATTLE20);
gLinkPlayers[0].linkType = 0x2211;
sub_80B3260(gSpecialVar_0x8004);
gLinkPlayers[0].linkType = LINKTYPE_BATTLE;
SetLinkBattleTypeFlags(gSpecialVar_0x8004);
CleanupOverworldWindowsAndTilemaps();
gTrainerBattleOpponent_A = 0x800;
SetMainCallback2(CB2_InitBattle);
@@ -971,9 +971,9 @@ void sub_80B360C(void)
Overworld_ResetMapMusic();
LoadPlayerParty();
SavePlayerBag();
sub_813BF10();
UpdateTrainerFansAfterLinkBattle();
if (gSpecialVar_0x8004 == 1 || gSpecialVar_0x8004 == 2)
if (gSpecialVar_0x8004 == USING_SINGLE_BATTLE || gSpecialVar_0x8004 == USING_DOUBLE_BATTLE)
{
UpdatePlayerLinkBattleRecords(gLocalLinkPlayerId ^ 1);
if (gWirelessCommType)
@@ -1004,7 +1004,10 @@ void sub_80B360C(void)
void CleanupLinkRoomState(void)
{
if (gSpecialVar_0x8004 == 1 || gSpecialVar_0x8004 == 2 || gSpecialVar_0x8004 == 5 || gSpecialVar_0x8004 == 9)
if (gSpecialVar_0x8004 == USING_SINGLE_BATTLE
|| gSpecialVar_0x8004 == USING_DOUBLE_BATTLE
|| gSpecialVar_0x8004 == USING_MULTI_BATTLE
|| gSpecialVar_0x8004 == USING_BATTLE_TOWER)
{
LoadPlayerParty();
SavePlayerBag();
@@ -1075,7 +1078,7 @@ static void sub_80B37FC(u8 taskId)
{
case 0:
ScriptContext2_Enable();
FadeScreen(1, 0);
FadeScreen(FADE_TO_BLACK, 0);
ClearLinkCallback_2();
task->data[0]++;
break;
@@ -1084,8 +1087,8 @@ static void sub_80B37FC(u8 taskId)
task->data[0]++;
break;
case 2:
gUnknown_02032298[0] = 0;
gUnknown_02032298[1] = 0;
gSelectedTradeMonPositions[TRADE_PLAYER] = 0;
gSelectedTradeMonPositions[TRADE_PARTNER] = 0;
m4aMPlayAllStop();
sub_800AC34();
task->data[0]++;
@@ -1093,7 +1096,7 @@ static void sub_80B37FC(u8 taskId)
case 3:
if (!gReceivedRemoteLinkPlayers)
{
SetMainCallback2(sub_80773AC);
SetMainCallback2(CB2_StartCreateTradeMenu);
DestroyTask(taskId);
}
break;
@@ -1108,8 +1111,8 @@ static void sub_80B3894(u8 taskId)
{
case 0:
ScriptContext2_Enable();
FadeScreen(1, 0);
Rfu_set_zero();
FadeScreen(FADE_TO_BLACK, 0);
ClearLinkRfuCallback();
data[0]++;
break;
case 1:
@@ -1117,8 +1120,8 @@ static void sub_80B3894(u8 taskId)
data[0]++;
break;
case 2:
gUnknown_02032298[0] = 0;
gUnknown_02032298[1] = 0;
gSelectedTradeMonPositions[TRADE_PLAYER] = 0;
gSelectedTradeMonPositions[TRADE_PARTNER] = 0;
m4aMPlayAllStop();
sub_800ADF8();
data[0]++;
@@ -1159,7 +1162,7 @@ void nullsub_37(void)
// Note: VAR_0x8005 is set to the ID of the player spot.
void ColosseumPlayerSpotTriggered(void)
{
gLinkType = 0x2211;
gLinkType = LINKTYPE_BATTLE;
if (gWirelessCommType != 0)
{
@@ -1178,7 +1181,7 @@ static void sub_80B39A4(void)
ScriptContext1_Stop();
}
void sp02A_crash_sound(void)
void Script_ShowLinkTrainerCard(void)
{
ShowTrainerCardInLink(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic);
}
@@ -1296,10 +1299,10 @@ void sub_80B3AF8(u8 taskId)
}
}
void sub_80B3BC4(void)
void TrySetBattleTowerLinkType(void)
{
if (gWirelessCommType == 0)
{
gLinkType = 0x2288;
gLinkType = LINKTYPE_BATTLE_TOWER;
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ static void InitTimeBasedEvents(void)
void DoTimeBasedEvents(void)
{
if (FlagGet(FLAG_SYS_CLOCK_SET) && !sub_813B9C0())
if (FlagGet(FLAG_SYS_CLOCK_SET) && !InPokemonCenter())
{
RtcCalcLocalTime();
UpdatePerDay(&gLocalTime);
+3 -4
View File
@@ -6,8 +6,7 @@
#include "string_util.h"
#include "menu.h"
#include "international_string_util.h"
#define MAX_COINS 9999
#include "constants/coins.h"
EWRAM_DATA u8 sCoinsWindowId = 0;
@@ -49,7 +48,7 @@ void SetCoins(u16 coinAmount)
gSaveBlock1Ptr->coins = coinAmount ^ gSaveBlock2Ptr->encryptionKey;
}
bool8 GiveCoins(u16 toAdd)
bool8 AddCoins(u16 toAdd)
{
u16 newAmount;
u16 ownedCoins = GetCoins();
@@ -71,7 +70,7 @@ bool8 GiveCoins(u16 toAdd)
return TRUE;
}
bool8 TakeCoins(u16 toSub)
bool8 RemoveCoins(u16 toSub)
{
u16 ownedCoins = GetCoins();
if (ownedCoins >= toSub)
+90 -112
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "gpu_regs.h"
#include "bg.h"
#include "alloc.h"
#include "malloc.h"
#include "constants/items.h"
#include "constants/event_objects.h"
#include "constants/moves.h"
@@ -219,15 +219,15 @@ static void sub_80DF9E0(u8 *, s32);
static void SwapMoveDescAndContestTilemaps(void);
// EWRAM vars.
EWRAM_DATA struct ContestPokemon gContestMons[4] = {0};
EWRAM_DATA s16 gContestMonConditions[4] = {0};
EWRAM_DATA s16 gUnknown_02039F08[4] = {0};
EWRAM_DATA s16 gUnknown_02039F10[4] = {0};
EWRAM_DATA s16 gUnknown_02039F18[4] = {0};
EWRAM_DATA u8 gContestFinalStandings[4] = {0};
EWRAM_DATA struct ContestPokemon gContestMons[CONTESTANT_COUNT] = {0};
EWRAM_DATA s16 gContestMonConditions[CONTESTANT_COUNT] = {0};
EWRAM_DATA s16 gUnknown_02039F08[CONTESTANT_COUNT] = {0};
EWRAM_DATA s16 gUnknown_02039F10[CONTESTANT_COUNT] = {0};
EWRAM_DATA s16 gUnknown_02039F18[CONTESTANT_COUNT] = {0};
EWRAM_DATA u8 gContestFinalStandings[CONTESTANT_COUNT] = {0};
EWRAM_DATA u8 gContestMonPartyIndex = 0;
EWRAM_DATA u8 gContestPlayerMonIndex = 0;
EWRAM_DATA u8 gContestantTurnOrder[4] = {0};
EWRAM_DATA u8 gContestantTurnOrder[CONTESTANT_COUNT] = {0};
EWRAM_DATA u8 gLinkContestFlags = 0;
// Bit 0: Is a link contest
// Bit 1: Link contest uses wireless adapter
@@ -238,7 +238,7 @@ EWRAM_DATA u8 gNumLinkContestPlayers = 0;
EWRAM_DATA u8 gHighestRibbonRank = 0;
EWRAM_DATA struct ContestResources *gContestResources = NULL;
EWRAM_DATA u8 sContestBgCopyFlags = 0;
EWRAM_DATA struct ContestWinner gUnknown_02039F3C = {0};
EWRAM_DATA struct ContestWinner gCurContestWinner = {0};
EWRAM_DATA u8 gUnknown_02039F5C = 0;
EWRAM_DATA u8 gUnknown_02039F5D = 0;
@@ -246,29 +246,8 @@ EWRAM_DATA u8 gUnknown_02039F5D = 0;
u32 gContestRngValue;
extern const u8 gText_LinkStandby4[];
extern const u8 gText_0827D55A[];
extern const u8 gText_0827E793[];
extern const u8 gText_0827E32E[];
extern const u8 gText_0827E35B[];
extern const u8 gText_0827E38D[];
extern const u8 gText_0827E2FE[];
extern const u8 gText_RepeatedAppeal[];
extern const u8 gText_0827E73C[];
extern const u8 gText_0827E717[];
extern const u8 gText_0827E76A[];
extern const u8 gText_0827E7EA[];
extern const u8 gText_0827E817[];
extern const u8 gText_0827E58A[];
extern const u8 gText_0827D56F[];
extern const u8 gText_0827D597[];
extern const u8 gText_Contest_Shyness[];
extern const u8 gText_Contest_Anxiety[];
extern const u8 gText_Contest_Laziness[];
extern const u8 gText_Contest_Hesitancy[];
extern const u8 gText_Contest_Fear[];
extern const u8 gText_BDot[];
extern const u8 gText_CDot[];
extern const u8 *const gUnknown_08587E10[];
extern void (*const gContestEffectFuncs[])(void);
static const u8 gUnknown_08587A6C[] =
@@ -291,10 +270,10 @@ static const struct SpriteSheet gUnknown_08587A74 =
static const struct OamData gOamData_8587A7C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
.x = 0,
.matrixNum = 0,
@@ -376,10 +355,10 @@ static const struct SpritePalette gUnknown_08587B08 =
static const struct OamData gOamData_8587B10 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x8),
.x = 0,
.matrixNum = 0,
@@ -435,16 +414,16 @@ const struct Subsprite gSubspriteTable_8587B78[] =
{
.x = -28,
.y = -4,
.shape = ST_OAM_H_RECTANGLE,
.size = 1,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 0,
.priority = 0
},
{
.x = 4,
.y = -4,
.shape = ST_OAM_H_RECTANGLE,
.size = 1,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
.tileOffset = 4,
.priority = 0
}
@@ -577,7 +556,7 @@ const struct SpriteTemplate gSpriteTemplate_8587C18 =
{
.tileTag = 0xABE0,
.paletteTag = 0xABE0,
.oam = &gUnknown_0852490C,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -1345,9 +1324,9 @@ static void sub_80D833C(u8 taskId)
DmaCopy32Defvars(3, gPlttBufferUnfaded, eUnknownHeap1A004.unk18204, PLTT_BUFFER_SIZE * 2);
ConvertIntToDecimalStringN(gStringVar1, eContest.turnNumber + 1, STR_CONV_MODE_LEFT_ALIGN, 1);
if (!Contest_IsMonsTurnDisabled(gContestPlayerMonIndex))
StringCopy(gDisplayedStringBattle, gText_0827D507);
StringCopy(gDisplayedStringBattle, gText_AppealNumWhichMoveWillBePlayed);
else
StringCopy(gDisplayedStringBattle, gText_0827D531);
StringCopy(gDisplayedStringBattle, gText_AppealNumButItCantParticipate);
ContestClearGeneralTextWindow();
StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle);
Contest_StartTextPrinter(gStringVar4, TRUE);
@@ -1443,9 +1422,9 @@ static void sub_80D8610(u8 taskId)
sub_80DC490(FALSE);
ConvertIntToDecimalStringN(gStringVar1, eContest.turnNumber + 1, STR_CONV_MODE_LEFT_ALIGN, 1);
if (!Contest_IsMonsTurnDisabled(gContestPlayerMonIndex))
StringCopy(gDisplayedStringBattle, gText_0827D507);
StringCopy(gDisplayedStringBattle, gText_AppealNumWhichMoveWillBePlayed);
else
StringCopy(gDisplayedStringBattle, gText_0827D531);
StringCopy(gDisplayedStringBattle, gText_AppealNumButItCantParticipate);
ContestClearGeneralTextWindow();
StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle);
Contest_StartTextPrinter(gStringVar4, 0);
@@ -1574,7 +1553,7 @@ static void sub_80D8A88(u8 taskId)
{
s32 i;
for (i = 0; i + gNumLinkContestPlayers < 4; i++)
for (i = 0; i + gNumLinkContestPlayers < CONTESTANT_COUNT; i++)
{
eContestantStatus[gNumLinkContestPlayers + i].currMove = GetChosenMove(gNumLinkContestPlayers + i);
}
@@ -1673,8 +1652,8 @@ static void sub_80D8B38(u8 taskId)
if (eContestantStatus[r6].currMove < MOVES_COUNT)
StringCopy(gStringVar2, gMoveNames[eContestantStatus[r6].currMove]);
else
StringCopy(gStringVar2, gUnknown_08587F1C[eContestantStatus[r6].moveCategory]);
StringExpandPlaceholders(gStringVar4, gText_0827D55A);
StringCopy(gStringVar2, sInvalidContestMoveNames[eContestantStatus[r6].moveCategory]);
StringExpandPlaceholders(gStringVar4, gText_MonAppealedWithMove);
Contest_StartTextPrinter(gStringVar4, 1);
gTasks[taskId].data[0] = 6;
}
@@ -1735,7 +1714,7 @@ static void sub_80D8B38(u8 taskId)
{
if (eContestantStatus[r6].effectStringId2 != CONTEST_STRING_NONE)
{
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (i != r6 && eContestantStatus[i].effectStringId != CONTEST_STRING_NONE)
break;
@@ -1838,10 +1817,10 @@ static void sub_80D8B38(u8 taskId)
s32 r2 = 0;
r3 = 0;
for (i = gTasks[taskId].data[1]; i < 4; i++)
for (i = gTasks[taskId].data[1]; i < CONTESTANT_COUNT; i++)
{
r3 = 0;
for (r2 = 0; r2 < 4; r2++)
for (r2 = 0; r2 < CONTESTANT_COUNT; r2++)
{
if (r2 != r6 && gContestantTurnOrder[r2] == i
&& eContestantStatus[r2].effectStringId != CONTEST_STRING_NONE)
@@ -1906,7 +1885,7 @@ static void sub_80D8B38(u8 taskId)
}
return;
case 30:
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (gContestantTurnOrder[i] == gTasks[taskId].data[1])
break;
@@ -1932,7 +1911,7 @@ static void sub_80D8B38(u8 taskId)
{
ContestClearGeneralTextWindow();
StringCopy(gStringVar1, gContestMons[r6].nickname);
StringExpandPlaceholders(gStringVar4, gText_0827E793);
StringExpandPlaceholders(gStringVar4, gText_MonCantAppealNextTurn);
Contest_StartTextPrinter(gStringVar4, 1);
}
gTasks[taskId].data[0] = 52;
@@ -1953,11 +1932,11 @@ static void sub_80D8B38(u8 taskId)
{
ContestClearGeneralTextWindow();
if (r3 == 1)
Contest_StartTextPrinter(gText_0827E32E, TRUE);
Contest_StartTextPrinter(gText_AppealComboWentOverWell, TRUE);
else if (r3 == 2)
Contest_StartTextPrinter(gText_0827E35B, TRUE);
Contest_StartTextPrinter(gText_AppealComboWentOverVeryWell, TRUE);
else
Contest_StartTextPrinter(gText_0827E38D, TRUE);
Contest_StartTextPrinter(gText_AppealComboWentOverExcellently, TRUE);
sub_80DD720(3);
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[0] = 45;
@@ -1966,7 +1945,7 @@ static void sub_80D8B38(u8 taskId)
{
ContestClearGeneralTextWindow();
StringCopy(gStringVar1, gContestMons[r6].nickname);
StringExpandPlaceholders(gStringVar4, gText_0827E2FE);
StringExpandPlaceholders(gStringVar4, gText_JudgeLookedAtMonExpectantly);
Contest_StartTextPrinter(gStringVar4, 1);
sub_80DD720(2);
gTasks[taskId].data[10] = 0;
@@ -2056,7 +2035,7 @@ static void sub_80D8B38(u8 taskId)
}
else
{
StringCopy(gStringVar3, gUnknown_08587F08[gContestMoves[eContestantStatus[r6].currMove].contestCategory]);
StringCopy(gStringVar3, sContestConditions[gContestMoves[eContestantStatus[r6].currMove].contestCategory]);
}
if (r3 > 0)
{
@@ -2075,11 +2054,11 @@ static void sub_80D8B38(u8 taskId)
else
{
if (r3 < 0)
StringExpandPlaceholders(gStringVar4, gText_0827E73C);
StringExpandPlaceholders(gStringVar4, gText_MonsXDidntGoOverWell);
else if (r3 > 0 && eContest.applauseLevel <= 4)
StringExpandPlaceholders(gStringVar4, gText_0827E717);
StringExpandPlaceholders(gStringVar4, gText_MonsXWentOverGreat);
else
StringExpandPlaceholders(gStringVar4, gText_0827E76A);
StringExpandPlaceholders(gStringVar4, gText_MonsXGotTheCrowdGoing);
Contest_StartTextPrinter(gStringVar4, 1);
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[11] = 0;
@@ -2189,7 +2168,7 @@ static void sub_80D8B38(u8 taskId)
StringCopy(gStringVar3, gContestMons[gContestResources->field_10->excitementFreezer].nickname);
StringCopy(gStringVar1, gContestMons[r6].nickname);
StringCopy(gStringVar2, gMoveNames[eContestantStatus[r6].currMove]);
StringExpandPlaceholders(gStringVar4, gText_0827E7EA);
StringExpandPlaceholders(gStringVar4, gText_CrowdContinuesToWatchMon);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].data[0] = 58;
return;
@@ -2197,7 +2176,7 @@ static void sub_80D8B38(u8 taskId)
if (!Contest_RunTextPrinters())
{
ContestClearGeneralTextWindow();
StringExpandPlaceholders(gStringVar4, gText_0827E817);
StringExpandPlaceholders(gStringVar4, gText_MonsMoveIsIgnored);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].data[0] = 59;
}
@@ -2215,7 +2194,7 @@ static void sub_80D8B38(u8 taskId)
sub_80DC9B4(r6);
StringCopy(gStringVar1, gContestMons[r6].nickname);
StringCopy(gStringVar2, gMoveNames[eContestantStatus[r6].currMove]);
StringExpandPlaceholders(gStringVar4, gText_0827E58A);
StringExpandPlaceholders(gStringVar4, gText_MonWasTooNervousToMove);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].data[0] = 34;
return;
@@ -2259,7 +2238,7 @@ static void sub_80D8B38(u8 taskId)
case 31:
ContestClearGeneralTextWindow();
StringCopy(gStringVar1, gContestMons[r6].nickname);
StringExpandPlaceholders(gStringVar4, gText_0827D56F);
StringExpandPlaceholders(gStringVar4, gText_MonWasWatchingOthers);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].data[0] = 32;
return;
@@ -2427,11 +2406,11 @@ static void sub_80DA3CC(u8 taskId)
{
if (gTasks[taskId].data[0] == 0)
{
u8 r4 = eContestantStatus[gContestPlayerMonIndex].attentionLevel;
u8 attention = eContestantStatus[gContestPlayerMonIndex].attentionLevel;
ContestClearGeneralTextWindow();
StringCopy(gStringVar1, gContestMons[gContestPlayerMonIndex].nickname);
StringExpandPlaceholders(gStringVar4, gUnknown_08587D90[r4]);
StringExpandPlaceholders(gStringVar4, sRoundResultTexts[attention]);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].data[0]++;
}
@@ -2509,7 +2488,7 @@ static void sub_80DA5E8(u8 taskId)
gBattle_BG0_Y = 0;
gBattle_BG2_Y = 0;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
gUnknown_02039F10[i] = eContestantStatus[i].pointTotal;
sub_80DBD18();
ContestClearGeneralTextWindow();
@@ -2522,7 +2501,7 @@ static void sub_80DA5E8(u8 taskId)
ContestDebugPrintBitStrings();
}
gContestRngValue = gRngValue;
StringExpandPlaceholders(gStringVar4, gText_0827D597);
StringExpandPlaceholders(gStringVar4, gText_AllOutOfAppealTime);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_80DA6B4;
@@ -2786,9 +2765,9 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame)
opponents[opponentsCount++] = i;
}
opponents[opponentsCount] = 0xFF;
for (i = 0; i < 4 - gNumLinkContestPlayers; i++)
for (i = 0; i < CONTESTANT_COUNT - gNumLinkContestPlayers; i++)
{
u16 rnd = sub_80F903C() % opponentsCount;
u16 rnd = GetContestRand() % opponentsCount;
gContestMons[gNumLinkContestPlayers + i] = gContestOpponents[opponents[rnd]];
sub_80DF9D4(gContestMons[gNumLinkContestPlayers + i].trainerName);
@@ -2799,16 +2778,15 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame)
}
}
// GetContestAvailability?
u8 sub_80DAE0C(struct Pokemon *pkmn)
u8 GetContestEntryEligibility(struct Pokemon *pkmn)
{
u8 ribbon;
u8 retVal;
u8 eligibility;
if (GetMonData(pkmn, MON_DATA_IS_EGG))
return 3;
return CANT_ENTER_CONTEST_EGG;
if (GetMonData(pkmn, MON_DATA_HP) == 0)
return 4;
return CANT_ENTER_CONTEST_FAINTED;
switch (gSpecialVar_ContestCategory)
{
case CONTEST_CATEGORY_COOL:
@@ -2827,19 +2805,19 @@ u8 sub_80DAE0C(struct Pokemon *pkmn)
ribbon = GetMonData(pkmn, MON_DATA_TOUGH_RIBBON);
break;
default:
return 0;
return CANT_ENTER_CONTEST;
}
// Couldn't get this to match any other way.
// Returns 2, 1, or 0 respectively if ribbon's rank is above, equal, or below
// the current contest rank.
if (ribbon > gSpecialVar_ContestRank)
retVal = 2;
eligibility = CAN_ENTER_CONTEST_HIGH_RANK;
else if (ribbon >= gSpecialVar_ContestRank)
retVal = 1;
eligibility = CAN_ENTER_CONTEST_EQUAL_RANK;
else
retVal = 0;
return retVal;
eligibility = CANT_ENTER_CONTEST;
return eligibility;
}
static void DrawContestantWindowText(void)
@@ -2935,7 +2913,7 @@ void sub_80DB09C(u8 contestCategory)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
gContestMonConditions[i] = sub_80DAFE0(i, contestCategory);
}
@@ -3102,7 +3080,7 @@ static void sub_80DB584(void)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80DB4E0(eContestantStatus[i].currMove, i);
}
@@ -3213,7 +3191,7 @@ static void sub_80DB884(void)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80DB798(i);
}
@@ -3863,7 +3841,7 @@ static void sub_80DC864(void)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80DC87C(i);
}
@@ -4260,7 +4238,7 @@ static void sub_80DD080(u8 contestant)
eContestResources8.jam2 = eContestResources8.jam;
eContestResources8.contestant = contestant;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
eContestantStatus[i].jam = 0;
eContestResources8.unnervedPokes[i] = 0;
@@ -4382,7 +4360,7 @@ static void sub_80DD45C(u8 contestant, u8 stringId)
StringCopy(gStringVar3, gText_Contest_Hesitancy);
else
StringCopy(gStringVar3, gText_Contest_Fear);
StringExpandPlaceholders(gStringVar4, gUnknown_08587E10[stringId]);
StringExpandPlaceholders(gStringVar4, sAppealResultTexts[stringId]);
ContestClearGeneralTextWindow();
Contest_StartTextPrinter(gStringVar4, 1);
}
@@ -4797,7 +4775,7 @@ static void sub_80DE008(bool8 a)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestantStatus[i].turnOrderMod != 0 && a)
{
@@ -5043,7 +5021,7 @@ static void sub_80DE69C(u8 a)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
gSprites[gContestResources->field_14[i].unk0].oam.matrixNum = AllocOamMatrix();
gSprites[gContestResources->field_14[i].unk0].oam.affineMode = 1;
gSprites[gContestResources->field_14[i].unk0].oam.affineMode = ST_OAM_AFFINE_NORMAL;
StartSpriteAffineAnim(&gSprites[gContestResources->field_14[i].unk0], a);
if (a == 2)
{
@@ -5115,7 +5093,7 @@ static void sub_80DE864(u8 a)
gContestResources->field_18->unk4_0 = 1;
break;
case MOVE_RETURN:
gAnimFriendship = 0xFF;
gAnimFriendship = MAX_FRIENDSHIP;
break;
case MOVE_FRUSTRATION:
gAnimFriendship = 0;
@@ -5303,7 +5281,7 @@ void ResetContestLinkResults(void)
gSaveBlock2Ptr->contestLinkResults[i][j] = 0;
}
bool8 sub_80DEDA8(u8 a)
bool8 sub_80DEDA8(u8 rank)
{
s32 i;
u8 r7 = Random() % 3;
@@ -5313,7 +5291,7 @@ bool8 sub_80DEDA8(u8 a)
if (gContestFinalStandings[i] == 0)
break;
}
if (a == 0xFF && i != gContestPlayerMonIndex)
if (rank == 0xFF && i != gContestPlayerMonIndex)
return FALSE;
switch (gSpecialVar_ContestCategory)
{
@@ -5333,9 +5311,9 @@ bool8 sub_80DEDA8(u8 a)
r7 += 12;
break;
}
if (a != 0xFE)
if (rank != 0xFE)
{
u8 r4 = sub_80DEFA8(a, 1);
u8 r4 = sub_80DEFA8(rank, 1);
gSaveBlock1Ptr->contestWinners[r4].personality = gContestMons[i].personality;
gSaveBlock1Ptr->contestWinners[r4].species = gContestMons[i].species;
@@ -5343,44 +5321,44 @@ bool8 sub_80DEDA8(u8 a)
StringCopy(gSaveBlock1Ptr->contestWinners[r4].monName, gContestMons[i].nickname);
StringCopy(gSaveBlock1Ptr->contestWinners[r4].trainerName, gContestMons[i].trainerName);
if(gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
gSaveBlock1Ptr->contestWinners[r4].contestRank = 4;
gSaveBlock1Ptr->contestWinners[r4].contestRank = CONTEST_RANK_LINK;
else
gSaveBlock1Ptr->contestWinners[r4].contestRank = gSpecialVar_ContestRank;
if (a != 0xFF)
if (rank != 0xFF)
gSaveBlock1Ptr->contestWinners[r4].contestCategory = gSpecialVar_ContestCategory;
else
gSaveBlock1Ptr->contestWinners[r4].contestCategory = r7;
}
else
{
gUnknown_02039F3C.personality = gContestMons[i].personality;
gUnknown_02039F3C.trainerId = gContestMons[i].otId;
gUnknown_02039F3C.species = gContestMons[i].species;
StringCopy(gUnknown_02039F3C.monName, gContestMons[i].nickname);
StringCopy(gUnknown_02039F3C.trainerName, gContestMons[i].trainerName);
gUnknown_02039F3C.contestCategory = r7;
gCurContestWinner.personality = gContestMons[i].personality;
gCurContestWinner.trainerId = gContestMons[i].otId;
gCurContestWinner.species = gContestMons[i].species;
StringCopy(gCurContestWinner.monName, gContestMons[i].nickname);
StringCopy(gCurContestWinner.trainerName, gContestMons[i].trainerName);
gCurContestWinner.contestCategory = r7;
}
return TRUE;
}
u8 sub_80DEFA8(u8 a, u8 b)
u8 sub_80DEFA8(u8 rank, u8 b)
{
s32 i;
switch (a)
switch (rank)
{
case 0:
case 1:
case 2:
case 3:
case CONTEST_RANK_NORMAL:
case CONTEST_RANK_SUPER:
case CONTEST_RANK_HYPER:
case CONTEST_RANK_MASTER:
if (b != 0)
{
for (i = 5; i >= 1; i--)
memcpy(&gSaveBlock1Ptr->contestWinners[i], &gSaveBlock1Ptr->contestWinners[i - 1], sizeof(struct ContestWinner));
}
return 0;
default:
default: // CONTEST_RANK_LINK
switch (gSpecialVar_ContestCategory)
{
case CONTEST_CATEGORY_COOL:
@@ -5435,7 +5413,7 @@ static void sub_80DF080(u8 contestant)
gContestResources->field_1c[contestant].unkC |= 8;
}
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (i != contestant && eContestantStatus[i].jam != 0)
{
@@ -5482,7 +5460,7 @@ static void sub_80DF250(void)
r1 = 0;
var_38 = 0;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (gContestFinalStandings[i] == 0)
var_38 = i;
@@ -5509,7 +5487,7 @@ static void sub_80DF250(void)
r12 = FALSE;
r8 = FALSE;
for (j = 0; j < 4; j++)
for (j = 0; j < CONTESTANT_COUNT; j++)
{
if (gContestMonConditions[i] > gContestMonConditions[j])
r12 = TRUE;
+77 -73
View File
@@ -1,5 +1,5 @@
#include "global.h"
#include "alloc.h"
#include "malloc.h"
#include "battle.h"
#include "battle_gfx_sfx_util.h"
#include "bg.h"
@@ -39,6 +39,7 @@
#include "constants/game_stat.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/tv.h"
#include "constants/vars.h"
#include "contest.h"
@@ -88,7 +89,7 @@ extern const struct CompressedSpriteSheet gUnknown_0858D878[];
extern const struct CompressedSpritePalette gUnknown_0858D880[];
extern const struct SpriteSheet gUnknown_0858D8E0;
extern const struct SpriteTemplate gSpriteTemplate_858D8C8;
extern const u8 gUnknown_0858D8E8[];
extern const u8 sContestLinkTextColors[];
extern const u8 gUnknown_0858D6D0[];
extern const struct SpriteTemplate gSpriteTemplate_858D7F8;
extern const struct SpriteSheet gUnknown_0858D810[];
@@ -265,7 +266,7 @@ void sub_80F5AE0(void)
{
int i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80F5A74(i);
CopyBgTilemapBufferToVram(1);
@@ -355,17 +356,17 @@ static void sub_80F5CE4(u8 taskId)
InterviewAfter();
}
sub_813BADC(2);
TryGainNewFanFromCounter(2);
sub_80DEDA8(gSpecialVar_ContestRank);
sub_80DEDA8(0xFE);
gUnknown_02039F5C = 1;
gUnknown_02039F5D = sub_80DEFA8(0xFE, 0);
var = VarGet(VAR_LINK_CONTEST_ROOM_STATE);
VarSet(VAR_LINK_CONTEST_ROOM_STATE, 0);
var = VarGet(VAR_CONTEST_HALL_STATE);
VarSet(VAR_CONTEST_HALL_STATE, 0);
SetContinueGameWarpStatusToDynamicWarp();
TrySavingData(SAVE_LINK);
ClearContinueGameWarpStatus2();
VarSet(VAR_LINK_CONTEST_ROOM_STATE, var);
VarSet(VAR_CONTEST_HALL_STATE, var);
gTasks[taskId].data[0]++;
break;
case 1:
@@ -410,7 +411,7 @@ static void sub_80F5CE4(u8 taskId)
sub_80DEDA8(0xFE);
gUnknown_02039F5C = 1;
gUnknown_02039F5D = sub_80DEFA8(0xFE, 0);
sub_813BADC(2);
TryGainNewFanFromCounter(2);
gTasks[taskId].func = sub_80F5F74;
}
}
@@ -576,7 +577,7 @@ static void sub_80F6204(u8 taskId)
}
break;
case 2:
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
newTaskId = CreateTask(sub_80F73DC, 10);
gTasks[newTaskId].data[0] = gContestFinalStandings[i];
@@ -592,7 +593,7 @@ static void sub_80F6204(u8 taskId)
gTasks[taskId].data[1] = 0;
CreateTask(sub_80F74BC, 10);
gTasks[taskId].data[0]++;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
sub_80F77E0(i, 14);
@@ -603,7 +604,7 @@ static void sub_80F6204(u8 taskId)
if (++gTasks[taskId].data[1] == 21)
{
gTasks[taskId].data[1] = 0;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
StringCopy(gStringVar1, gContestMons[i].trainerName);
@@ -636,7 +637,7 @@ static void sub_80F6404(u8 taskId)
case 0:
gBattle_WIN0H = 0x00F0;
gBattle_WIN0V = 0x5050;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
species = gContestMons[i].species;
@@ -732,7 +733,7 @@ static void sub_80F66B4(u8 taskId)
{
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK))
{
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
nationalDexNum = SpeciesToNationalPokedexNum(gContestMons[i].species);
GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN);
@@ -874,7 +875,7 @@ static void LoadAllContestMonIcons(u8 srcOffset, u8 useDmaNow)
{
int i;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80F69B8(gContestMons[i].species, i, srcOffset, useDmaNow, gContestMons[i].personality);
}
@@ -882,7 +883,7 @@ static void sub_80F6A9C(void)
{
int i, species;
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
species = gContestMons[i].species;
LoadPalette(gMonIconPalettes[gMonIconPaletteIndices[GetIconSpecies(species, 0)]], i * 0x10 + 0xA0, 0x20);
@@ -934,7 +935,7 @@ s32 sub_80F6B78(const u8 *text, u8 spriteId)
if (strWidth > 30)
strWidth = 30;
AddTextPrinterParameterized3(windowId, 1, (strWidth * 8 - origWidth) / 2, 1, gUnknown_0858D8E8, -1, text);
AddTextPrinterParameterized3(windowId, 1, (strWidth * 8 - origWidth) / 2, 1, sContestLinkTextColors, -1, text);
windowTilesPtr = (u8 *)(GetWindowAttribute(windowId, WINDOW_TILE_DATA));
src = (u8 *)(gUnknown_0858D6D0);
@@ -1028,7 +1029,7 @@ _080F6BD0:\n\
asrs r2, 1\n\
lsls r2, 24\n\
lsrs r2, 24\n\
ldr r0, =gUnknown_0858D8E8\n\
ldr r0, =sContestLinkTextColors\n\
str r0, [sp]\n\
movs r0, 0x1\n\
negs r0, r0\n\
@@ -1423,48 +1424,48 @@ static void sub_80F71C8(void)
CopyToBgTilemapBufferRect(2, gUnknown_08DC6498, 5, 1, 5, 2);
x = 10;
}
else if (gSpecialVar_ContestRank == 0)
else if (gSpecialVar_ContestRank == CONTEST_RANK_NORMAL)
{
CopyToBgTilemapBufferRect(2, gUnknown_08DC63F8, 5, 1, 10, 2);
x = 15;
}
else if (gSpecialVar_ContestRank == 1)
else if (gSpecialVar_ContestRank == CONTEST_RANK_SUPER)
{
CopyToBgTilemapBufferRect(2, gUnknown_08DC6420, 5, 1, 10, 2);
x = 15;
}
else if (gSpecialVar_ContestRank == 2)
else if (gSpecialVar_ContestRank == CONTEST_RANK_HYPER)
{
CopyToBgTilemapBufferRect(2, gUnknown_08DC6448, 5, 1, 10, 2);
x = 15;
}
else
else // CONTEST_RANK_MASTER
{
CopyToBgTilemapBufferRect(2, gUnknown_08DC6470, 5, 1, 10, 2);
x = 15;
}
if (gSpecialVar_ContestCategory == 0)
if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_COOL)
{
palette = 0;
CopyToBgTilemapBufferRect(2, gUnknown_08DC64AC, x, y, 5, 2);
}
else if (gSpecialVar_ContestCategory == 1)
else if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_BEAUTY)
{
palette = 1;
CopyToBgTilemapBufferRect(2, gUnknown_08DC64C0, x, y, 5, 2);
}
else if (gSpecialVar_ContestCategory == 2)
else if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_CUTE)
{
palette = 2;
CopyToBgTilemapBufferRect(2, gUnknown_08DC64D4, x, y, 5, 2);
}
else if (gSpecialVar_ContestCategory == 3)
else if (gSpecialVar_ContestCategory == CONTEST_CATEGORY_SMART)
{
palette = 3;
CopyToBgTilemapBufferRect(2, gUnknown_08DC64E8, x, y, 5, 2);
}
else
else // CONTEST_CATEGORY_TOUGH
{
palette = 4;
CopyToBgTilemapBufferRect(2, gUnknown_08DC64FC, x, y, 5, 2);
@@ -1550,7 +1551,7 @@ static void sub_80F73DC(u8 taskId)
static void sub_80F74BC(u8 taskId)
{
int i;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
CopyToBgTilemapBufferRect_ChangePalette(2, i * 0xC0 + 0x100 + gUnknown_0203A034->unkC[2], 0, i * 3 + 4, 32, 3, 9);
@@ -1706,7 +1707,7 @@ static void sub_80F7880(void)
}
}
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
r4 = (gContestMonConditions[i] * 1000) / abs(r2);
if (r4 % 10 > 4)
@@ -1933,50 +1934,52 @@ static void sub_80F7ED0(int windowId, u8 *str, int arg2)
PutWindowTilemap(windowId);
}
void sub_80F7F30(void)
void TryEnterContestMon(void)
{
u8 result = sub_80DAE0C(&gPlayerParty[gContestMonPartyIndex]);
if (result)
u8 eligibility = GetContestEntryEligibility(&gPlayerParty[gContestMonPartyIndex]);
// Nonzero eligibility can still be non-eligibile, if mon is fainted or egg
if (eligibility)
{
sub_80DAB8C(gSpecialVar_ContestCategory, gSpecialVar_ContestRank);
sub_80DB09C(gSpecialVar_ContestCategory);
}
gSpecialVar_Result = result;
gSpecialVar_Result = eligibility;
}
u16 sub_80F7F7C(void)
u16 HasMonWonThisContestBefore(void)
{
u16 result = 0;
u16 hasRankRibbon = FALSE;
struct Pokemon *mon = &gPlayerParty[gContestMonPartyIndex];
switch (gSpecialVar_ContestCategory)
{
case CONTEST_CATEGORY_COOL:
if (GetMonData(mon, MON_DATA_COOL_RIBBON) > gSpecialVar_ContestRank)
result = 1;
hasRankRibbon = TRUE;
break;
case CONTEST_CATEGORY_BEAUTY:
if (GetMonData(mon, MON_DATA_BEAUTY_RIBBON) > gSpecialVar_ContestRank)
result = 1;
hasRankRibbon = TRUE;
break;
case CONTEST_CATEGORY_CUTE:
if (GetMonData(mon, MON_DATA_CUTE_RIBBON) > gSpecialVar_ContestRank)
result = 1;
hasRankRibbon = TRUE;
break;
case CONTEST_CATEGORY_SMART:
if (GetMonData(mon, MON_DATA_SMART_RIBBON) > gSpecialVar_ContestRank)
result = 1;
hasRankRibbon = TRUE;
break;
case CONTEST_CATEGORY_TOUGH:
if (GetMonData(mon, MON_DATA_TOUGH_RIBBON) > gSpecialVar_ContestRank)
result = 1;
hasRankRibbon = TRUE;
break;
}
return result;
return hasRankRibbon;
}
void sub_80F7FFC(void)
void GiveMonContestRibbon(void)
{
u8 ribbonData;
@@ -1991,8 +1994,8 @@ void sub_80F7FFC(void)
{
ribbonData++;
SetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_COOL_RIBBON, &ribbonData);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > 4)
sub_80EE4DC(&gPlayerParty[gContestMonPartyIndex], MON_DATA_COOL_RIBBON);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > NUM_CUTIES_RIBBONS)
TryPutSpotTheCutiesOnAir(&gPlayerParty[gContestMonPartyIndex], MON_DATA_COOL_RIBBON);
}
break;
case CONTEST_CATEGORY_BEAUTY:
@@ -2001,8 +2004,8 @@ void sub_80F7FFC(void)
{
ribbonData++;
SetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_BEAUTY_RIBBON, &ribbonData);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > 4)
sub_80EE4DC(&gPlayerParty[gContestMonPartyIndex], MON_DATA_BEAUTY_RIBBON);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > NUM_CUTIES_RIBBONS)
TryPutSpotTheCutiesOnAir(&gPlayerParty[gContestMonPartyIndex], MON_DATA_BEAUTY_RIBBON);
}
break;
case CONTEST_CATEGORY_CUTE:
@@ -2011,8 +2014,8 @@ void sub_80F7FFC(void)
{
ribbonData++;
SetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_CUTE_RIBBON, &ribbonData);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > 4)
sub_80EE4DC(&gPlayerParty[gContestMonPartyIndex], MON_DATA_CUTE_RIBBON);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > NUM_CUTIES_RIBBONS)
TryPutSpotTheCutiesOnAir(&gPlayerParty[gContestMonPartyIndex], MON_DATA_CUTE_RIBBON);
}
break;
case CONTEST_CATEGORY_SMART:
@@ -2021,8 +2024,8 @@ void sub_80F7FFC(void)
{
ribbonData++;
SetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_SMART_RIBBON, &ribbonData);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > 4)
sub_80EE4DC(&gPlayerParty[gContestMonPartyIndex], MON_DATA_SMART_RIBBON);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > NUM_CUTIES_RIBBONS)
TryPutSpotTheCutiesOnAir(&gPlayerParty[gContestMonPartyIndex], MON_DATA_SMART_RIBBON);
}
break;
case CONTEST_CATEGORY_TOUGH:
@@ -2031,95 +2034,96 @@ void sub_80F7FFC(void)
{
ribbonData++;
SetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_TOUGH_RIBBON, &ribbonData);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > 4)
sub_80EE4DC(&gPlayerParty[gContestMonPartyIndex], MON_DATA_TOUGH_RIBBON);
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > NUM_CUTIES_RIBBONS)
TryPutSpotTheCutiesOnAir(&gPlayerParty[gContestMonPartyIndex], MON_DATA_TOUGH_RIBBON);
}
break;
}
}
void sub_80F8264(void)
void BufferContestantTrainerName(void)
{
StringCopy(gStringVar1, gContestMons[gSpecialVar_0x8006].trainerName);
sub_81DB5AC(gStringVar1);
}
void sub_80F8290(void)
void BufferContestantMonNickname(void)
{
StringCopy(gStringVar3, gContestMons[gSpecialVar_0x8006].nickname);
}
void sub_80F82B4(void)
// Unused script special
void GetContestMonConditionRanking(void)
{
u8 i, count;
u8 i, rank;
for (i = 0, count = 0; i < 4; i++)
for (i = 0, rank = 0; i < CONTESTANT_COUNT; i++)
{
if (gContestMonConditions[gSpecialVar_0x8006] < gContestMonConditions[i])
count++;
rank++;
}
gSpecialVar_0x8004 = count;
gSpecialVar_0x8004 = rank;
}
void sub_80F82FC(void)
void GetContestMonCondition(void)
{
gSpecialVar_0x8004 = gContestMonConditions[gSpecialVar_0x8006];
}
void sub_80F831C(void)
void GetContestWinnerId(void)
{
u8 i;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
gSpecialVar_0x8005 = i;
}
void sub_80F834C(void)
void BufferContestWinnerTrainerName(void)
{
u8 i;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
StringCopy(gStringVar3, gContestMons[i].trainerName);
sub_81DB5AC(gStringVar3);
}
void sub_80F8390(void)
void BufferContestWinnerMonName(void)
{
u8 i;
for (i = 0; i < 4 && gContestFinalStandings[i] != 0; i++)
for (i = 0; i < CONTESTANT_COUNT && gContestFinalStandings[i] != 0; i++)
;
StringCopy(gStringVar1, gContestMons[i].nickname);
}
void sub_80F83D0(void)
void CB2_SetStartContestCallback(void)
{
SetMainCallback2(CB2_StartContest);
}
static void sub_80F83E0(u8 taskId)
static void Task_StartContest(u8 taskId)
{
if (!gPaletteFade.active)
{
DestroyTask(taskId);
SetMainCallback2(sub_80F83D0);
SetMainCallback2(CB2_SetStartContestCallback);
}
}
void sub_80F840C(void)
void StartContest(void)
{
ScriptContext2_Enable();
CreateTask(sub_80F83E0, 10);
CreateTask(Task_StartContest, 10);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
}
void sub_80F8438(void)
void BufferContestantMonSpecies(void)
{
gSpecialVar_0x8004 = gContestMons[gSpecialVar_0x8006].species;
}
@@ -2140,7 +2144,7 @@ void sub_80F8484(void)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
}
void sub_80F84B0(void)
void GetContestPlayerId(void)
{
gSpecialVar_0x8004 = gContestPlayerMonIndex;
}
@@ -2246,7 +2250,7 @@ void sub_80F8714(u8 taskId)
}
else
{
for (i = 0; i < 4; i++)
for (i = 0; i < CONTESTANT_COUNT; i++)
StringGetEnd10(gContestMons[i].nickname);
DestroyTask(taskId);
+97 -98
View File
@@ -1,14 +1,14 @@
#include "global.h"
#include "alloc.h"
#include "malloc.h"
#include "battle.h"
#include "battle_gfx_sfx_util.h"
#include "bg.h"
#include "contest.h"
#include "contest_painting.h"
#include "contest_painting_effects.h"
#include "data.h"
#include "decompress.h"
#include "gpu_regs.h"
#include "image_processing_effects.h"
#include "international_string_util.h"
#include "main.h"
#include "lilycove_lady.h"
@@ -22,9 +22,9 @@
#include "constants/rgb.h"
// IWRAM common
u16 (*gUnknown_03006190)[][32];
struct Unk030061A0 gUnknown_030061A0;
struct ContestWinner *gUnknown_030061C0;
u16 (*gContestMonPixels)[][32];
struct ImageProcessingContext gImageProcessingContext;
struct ContestWinner *gContestPaintingWinner;
u16 *gContestPaintingMonPalette;
// IWRAM bss
@@ -39,10 +39,10 @@ static void HoldContestPainting(void);
static void InitContestPaintingWindow(void);
static void InitContestPaintingBg(void);
static void InitContestPaintingVars(bool8);
static void sub_8130884(u8, u8);
static void CreateContestPaintingPicture(u8, u8);
static void PrintContestPaintingCaption(u8, u8);
static void VBlankCB_ContestPainting(void);
static void sub_8130380(u8 *spritePixels, u16 *palette, u16 (*destColorBuffer)[64][64]);
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64]);
extern const u8 gUnknown_0827EA0C[];
extern const u8 gContestCoolness[];
@@ -85,7 +85,7 @@ const u8 gPictureFrameTilemap_3[] = INCBIN_U8("graphics/picture_frame/frame3_map
const u8 gPictureFrameTilemap_4[] = INCBIN_U8("graphics/picture_frame/frame4_map.bin.rl");
const u8 gPictureFrameTilemap_5[] = INCBIN_U8("graphics/picture_frame/frame5_map.bin.rl");
const u8 *const gUnknown_085B07C0[] =
static const u8 *const sContestCategoryNames_Unused[] =
{
gContestCoolness,
gContestBeauty,
@@ -94,7 +94,7 @@ const u8 *const gUnknown_085B07C0[] =
gContestToughness,
};
const u8 *const gContestRankTextPointers[] =
static const u8 *const sContestRankNames[] =
{
gContestRankNormal,
gContestRankSuper,
@@ -103,7 +103,7 @@ const u8 *const gContestRankTextPointers[] =
gContestLink,
};
const struct BgTemplate gUnknown_085B07E8[] =
static const struct BgTemplate sContestPaintingBgTemplates[] =
{
{
.bg = 1,
@@ -116,7 +116,7 @@ const struct BgTemplate gUnknown_085B07E8[] =
},
};
const struct WindowTemplate gUnknown_085B07EC =
static const struct WindowTemplate sContestPaintingWindowTemplate =
{
.bg = 1,
.tilemapLeft = 2,
@@ -127,7 +127,7 @@ const struct WindowTemplate gUnknown_085B07EC =
.baseBlock = 1,
};
const u8 *const gContestPaintingDescriptionPointers[] =
static const u8 *const sContestPaintingDescriptionPointers[] =
{
gContestPaintingCool1,
gContestPaintingCool2,
@@ -146,7 +146,7 @@ const u8 *const gContestPaintingDescriptionPointers[] =
gContestPaintingTough3,
};
const struct OamData gUnknown_085B0830 =
static const struct OamData sContestPaintingMonOamData =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -163,13 +163,13 @@ const struct OamData gUnknown_085B0830 =
const u16 gUnknown_085B0838[] = {RGB(0, 0, 0), RGB(0, 0, 0)};
void sub_812FDA8(int contestWinner)
void SetContestWinnerForPainting(int contestWinnerId)
{
// probably fakematching
u8 *ptr1 = &gUnknown_02039F5D;
u8 *ptr2 = &gUnknown_02039F5C;
gUnknown_02039F3C = gSaveBlock1Ptr->contestWinners[contestWinner - 1];
*ptr1 = contestWinner - 1;
gCurContestWinner = gSaveBlock1Ptr->contestWinners[contestWinnerId - 1];
*ptr1 = contestWinnerId - 1;
*ptr2 = 0;
}
@@ -189,7 +189,7 @@ static void CB2_QuitContestPainting(void)
{
SetMainCallback2(gMain.savedCallback);
FREE_AND_SET_NULL(gContestPaintingMonPalette);
FREE_AND_SET_NULL(gUnknown_03006190);
FREE_AND_SET_NULL(gContestMonPixels);
RemoveWindow(gContestPaintingWindowId);
Free(GetBgTilemapBuffer(1));
FreeMonSpritesGfx();
@@ -203,7 +203,7 @@ static void ShowContestPainting(void)
ScanlineEffect_Stop();
SetVBlankCallback(NULL);
AllocateMonSpritesGfx();
gUnknown_030061C0 = &gUnknown_02039F3C;
gContestPaintingWinner = &gCurContestWinner;
InitContestPaintingVars(1);
InitContestPaintingBg();
gMain.state++;
@@ -221,7 +221,7 @@ static void ShowContestPainting(void)
gMain.state++;
break;
case 3:
sub_8130884(gUnknown_02039F5D, gUnknown_02039F5C);
CreateContestPaintingPicture(gUnknown_02039F5D, gUnknown_02039F5C);
gMain.state++;
break;
case 4:
@@ -269,11 +269,11 @@ static void HoldContestPainting(void)
static void InitContestPaintingWindow(void)
{
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, gUnknown_085B07E8, ARRAY_COUNT(gUnknown_085B07E8));
InitBgsFromTemplates(0, sContestPaintingBgTemplates, ARRAY_COUNT(sContestPaintingBgTemplates));
ChangeBgX(1, 0, 0);
ChangeBgY(1, 0, 0);
SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE));
gContestPaintingWindowId = AddWindow(&gUnknown_085B07EC);
gContestPaintingWindowId = AddWindow(&sContestPaintingWindowTemplate);
DeactivateAllTextPrinters();
FillWindowPixelBuffer(gContestPaintingWindowId, PIXEL_FILL(0));
PutWindowTilemap(gContestPaintingWindowId);
@@ -289,21 +289,21 @@ static void PrintContestPaintingCaption(u8 contestType, u8 arg1)
if (arg1 == TRUE)
return;
category = gUnknown_030061C0->contestCategory;
category = gContestPaintingWinner->contestCategory;
if (contestType < 8)
{
BufferContestName(gStringVar1, category);
StringAppend(gStringVar1, gText_Space);
StringAppend(gStringVar1, gContestRankTextPointers[gUnknown_030061C0->contestRank]);
StringCopy(gStringVar2, gUnknown_030061C0->trainerName);
StringAppend(gStringVar1, sContestRankNames[gContestPaintingWinner->contestRank]);
StringCopy(gStringVar2, gContestPaintingWinner->trainerName);
sub_81DB5AC(gStringVar2);
StringCopy(gStringVar3, gUnknown_030061C0->monName);
StringCopy(gStringVar3, gContestPaintingWinner->monName);
StringExpandPlaceholders(gStringVar4, gUnknown_0827EA0C);
}
else
{
StringCopy(gStringVar1, gUnknown_030061C0->monName);
StringExpandPlaceholders(gStringVar4, gContestPaintingDescriptionPointers[category]);
StringCopy(gStringVar1, gContestPaintingWinner->monName);
StringExpandPlaceholders(gStringVar4, sContestPaintingDescriptionPointers[category]);
}
x = GetStringCenterAlignXOffset(1, gStringVar4, 208);
@@ -360,18 +360,18 @@ static void VBlankCB_ContestPainting(void)
TransferPlttBuffer();
}
void sub_81302E8(u16 species, u8 arg1)
static void InitContestMonPixels(u16 species, u8 whichSprite)
{
const void *pal = GetMonSpritePalFromSpeciesAndPersonality(species, gUnknown_030061C0->trainerId, gUnknown_030061C0->personality);
const void *pal = GetMonSpritePalFromSpeciesAndPersonality(species, gContestPaintingWinner->trainerId, gContestPaintingWinner->personality);
LZDecompressVram(pal, gContestPaintingMonPalette);
if (!arg1)
if (whichSprite == 0)
{
HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[1],
species,
gUnknown_030061C0->personality);
sub_8130380(gMonSpritesGfxPtr->sprites[1], gContestPaintingMonPalette, (void *)gUnknown_03006190);
gContestPaintingWinner->personality);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites[1], gContestPaintingMonPalette, (void *)gContestMonPixels);
}
else
{
@@ -379,14 +379,14 @@ void sub_81302E8(u16 species, u8 arg1)
&gMonBackPicTable[species],
gMonSpritesGfxPtr->sprites[0],
species,
gUnknown_030061C0->personality);
sub_8130380(gMonSpritesGfxPtr->sprites[0], gContestPaintingMonPalette, (void *)gUnknown_03006190);
gContestPaintingWinner->personality);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites[0], gContestPaintingMonPalette, (void *)gContestMonPixels);
}
}
#ifdef NONMATCHING
// functionally equivalent.
static void sub_8130380(u8 *spritePixels, u16 *palette, u16 (*destColorBuffer)[64][64])
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64])
{
u16 tileY, tileX, pixelY, pixelX;
u8 colorIndex;
@@ -400,16 +400,16 @@ static void sub_8130380(u8 *spritePixels, u16 *palette, u16 (*destColorBuffer)[6
for (pixelX = 0; pixelX < 8; pixelX++)
{
int offset = 32 * (8 * tileY + tileX) + (pixelY * 4 + pixelX / 2);
colorIndex = spritePixels[offset];
colorIndex = spriteGfx[offset];
if (pixelX & 1)
colorIndex >>= 4;
else
colorIndex &= 0xF;
if (colorIndex == 0) // transparent pixel
(*destColorBuffer)[8 * tileY + pixelY][tileX * 8 + pixelX] = 0x8000;
(*destPixels)[8 * tileY + pixelY][tileX * 8 + pixelX] = 0x8000;
else
(*destColorBuffer)[8 * tileY + pixelY][tileX * 8 + pixelX] = palette[colorIndex];
(*destPixels)[8 * tileY + pixelY][tileX * 8 + pixelX] = palette[colorIndex];
}
}
}
@@ -417,7 +417,7 @@ static void sub_8130380(u8 *spritePixels, u16 *palette, u16 (*destColorBuffer)[6
}
#else
NAKED
static void sub_8130380(u8 *spritePixels, u16 *palette, u16 (*destColorBuffer)[64][64])
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64])
{
asm_unified("\n\
push {r4-r7,lr}\n\
@@ -519,34 +519,34 @@ _081303F8:\n\
}
#endif
static void sub_8130430(u8 arg0, u8 arg1)
static void LoadContestPaintingFrame(u8 contestWinnerId, u8 arg1)
{
u8 x, y;
LoadPalette(gPictureFramePalettes, 0, 0x100);
if (arg1 == 1)
{
switch (gUnknown_030061C0->contestCategory / 3)
switch (gContestPaintingWinner->contestCategory / 3)
{
case CONTEST_CATEGORY_COOL:
RLUnCompVram(gPictureFrameTiles_0, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_0, gUnknown_03006190);
RLUnCompWram(gPictureFrameTilemap_0, gContestMonPixels);
break;
case CONTEST_CATEGORY_BEAUTY:
RLUnCompVram(gPictureFrameTiles_1, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_1, gUnknown_03006190);
RLUnCompWram(gPictureFrameTilemap_1, gContestMonPixels);
break;
case CONTEST_CATEGORY_CUTE:
RLUnCompVram(gPictureFrameTiles_2, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_2, gUnknown_03006190);
RLUnCompWram(gPictureFrameTilemap_2, gContestMonPixels);
break;
case CONTEST_CATEGORY_SMART:
RLUnCompVram(gPictureFrameTiles_3, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_3, gUnknown_03006190);
RLUnCompWram(gPictureFrameTilemap_3, gContestMonPixels);
break;
case CONTEST_CATEGORY_TOUGH:
RLUnCompVram(gPictureFrameTiles_4, (void *)VRAM);
RLUnCompWram(gPictureFrameTilemap_4, gUnknown_03006190);
RLUnCompWram(gPictureFrameTilemap_4, gContestMonPixels);
break;
}
@@ -563,23 +563,23 @@ static void sub_8130430(u8 arg0, u8 arg1)
for (y = 0; y < 10; y++)
{
for (x = 0; x < 18; x++)
VRAM_PICTURE_DATA(x + 6, y + 2) = (*gUnknown_03006190)[y + 2][x + 6];
VRAM_PICTURE_DATA(x + 6, y + 2) = (*gContestMonPixels)[y + 2][x + 6];
}
// Re-set the entire top row to the first top frame part
for (x = 0; x < 16; x++)
VRAM_PICTURE_DATA(x + 7, 2) = (*gUnknown_03006190)[2][7];
VRAM_PICTURE_DATA(x + 7, 2) = (*gContestMonPixels)[2][7];
#undef VRAM_PICTURE_DATA
}
else if (arg0 < 8)
else if (contestWinnerId < 8)
{
RLUnCompVram(gPictureFrameTiles_5, (void *)VRAM);
RLUnCompVram(gPictureFrameTilemap_5, (void *)(BG_SCREEN_ADDR(12)));
}
else
{
switch (gUnknown_030061C0->contestCategory / 3)
switch (gContestPaintingWinner->contestCategory / 3)
{
case CONTEST_CATEGORY_COOL:
RLUnCompVram(gPictureFrameTiles_0, (void *)VRAM);
@@ -605,100 +605,99 @@ static void sub_8130430(u8 arg0, u8 arg1)
}
}
static void sub_8130688(u8 arg0)
static void InitPaintingMonOamData(u8 contestWinnerId)
{
//Some hacks just to get the asm to match
#ifndef NONMATCHING
asm(""::"r"(arg0));
asm(""::"r"(contestWinnerId));
#endif
gMain.oamBuffer[0] = gUnknown_085B0830;
gMain.oamBuffer[0] = sContestPaintingMonOamData;
gMain.oamBuffer[0].tileNum = 0;
#ifndef NONMATCHING
if (arg0) arg0 = gMain.oamBuffer[0].tileNum;
if (contestWinnerId) contestWinnerId = gMain.oamBuffer[0].tileNum;
#endif
gMain.oamBuffer[0].x = 88;
gMain.oamBuffer[0].y = 24;
}
static u8 sub_81306CC(u8 arg0)
static u8 GetImageEffectForContestWinner(u8 contestWinnerId)
{
u8 contestCategory;
if (arg0 < 8)
contestCategory = gUnknown_030061C0->contestCategory;
if (contestWinnerId < 8)
contestCategory = gContestPaintingWinner->contestCategory;
else
contestCategory = gUnknown_030061C0->contestCategory / 3;
contestCategory = gContestPaintingWinner->contestCategory / 3;
switch (contestCategory)
{
case CONTEST_CATEGORY_COOL:
return CONTESTRESULT_COOL;
return IMAGE_EFFECT_OUTLINE_COLORED;
case CONTEST_CATEGORY_BEAUTY:
return CONTESTRESULT_BEAUTY;
return IMAGE_EFFECT_SHIMMER;
case CONTEST_CATEGORY_CUTE:
return CONTESTRESULT_CUTE;
return IMAGE_EFFECT_POINTILLISM;
case CONTEST_CATEGORY_SMART:
return CONTESTRESULT_SMART;
return IMAGE_EFFECT_CHARCOAL;
case CONTEST_CATEGORY_TOUGH:
return CONTESTRESULT_TOUGH;
return IMAGE_EFFECT_GRAYSCALE_LIGHT;
}
return contestCategory;
}
static void sub_8130738(void)
static void AllocPaintingResources(void)
{
gContestPaintingMonPalette = AllocZeroed(0x200);
gUnknown_03006190 = AllocZeroed(0x2000);
gContestPaintingMonPalette = AllocZeroed(OBJ_PLTT_SIZE);
gContestMonPixels = AllocZeroed(0x2000);
}
static void sub_8130760(u8 contestResult)
static void DoContestPaintingImageProcessing(u8 imageEffect)
{
gUnknown_030061A0.var_4 = gUnknown_03006190;
gUnknown_030061A0.var_8 = gContestPaintingMonPalette;
gUnknown_030061A0.var_18 = 0;
gUnknown_030061A0.var_1F = gUnknown_030061C0->personality % 256;
gUnknown_030061A0.var_19 = 0;
gUnknown_030061A0.var_1A = 0;
gUnknown_030061A0.var_1B = 64;
gUnknown_030061A0.var_1C = 64;
gUnknown_030061A0.var_1D = 64;
gUnknown_030061A0.var_1E = 64;
gImageProcessingContext.canvasPixels = gContestMonPixels;
gImageProcessingContext.canvasPalette = gContestPaintingMonPalette;
gImageProcessingContext.paletteStart = 0;
gImageProcessingContext.personality = gContestPaintingWinner->personality % 256;
gImageProcessingContext.columnStart = 0;
gImageProcessingContext.rowStart = 0;
gImageProcessingContext.columnEnd = 64;
gImageProcessingContext.rowEnd = 64;
gImageProcessingContext.canvasWidth = 64;
gImageProcessingContext.canvasHeight = 64;
switch (contestResult)
switch (imageEffect)
{
case CONTESTRESULT_SMART:
case CONTESTRESULT_TOUGH:
gUnknown_030061A0.var_14 = 3;
case IMAGE_EFFECT_CHARCOAL:
case IMAGE_EFFECT_GRAYSCALE_LIGHT:
gImageProcessingContext.quantizeEffect = QUANTIZE_EFFECT_GRAYSCALE;
break;
case CONTESTRESULT_COOL:
case CONTESTRESULT_BEAUTY:
case CONTESTRESULT_CUTE:
case IMAGE_EFFECT_OUTLINE_COLORED:
case IMAGE_EFFECT_SHIMMER:
case IMAGE_EFFECT_POINTILLISM:
default:
gUnknown_030061A0.var_14 = 1;
gImageProcessingContext.quantizeEffect = QUANTIZE_EFFECT_STANDARD_LIMITED_COLORS;
break;
}
gUnknown_030061A0.var_16 = 2;
gUnknown_030061A0.var_0 = contestResult;
gUnknown_030061A0.var_10 = OBJ_VRAM0;
sub_8124F2C(&gUnknown_030061A0);
sub_81261A4(&gUnknown_030061A0);
sub_8126058(&gUnknown_030061A0);
gImageProcessingContext.var_16 = 2;
gImageProcessingContext.effect = imageEffect;
gImageProcessingContext.dest = (void *)OBJ_VRAM0;
ApplyImageProcessingEffects(&gImageProcessingContext);
ApplyImageProcessingQuantization(&gImageProcessingContext);
ConvertImageProcessingToGBA(&gImageProcessingContext);
LoadPalette(gContestPaintingMonPalette, 0x100, 0x200);
}
static void sub_8130884(u8 arg0, u8 arg1)
static void CreateContestPaintingPicture(u8 contestWinnerId, u8 arg1)
{
sub_8130738();
sub_81302E8(gUnknown_030061C0->species, 0);
sub_8130760(sub_81306CC(arg0));
sub_8130688(arg0);
sub_8130430(arg0, arg1);
AllocPaintingResources();
InitContestMonPixels(gContestPaintingWinner->species, 0);
DoContestPaintingImageProcessing(GetImageEffectForContestWinner(contestWinnerId));
InitPaintingMonOamData(contestWinnerId);
LoadContestPaintingFrame(contestWinnerId, arg1);
}
File diff suppressed because it is too large Load Diff
+25 -25
View File
@@ -11,38 +11,38 @@ struct CoordEventWeather
static void CoordEventWeather_Clouds(void);
static void CoordEventWeather_Sunny(void);
static void CoordEventWeather_LightRain(void);
static void CoordEventWeather_Rain(void);
static void CoordEventWeather_Snow(void);
static void CoordEventWeather_Thunderstorm(void);
static void CoordEventWeather_Fog(void);
static void CoordEventWeather_HorizontalFog(void);
static void CoordEventWeather_DiagonalFog(void);
static void CoordEventWeather_Ash(void);
static void CoordEventWeather_Sandstorm(void);
static void CoordEventWeather_Dark(void);
static void CoordEventWeather_Shade(void);
static void CoordEventWeather_Drought(void);
static void CoordEventWeather_Route119Cycle(void);
static void CoordEventWeather_Route123Cycle(void);
static const struct CoordEventWeather sCoordEventWeatherFuncs[] =
{
{ COORD_EVENT_WEATHER_CLOUDS, CoordEventWeather_Clouds },
{ COORD_EVENT_WEATHER_SUNNY, CoordEventWeather_Sunny },
{ COORD_EVENT_WEATHER_RAIN_LIGHT, CoordEventWeather_LightRain },
{ COORD_EVENT_WEATHER_SNOW, CoordEventWeather_Snow },
{ COORD_EVENT_WEATHER_RAIN_MED, CoordEventWeather_Thunderstorm },
{ COORD_EVENT_WEATHER_FOG_1, CoordEventWeather_Fog },
{ COORD_EVENT_WEATHER_FOG_2, CoordEventWeather_DiagonalFog },
{ COORD_EVENT_WEATHER_ASH, CoordEventWeather_Ash },
{ COORD_EVENT_WEATHER_SANDSTORM, CoordEventWeather_Sandstorm },
{ COORD_EVENT_WEATHER_SHADE, CoordEventWeather_Dark },
{ COORD_EVENT_WEATHER_DROUGHT, CoordEventWeather_Drought },
{ COORD_EVENT_WEATHER_ROUTE119_CYCLE, CoordEventWeather_Route119Cycle },
{ COORD_EVENT_WEATHER_ROUTE123_CYCLE, CoordEventWeather_Route123Cycle },
{ COORD_EVENT_WEATHER_SUNNY_CLOUDS, CoordEventWeather_Clouds },
{ COORD_EVENT_WEATHER_SUNNY, CoordEventWeather_Sunny },
{ COORD_EVENT_WEATHER_RAIN, CoordEventWeather_Rain },
{ COORD_EVENT_WEATHER_SNOW, CoordEventWeather_Snow },
{ COORD_EVENT_WEATHER_RAIN_THUNDERSTORM, CoordEventWeather_Thunderstorm },
{ COORD_EVENT_WEATHER_FOG_HORIZONTAL, CoordEventWeather_HorizontalFog },
{ COORD_EVENT_WEATHER_FOG_DIAGONAL, CoordEventWeather_DiagonalFog },
{ COORD_EVENT_WEATHER_VOLCANIC_ASH, CoordEventWeather_Ash },
{ COORD_EVENT_WEATHER_SANDSTORM, CoordEventWeather_Sandstorm },
{ COORD_EVENT_WEATHER_SHADE, CoordEventWeather_Shade },
{ COORD_EVENT_WEATHER_DROUGHT, CoordEventWeather_Drought },
{ COORD_EVENT_WEATHER_ROUTE119_CYCLE, CoordEventWeather_Route119Cycle },
{ COORD_EVENT_WEATHER_ROUTE123_CYCLE, CoordEventWeather_Route123Cycle },
};
static void CoordEventWeather_Clouds(void)
{
SetWeather(WEATHER_CLOUDS);
SetWeather(WEATHER_SUNNY_CLOUDS);
}
static void CoordEventWeather_Sunny(void)
@@ -50,9 +50,9 @@ static void CoordEventWeather_Sunny(void)
SetWeather(WEATHER_SUNNY);
}
static void CoordEventWeather_LightRain(void)
static void CoordEventWeather_Rain(void)
{
SetWeather(WEATHER_RAIN_LIGHT);
SetWeather(WEATHER_RAIN);
}
static void CoordEventWeather_Snow(void)
@@ -62,22 +62,22 @@ static void CoordEventWeather_Snow(void)
static void CoordEventWeather_Thunderstorm(void)
{
SetWeather(WEATHER_RAIN_MED);
SetWeather(WEATHER_RAIN_THUNDERSTORM);
}
static void CoordEventWeather_Fog(void)
static void CoordEventWeather_HorizontalFog(void)
{
SetWeather(WEATHER_FOG_1);
SetWeather(WEATHER_FOG_HORIZONTAL);
}
static void CoordEventWeather_DiagonalFog(void)
{
SetWeather(WEATHER_FOG_2);
SetWeather(WEATHER_FOG_DIAGONAL);
}
static void CoordEventWeather_Ash(void)
{
SetWeather(WEATHER_ASH);
SetWeather(WEATHER_VOLCANIC_ASH);
}
static void CoordEventWeather_Sandstorm(void)
@@ -85,7 +85,7 @@ static void CoordEventWeather_Sandstorm(void)
SetWeather(WEATHER_SANDSTORM);
}
static void CoordEventWeather_Dark(void)
static void CoordEventWeather_Shade(void)
{
SetWeather(WEATHER_SHADE);
}
+78 -64
View File
@@ -3,7 +3,7 @@
#include "main.h"
#include "task.h"
#include "bg.h"
#include "alloc.h"
#include "malloc.h"
#include "window.h"
#include "text.h"
#include "menu.h"
@@ -128,16 +128,17 @@ enum
TDE_TASK_A_ID = 2,
};
struct Unk201C000
#define NUM_MON_SLIDES 71
struct CreditsData
{
u16 unk0[71];
u16 unk8E;
u16 unk90;
u16 unk92;
u16 unk94;
u16 unk96[NATIONAL_DEX_COUNT];
u16 unk39A;
u16 unk39C[7];
u16 monToShow[NUM_MON_SLIDES]; // List of Pokemon species ids that will show during the credits
u16 imgCounter; //how many mon images have been shown
u16 nextImgPos; //if the next image spawns left/center/right
u16 currShownMon; //index into monToShow
u16 numMonToShow; //number of pokemon to show, always NUM_MON_SLIDES after determine function
u16 caughtMonIds[NATIONAL_DEX_COUNT]; //temporary location to hold a condensed array of all caught pokemon
u16 numCaughtMon; //count of filled spaces in caughtMonIds
u16 unk39C[7]; // unused padding?
};
struct CreditsEntry
@@ -151,7 +152,7 @@ static EWRAM_DATA s16 gUnknown_0203BCE0 = 0;
static EWRAM_DATA u16 gUnknown_0203BCE2 = 0; // TASK A
EWRAM_DATA bool8 gHasHallOfFameRecords = 0;
static EWRAM_DATA u8 gUnknown_0203BCE5 = 0;
static EWRAM_DATA struct Unk201C000 *gUnknown_0203BCE8 = {0};
static EWRAM_DATA struct CreditsData *sCreditsData = {0};
static const u16 gUnknown_085E56F0[][16] =
{
@@ -959,7 +960,7 @@ static const struct WindowTemplate sWindowTemplates[] =
},
DUMMY_WIN_TEMPLATE,
};
static const u8 gUnknown_085E6F7C[][2] =
static const u8 sMonSpritePos[][2] =
{
{104, 36},
{120, 36},
@@ -1052,10 +1053,10 @@ static const struct SpritePalette gUnknown_085E702C[] = {
static const struct OamData gUnknown_085E703C =
{
.y = 160,
.affineMode = 0,
.objMode = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
@@ -1127,8 +1128,8 @@ static void LoadTheEndScreen(u16, u16, u16);
static void sub_8176E40(u16 arg0, u16 palette);
static void sub_8176EE8(struct Sprite *sprite);
static void sub_8176F90(struct Sprite *sprite);
static u8 sub_8177224(u16 species, s16 x, s16 y, u16 position);
static void sub_8177388(void);
static u8 MakeMonSprite(u16 species, s16 x, s16 y, u16 position);
static void DeterminePokemonToShow(void);
static void CreditsVBlankCallback(void)
{
@@ -1241,13 +1242,13 @@ void CB2_StartCreditsSequence(void)
m4aSongNumStart(MUS_THANKFOR);
SetMainCallback2(CB2_RunCreditsSequence);
gUnknown_0203BCE5 = 0;
gUnknown_0203BCE8 = AllocZeroed(sizeof(struct Unk201C000));
sCreditsData = AllocZeroed(sizeof(struct CreditsData));
sub_8177388();
DeterminePokemonToShow();
gUnknown_0203BCE8->unk8E = 0;
gUnknown_0203BCE8->unk90 = 0;
gUnknown_0203BCE8->unk92 = 0;
sCreditsData->imgCounter = 0;
sCreditsData->nextImgPos = 0;
sCreditsData->currShownMon = 0;
gUnknown_0203BCE2 = taskIdA;
}
@@ -1604,7 +1605,7 @@ static void sub_8175DA0(u8 taskIdB)
gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_4] = 1;
DestroyTask(taskIdB);
sub_81755A4();
FREE_AND_SET_NULL(gUnknown_0203BCE8);
FREE_AND_SET_NULL(sCreditsData);
return;
}
}
@@ -1683,29 +1684,29 @@ static void sub_81760FC(u8 taskIdD)
case 0:
break;
case 1:
if (gUnknown_0203BCE8->unk90 == 0 && gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].data[TDA_14] == 0)
if (sCreditsData->nextImgPos == 0 && gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].data[TDA_14] == 0)
break;
gTasks[taskIdD].data[TDD_STATE]++;
break;
case 2:
if (gUnknown_0203BCE8->unk8E == 71 || gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].func != Task_ProgressCreditTasks)
if (sCreditsData->imgCounter == NUM_MON_SLIDES || gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].func != Task_ProgressCreditTasks)
break;
r2 = sub_8177224(gUnknown_0203BCE8->unk0[gUnknown_0203BCE8->unk92], gUnknown_085E6F7C[gUnknown_0203BCE8->unk90][0], gUnknown_085E6F7C[gUnknown_0203BCE8->unk90][1], gUnknown_0203BCE8->unk90);
if (gUnknown_0203BCE8->unk92 < gUnknown_0203BCE8->unk94 - 1)
r2 = MakeMonSprite(sCreditsData->monToShow[sCreditsData->currShownMon], sMonSpritePos[sCreditsData->nextImgPos][0], sMonSpritePos[sCreditsData->nextImgPos][1], sCreditsData->nextImgPos);
if (sCreditsData->currShownMon < sCreditsData->numMonToShow - 1)
{
gUnknown_0203BCE8->unk92++;
sCreditsData->currShownMon++;
gSprites[r2].data[3] = 50;
}
else
{
gUnknown_0203BCE8->unk92 = 0;
sCreditsData->currShownMon = 0;
gSprites[r2].data[3] = 512;
}
gUnknown_0203BCE8->unk8E++;
if (gUnknown_0203BCE8->unk90 == 2)
gUnknown_0203BCE8->unk90 = 0;
sCreditsData->imgCounter++;
if (sCreditsData->nextImgPos == 2)
sCreditsData->nextImgPos = 0;
else
gUnknown_0203BCE8->unk90++;
sCreditsData->nextImgPos++;
gTasks[taskIdD].data[TDD_3] = 50;
gTasks[taskIdD].data[TDD_STATE]++;
break;
@@ -2182,7 +2183,7 @@ static void sub_8177050(struct Sprite *sprite)
{
case 0:
default:
sprite->oam.affineMode = 1;
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
sprite->oam.matrixNum = sprite->data[1];
sprite->data[2] = 16;
SetOamMatrix(sprite->data[1], 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]);
@@ -2224,7 +2225,7 @@ static void sub_8177050(struct Sprite *sprite)
{
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
sprite->oam.objMode = 1;
sprite->oam.objMode = ST_OAM_OBJ_BLEND;
sprite->data[3] = 16;
sprite->data[0] += 1;
}
@@ -2256,7 +2257,7 @@ static void sub_8177050(struct Sprite *sprite)
}
}
static u8 sub_8177224(u16 nationalDexNum, s16 x, s16 y, u16 position)
static u8 MakeMonSprite(u16 nationalDexNum, s16 x, s16 y, u16 position)
{
u8 spriteId;
u8 spriteId2;
@@ -2292,73 +2293,86 @@ static void sub_81772B8(struct Sprite *sprite)
sprite->pos1.y = gSprites[sprite->data[0]].pos1.y;
}
static void sub_8177388(void)
static void DeterminePokemonToShow(void)
{
u16 starter = SpeciesToNationalPokedexNum(GetStarterPokemon(VarGet(VAR_STARTER_MON)));
u16 page;
u16 dexNum;
u16 j;
// Go through the Pokedex, and anything that has gotten caught we put into our massive array.
// This basically packs all of the caught pokemon into the front of the array
for (dexNum = 1, j = 0; dexNum < NATIONAL_DEX_COUNT; dexNum++)
{
if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT))
{
gUnknown_0203BCE8->unk96[j] = dexNum;
sCreditsData->caughtMonIds[j] = dexNum;
j++;
}
}
// Fill the rest of the array with zeroes
for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++)
gUnknown_0203BCE8->unk96[dexNum] = 0;
sCreditsData->caughtMonIds[dexNum] = 0;
gUnknown_0203BCE8->unk39A = j;
if (gUnknown_0203BCE8->unk39A < 71)
gUnknown_0203BCE8->unk94 = j;
// Cap the number of pokemon we care about to NUM_MON_SLIDES, the max we show in the credits scene (-1 for the starter)
sCreditsData->numCaughtMon = j;
if (sCreditsData->numCaughtMon < NUM_MON_SLIDES)
sCreditsData->numMonToShow = j;
else
gUnknown_0203BCE8->unk94 = 71;
sCreditsData->numMonToShow = NUM_MON_SLIDES;
// Loop through our list of caught pokemon and select randomly from it to fill the images to show
j = 0;
do
{
page = Random() % gUnknown_0203BCE8->unk39A;
gUnknown_0203BCE8->unk0[j] = gUnknown_0203BCE8->unk96[page];
// Select a random mon, insert into array
page = Random() % sCreditsData->numCaughtMon;
sCreditsData->monToShow[j] = sCreditsData->caughtMonIds[page];
// Remove the select mon from the array, and condense array entries
j++;
gUnknown_0203BCE8->unk96[page] = 0;
gUnknown_0203BCE8->unk39A--;
if (page != gUnknown_0203BCE8->unk39A)
sCreditsData->caughtMonIds[page] = 0;
sCreditsData->numCaughtMon--;
if (page != sCreditsData->numCaughtMon)
{
gUnknown_0203BCE8->unk96[page] = gUnknown_0203BCE8->unk96[gUnknown_0203BCE8->unk39A];
gUnknown_0203BCE8->unk96[gUnknown_0203BCE8->unk39A] = 0;
// Instead of looping through and moving everything down, just take from the end. Order doesn't matter after all.
sCreditsData->caughtMonIds[page] = sCreditsData->caughtMonIds[sCreditsData->numCaughtMon];
sCreditsData->caughtMonIds[sCreditsData->numCaughtMon] = 0;
}
}
while (gUnknown_0203BCE8->unk39A != 0 && j < 71);
while (sCreditsData->numCaughtMon != 0 && j < NUM_MON_SLIDES);
if (gUnknown_0203BCE8->unk94 < 71)
// If we don't have enough pokemon in the dex to fill everything, copy the selected mon into the end of the array, so it loops
if (sCreditsData->numMonToShow < NUM_MON_SLIDES)
{
for (j = gUnknown_0203BCE8->unk94, page = 0; j < 71; j++)
for (j = sCreditsData->numMonToShow, page = 0; j < NUM_MON_SLIDES; j++)
{
gUnknown_0203BCE8->unk0[j] = gUnknown_0203BCE8->unk0[page];
sCreditsData->monToShow[j] = sCreditsData->monToShow[page];
page++;
if (page == gUnknown_0203BCE8->unk94)
if (page == sCreditsData->numMonToShow)
page = 0;
}
gUnknown_0203BCE8->unk0[70] = starter;
// Ensure the last pokemon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES-1] = starter;
}
else
{
for (dexNum = 0; gUnknown_0203BCE8->unk0[dexNum] != starter && dexNum < 71; dexNum++);
// Check to see if our starter has already appeared in this list, break if it has
for (dexNum = 0; sCreditsData->monToShow[dexNum] != starter && dexNum < NUM_MON_SLIDES; dexNum++);
if (dexNum < gUnknown_0203BCE8->unk94 - 1)
// If it has, swap it with the last pokemon, to ensure our starter is the last image
if (dexNum < sCreditsData->numMonToShow - 1)
{
gUnknown_0203BCE8->unk0[dexNum] = gUnknown_0203BCE8->unk0[70];
gUnknown_0203BCE8->unk0[70] = starter;
sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1];
sCreditsData->monToShow[NUM_MON_SLIDES-1] = starter;
}
else
{
gUnknown_0203BCE8->unk0[70] = starter;
// Ensure the last pokemon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES-1] = starter;
}
}
gUnknown_0203BCE8->unk94 = 71;
sCreditsData->numMonToShow = NUM_MON_SLIDES;
}
+5 -5
View File
@@ -29,7 +29,7 @@ const struct SpriteTemplate gUnknown_08596FC8 =
{
.tileTag = ANIM_TAG_TIED_BAG,
.paletteTag = ANIM_TAG_TIED_BAG,
.oam = &gUnknown_0852490C,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -100,7 +100,7 @@ const struct SpriteTemplate gUnknown_08597080 =
{
.tileTag = ANIM_TAG_SHARP_TEETH,
.paletteTag = ANIM_TAG_SHARP_TEETH,
.oam = &gUnknown_08524A9C,
.oam = &gOamData_AffineNormal_ObjBlend_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_08597060,
@@ -111,7 +111,7 @@ const struct SpriteTemplate gUnknown_08597098 =
{
.tileTag = ANIM_TAG_CLAMP,
.paletteTag = ANIM_TAG_CLAMP,
.oam = &gUnknown_08524A9C,
.oam = &gOamData_AffineNormal_ObjBlend_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_08597060,
@@ -142,7 +142,7 @@ const struct SpriteTemplate gUnknown_085970E8 =
{
.tileTag = ANIM_TAG_SMALL_BUBBLES,
.paletteTag = ANIM_TAG_SMALL_BUBBLES,
.oam = &gUnknown_0852496C,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gUnknown_085970E0,
@@ -179,7 +179,7 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8597138 =
{
.tileTag = ANIM_TAG_CLAW_SLASH,
.paletteTag = ANIM_TAG_CLAW_SLASH,
.oam = &gUnknown_08524914,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_08597130,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
+1 -1
View File
@@ -1,5 +1,5 @@
#include "global.h"
#include "alloc.h"
#include "malloc.h"
#include "battle.h"
#include "data.h"
#include "graphics.h"
+982
View File
@@ -0,0 +1,982 @@
// data/text/apprentice.inc
extern const u8 gText_ApprenticePleaseTeach0[];
extern const u8 gText_ApprenticePleaseTeach1[];
extern const u8 gText_ApprenticePleaseTeach2[];
extern const u8 gText_ApprenticePleaseTeach3[];
extern const u8 gText_ApprenticePleaseTeach4[];
extern const u8 gText_ApprenticePleaseTeach5[];
extern const u8 gText_ApprenticePleaseTeach6[];
extern const u8 gText_ApprenticePleaseTeach7[];
extern const u8 gText_ApprenticePleaseTeach8[];
extern const u8 gText_ApprenticePleaseTeach9[];
extern const u8 gText_ApprenticePleaseTeach10[];
extern const u8 gText_ApprenticePleaseTeach11[];
extern const u8 gText_ApprenticePleaseTeach12[];
extern const u8 gText_ApprenticePleaseTeach13[];
extern const u8 gText_ApprenticePleaseTeach14[];
extern const u8 gText_ApprenticePleaseTeach15[];
extern const u8 gText_ApprenticeRejectTeaching0[];
extern const u8 gText_ApprenticeRejectTeaching1[];
extern const u8 gText_ApprenticeRejectTeaching2[];
extern const u8 gText_ApprenticeRejectTeaching3[];
extern const u8 gText_ApprenticeRejectTeaching4[];
extern const u8 gText_ApprenticeRejectTeaching5[];
extern const u8 gText_ApprenticeRejectTeaching6[];
extern const u8 gText_ApprenticeRejectTeaching7[];
extern const u8 gText_ApprenticeRejectTeaching8[];
extern const u8 gText_ApprenticeRejectTeaching9[];
extern const u8 gText_ApprenticeRejectTeaching10[];
extern const u8 gText_ApprenticeRejectTeaching11[];
extern const u8 gText_ApprenticeRejectTeaching12[];
extern const u8 gText_ApprenticeRejectTeaching13[];
extern const u8 gText_ApprenticeRejectTeaching14[];
extern const u8 gText_ApprenticeRejectTeaching15[];
extern const u8 gText_ApprenticeWhichLevelMode0[];
extern const u8 gText_ApprenticeWhichLevelMode1[];
extern const u8 gText_ApprenticeWhichLevelMode2[];
extern const u8 gText_ApprenticeWhichLevelMode3[];
extern const u8 gText_ApprenticeWhichLevelMode4[];
extern const u8 gText_ApprenticeWhichLevelMode5[];
extern const u8 gText_ApprenticeWhichLevelMode6[];
extern const u8 gText_ApprenticeWhichLevelMode7[];
extern const u8 gText_ApprenticeWhichLevelMode8[];
extern const u8 gText_ApprenticeWhichLevelMode9[];
extern const u8 gText_ApprenticeWhichLevelMode10[];
extern const u8 gText_ApprenticeWhichLevelMode11[];
extern const u8 gText_ApprenticeWhichLevelMode12[];
extern const u8 gText_ApprenticeWhichLevelMode13[];
extern const u8 gText_ApprenticeWhichLevelMode14[];
extern const u8 gText_ApprenticeWhichLevelMode15[];
extern const u8 gText_ApprenticeLevelModeThanks0[];
extern const u8 gText_ApprenticeLevelModeThanks1[];
extern const u8 gText_ApprenticeLevelModeThanks2[];
extern const u8 gText_ApprenticeLevelModeThanks3[];
extern const u8 gText_ApprenticeLevelModeThanks4[];
extern const u8 gText_ApprenticeLevelModeThanks5[];
extern const u8 gText_ApprenticeLevelModeThanks6[];
extern const u8 gText_ApprenticeLevelModeThanks7[];
extern const u8 gText_ApprenticeLevelModeThanks8[];
extern const u8 gText_ApprenticeLevelModeThanks9[];
extern const u8 gText_ApprenticeLevelModeThanks10[];
extern const u8 gText_ApprenticeLevelModeThanks11[];
extern const u8 gText_ApprenticeLevelModeThanks12[];
extern const u8 gText_ApprenticeLevelModeThanks13[];
extern const u8 gText_ApprenticeLevelModeThanks14[];
extern const u8 gText_ApprenticeLevelModeThanks15[];
extern const u8 gText_ApprenticeWhichMon0[];
extern const u8 gText_ApprenticeWhichMon1[];
extern const u8 gText_ApprenticeWhichMon2[];
extern const u8 gText_ApprenticeWhichMon3[];
extern const u8 gText_ApprenticeWhichMon4[];
extern const u8 gText_ApprenticeWhichMon5[];
extern const u8 gText_ApprenticeWhichMon6[];
extern const u8 gText_ApprenticeWhichMon7[];
extern const u8 gText_ApprenticeWhichMon8[];
extern const u8 gText_ApprenticeWhichMon9[];
extern const u8 gText_ApprenticeWhichMon10[];
extern const u8 gText_ApprenticeWhichMon11[];
extern const u8 gText_ApprenticeWhichMon12[];
extern const u8 gText_ApprenticeWhichMon13[];
extern const u8 gText_ApprenticeWhichMon14[];
extern const u8 gText_ApprenticeWhichMon15[];
extern const u8 gText_ApprenticeMonThanks0[];
extern const u8 gText_ApprenticeMonThanks1[];
extern const u8 gText_ApprenticeMonThanks2[];
extern const u8 gText_ApprenticeMonThanks3[];
extern const u8 gText_ApprenticeMonThanks4[];
extern const u8 gText_ApprenticeMonThanks5[];
extern const u8 gText_ApprenticeMonThanks6[];
extern const u8 gText_ApprenticeMonThanks7[];
extern const u8 gText_ApprenticeMonThanks8[];
extern const u8 gText_ApprenticeMonThanks9[];
extern const u8 gText_ApprenticeMonThanks10[];
extern const u8 gText_ApprenticeMonThanks11[];
extern const u8 gText_ApprenticeMonThanks12[];
extern const u8 gText_ApprenticeMonThanks13[];
extern const u8 gText_ApprenticeMonThanks14[];
extern const u8 gText_ApprenticeMonThanks15[];
extern const u8 gText_ApprenticeWhatHeldItem0[];
extern const u8 gText_ApprenticeWhatHeldItem1[];
extern const u8 gText_ApprenticeWhatHeldItem2[];
extern const u8 gText_ApprenticeWhatHeldItem3[];
extern const u8 gText_ApprenticeWhatHeldItem4[];
extern const u8 gText_ApprenticeWhatHeldItem5[];
extern const u8 gText_ApprenticeWhatHeldItem6[];
extern const u8 gText_ApprenticeWhatHeldItem7[];
extern const u8 gText_ApprenticeWhatHeldItem8[];
extern const u8 gText_ApprenticeWhatHeldItem9[];
extern const u8 gText_ApprenticeWhatHeldItem10[];
extern const u8 gText_ApprenticeWhatHeldItem11[];
extern const u8 gText_ApprenticeWhatHeldItem12[];
extern const u8 gText_ApprenticeWhatHeldItem13[];
extern const u8 gText_ApprenticeWhatHeldItem14[];
extern const u8 gText_ApprenticeWhatHeldItem15[];
extern const u8 gText_ApprenticeHoldNothing0[];
extern const u8 gText_ApprenticeHoldNothing1[];
extern const u8 gText_ApprenticeHoldNothing2[];
extern const u8 gText_ApprenticeHoldNothing3[];
extern const u8 gText_ApprenticeHoldNothing4[];
extern const u8 gText_ApprenticeHoldNothing5[];
extern const u8 gText_ApprenticeHoldNothing6[];
extern const u8 gText_ApprenticeHoldNothing7[];
extern const u8 gText_ApprenticeHoldNothing8[];
extern const u8 gText_ApprenticeHoldNothing9[];
extern const u8 gText_ApprenticeHoldNothing10[];
extern const u8 gText_ApprenticeHoldNothing11[];
extern const u8 gText_ApprenticeHoldNothing12[];
extern const u8 gText_ApprenticeHoldNothing13[];
extern const u8 gText_ApprenticeHoldNothing14[];
extern const u8 gText_ApprenticeHoldNothing15[];
extern const u8 gText_ApprenticeThanksNoHeldItem0[];
extern const u8 gText_ApprenticeThanksNoHeldItem1[];
extern const u8 gText_ApprenticeThanksNoHeldItem2[];
extern const u8 gText_ApprenticeThanksNoHeldItem3[];
extern const u8 gText_ApprenticeThanksNoHeldItem4[];
extern const u8 gText_ApprenticeThanksNoHeldItem5[];
extern const u8 gText_ApprenticeThanksNoHeldItem6[];
extern const u8 gText_ApprenticeThanksNoHeldItem7[];
extern const u8 gText_ApprenticeThanksNoHeldItem8[];
extern const u8 gText_ApprenticeThanksNoHeldItem9[];
extern const u8 gText_ApprenticeThanksNoHeldItem10[];
extern const u8 gText_ApprenticeThanksNoHeldItem11[];
extern const u8 gText_ApprenticeThanksNoHeldItem12[];
extern const u8 gText_ApprenticeThanksNoHeldItem13[];
extern const u8 gText_ApprenticeThanksNoHeldItem14[];
extern const u8 gText_ApprenticeThanksNoHeldItem15[];
extern const u8 gText_ApprenticeThanksHeldItem0[];
extern const u8 gText_ApprenticeThanksHeldItem1[];
extern const u8 gText_ApprenticeThanksHeldItem2[];
extern const u8 gText_ApprenticeThanksHeldItem3[];
extern const u8 gText_ApprenticeThanksHeldItem4[];
extern const u8 gText_ApprenticeThanksHeldItem5[];
extern const u8 gText_ApprenticeThanksHeldItem6[];
extern const u8 gText_ApprenticeThanksHeldItem7[];
extern const u8 gText_ApprenticeThanksHeldItem8[];
extern const u8 gText_ApprenticeThanksHeldItem9[];
extern const u8 gText_ApprenticeThanksHeldItem10[];
extern const u8 gText_ApprenticeThanksHeldItem11[];
extern const u8 gText_ApprenticeThanksHeldItem12[];
extern const u8 gText_ApprenticeThanksHeldItem13[];
extern const u8 gText_ApprenticeThanksHeldItem14[];
extern const u8 gText_ApprenticeThanksHeldItem15[];
extern const u8 gText_ApprenticeItemAlreadyRecommended0[];
extern const u8 gText_ApprenticeItemAlreadyRecommended1[];
extern const u8 gText_ApprenticeItemAlreadyRecommended2[];
extern const u8 gText_ApprenticeItemAlreadyRecommended3[];
extern const u8 gText_ApprenticeItemAlreadyRecommended4[];
extern const u8 gText_ApprenticeItemAlreadyRecommended5[];
extern const u8 gText_ApprenticeItemAlreadyRecommended6[];
extern const u8 gText_ApprenticeItemAlreadyRecommended7[];
extern const u8 gText_ApprenticeItemAlreadyRecommended8[];
extern const u8 gText_ApprenticeItemAlreadyRecommended9[];
extern const u8 gText_ApprenticeItemAlreadyRecommended10[];
extern const u8 gText_ApprenticeItemAlreadyRecommended11[];
extern const u8 gText_ApprenticeItemAlreadyRecommended12[];
extern const u8 gText_ApprenticeItemAlreadyRecommended13[];
extern const u8 gText_ApprenticeItemAlreadyRecommended14[];
extern const u8 gText_ApprenticeItemAlreadyRecommended15[];
extern const u8 gText_ApprenticeWhichMove0[];
extern const u8 gText_ApprenticeWhichMove1[];
extern const u8 gText_ApprenticeWhichMove2[];
extern const u8 gText_ApprenticeWhichMove3[];
extern const u8 gText_ApprenticeWhichMove4[];
extern const u8 gText_ApprenticeWhichMove5[];
extern const u8 gText_ApprenticeWhichMove6[];
extern const u8 gText_ApprenticeWhichMove7[];
extern const u8 gText_ApprenticeWhichMove8[];
extern const u8 gText_ApprenticeWhichMove9[];
extern const u8 gText_ApprenticeWhichMove10[];
extern const u8 gText_ApprenticeWhichMove11[];
extern const u8 gText_ApprenticeWhichMove12[];
extern const u8 gText_ApprenticeWhichMove13[];
extern const u8 gText_ApprenticeWhichMove14[];
extern const u8 gText_ApprenticeWhichMove15[];
extern const u8 gText_ApprenticeMoveThanks0[];
extern const u8 gText_ApprenticeMoveThanks1[];
extern const u8 gText_ApprenticeMoveThanks2[];
extern const u8 gText_ApprenticeMoveThanks3[];
extern const u8 gText_ApprenticeMoveThanks4[];
extern const u8 gText_ApprenticeMoveThanks5[];
extern const u8 gText_ApprenticeMoveThanks6[];
extern const u8 gText_ApprenticeMoveThanks7[];
extern const u8 gText_ApprenticeMoveThanks8[];
extern const u8 gText_ApprenticeMoveThanks9[];
extern const u8 gText_ApprenticeMoveThanks10[];
extern const u8 gText_ApprenticeMoveThanks11[];
extern const u8 gText_ApprenticeMoveThanks12[];
extern const u8 gText_ApprenticeMoveThanks13[];
extern const u8 gText_ApprenticeMoveThanks14[];
extern const u8 gText_ApprenticeMoveThanks15[];
extern const u8 gText_ApprenticeWhichMonFirst0[];
extern const u8 gText_ApprenticeWhichMonFirst1[];
extern const u8 gText_ApprenticeWhichMonFirst2[];
extern const u8 gText_ApprenticeWhichMonFirst3[];
extern const u8 gText_ApprenticeWhichMonFirst4[];
extern const u8 gText_ApprenticeWhichMonFirst5[];
extern const u8 gText_ApprenticeWhichMonFirst6[];
extern const u8 gText_ApprenticeWhichMonFirst7[];
extern const u8 gText_ApprenticeWhichMonFirst8[];
extern const u8 gText_ApprenticeWhichMonFirst9[];
extern const u8 gText_ApprenticeWhichMonFirst10[];
extern const u8 gText_ApprenticeWhichMonFirst11[];
extern const u8 gText_ApprenticeWhichMonFirst12[];
extern const u8 gText_ApprenticeWhichMonFirst13[];
extern const u8 gText_ApprenticeWhichMonFirst14[];
extern const u8 gText_ApprenticeWhichMonFirst15[];
extern const u8 gText_ApprenticeMonFirstThanks0[];
extern const u8 gText_ApprenticeMonFirstThanks1[];
extern const u8 gText_ApprenticeMonFirstThanks2[];
extern const u8 gText_ApprenticeMonFirstThanks3[];
extern const u8 gText_ApprenticeMonFirstThanks4[];
extern const u8 gText_ApprenticeMonFirstThanks5[];
extern const u8 gText_ApprenticeMonFirstThanks6[];
extern const u8 gText_ApprenticeMonFirstThanks7[];
extern const u8 gText_ApprenticeMonFirstThanks8[];
extern const u8 gText_ApprenticeMonFirstThanks9[];
extern const u8 gText_ApprenticeMonFirstThanks10[];
extern const u8 gText_ApprenticeMonFirstThanks11[];
extern const u8 gText_ApprenticeMonFirstThanks12[];
extern const u8 gText_ApprenticeMonFirstThanks13[];
extern const u8 gText_ApprenticeMonFirstThanks14[];
extern const u8 gText_ApprenticeMonFirstThanks15[];
extern const u8 gText_ApprenticePickWinSpeech0[];
extern const u8 gText_ApprenticePickWinSpeech1[];
extern const u8 gText_ApprenticePickWinSpeech2[];
extern const u8 gText_ApprenticePickWinSpeech3[];
extern const u8 gText_ApprenticePickWinSpeech4[];
extern const u8 gText_ApprenticePickWinSpeech5[];
extern const u8 gText_ApprenticePickWinSpeech6[];
extern const u8 gText_ApprenticePickWinSpeech7[];
extern const u8 gText_ApprenticePickWinSpeech8[];
extern const u8 gText_ApprenticePickWinSpeech9[];
extern const u8 gText_ApprenticePickWinSpeech10[];
extern const u8 gText_ApprenticePickWinSpeech11[];
extern const u8 gText_ApprenticePickWinSpeech12[];
extern const u8 gText_ApprenticePickWinSpeech13[];
extern const u8 gText_ApprenticePickWinSpeech14[];
extern const u8 gText_ApprenticePickWinSpeech15[];
extern const u8 gText_ApprenticeWinSpeechThanks0[];
extern const u8 gText_ApprenticeWinSpeechThanks1[];
extern const u8 gText_ApprenticeWinSpeechThanks2[];
extern const u8 gText_ApprenticeWinSpeechThanks3[];
extern const u8 gText_ApprenticeWinSpeechThanks4[];
extern const u8 gText_ApprenticeWinSpeechThanks5[];
extern const u8 gText_ApprenticeWinSpeechThanks6[];
extern const u8 gText_ApprenticeWinSpeechThanks7[];
extern const u8 gText_ApprenticeWinSpeechThanks8[];
extern const u8 gText_ApprenticeWinSpeechThanks9[];
extern const u8 gText_ApprenticeWinSpeechThanks10[];
extern const u8 gText_ApprenticeWinSpeechThanks11[];
extern const u8 gText_ApprenticeWinSpeechThanks12[];
extern const u8 gText_ApprenticeWinSpeechThanks13[];
extern const u8 gText_ApprenticeWinSpeechThanks14[];
extern const u8 gText_ApprenticeWinSpeechThanks15[];
extern const u8 gText_ApprenticeChallenge0[];
extern const u8 gText_ApprenticeChallenge1[];
extern const u8 gText_ApprenticeChallenge2[];
extern const u8 gText_ApprenticeChallenge3[];
extern const u8 gText_ApprenticeChallenge4[];
extern const u8 gText_ApprenticeChallenge5[];
extern const u8 gText_ApprenticeChallenge6[];
extern const u8 gText_ApprenticeChallenge7[];
extern const u8 gText_ApprenticeChallenge8[];
extern const u8 gText_ApprenticeChallenge9[];
extern const u8 gText_ApprenticeChallenge10[];
extern const u8 gText_ApprenticeChallenge11[];
extern const u8 gText_ApprenticeChallenge12[];
extern const u8 gText_ApprenticeChallenge13[];
extern const u8 gText_ApprenticeChallenge14[];
extern const u8 gText_ApprenticeChallenge15[];
const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] =
{
{
.name = {_("サダヒロ"), _("ALANN"), _("ALAIN"), _("ADELFO"), _("CLAUS"), _("TEO")},
.otId = 0xBDC9,
.facilityClass = FACILITY_CLASS_BUG_CATCHER,
.species = {SPECIES_BEAUTIFLY, SPECIES_DUSTOX, SPECIES_ILLUMISE, SPECIES_SHIFTRY, SPECIES_BRELOOM, SPECIES_NINJASK, SPECIES_SHEDINJA, SPECIES_PINSIR, SPECIES_HERACROSS, SPECIES_VOLBEAT},
.id = 0,
.speechLost = {EC_WORD_NO, EC_WORD_MISTAKE, EC_WORD_EXCL, EC_WORD_I, EC_WORD_LOST, EC_WORD_BADLY},
},
{
.name = {_("ヒロオ"), _("LIONEL"), _("LIONEL"), _("CAIO"), _("LUDWIG"), _("LEO")},
.otId = 0xCF09,
.facilityClass = FACILITY_CLASS_YOUNGSTER,
.species = {SPECIES_SWELLOW, SPECIES_SWALOT, SPECIES_SHUCKLE, SPECIES_MANECTRIC, SPECIES_TORKOAL, SPECIES_HARIYAMA, SPECIES_MIGHTYENA, SPECIES_LUDICOLO, SPECIES_CRAWDAUNT, SPECIES_WHISCASH},
.id = 1,
.speechLost = {EC_WORD_OKAY, EC_WORD_I, EC_WORD_LOST, EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_MASTER},
},
{
.name = {_("ケイジ"), _("SONNY"), _("HERVE"), _("FEDRO"), _("WENZEL"), _("SANTI")},
.otId = 0x2E34,
.facilityClass = FACILITY_CLASS_SCHOOL_KID_M,
.species = {SPECIES_LINOONE, SPECIES_MIGHTYENA, SPECIES_WHISCASH, SPECIES_ZANGOOSE, SPECIES_SEVIPER, SPECIES_NINETALES, SPECIES_KECLEON, SPECIES_SHUCKLE, SPECIES_MANECTRIC, SPECIES_MACHAMP},
.id = 2,
.speechLost = {EC_WORD_I, EC_WORD_WENT, EC_WORD_AND, EC_WORD_LOST, EC_WORD_AWW, EC_WORD_ELLIPSIS},
},
{
.name = {_("ユラ"), _("LAYLA"), _("LAYLA"), _("ASTRID"), _("SONJA"), _("LOLA")},
.otId = 0x84EF,
.facilityClass = FACILITY_CLASS_LASS,
.species = {SPECIES_SWALOT, SPECIES_XATU, SPECIES_ALTARIA, SPECIES_GOLDUCK, SPECIES_FLYGON, SPECIES_ALAKAZAM, SPECIES_GARDEVOIR, SPECIES_WAILORD, SPECIES_GRUMPIG, SPECIES_MIGHTYENA},
.id = 3,
.speechLost = {EC_WORD_IS, EC_WORD_THIS, EC_WORD_TOO, EC_WORD_MUCH, EC_WORD_QUES, 0xFFFF},
},
{
.name = {_("ヨウカ"), _("MACY"), _("AMELIE"), _("CLEO"), _("MARIA"), _("ELISA")},
.otId = 0x1E43,
.facilityClass = FACILITY_CLASS_SCHOOL_KID_F,
.species = {SPECIES_WIGGLYTUFF, SPECIES_LINOONE, SPECIES_KINGDRA, SPECIES_DELCATTY, SPECIES_RAICHU, SPECIES_FEAROW, SPECIES_STARMIE, SPECIES_MEDICHAM, SPECIES_SHIFTRY, SPECIES_BEAUTIFLY},
.id = 4,
.speechLost = {EC_WORD_THIS, EC_WORD_WON_T, EC_WORD_BE, EC_WORD_HAPPENING, EC_WORD_NEXT, EC_WORD_TIME},
},
{
.name = {_("ヤスシ"), _("DONTE"), _("BRAHIM"), _("GLAUCO"), _("JOSEF"), _("ROQUE")},
.otId = 0x379F,
.facilityClass = FACILITY_CLASS_RUNNING_TRIATHLETE_M,
.species = {SPECIES_STARMIE, SPECIES_DODRIO, SPECIES_AGGRON, SPECIES_MAGNETON, SPECIES_MACHAMP, SPECIES_ARMALDO, SPECIES_HERACROSS, SPECIES_NOSEPASS, SPECIES_EXPLOUD, SPECIES_MIGHTYENA},
.id = 5,
.speechLost = {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_RUN, EC_WORD_BYE_BYE, EC_WORD_EXCL},
},
{
.name = {_("ミサオ"), _("AMIRA"), _("LAURE"), _("DAFNE"), _("AMELIE"), _("LARA")},
.otId = 0xF555,
.facilityClass = FACILITY_CLASS_RUNNING_TRIATHLETE_F,
.species = {SPECIES_STARMIE, SPECIES_DODRIO, SPECIES_MAGNETON, SPECIES_MEDICHAM, SPECIES_MIGHTYENA, SPECIES_GLALIE, SPECIES_GOLEM, SPECIES_ELECTRODE, SPECIES_PELIPPER, SPECIES_SHARPEDO},
.id = 6,
.speechLost = {EC_WORD_AHAHA, EC_WORD_DEFEATED, EC_WORD_EXCL, EC_WORD_IT_S, EC_WORD_NOTHING, EC_WORD_EXCL},
},
{
.name = {_("カズサ"), _("KALI"), _("JODIE"), _("ILENIA"), _("KARO"), _("ELSA")},
.otId = 0x8D26,
.facilityClass = FACILITY_CLASS_BEAUTY,
.species = {SPECIES_NINETALES, SPECIES_ALAKAZAM, SPECIES_SCEPTILE, SPECIES_SALAMENCE, SPECIES_GOLDUCK, SPECIES_MAWILE, SPECIES_WEEZING, SPECIES_LANTURN, SPECIES_GARDEVOIR, SPECIES_MILOTIC},
.id = 7,
.speechLost = {EC_WORD_YOU_RE, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, 0xFFFF},
},
{
.name = {_("スミレ"), _("ANNIE"), _("ANNIE"), _("IMELDA"), _("INES"), _("ROSA")},
.otId = 0x800C,
.facilityClass = FACILITY_CLASS_AROMA_LADY,
.species = {SPECIES_SCEPTILE, SPECIES_VILEPLUME, SPECIES_BELLOSSOM, SPECIES_ROSELIA, SPECIES_CORSOLA, SPECIES_FLYGON, SPECIES_BRELOOM, SPECIES_MILOTIC, SPECIES_ALTARIA, SPECIES_CRADILY},
.id = 8,
.speechLost = {EC_WORD_WHAT, EC_WORD_TOUGH, EC_WORD_POKEMON, EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_EXCL},
},
{
.name = {_("アキノリ"), _("DILLEN"), _("RENE"), _("INDRO"), _("DETLEF"), _("PEDRO")},
.otId = 0x469f,
.facilityClass = FACILITY_CLASS_HIKER,
.species = {SPECIES_SKARMORY, SPECIES_GOLEM, SPECIES_BLAZIKEN, SPECIES_CAMERUPT, SPECIES_DONPHAN, SPECIES_MUK, SPECIES_SALAMENCE, SPECIES_TROPIUS, SPECIES_SOLROCK, SPECIES_RHYDON},
.id = 9,
.speechLost = {EC_WORD_WE, EC_WORD_WERE, EC_WORD_JUST, EC_WORD_SHREDDED, EC_WORD_ELLIPSIS, 0xFFFF},
},
{
.name = {_("トウゾウ"), _("DALLAS"), _("BRUNO"), _("LEARCO"), _("ANSGAR"), _("MANOLO")},
.otId = 0x71FC,
.facilityClass = FACILITY_CLASS_FISHERMAN,
.species = {SPECIES_SEAKING, SPECIES_STARMIE, SPECIES_GOLDUCK, SPECIES_TENTACRUEL, SPECIES_OCTILLERY, SPECIES_GOREBYSS, SPECIES_GLALIE, SPECIES_WAILORD, SPECIES_SHARPEDO, SPECIES_KINGDRA},
.id = 10,
.speechLost = {EC_WORD_YOUR, EC_WORD_WIN, EC_WORD_ANGERS, EC_WORD_ME, EC_WORD_EXCL, 0xFFFF},
},
{
.name = {_("セイヤ"), _("FRANK"), _("FRANK"), _("OLINDO"), _("FRANK"), _("MAURO")},
.otId = 0xA39E,
.facilityClass = FACILITY_CLASS_SAILOR,
.species = {SPECIES_QUAGSIRE, SPECIES_STARMIE, SPECIES_PELIPPER, SPECIES_CRAWDAUNT, SPECIES_WAILORD, SPECIES_GYARADOS, SPECIES_SWAMPERT, SPECIES_LANTURN, SPECIES_WHISCASH, SPECIES_SHUCKLE},
.id = 11,
.speechLost = {EC_WORD_LOSING, EC_WORD_DOESN_T, EC_MOVE(CUT), EC_WORD_ME, EC_WORD_DEEP, EC_WORD_OK_QUES},
},
{
.name = {_("リュウジ"), _("LAMONT"), _("XAV"), _("ORFEO"), _("JÜRGEN"), _("JORGE")},
.otId = 0xE590,
.facilityClass = FACILITY_CLASS_GUITARIST,
.species = {SPECIES_ABSOL, SPECIES_CROBAT, SPECIES_EXPLOUD, SPECIES_MAGNETON, SPECIES_SHARPEDO, SPECIES_MANECTRIC, SPECIES_METAGROSS, SPECIES_ELECTRODE, SPECIES_NOSEPASS, SPECIES_WEEZING},
.id = 12,
.speechLost = {EC_WORD_A, EC_WORD_LOSS, EC_WORD_IS, EC_WORD_WHAT, EC_WORD_THIS, EC_WORD_IS},
},
{
.name = {_("カツアキ"), _("TYRESE"), _("ANDY"), _("PARIDE"), _("DAVID"), _("CHICHO")},
.otId = 0xD018,
.facilityClass = FACILITY_CLASS_BLACK_BELT,
.species = {SPECIES_BLAZIKEN, SPECIES_GOLEM, SPECIES_MACHAMP, SPECIES_RHYDON, SPECIES_HARIYAMA, SPECIES_AGGRON, SPECIES_MEDICHAM, SPECIES_ZANGOOSE, SPECIES_VIGOROTH, SPECIES_SLAKING},
.id = 13,
.speechLost = {EC_WORD_I_AM, EC_WORD_TOO_WEAK, EC_WORD_AND, EC_WORD_LOW, EC_WORD_OF, EC_WORD_POWER},
},
{
.name = {_("トシミツ"), _("DANTE"), _("DANTE"), _("RAOUL"), _("LOTHAR"), _("PABLO")},
.otId = 0xBC75,
.facilityClass = FACILITY_CLASS_RUIN_MANIAC,
.species = {SPECIES_SCEPTILE, SPECIES_SANDSLASH, SPECIES_FLYGON, SPECIES_CLAYDOL, SPECIES_ARMALDO, SPECIES_CROBAT, SPECIES_CRADILY, SPECIES_SOLROCK, SPECIES_LUNATONE, SPECIES_GOLEM},
.id = 14,
.speechLost = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_UNDERSTAND, EC_WORD_WHAT, EC_WORD_IS, EC_WORD_HAPPENING},
},
{
.name = {_("ローウェン"), _("ARTURO"), _("ARTURO"), _("ROMOLO"), _("BRIAN"), _("ARTURO")},
.otId = 0xFA02,
.facilityClass = FACILITY_CLASS_GENTLEMAN,
.species = {SPECIES_ABSOL, SPECIES_MIGHTYENA, SPECIES_ALAKAZAM, SPECIES_BANETTE, SPECIES_NINETALES, SPECIES_CLAYDOL, SPECIES_MUK, SPECIES_SALAMENCE, SPECIES_WALREIN, SPECIES_DUSCLOPS},
.id = 15,
.speechLost = {EC_WORD_THIS, EC_WORD_HAS, EC_WORD_TO, EC_WORD_BE, EC_WORD_A, EC_WORD_LIE},
},
};
// Sequence of 4 messages for the first meeting with the apprentice
static const u8 *const sApprenticeFirstMeetingTexts[NUM_APPRENTICES][4] =
{
{gText_ApprenticePleaseTeach0, gText_ApprenticeRejectTeaching0, gText_ApprenticeWhichLevelMode0, gText_ApprenticeLevelModeThanks0},
{gText_ApprenticePleaseTeach1, gText_ApprenticeRejectTeaching1, gText_ApprenticeWhichLevelMode1, gText_ApprenticeLevelModeThanks1},
{gText_ApprenticePleaseTeach2, gText_ApprenticeRejectTeaching2, gText_ApprenticeWhichLevelMode2, gText_ApprenticeLevelModeThanks2},
{gText_ApprenticePleaseTeach3, gText_ApprenticeRejectTeaching3, gText_ApprenticeWhichLevelMode3, gText_ApprenticeLevelModeThanks3},
{gText_ApprenticePleaseTeach4, gText_ApprenticeRejectTeaching4, gText_ApprenticeWhichLevelMode4, gText_ApprenticeLevelModeThanks4},
{gText_ApprenticePleaseTeach5, gText_ApprenticeRejectTeaching5, gText_ApprenticeWhichLevelMode5, gText_ApprenticeLevelModeThanks5},
{gText_ApprenticePleaseTeach6, gText_ApprenticeRejectTeaching6, gText_ApprenticeWhichLevelMode6, gText_ApprenticeLevelModeThanks6},
{gText_ApprenticePleaseTeach7, gText_ApprenticeRejectTeaching7, gText_ApprenticeWhichLevelMode7, gText_ApprenticeLevelModeThanks7},
{gText_ApprenticePleaseTeach8, gText_ApprenticeRejectTeaching8, gText_ApprenticeWhichLevelMode8, gText_ApprenticeLevelModeThanks8},
{gText_ApprenticePleaseTeach9, gText_ApprenticeRejectTeaching9, gText_ApprenticeWhichLevelMode9, gText_ApprenticeLevelModeThanks9},
{gText_ApprenticePleaseTeach10, gText_ApprenticeRejectTeaching10, gText_ApprenticeWhichLevelMode10, gText_ApprenticeLevelModeThanks10},
{gText_ApprenticePleaseTeach11, gText_ApprenticeRejectTeaching11, gText_ApprenticeWhichLevelMode11, gText_ApprenticeLevelModeThanks11},
{gText_ApprenticePleaseTeach12, gText_ApprenticeRejectTeaching12, gText_ApprenticeWhichLevelMode12, gText_ApprenticeLevelModeThanks12},
{gText_ApprenticePleaseTeach13, gText_ApprenticeRejectTeaching13, gText_ApprenticeWhichLevelMode13, gText_ApprenticeLevelModeThanks13},
{gText_ApprenticePleaseTeach14, gText_ApprenticeRejectTeaching14, gText_ApprenticeWhichLevelMode14, gText_ApprenticeLevelModeThanks14},
{gText_ApprenticePleaseTeach15, gText_ApprenticeRejectTeaching15, gText_ApprenticeWhichLevelMode15, gText_ApprenticeLevelModeThanks15},
};
static const u8 *const sApprenticeWhichMonTexts[NUM_APPRENTICES][2] =
{
{gText_ApprenticeWhichMon0, gText_ApprenticeMonThanks0},
{gText_ApprenticeWhichMon1, gText_ApprenticeMonThanks1},
{gText_ApprenticeWhichMon2, gText_ApprenticeMonThanks2},
{gText_ApprenticeWhichMon3, gText_ApprenticeMonThanks3},
{gText_ApprenticeWhichMon4, gText_ApprenticeMonThanks4},
{gText_ApprenticeWhichMon5, gText_ApprenticeMonThanks5},
{gText_ApprenticeWhichMon6, gText_ApprenticeMonThanks6},
{gText_ApprenticeWhichMon7, gText_ApprenticeMonThanks7},
{gText_ApprenticeWhichMon8, gText_ApprenticeMonThanks8},
{gText_ApprenticeWhichMon9, gText_ApprenticeMonThanks9},
{gText_ApprenticeWhichMon10, gText_ApprenticeMonThanks10},
{gText_ApprenticeWhichMon11, gText_ApprenticeMonThanks11},
{gText_ApprenticeWhichMon12, gText_ApprenticeMonThanks12},
{gText_ApprenticeWhichMon13, gText_ApprenticeMonThanks13},
{gText_ApprenticeWhichMon14, gText_ApprenticeMonThanks14},
{gText_ApprenticeWhichMon15, gText_ApprenticeMonThanks15},
};
// Sequence of 5 messages for suggesting a held item to the apprentice
static const u8 *const sApprenticeHeldItemTexts[NUM_APPRENTICES][5] =
{
{gText_ApprenticeWhatHeldItem0, gText_ApprenticeHoldNothing0, gText_ApprenticeThanksNoHeldItem0, gText_ApprenticeThanksHeldItem0, gText_ApprenticeItemAlreadyRecommended0},
{gText_ApprenticeWhatHeldItem1, gText_ApprenticeHoldNothing1, gText_ApprenticeThanksNoHeldItem1, gText_ApprenticeThanksHeldItem1, gText_ApprenticeItemAlreadyRecommended1},
{gText_ApprenticeWhatHeldItem2, gText_ApprenticeHoldNothing2, gText_ApprenticeThanksNoHeldItem2, gText_ApprenticeThanksHeldItem2, gText_ApprenticeItemAlreadyRecommended2},
{gText_ApprenticeWhatHeldItem3, gText_ApprenticeHoldNothing3, gText_ApprenticeThanksNoHeldItem3, gText_ApprenticeThanksHeldItem3, gText_ApprenticeItemAlreadyRecommended3},
{gText_ApprenticeWhatHeldItem4, gText_ApprenticeHoldNothing4, gText_ApprenticeThanksNoHeldItem4, gText_ApprenticeThanksHeldItem4, gText_ApprenticeItemAlreadyRecommended4},
{gText_ApprenticeWhatHeldItem5, gText_ApprenticeHoldNothing5, gText_ApprenticeThanksNoHeldItem5, gText_ApprenticeThanksHeldItem5, gText_ApprenticeItemAlreadyRecommended5},
{gText_ApprenticeWhatHeldItem6, gText_ApprenticeHoldNothing6, gText_ApprenticeThanksNoHeldItem6, gText_ApprenticeThanksHeldItem6, gText_ApprenticeItemAlreadyRecommended6},
{gText_ApprenticeWhatHeldItem7, gText_ApprenticeHoldNothing7, gText_ApprenticeThanksNoHeldItem7, gText_ApprenticeThanksHeldItem7, gText_ApprenticeItemAlreadyRecommended7},
{gText_ApprenticeWhatHeldItem8, gText_ApprenticeHoldNothing8, gText_ApprenticeThanksNoHeldItem8, gText_ApprenticeThanksHeldItem8, gText_ApprenticeItemAlreadyRecommended8},
{gText_ApprenticeWhatHeldItem9, gText_ApprenticeHoldNothing9, gText_ApprenticeThanksNoHeldItem9, gText_ApprenticeThanksHeldItem9, gText_ApprenticeItemAlreadyRecommended9},
{gText_ApprenticeWhatHeldItem10, gText_ApprenticeHoldNothing10, gText_ApprenticeThanksNoHeldItem10, gText_ApprenticeThanksHeldItem10, gText_ApprenticeItemAlreadyRecommended10},
{gText_ApprenticeWhatHeldItem11, gText_ApprenticeHoldNothing11, gText_ApprenticeThanksNoHeldItem11, gText_ApprenticeThanksHeldItem11, gText_ApprenticeItemAlreadyRecommended11},
{gText_ApprenticeWhatHeldItem12, gText_ApprenticeHoldNothing12, gText_ApprenticeThanksNoHeldItem12, gText_ApprenticeThanksHeldItem12, gText_ApprenticeItemAlreadyRecommended12},
{gText_ApprenticeWhatHeldItem13, gText_ApprenticeHoldNothing13, gText_ApprenticeThanksNoHeldItem13, gText_ApprenticeThanksHeldItem13, gText_ApprenticeItemAlreadyRecommended13},
{gText_ApprenticeWhatHeldItem14, gText_ApprenticeHoldNothing14, gText_ApprenticeThanksNoHeldItem14, gText_ApprenticeThanksHeldItem14, gText_ApprenticeItemAlreadyRecommended14},
{gText_ApprenticeWhatHeldItem15, gText_ApprenticeHoldNothing15, gText_ApprenticeThanksNoHeldItem15, gText_ApprenticeThanksHeldItem15, gText_ApprenticeItemAlreadyRecommended15},
};
static const u8 *const sApprenticeWhichMoveTexts[NUM_APPRENTICES][2] =
{
{gText_ApprenticeWhichMove0, gText_ApprenticeMoveThanks0},
{gText_ApprenticeWhichMove1, gText_ApprenticeMoveThanks1},
{gText_ApprenticeWhichMove2, gText_ApprenticeMoveThanks2},
{gText_ApprenticeWhichMove3, gText_ApprenticeMoveThanks3},
{gText_ApprenticeWhichMove4, gText_ApprenticeMoveThanks4},
{gText_ApprenticeWhichMove5, gText_ApprenticeMoveThanks5},
{gText_ApprenticeWhichMove6, gText_ApprenticeMoveThanks6},
{gText_ApprenticeWhichMove7, gText_ApprenticeMoveThanks7},
{gText_ApprenticeWhichMove8, gText_ApprenticeMoveThanks8},
{gText_ApprenticeWhichMove9, gText_ApprenticeMoveThanks9},
{gText_ApprenticeWhichMove10, gText_ApprenticeMoveThanks10},
{gText_ApprenticeWhichMove11, gText_ApprenticeMoveThanks11},
{gText_ApprenticeWhichMove12, gText_ApprenticeMoveThanks12},
{gText_ApprenticeWhichMove13, gText_ApprenticeMoveThanks13},
{gText_ApprenticeWhichMove14, gText_ApprenticeMoveThanks14},
{gText_ApprenticeWhichMove15, gText_ApprenticeMoveThanks15},
};
static const u8 *const sApprenticeWhichMonFirstTexts[NUM_APPRENTICES][2] =
{
{gText_ApprenticeWhichMonFirst0, gText_ApprenticeMonFirstThanks0},
{gText_ApprenticeWhichMonFirst1, gText_ApprenticeMonFirstThanks1},
{gText_ApprenticeWhichMonFirst2, gText_ApprenticeMonFirstThanks2},
{gText_ApprenticeWhichMonFirst3, gText_ApprenticeMonFirstThanks3},
{gText_ApprenticeWhichMonFirst4, gText_ApprenticeMonFirstThanks4},
{gText_ApprenticeWhichMonFirst5, gText_ApprenticeMonFirstThanks5},
{gText_ApprenticeWhichMonFirst6, gText_ApprenticeMonFirstThanks6},
{gText_ApprenticeWhichMonFirst7, gText_ApprenticeMonFirstThanks7},
{gText_ApprenticeWhichMonFirst8, gText_ApprenticeMonFirstThanks8},
{gText_ApprenticeWhichMonFirst9, gText_ApprenticeMonFirstThanks9},
{gText_ApprenticeWhichMonFirst10, gText_ApprenticeMonFirstThanks10},
{gText_ApprenticeWhichMonFirst11, gText_ApprenticeMonFirstThanks11},
{gText_ApprenticeWhichMonFirst12, gText_ApprenticeMonFirstThanks12},
{gText_ApprenticeWhichMonFirst13, gText_ApprenticeMonFirstThanks13},
{gText_ApprenticeWhichMonFirst14, gText_ApprenticeMonFirstThanks14},
{gText_ApprenticeWhichMonFirst15, gText_ApprenticeMonFirstThanks15},
};
static const u8 *const sApprenticePickWinSpeechTexts[NUM_APPRENTICES][2] =
{
{gText_ApprenticePickWinSpeech0, gText_ApprenticeWinSpeechThanks0},
{gText_ApprenticePickWinSpeech1, gText_ApprenticeWinSpeechThanks1},
{gText_ApprenticePickWinSpeech2, gText_ApprenticeWinSpeechThanks2},
{gText_ApprenticePickWinSpeech3, gText_ApprenticeWinSpeechThanks3},
{gText_ApprenticePickWinSpeech4, gText_ApprenticeWinSpeechThanks4},
{gText_ApprenticePickWinSpeech5, gText_ApprenticeWinSpeechThanks5},
{gText_ApprenticePickWinSpeech6, gText_ApprenticeWinSpeechThanks6},
{gText_ApprenticePickWinSpeech7, gText_ApprenticeWinSpeechThanks7},
{gText_ApprenticePickWinSpeech8, gText_ApprenticeWinSpeechThanks8},
{gText_ApprenticePickWinSpeech9, gText_ApprenticeWinSpeechThanks9},
{gText_ApprenticePickWinSpeech10, gText_ApprenticeWinSpeechThanks10},
{gText_ApprenticePickWinSpeech11, gText_ApprenticeWinSpeechThanks11},
{gText_ApprenticePickWinSpeech12, gText_ApprenticeWinSpeechThanks12},
{gText_ApprenticePickWinSpeech13, gText_ApprenticeWinSpeechThanks13},
{gText_ApprenticePickWinSpeech14, gText_ApprenticeWinSpeechThanks14},
{gText_ApprenticePickWinSpeech15, gText_ApprenticeWinSpeechThanks15},
};
static const u8 *const sApprenticeChallengeTexts[NUM_APPRENTICES] =
{
gText_ApprenticeChallenge0,
gText_ApprenticeChallenge1,
gText_ApprenticeChallenge2,
gText_ApprenticeChallenge3,
gText_ApprenticeChallenge4,
gText_ApprenticeChallenge5,
gText_ApprenticeChallenge6,
gText_ApprenticeChallenge7,
gText_ApprenticeChallenge8,
gText_ApprenticeChallenge9,
gText_ApprenticeChallenge10,
gText_ApprenticeChallenge11,
gText_ApprenticeChallenge12,
gText_ApprenticeChallenge13,
gText_ApprenticeChallenge14,
gText_ApprenticeChallenge15,
};
// Unclear what the criteria are for valid moves
// Notably, a large percentage of multi-strike moves are not valid
static const bool8 sValidApprenticeMoves[MOVES_COUNT] =
{
[MOVE_NONE] = FALSE,
[MOVE_POUND] = FALSE,
[MOVE_KARATE_CHOP] = TRUE,
[MOVE_DOUBLE_SLAP] = TRUE,
[MOVE_COMET_PUNCH] = FALSE,
[MOVE_MEGA_PUNCH] = TRUE,
[MOVE_PAY_DAY] = FALSE,
[MOVE_FIRE_PUNCH] = TRUE,
[MOVE_ICE_PUNCH] = TRUE,
[MOVE_THUNDER_PUNCH] = TRUE,
[MOVE_SCRATCH] = FALSE,
[MOVE_VICE_GRIP] = FALSE,
[MOVE_GUILLOTINE] = TRUE,
[MOVE_RAZOR_WIND] = FALSE,
[MOVE_SWORDS_DANCE] = TRUE,
[MOVE_CUT] = FALSE,
[MOVE_GUST] = FALSE,
[MOVE_WING_ATTACK] = FALSE,
[MOVE_WHIRLWIND] = TRUE,
[MOVE_FLY] = TRUE,
[MOVE_BIND] = TRUE,
[MOVE_SLAM] = TRUE,
[MOVE_VINE_WHIP] = FALSE,
[MOVE_STOMP] = TRUE,
[MOVE_DOUBLE_KICK] = TRUE,
[MOVE_MEGA_KICK] = TRUE,
[MOVE_JUMP_KICK] = TRUE,
[MOVE_ROLLING_KICK] = TRUE,
[MOVE_SAND_ATTACK] = TRUE,
[MOVE_HEADBUTT] = TRUE,
[MOVE_HORN_ATTACK] = FALSE,
[MOVE_FURY_ATTACK] = FALSE,
[MOVE_HORN_DRILL] = TRUE,
[MOVE_TACKLE] = FALSE,
[MOVE_BODY_SLAM] = TRUE,
[MOVE_WRAP] = TRUE,
[MOVE_TAKE_DOWN] = TRUE,
[MOVE_THRASH] = TRUE,
[MOVE_DOUBLE_EDGE] = TRUE,
[MOVE_TAIL_WHIP] = FALSE,
[MOVE_POISON_STING] = FALSE,
[MOVE_TWINEEDLE] = TRUE,
[MOVE_PIN_MISSILE] = FALSE,
[MOVE_LEER] = FALSE,
[MOVE_BITE] = TRUE,
[MOVE_GROWL] = FALSE,
[MOVE_ROAR] = TRUE,
[MOVE_SING] = TRUE,
[MOVE_SUPERSONIC] = TRUE,
[MOVE_SONIC_BOOM] = TRUE,
[MOVE_DISABLE] = TRUE,
[MOVE_ACID] = FALSE,
[MOVE_EMBER] = FALSE,
[MOVE_FLAMETHROWER] = TRUE,
[MOVE_MIST] = TRUE,
[MOVE_WATER_GUN] = FALSE,
[MOVE_HYDRO_PUMP] = TRUE,
[MOVE_SURF] = TRUE,
[MOVE_ICE_BEAM] = TRUE,
[MOVE_BLIZZARD] = TRUE,
[MOVE_PSYBEAM] = TRUE,
[MOVE_BUBBLE_BEAM] = FALSE,
[MOVE_AURORA_BEAM] = FALSE,
[MOVE_HYPER_BEAM] = TRUE,
[MOVE_PECK] = FALSE,
[MOVE_DRILL_PECK] = TRUE,
[MOVE_SUBMISSION] = TRUE,
[MOVE_LOW_KICK] = TRUE,
[MOVE_COUNTER] = TRUE,
[MOVE_SEISMIC_TOSS] = TRUE,
[MOVE_STRENGTH] = TRUE,
[MOVE_ABSORB] = FALSE,
[MOVE_MEGA_DRAIN] = FALSE,
[MOVE_LEECH_SEED] = TRUE,
[MOVE_GROWTH] = TRUE,
[MOVE_RAZOR_LEAF] = TRUE,
[MOVE_SOLAR_BEAM] = TRUE,
[MOVE_POISON_POWDER] = TRUE,
[MOVE_STUN_SPORE] = TRUE,
[MOVE_SLEEP_POWDER] = TRUE,
[MOVE_PETAL_DANCE] = TRUE,
[MOVE_STRING_SHOT] = FALSE,
[MOVE_DRAGON_RAGE] = TRUE,
[MOVE_FIRE_SPIN] = TRUE,
[MOVE_THUNDER_SHOCK] = FALSE,
[MOVE_THUNDERBOLT] = TRUE,
[MOVE_THUNDER_WAVE] = TRUE,
[MOVE_THUNDER] = TRUE,
[MOVE_ROCK_THROW] = FALSE,
[MOVE_EARTHQUAKE] = TRUE,
[MOVE_FISSURE] = TRUE,
[MOVE_DIG] = TRUE,
[MOVE_TOXIC] = TRUE,
[MOVE_CONFUSION] = FALSE,
[MOVE_PSYCHIC] = TRUE,
[MOVE_HYPNOSIS] = TRUE,
[MOVE_MEDITATE] = TRUE,
[MOVE_AGILITY] = TRUE,
[MOVE_QUICK_ATTACK] = TRUE,
[MOVE_RAGE] = FALSE,
[MOVE_TELEPORT] = FALSE,
[MOVE_NIGHT_SHADE] = TRUE,
[MOVE_MIMIC] = TRUE,
[MOVE_SCREECH] = TRUE,
[MOVE_DOUBLE_TEAM] = TRUE,
[MOVE_RECOVER] = TRUE,
[MOVE_HARDEN] = TRUE,
[MOVE_MINIMIZE] = TRUE,
[MOVE_SMOKESCREEN] = TRUE,
[MOVE_CONFUSE_RAY] = TRUE,
[MOVE_WITHDRAW] = TRUE,
[MOVE_DEFENSE_CURL] = TRUE,
[MOVE_BARRIER] = TRUE,
[MOVE_LIGHT_SCREEN] = TRUE,
[MOVE_HAZE] = TRUE,
[MOVE_REFLECT] = TRUE,
[MOVE_FOCUS_ENERGY] = TRUE,
[MOVE_BIDE] = FALSE,
[MOVE_METRONOME] = TRUE,
[MOVE_MIRROR_MOVE] = TRUE,
[MOVE_SELF_DESTRUCT] = TRUE,
[MOVE_EGG_BOMB] = TRUE,
[MOVE_LICK] = TRUE,
[MOVE_SMOG] = FALSE,
[MOVE_SLUDGE] = FALSE,
[MOVE_BONE_CLUB] = FALSE,
[MOVE_FIRE_BLAST] = TRUE,
[MOVE_WATERFALL] = TRUE,
[MOVE_CLAMP] = TRUE,
[MOVE_SWIFT] = TRUE,
[MOVE_SKULL_BASH] = TRUE,
[MOVE_SPIKE_CANNON] = FALSE,
[MOVE_CONSTRICT] = FALSE,
[MOVE_AMNESIA] = TRUE,
[MOVE_KINESIS] = TRUE,
[MOVE_SOFT_BOILED] = TRUE,
[MOVE_HI_JUMP_KICK] = TRUE,
[MOVE_GLARE] = TRUE,
[MOVE_DREAM_EATER] = TRUE,
[MOVE_POISON_GAS] = FALSE,
[MOVE_BARRAGE] = FALSE,
[MOVE_LEECH_LIFE] = FALSE,
[MOVE_LOVELY_KISS] = TRUE,
[MOVE_SKY_ATTACK] = TRUE,
[MOVE_TRANSFORM] = TRUE,
[MOVE_BUBBLE] = FALSE,
[MOVE_DIZZY_PUNCH] = TRUE,
[MOVE_SPORE] = TRUE,
[MOVE_FLASH] = TRUE,
[MOVE_PSYWAVE] = TRUE,
[MOVE_SPLASH] = FALSE,
[MOVE_ACID_ARMOR] = TRUE,
[MOVE_CRABHAMMER] = TRUE,
[MOVE_EXPLOSION] = TRUE,
[MOVE_FURY_SWIPES] = FALSE,
[MOVE_BONEMERANG] = TRUE,
[MOVE_REST] = TRUE,
[MOVE_ROCK_SLIDE] = TRUE,
[MOVE_HYPER_FANG] = TRUE,
[MOVE_SHARPEN] = TRUE,
[MOVE_CONVERSION] = TRUE,
[MOVE_TRI_ATTACK] = TRUE,
[MOVE_SUPER_FANG] = TRUE,
[MOVE_SLASH] = TRUE,
[MOVE_SUBSTITUTE] = TRUE,
[MOVE_STRUGGLE] = TRUE,
[MOVE_SKETCH] = TRUE,
[MOVE_TRIPLE_KICK] = TRUE,
[MOVE_THIEF] = TRUE,
[MOVE_SPIDER_WEB] = TRUE,
[MOVE_MIND_READER] = TRUE,
[MOVE_NIGHTMARE] = TRUE,
[MOVE_FLAME_WHEEL] = FALSE,
[MOVE_SNORE] = TRUE,
[MOVE_CURSE] = TRUE,
[MOVE_FLAIL] = TRUE,
[MOVE_CONVERSION_2] = TRUE,
[MOVE_AEROBLAST] = TRUE,
[MOVE_COTTON_SPORE] = TRUE,
[MOVE_REVERSAL] = TRUE,
[MOVE_SPITE] = TRUE,
[MOVE_POWDER_SNOW] = FALSE,
[MOVE_PROTECT] = TRUE,
[MOVE_MACH_PUNCH] = TRUE,
[MOVE_SCARY_FACE] = TRUE,
[MOVE_FAINT_ATTACK] = TRUE,
[MOVE_SWEET_KISS] = TRUE,
[MOVE_BELLY_DRUM] = TRUE,
[MOVE_SLUDGE_BOMB] = TRUE,
[MOVE_MUD_SLAP] = TRUE,
[MOVE_OCTAZOOKA] = TRUE,
[MOVE_SPIKES] = TRUE,
[MOVE_ZAP_CANNON] = TRUE,
[MOVE_FORESIGHT] = TRUE,
[MOVE_DESTINY_BOND] = TRUE,
[MOVE_PERISH_SONG] = TRUE,
[MOVE_ICY_WIND] = TRUE,
[MOVE_DETECT] = TRUE,
[MOVE_BONE_RUSH] = FALSE,
[MOVE_LOCK_ON] = TRUE,
[MOVE_OUTRAGE] = TRUE,
[MOVE_SANDSTORM] = TRUE,
[MOVE_GIGA_DRAIN] = TRUE,
[MOVE_ENDURE] = TRUE,
[MOVE_CHARM] = TRUE,
[MOVE_ROLLOUT] = TRUE,
[MOVE_FALSE_SWIPE] = TRUE,
[MOVE_SWAGGER] = TRUE,
[MOVE_MILK_DRINK] = TRUE,
[MOVE_SPARK] = FALSE,
[MOVE_FURY_CUTTER] = TRUE,
[MOVE_STEEL_WING] = TRUE,
[MOVE_MEAN_LOOK] = TRUE,
[MOVE_ATTRACT] = TRUE,
[MOVE_SLEEP_TALK] = TRUE,
[MOVE_HEAL_BELL] = TRUE,
[MOVE_RETURN] = TRUE,
[MOVE_PRESENT] = TRUE,
[MOVE_FRUSTRATION] = TRUE,
[MOVE_SAFEGUARD] = TRUE,
[MOVE_PAIN_SPLIT] = TRUE,
[MOVE_SACRED_FIRE] = TRUE,
[MOVE_MAGNITUDE] = FALSE,
[MOVE_DYNAMIC_PUNCH] = TRUE,
[MOVE_MEGAHORN] = TRUE,
[MOVE_DRAGON_BREATH] = TRUE,
[MOVE_BATON_PASS] = TRUE,
[MOVE_ENCORE] = TRUE,
[MOVE_PURSUIT] = TRUE,
[MOVE_RAPID_SPIN] = TRUE,
[MOVE_SWEET_SCENT] = TRUE,
[MOVE_IRON_TAIL] = TRUE,
[MOVE_METAL_CLAW] = TRUE,
[MOVE_VITAL_THROW] = TRUE,
[MOVE_MORNING_SUN] = TRUE,
[MOVE_SYNTHESIS] = TRUE,
[MOVE_MOONLIGHT] = TRUE,
[MOVE_HIDDEN_POWER] = TRUE,
[MOVE_CROSS_CHOP] = TRUE,
[MOVE_TWISTER] = FALSE,
[MOVE_RAIN_DANCE] = TRUE,
[MOVE_SUNNY_DAY] = TRUE,
[MOVE_CRUNCH] = TRUE,
[MOVE_MIRROR_COAT] = TRUE,
[MOVE_PSYCH_UP] = TRUE,
[MOVE_EXTREME_SPEED] = TRUE,
[MOVE_ANCIENT_POWER] = TRUE,
[MOVE_SHADOW_BALL] = TRUE,
[MOVE_FUTURE_SIGHT] = TRUE,
[MOVE_ROCK_SMASH] = TRUE,
[MOVE_WHIRLPOOL] = TRUE,
[MOVE_BEAT_UP] = TRUE,
[MOVE_FAKE_OUT] = TRUE,
[MOVE_UPROAR] = TRUE,
[MOVE_STOCKPILE] = TRUE,
[MOVE_SPIT_UP] = TRUE,
[MOVE_SWALLOW] = TRUE,
[MOVE_HEAT_WAVE] = TRUE,
[MOVE_HAIL] = TRUE,
[MOVE_TORMENT] = TRUE,
[MOVE_FLATTER] = TRUE,
[MOVE_WILL_O_WISP] = TRUE,
[MOVE_MEMENTO] = TRUE,
[MOVE_FACADE] = TRUE,
[MOVE_FOCUS_PUNCH] = TRUE,
[MOVE_SMELLING_SALT] = TRUE,
[MOVE_FOLLOW_ME] = TRUE,
[MOVE_NATURE_POWER] = TRUE,
[MOVE_CHARGE] = TRUE,
[MOVE_TAUNT] = TRUE,
[MOVE_HELPING_HAND] = TRUE,
[MOVE_TRICK] = TRUE,
[MOVE_ROLE_PLAY] = TRUE,
[MOVE_WISH] = TRUE,
[MOVE_ASSIST] = TRUE,
[MOVE_INGRAIN] = TRUE,
[MOVE_SUPERPOWER] = TRUE,
[MOVE_MAGIC_COAT] = TRUE,
[MOVE_RECYCLE] = TRUE,
[MOVE_REVENGE] = TRUE,
[MOVE_BRICK_BREAK] = TRUE,
[MOVE_YAWN] = TRUE,
[MOVE_KNOCK_OFF] = TRUE,
[MOVE_ENDEAVOR] = TRUE,
[MOVE_ERUPTION] = TRUE,
[MOVE_SKILL_SWAP] = TRUE,
[MOVE_IMPRISON] = TRUE,
[MOVE_REFRESH] = TRUE,
[MOVE_GRUDGE] = TRUE,
[MOVE_SNATCH] = TRUE,
[MOVE_SECRET_POWER] = TRUE,
[MOVE_DIVE] = TRUE,
[MOVE_ARM_THRUST] = FALSE,
[MOVE_CAMOUFLAGE] = TRUE,
[MOVE_TAIL_GLOW] = TRUE,
[MOVE_LUSTER_PURGE] = TRUE,
[MOVE_MIST_BALL] = TRUE,
[MOVE_FEATHER_DANCE] = TRUE,
[MOVE_TEETER_DANCE] = TRUE,
[MOVE_BLAZE_KICK] = TRUE,
[MOVE_MUD_SPORT] = TRUE,
[MOVE_ICE_BALL] = FALSE,
[MOVE_NEEDLE_ARM] = TRUE,
[MOVE_SLACK_OFF] = TRUE,
[MOVE_HYPER_VOICE] = TRUE,
[MOVE_POISON_FANG] = FALSE,
[MOVE_CRUSH_CLAW] = TRUE,
[MOVE_BLAST_BURN] = TRUE,
[MOVE_HYDRO_CANNON] = TRUE,
[MOVE_METEOR_MASH] = TRUE,
[MOVE_ASTONISH] = TRUE,
[MOVE_WEATHER_BALL] = TRUE,
[MOVE_AROMATHERAPY] = TRUE,
[MOVE_FAKE_TEARS] = TRUE,
[MOVE_AIR_CUTTER] = TRUE,
[MOVE_OVERHEAT] = TRUE,
[MOVE_ODOR_SLEUTH] = TRUE,
[MOVE_ROCK_TOMB] = TRUE,
[MOVE_SILVER_WIND] = TRUE,
[MOVE_METAL_SOUND] = TRUE,
[MOVE_GRASS_WHISTLE] = TRUE,
[MOVE_TICKLE] = TRUE,
[MOVE_COSMIC_POWER] = TRUE,
[MOVE_WATER_SPOUT] = TRUE,
[MOVE_SIGNAL_BEAM] = TRUE,
[MOVE_SHADOW_PUNCH] = TRUE,
[MOVE_EXTRASENSORY] = TRUE,
[MOVE_SKY_UPPERCUT] = TRUE,
[MOVE_SAND_TOMB] = TRUE,
[MOVE_SHEER_COLD] = TRUE,
[MOVE_MUDDY_WATER] = TRUE,
[MOVE_BULLET_SEED] = FALSE,
[MOVE_AERIAL_ACE] = TRUE,
[MOVE_ICICLE_SPEAR] = FALSE,
[MOVE_IRON_DEFENSE] = TRUE,
[MOVE_BLOCK] = TRUE,
[MOVE_HOWL] = TRUE,
[MOVE_DRAGON_CLAW] = TRUE,
[MOVE_FRENZY_PLANT] = TRUE,
[MOVE_BULK_UP] = TRUE,
[MOVE_BOUNCE] = TRUE,
[MOVE_MUD_SHOT] = FALSE,
[MOVE_POISON_TAIL] = TRUE,
[MOVE_COVET] = TRUE,
[MOVE_VOLT_TACKLE] = TRUE,
[MOVE_MAGICAL_LEAF] = TRUE,
[MOVE_WATER_SPORT] = TRUE,
[MOVE_CALM_MIND] = TRUE,
[MOVE_LEAF_BLADE] = TRUE,
[MOVE_DRAGON_DANCE] = TRUE,
[MOVE_ROCK_BLAST] = FALSE,
[MOVE_SHOCK_WAVE] = TRUE,
[MOVE_WATER_PULSE] = TRUE,
[MOVE_DOOM_DESIRE] = TRUE,
[MOVE_PSYCHO_BOOST] = TRUE,
};
// The possible questions to ask after the initial 3 WHICH MON questions. Retrieved from here and shuffled
// WHAT_ITEM has max 3 occurrences, one for each party member
// WHICH_MOVE has max 5 occurrences, defined as NUM_WHICH_MOVE_QUESTIONS
// WHICH_FIRST has max 1 occurrence, lead mon should only be chosen once
// WHICH_SPEECH has max 1 occurrence, as the apprentice leaves after its asked
static const u8 sQuestionPossibilities[MAX_APPRENTICE_QUESTIONS] =
{
QUESTION_ID_WHAT_ITEM,
QUESTION_ID_WHAT_ITEM,
QUESTION_ID_WHAT_ITEM,
QUESTION_ID_WHICH_MOVE,
QUESTION_ID_WHICH_MOVE,
QUESTION_ID_WHICH_MOVE,
QUESTION_ID_WHICH_MOVE,
QUESTION_ID_WHICH_MOVE,
QUESTION_ID_WHICH_FIRST,
QUESTION_ID_WIN_SPEECH
};
static void (* const sApprenticeFunctions[])(void) =
{
[APPRENTICE_FUNC_GAVE_LVLMODE] = Script_GivenApprenticeLvlMode,
[APPRENTICE_FUNC_SET_LVLMODE] = Script_SetApprenticeLvlMode,
[APPRENTICE_FUNC_SET_ID] = Script_SetApprenticeId,
[APPRENTICE_FUNC_SHUFFLE_SPECIES] = ShuffleApprenticeSpecies,
[APPRENTICE_FUNC_RANDOMIZE_QUESTIONS] = Script_SetRandomQuestionData,
[APPRENTICE_FUNC_ANSWERED_QUESTION] = IncrementQuestionsAnswered,
[APPRENTICE_FUNC_IS_FINAL_QUESTION] = IsFinalQuestion,
[APPRENTICE_FUNC_MENU] = Script_CreateApprenticeMenu,
[APPRENTICE_FUNC_PRINT_MSG] = Script_PrintApprenticeMessage,
[APPRENTICE_FUNC_RESET] = Script_ResetPlayerApprentice,
[APPRENTICE_FUNC_CHECK_GONE] = GetShouldCheckApprenticeGone,
[APPRENTICE_FUNC_GET_QUESTION] = ApprenticeGetQuestion,
[APPRENTICE_FUNC_GET_NUM_PARTY_MONS] = GetNumApprenticePartyMonsAssigned,
[APPRENTICE_FUNC_SET_PARTY_MON] = SetApprenticePartyMon,
[APPRENTICE_FUNC_INIT_QUESTION_DATA] = InitQuestionData,
[APPRENTICE_FUNC_FREE_QUESTION_DATA] = FreeQuestionData,
[APPRENTICE_FUNC_BUFFER_STRING] = ApprenticeBufferString,
[APPRENTICE_FUNC_SET_MOVE] = SetApprenticeMonMove,
[APPRENTICE_FUNC_SET_LEAD_MON] = SetLeadApprenticeMon,
[APPRENTICE_FUNC_OPEN_BAG] = Script_ApprenticeOpenBagMenu,
[APPRENTICE_FUNC_TRY_SET_HELD_ITEM] = TrySetApprenticeHeldItem,
[APPRENTICE_FUNC_SAVE] = SaveApprentice,
[APPRENTICE_FUNC_SET_GFX_SAVED] = SetSavedApprenticeTrainerGfxId,
[APPRENTICE_FUNC_SET_GFX] = SetPlayerApprenticeTrainerGfxId,
[APPRENTICE_FUNC_SHOULD_LEAVE] = GetShouldApprenticeLeave,
[APPRENTICE_FUNC_SHIFT_SAVED] = ShiftSavedApprentices,
};
// The first Apprentice can only be one of these
static const u8 sInitialApprenticeIds[8] = {0, 1, 2, 3, 6, 7, 8, 9};
@@ -0,0 +1,99 @@
static const u16 sFrontierExchangeCorner_Decor1[] =
{
DECOR_KISS_POSTER,
DECOR_KISS_CUSHION,
DECOR_SMOOCHUM_DOLL,
DECOR_TOGEPI_DOLL,
DECOR_MEOWTH_DOLL,
DECOR_CLEFAIRY_DOLL,
DECOR_DITTO_DOLL,
DECOR_CYNDAQUIL_DOLL,
DECOR_CHIKORITA_DOLL,
DECOR_TOTODILE_DOLL,
0xFFFF
};
static const u16 sFrontierExchangeCorner_Decor2[] =
{
DECOR_LAPRAS_DOLL,
DECOR_SNORLAX_DOLL,
DECOR_VENUSAUR_DOLL,
DECOR_CHARIZARD_DOLL,
DECOR_BLASTOISE_DOLL,
0xFFFF
};
static const u16 sFrontierExchangeCorner_Vitamins[] =
{
ITEM_PROTEIN,
ITEM_CALCIUM,
ITEM_IRON,
ITEM_ZINC,
ITEM_CARBOS,
ITEM_HP_UP,
0xFFFF
};
static const u16 sFrontierExchangeCorner_HoldItems[] =
{
ITEM_LEFTOVERS,
ITEM_WHITE_HERB,
ITEM_QUICK_CLAW,
ITEM_MENTAL_HERB,
ITEM_BRIGHT_POWDER,
ITEM_CHOICE_BAND,
ITEM_KINGS_ROCK,
ITEM_FOCUS_BAND,
ITEM_SCOPE_LENS,
0xFFFF
};
static const u8 *const sFrontierExchangeCorner_Decor1Descriptions[] =
{
BattleFrontier_ExchangeServiceCorner_Text_KissPosterDesc,
BattleFrontier_ExchangeServiceCorner_Text_KissCushionDesc,
BattleFrontier_ExchangeServiceCorner_Text_SmoochumDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_TogepiDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_MeowthDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_ClefairyDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_DittoDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_CyndaquilDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_ChikoritaDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_TotodileDollDesc,
gText_Exit,
};
static const u8 *const sFrontierExchangeCorner_Decor2Descriptions[] =
{
BattleFrontier_ExchangeServiceCorner_Text_LargeDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_LargeDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_LargeDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_LargeDollDesc,
BattleFrontier_ExchangeServiceCorner_Text_LargeDollDesc,
gText_Exit
};
static const u8 *const sFrontierExchangeCorner_VitaminsDescriptions[] =
{
BattleFrontier_ExchangeServiceCorner_Text_ProteinDesc,
BattleFrontier_ExchangeServiceCorner_Text_CalciumDesc,
BattleFrontier_ExchangeServiceCorner_Text_IronDesc,
BattleFrontier_ExchangeServiceCorner_Text_ZincDesc,
BattleFrontier_ExchangeServiceCorner_Text_CarbosDesc,
BattleFrontier_ExchangeServiceCorner_Text_HPUpDesc,
gText_Exit
};
static const u8 *const sFrontierExchangeCorner_HoldItemsDescriptions[] =
{
BattleFrontier_ExchangeServiceCorner_Text_LeftoversDesc,
BattleFrontier_ExchangeServiceCorner_Text_WhiteHerbDesc,
BattleFrontier_ExchangeServiceCorner_Text_QuickClawDesc,
BattleFrontier_ExchangeServiceCorner_Text_MentalHerbDesc,
BattleFrontier_ExchangeServiceCorner_Text_BrightpowderDesc,
BattleFrontier_ExchangeServiceCorner_Text_ChoiceBandDesc,
BattleFrontier_ExchangeServiceCorner_Text_KingsRockDesc,
BattleFrontier_ExchangeServiceCorner_Text_FocusBandDesc,
BattleFrontier_ExchangeServiceCorner_Text_ScopeLensDesc,
gText_Exit
};
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+67 -66
View File
@@ -1,16 +1,17 @@
#define TRAINER_HILL_OTID 0x10000000
static const struct TrHillTag gUnknown_0862609C = {
.unkField_0 = 4,
static const struct TrHillTag sDataTagJPDefault = {
.numTrainers = NUM_TRAINER_HILL_TRAINERS_JP,
.unused1 = 1,
.numFloors = 2,
.numFloors = NUM_TRAINER_HILL_FLOORS_JP,
.checksum = 0x0
};
static const struct TrHillFloor gUnknown_0862609C_floors[] = {
static const struct TrHillFloor sDataTagJPDefault_Floors[] = {
[0] = {
.unk0 = 0,
.unk1 = 0,
.trainerNum1 = 0,
.trainerNum2 = 0,
.trainers = {
[0] = {
.name = __("シゲノブ$$$$ "),
@@ -33,7 +34,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 100,
.spAttackEV = 0,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -57,7 +58,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 150,
.spDefenseEV = 120,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -81,7 +82,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 0,
.spDefenseEV = 200,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -122,7 +123,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 100,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -146,7 +147,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 100,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -170,7 +171,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 100,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -194,8 +195,8 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
}
},
[1] = {
.unk0 = 0,
.unk1 = 0,
.trainerNum1 = 0,
.trainerNum2 = 0,
.trainers = {
[0] = {
.name = __("シゲゾウ$$$$ "),
@@ -218,7 +219,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 120,
.spAttackEV = 150,
.spDefenseEV = 0,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -242,7 +243,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 100,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -266,7 +267,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 110,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -307,7 +308,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 0,
.spAttackEV = 110,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -331,7 +332,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 100,
.spAttackEV = 110,
.spDefenseEV = 100,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -355,7 +356,7 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
.speedEV = 80,
.spAttackEV = 80,
.spDefenseEV = 80,
.otId = 0x10000000,
.otId = TRAINER_HILL_OTID,
.hpIV = 5,
.attackIV = 5,
.defenseIV = 5,
@@ -382,18 +383,18 @@ static const struct TrHillFloor gUnknown_0862609C_floors[] = {
static const struct TrHillTag sDataTagNormal =
{
.unkField_0 = 8,
.numTrainers = NUM_TRAINER_HILL_TRAINERS,
.unused1 = 2,
.numFloors = 4,
.numFloors = NUM_TRAINER_HILL_FLOORS,
.checksum = 0x00051E05
};
static const struct TrHillFloor sDataTagNormal_floors[] =
static const struct TrHillFloor sDataTagNormal_Floors[] =
{
[0] =
{
.unk0 = 0x11,
.unk1 = 0x12,
.trainerNum1 = 17,
.trainerNum2 = 18,
.trainers =
{
[0] =
@@ -694,8 +695,8 @@ static const struct TrHillFloor sDataTagNormal_floors[] =
},
[1] =
{
.unk0 = 0x13,
.unk1 = 0x14,
.trainerNum1 = 19,
.trainerNum2 = 20,
.trainers =
{
[0] =
@@ -846,7 +847,7 @@ static const struct TrHillFloor sDataTagNormal_floors[] =
[1] =
{
.name = _("JAYDEN"),
.facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F,
.facilityClass = FACILITY_CLASS_PKMN_BREEDER_F,
.unused = 0,
.speechBefore = {EC_WORD_SOME, EC_WORD_THINGS, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_DO, EC_WORD_ALONE},
.speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, 0xFFFF},
@@ -999,8 +1000,8 @@ static const struct TrHillFloor sDataTagNormal_floors[] =
},
[2] =
{
.unk0 = 0x15,
.unk1 = 0x16,
.trainerNum1 = 21,
.trainerNum2 = 22,
.trainers =
{
[0] =
@@ -1151,7 +1152,7 @@ static const struct TrHillFloor sDataTagNormal_floors[] =
[1] =
{
.name = _("VERONICA"),
.facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F,
.facilityClass = FACILITY_CLASS_PKMN_BREEDER_F,
.unused = 0,
.speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_STRONG, EC_WORD_BEAUTY, EC_WORD_AROUND, EC_WORD_HERE},
.speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, 0xFFFF},
@@ -1303,8 +1304,8 @@ static const struct TrHillFloor sDataTagNormal_floors[] =
},
[3] =
{
.unk0 = 0x17,
.unk1 = 0x18,
.trainerNum1 = 23,
.trainerNum2 = 24,
.trainers =
{
[0] =
@@ -1602,17 +1603,17 @@ static const struct TrHillFloor sDataTagNormal_floors[] =
static const struct TrHillTag sDataTagVariety =
{
.unkField_0 = 8,
.numTrainers = NUM_TRAINER_HILL_TRAINERS,
.unused1 = 1,
.numFloors = 4,
.numFloors = NUM_TRAINER_HILL_FLOORS,
.checksum = 0x00054C15
};
static const struct TrHillFloor sDataTagVariety_floors[] = {
static const struct TrHillFloor sDataTagVariety_Floors[] = {
[0] =
{
.unk0 = 0x29,
.unk1 = 0x2A,
.trainerNum1 = 41,
.trainerNum2 = 42,
.trainers =
{
[0] =
@@ -1904,8 +1905,8 @@ static const struct TrHillFloor sDataTagVariety_floors[] = {
},
[1] =
{
.unk0 = 0x2B,
.unk1 = 0x2C,
.trainerNum1 = 43,
.trainerNum2 = 44,
.trainers =
{
[0] =
@@ -2227,8 +2228,8 @@ static const struct TrHillFloor sDataTagVariety_floors[] = {
},
[2] =
{
.unk0 = 0x2D,
.unk1 = 0x2E,
.trainerNum1 = 45,
.trainerNum2 = 46,
.trainers =
{
[0] =
@@ -2531,8 +2532,8 @@ static const struct TrHillFloor sDataTagVariety_floors[] = {
},
[3] =
{
.unk0 = 0x2F,
.unk1 = 0x30,
.trainerNum1 = 47,
.trainerNum2 = 48,
.trainers =
{
[0] =
@@ -2828,17 +2829,17 @@ static const struct TrHillFloor sDataTagVariety_floors[] = {
static const struct TrHillTag sDataTagUnique =
{
.unkField_0 = 8,
.numTrainers = NUM_TRAINER_HILL_TRAINERS,
.unused1 = 3,
.numFloors = 4,
.numFloors = NUM_TRAINER_HILL_FLOORS,
.checksum = 0x000652F3
};
static const struct TrHillFloor sDataTagUnique_floors[] = {
static const struct TrHillFloor sDataTagUnique_Floors[] = {
[0] =
{
.unk0 = 0x31,
.unk1 = 0x32,
.trainerNum1 = 49,
.trainerNum2 = 50,
.trainers =
{
[0] =
@@ -3135,8 +3136,8 @@ static const struct TrHillFloor sDataTagUnique_floors[] = {
},
[1] =
{
.unk0 = 0x33,
.unk1 = 0x34,
.trainerNum1 = 51,
.trainerNum2 = 52,
.trainers =
{
[0] =
@@ -3439,8 +3440,8 @@ static const struct TrHillFloor sDataTagUnique_floors[] = {
},
[2] =
{
.unk0 = 0x35,
.unk1 = 0x36,
.trainerNum1 = 53,
.trainerNum2 = 54,
.trainers =
{
[0] =
@@ -3743,8 +3744,8 @@ static const struct TrHillFloor sDataTagUnique_floors[] = {
},
[3] =
{
.unk0 = 0x38,
.unk1 = 0x37,
.trainerNum1 = 56,
.trainerNum2 = 55,
.trainers =
{
[0] =
@@ -4039,17 +4040,17 @@ static const struct TrHillFloor sDataTagUnique_floors[] = {
static const struct TrHillTag sDataTagExpert =
{
.unkField_0 = 8,
.numTrainers = NUM_TRAINER_HILL_TRAINERS,
.unused1 = 1,
.numFloors = 4,
.numFloors = NUM_TRAINER_HILL_FLOORS,
.checksum = 0x00061F3F
};
static const struct TrHillFloor sDataTagExpert_floors[] = {
static const struct TrHillFloor sDataTagExpert_Floors[] = {
[0] =
{
.unk0 = 0x39,
.unk1 = 0x3A,
.trainerNum1 = 57,
.trainerNum2 = 58,
.trainers =
{
[0] =
@@ -4353,8 +4354,8 @@ static const struct TrHillFloor sDataTagExpert_floors[] = {
},
[1] =
{
.unk0 = 0x3B,
.unk1 = 0x3C,
.trainerNum1 = 59,
.trainerNum2 = 60,
.trainers =
{
[0] =
@@ -4658,8 +4659,8 @@ static const struct TrHillFloor sDataTagExpert_floors[] = {
},
[2] =
{
.unk0 = 0x3D,
.unk1 = 0x3E,
.trainerNum1 = 61,
.trainerNum2 = 62,
.trainers =
{
[0] =
@@ -4963,8 +4964,8 @@ static const struct TrHillFloor sDataTagExpert_floors[] = {
},
[3] =
{
.unk0 = 0x3F,
.unk1 = 0x40,
.trainerNum1 = 63,
.trainerNum2 = 64,
.trainers =
{
[0] =
+395 -370
View File
@@ -1,414 +1,439 @@
#include "global.h"
extern const u8 gContestEffect00hDescription[];
extern const u8 gContestEffect01hDescription[];
extern const u8 gContestEffect02hDescription[];
extern const u8 gContestEffect03hDescription[];
extern const u8 gContestEffect04hDescription[];
extern const u8 gContestEffect05hDescription[];
extern const u8 gContestEffect06hDescription[];
extern const u8 gContestEffect07hDescription[];
extern const u8 gContestEffect08hDescription[];
extern const u8 gContestEffect09hDescription[];
extern const u8 gContestEffect0AhDescription[];
extern const u8 gContestEffect0BhDescription[];
extern const u8 gContestEffect0ChDescription[];
extern const u8 gContestEffect0DhDescription[];
extern const u8 gContestEffect0EhDescription[];
extern const u8 gContestEffect0FhDescription[];
extern const u8 gContestEffect10hDescription[];
extern const u8 gContestEffect11hDescription[];
extern const u8 gContestEffect12hDescription[];
extern const u8 gContestEffect13hDescription[];
extern const u8 gContestEffect14hDescription[];
extern const u8 gContestEffect15hDescription[];
extern const u8 gContestEffect16hDescription[];
extern const u8 gContestEffect17hDescription[];
extern const u8 gContestEffect18hDescription[];
extern const u8 gContestEffect19hDescription[];
extern const u8 gContestEffect1AhDescription[];
extern const u8 gContestEffect1BhDescription[];
extern const u8 gContestEffect1ChDescription[];
extern const u8 gContestEffect1DhDescription[];
extern const u8 gContestEffect1EhDescription[];
extern const u8 gContestEffect1FhDescription[];
extern const u8 gContestEffect20hDescription[];
extern const u8 gContestEffect21hDescription[];
extern const u8 gContestEffect22hDescription[];
extern const u8 gContestEffect23hDescription[];
extern const u8 gContestEffect24hDescription[];
extern const u8 gContestEffect25hDescription[];
extern const u8 gContestEffect26hDescription[];
extern const u8 gContestEffect27hDescription[];
extern const u8 gContestEffect28hDescription[];
extern const u8 gContestEffect29hDescription[];
extern const u8 gContestEffect2AhDescription[];
extern const u8 gContestEffect2BhDescription[];
extern const u8 gContestEffect2ChDescription[];
extern const u8 gContestEffect2DhDescription[];
extern const u8 gContestEffect2EhDescription[];
extern const u8 gContestEffect2FhDescription[];
// gContestEffectDescriptionPointers
extern const u8 gText_HighlyAppealingMove[];
extern const u8 gText_UserMoreEasilyStartled[];
extern const u8 gText_GreatAppealButNoMoreToEnd[];
extern const u8 gText_UsedRepeatedlyWithoutBoringJudge[];
extern const u8 gText_AvoidStartledByOthersOnce[];
extern const u8 gText_AvoidStartledByOthers[];
extern const u8 gText_AvoidStartledByOthersLittle[];
extern const u8 gText_UserLessLikelyStartled[];
extern const u8 gText_SlightlyStartleFrontMon[];
extern const u8 gText_SlightlyStartleAppealed[];
extern const u8 gText_StartleAppealedBeforeUser[];
extern const u8 gText_StartleAllAppealed[];
extern const u8 gText_BadlyStartleFrontMon[];
extern const u8 gText_BadlyStartleAppealed[];
extern const u8 gText_StartleAppealedBeforeUser2[];
extern const u8 gText_StartleAllAppealed2[];
extern const u8 gText_ShiftJudgesAttentionFromOthers[];
extern const u8 gText_StartleMonHasJudgesAttention[];
extern const u8 gText_JamOthersMissesTurn[];
extern const u8 gText_StartleMonsMadeSameTypeAppeal[];
extern const u8 gText_BadlyStartleCoolAppeals[];
extern const u8 gText_BadlyStartleBeautyAppeals[];
extern const u8 gText_BadlyStartleCuteAppeals[];
extern const u8 gText_BadlyStartleSmartAppeals[];
extern const u8 gText_BadlyStartleToughAppeals[];
extern const u8 gText_MakeMonAfterUserNervous[];
extern const u8 gText_MakeAllMonsAfterUserNervous[];
extern const u8 gText_WorsenConditionOfThoseMadeAppeals[];
extern const u8 gText_BadlyStartleMonsGoodCondition[];
extern const u8 gText_AppealGreatIfPerformedFirst[];
extern const u8 gText_AppealGreatIfPerformedLast[];
extern const u8 gText_AppealAsGoodAsThoseBeforeIt[];
extern const u8 gText_AppealAsGoodAsOneBeforeIt[];
extern const u8 gText_AppealBetterLaterItsPerformed[];
extern const u8 gText_AppealVariesDependingOnTiming[];
extern const u8 gText_WorksWellIfSameTypeAsBefore[];
extern const u8 gText_WorksWellIfDifferentTypeAsBefore[];
extern const u8 gText_AffectedByAppealInFront[];
extern const u8 gText_UpsConditionHelpsPreventNervousness[];
extern const u8 gText_AppealWorksWellIfConditionGood[];
extern const u8 gText_NextAppealMadeEarlier[];
extern const u8 gText_NextAppealMadeLater[];
extern const u8 gText_TurnOrderMoreEasilyScrambled[];
extern const u8 gText_ScrambleOrderOfNextAppeals[];
extern const u8 gText_AppealExcitesAudienceInAnyContest[];
extern const u8 gText_BadlyStartlesMonsGoodAppeals[];
extern const u8 gText_AppealBestMoreCrowdExcited[];
extern const u8 gText_TemporarilyStopCrowdExcited[];
extern const u8 gUnusedContestMoveName0[];
extern const u8 gUnusedContestMoveName1[];
extern const u8 gUnusedContestMoveName2[];
extern const u8 gUnusedContestMoveName3[];
extern const u8 gUnusedContestMoveName4[];
extern const u8 gUnusedContestMoveName5[];
extern const u8 gUnusedContestMoveName6[];
extern const u8 gUnusedContestMoveName7[];
extern const u8 gUnusedContestMoveName8[];
extern const u8 gUnusedContestMoveName9[];
extern const u8 gUnusedContestMoveName10[];
extern const u8 gUnusedContestMoveName11[];
extern const u8 gUnusedContestMoveName12[];
// sUnusedComboMoveNameTexts
extern const u8 gText_RainDance[];
extern const u8 gText_Rage[];
extern const u8 gText_FocusEnergy[];
extern const u8 gText_Hypnosis[];
extern const u8 gText_Softboiled[];
extern const u8 gText_HornAttack[];
extern const u8 gText_SwordsDance[];
extern const u8 gText_Conversion[];
extern const u8 gText_SunnyDay[];
extern const u8 gText_Rest2[];
extern const u8 gText_Vicegrip[];
extern const u8 gText_DefenseCurl[];
extern const u8 gText_LockOn[];
// gContestMoveTypeTextPointers
extern const u8 gContestMoveTypeCoolText[];
extern const u8 gContestMoveTypeBeautyText[];
extern const u8 gContestMoveTypeCuteText[];
extern const u8 gContestMoveTypeSmartText[];
extern const u8 gContestMoveTypeToughText[];
extern const u8 gText_0827D5C1[];
extern const u8 gText_0827D5DC[];
extern const u8 gText_0827D600[];
extern const u8 gText_0827D612[];
extern const u8 gText_0827D612[];
extern const u8 gText_0827D62D[];
extern const u8 gText_0827D654[];
extern const u8 gText_0827D67E[];
extern const u8 gText_0827D69C[];
extern const u8 gText_0827D6BA[];
extern const u8 gText_0827D6E5[];
extern const u8 gText_0827D706[];
extern const u8 gText_0827D71D[];
// sUnusedAppealResultTexts
extern const u8 gText_ButAppealWasJammed[];
extern const u8 gText_FollowedAnotherMonsLead[];
extern const u8 gText_ButItMessedUp[];
extern const u8 gText_WentBetterThanUsual[];
extern const u8 gText_JudgeLookedAwayForSomeReason[];
extern const u8 gText_WorkedHardToBuildOnPastMistakes[];
extern const u8 gText_CantMakeAnyMoreMoves[];
extern const u8 gText_WorkedFrighteninglyWell[];
extern const u8 gText_WorkedHardAsStandoutMon[];
extern const u8 gText_JudgedLookedOnExpectantly[];
extern const u8 gText_WorkedRatherWell[];
extern const u8 gText_WorkedLittleBetterThanUsual[];
extern const u8 gText_0827D743[];
extern const u8 gText_0827D764[];
extern const u8 gText_0827D785[];
extern const u8 gText_0827D7A5[];
extern const u8 gText_0827D7C8[];
extern const u8 gText_0827D7E8[];
extern const u8 gText_0827D831[];
extern const u8 gText_0827D855[];
extern const u8 gText_0827D830[];
extern const u8 gText_0827D872[];
extern const u8 gText_0827D88F[];
extern const u8 gText_0827D8B5[];
extern const u8 gText_0827D8E4[];
extern const u8 gText_0827D8FE[];
extern const u8 gText_0827D926[];
extern const u8 gText_0827D947[];
extern const u8 gText_0827D961[];
extern const u8 gText_0827D986[];
extern const u8 gText_0827D9B1[];
extern const u8 gText_0827D9D9[];
extern const u8 gText_0827DA03[];
extern const u8 gText_0827DA31[];
extern const u8 gText_0827DA5B[];
extern const u8 gText_0827DA85[];
extern const u8 gText_0827DAB2[];
extern const u8 gText_0827DADA[];
extern const u8 gText_0827DB03[];
extern const u8 gText_0827D830[];
extern const u8 gText_0827D830[];
extern const u8 gText_0827D830[];
extern const u8 gText_0827DB1F[];
extern const u8 gText_0827DB4E[];
// sRoundResultTexts
extern const u8 gText_MonFailedToStandOutAtAll[];
extern const u8 gText_MonDidntStandOutVeryMuch[];
extern const u8 gText_MonCaughtALittleAttention[];
extern const u8 gText_MonAttractedALotOfAttention[];
extern const u8 gText_MonCommandedTotalAttention[];
extern const u8 gText_MonHasntMadeItsAppeal[];
extern const u8 gText_JudgesViewsOnMonHeldFirm[];
extern const u8 gText_MonsXChangedPerceptions[];
extern const u8 gText_EmptyContestString[];
extern const u8 gText_MonsAppealEffectWoreOff[];
extern const u8 gText_SpecialAppealsEffectWoreOff[];
extern const u8 gText_EveryonesAppealsMadeToLookSame[];
extern const u8 gText_CheapenedMonsAppeal[];
extern const u8 gText_CheapenedMonsAppeal2[];
extern const u8 gText_CheapenedAppealOfThoseAhead[];
extern const u8 gText_CheapenedAppealOfThoseAhead2[];
extern const u8 gText_StoleAttentionAwayFromMon[];
extern const u8 gText_SeverelyCheapenedOtherAppeals[];
extern const u8 gText_AnticipationSwelledForMonsAppealNext[];
extern const u8 gText_CheapenedJudgesFavoriteAppeal[];
extern const u8 gText_AppealsOfOthersCheapenedByHalf[];
extern const u8 gText_StoodOutToMakeUpForBeingJammed[];
extern const u8 gText_CantParticipateInAppealsAnyMore[];
extern const u8 gText_TouchedJudgeForFantasticAppeal[];
extern const u8 gText_AnticipationRoseForUpcomingAppeals[];
extern const u8 gText_StoodOutAsMuchAsSpecialAppeals[];
extern const u8 gText_StoodOutAsMuchAsMon[];
extern const u8 gText_JammedAppealsMadeEvenLessNoticeable[];
extern const u8 gText_EveryonesAppealsMadeSame[];
extern const u8 gText_827DB75[];
extern const u8 gText_827DBB0[];
extern const u8 gText_827DBE0[];
extern const u8 gText_827DC0F[];
extern const u8 gText_827DC45[];
extern const u8 gText_827DC7C[];
extern const u8 gText_827DCB4[];
extern const u8 gText_827DCE7[];
extern const u8 gText_827DD12[];
extern const u8 gText_827DD3D[];
extern const u8 gText_827DD6F[];
extern const u8 gText_827DD8E[];
extern const u8 gText_827DDC7[];
extern const u8 gText_827DDF2[];
extern const u8 gText_827DE14[];
extern const u8 gText_827DE44[];
extern const u8 gText_827DE73[];
extern const u8 gText_827DEA5[];
extern const u8 gText_827DED9[];
extern const u8 gText_827DF02[];
extern const u8 gText_827DF3A[];
extern const u8 gText_827DF63[];
extern const u8 gText_827DF8C[];
extern const u8 gText_827DFB8[];
extern const u8 gText_827DFE2[];
extern const u8 gText_827E00C[];
extern const u8 gText_827E02F[];
extern const u8 gText_827E05F[];
extern const u8 gText_827E08B[];
extern const u8 gText_827E0B5[];
extern const u8 gText_827E0DD[];
extern const u8 gText_827E107[];
extern const u8 gText_827E143[];
extern const u8 gText_827E17F[];
extern const u8 gText_827E1BB[];
extern const u8 gText_827E1F3[];
extern const u8 gText_827E220[];
extern const u8 gText_827E254[];
extern const u8 gText_827E289[];
extern const u8 gText_827E2C5[];
extern const u8 gText_0827E2FE[];
extern const u8 gText_0827E32E[];
extern const u8 gText_0827E35B[];
extern const u8 gText_0827E38D[];
extern const u8 gText_0827E3C1[];
extern const u8 gText_0827E3EB[];
extern const u8 gText_0827E416[];
extern const u8 gText_0827E448[];
extern const u8 gText_0827E473[];
extern const u8 gText_0827E4A6[];
extern const u8 gText_0827E4D5[];
extern const u8 gText_0827E504[];
extern const u8 gText_0827E531[];
extern const u8 gText_0827E55A[];
extern const u8 gText_0827E5B2[];
extern const u8 gText_0827E5D0[];
extern const u8 gText_0827E606[];
extern const u8 gText_0827E638[];
extern const u8 gText_0827E658[];
extern const u8 gText_0827E68B[];
extern const u8 gText_0827E6C4[];
extern const u8 gText_0827E7BA[];
// sAppealResultTexts
extern const u8 gText_BecameMoreConsciousOfOtherMons[];
extern const u8 gText_MonCantMakeAnAppealAfterThis[];
extern const u8 gText_SettledDownJustLittleBit[];
extern const u8 gText_BecameObliviousToOtherMons[];
extern const u8 gText_BecameLessAwareOfOtherMons[];
extern const u8 gText_StoppedCaringAboutOtherMons[];
extern const u8 gText_TriedToStartleOtherMons[];
extern const u8 gText_TriedToDazzleOthers[];
extern const u8 gText_JudgeLookedAwayFromMon[];
extern const u8 gText_TriedToUnnerveNextMon[];
extern const u8 gText_MonBecameNervous[];
extern const u8 gText_AppealTriedToUnnerveWaitingMons[];
extern const u8 gText_TauntedMonsDoingWell[];
extern const u8 gText_MonRegainedItsForm[];
extern const u8 gText_TriedToJamMonDoingWell[];
extern const u8 gText_StandoutMonHustledEvenMore[];
extern const u8 gText_LargelyUnnoticedMonWorkedHard[];
extern const u8 gText_WorkedAsMuchAsMonBefore[];
extern const u8 gText_WorkedAsMuchAsPrecedingMon[];
extern const u8 gText_MonsAppealWasDud[];
extern const u8 gText_MonsAppealDidNotGoWell[];
extern const u8 gText_MonsAppealDidNotGoWell2[];
extern const u8 gText_MonsAppealDidNotGoWell3[];
extern const u8 gText_MonsAppealDidNotWorkVeryWell[];
extern const u8 gText_MonsAppealWentSlightlyWell[];
extern const u8 gText_MonsAppealWentSlightlyWell2[];
extern const u8 gText_MonsAppealWentPrettyWell[];
extern const u8 gText_MonsAppealWentPrettyWell2[];
extern const u8 gText_MonsAppealWentVeryWell[];
extern const u8 gText_MonsAppealWentExcellently[];
extern const u8 gText_MonsAppealWentExcellently2[];
extern const u8 gText_SameTypeAsOneBeforeGood[];
extern const u8 gText_NotSameTypeAsOneBeforeGood[];
extern const u8 gText_StoodOutMuchMoreThanMonBefore[];
extern const u8 gText_DidntDoAsWellAsMonBefore[];
extern const u8 gText_MonsConditionRoseAboveUsual[];
extern const u8 gText_MonsHotStatusMadeGreatAppeal[];
extern const u8 gText_MovedUpInLineForNextAppeal[];
extern const u8 gText_MovedBackInLineForNextAppeal[];
extern const u8 gText_ScrambledUpOrderForNextTurn[];
extern const u8 gText_JudgeLookedAtMonExpectantly[];
extern const u8 gText_AppealComboWentOverWell[];
extern const u8 gText_AppealComboWentOverVeryWell[];
extern const u8 gText_AppealComboWentOverExcellently[];
extern const u8 gText_MonManagedToAvertGaze[];
extern const u8 gText_MonManagedToAvoidSeeingIt[];
extern const u8 gText_MonIsntFazedByThatSortOfThing[];
extern const u8 gText_MonBecameALittleDistracted[];
extern const u8 gText_TriedToStartleOtherPokemon[];
extern const u8 gText_MonLookedDownOutOfDistraction[];
extern const u8 gText_MonTurnedBackOutOfDistraction[];
extern const u8 gText_MonCouldntHelpUtteringCry[];
extern const u8 gText_MonCouldntHelpLeapingUp[];
extern const u8 gText_MonTrippedOutOfDistraction[];
extern const u8 gText_ButItMessedUp2[];
extern const u8 gText_ButItFailedToMakeTargetNervous[];
extern const u8 gText_ButItFailedToMakeAnyoneNervous[];
extern const u8 gText_ButItWasIgnored[];
extern const u8 gText_CouldntImproveItsCondition[];
extern const u8 gText_BadConditionResultedInWeakAppeal[];
extern const u8 gText_MonWasUnaffected[];
extern const u8 gText_AttractedCrowdsAttention[];
// sContestConditions
extern const u8 gText_Contest_Coolness[];
extern const u8 gText_Contest_Beauty[];
extern const u8 gText_Contest_Cuteness[];
extern const u8 gText_Contest_Smartness[];
extern const u8 gText_Contest_Toughness[];
extern const u8 gText_0827E85F[];
extern const u8 gText_0827E868[];
extern const u8 gText_0827E86F[];
extern const u8 gText_0827E878[];
extern const u8 gText_0827E882[];
// sInvalidContestMoveNames
extern const u8 gText_CoolMove[];
extern const u8 gText_BeautyMove[];
extern const u8 gText_CuteMove[];
extern const u8 gText_SmartMove[];
extern const u8 gText_ToughMove[];
extern const u8 gText_3QuestionMarks[];
extern const u8 gText_0827E894[];
extern const u8 gText_0827E89E[];
extern const u8 gText_0827E8AA[];
extern const u8 gText_0827E8B4[];
extern const u8 gText_0827E8BF[];
extern const u8 gText_0827E8CA[];
// Misc, used directly
extern const u8 gText_MonAppealedWithMove[];
extern const u8 gText_MonCantAppealNextTurn[];
extern const u8 gText_RepeatedAppeal[];
extern const u8 gText_MonsXDidntGoOverWell[];
extern const u8 gText_MonsXWentOverGreat[];
extern const u8 gText_MonsXGotTheCrowdGoing[];
extern const u8 gText_CrowdContinuesToWatchMon[];
extern const u8 gText_MonsMoveIsIgnored[];
extern const u8 gText_MonWasTooNervousToMove[];
extern const u8 gText_MonWasWatchingOthers[];
extern const u8 gText_AllOutOfAppealTime[];
extern const u8 gText_Contest_Shyness[];
extern const u8 gText_Contest_Anxiety[];
extern const u8 gText_Contest_Laziness[];
extern const u8 gText_Contest_Hesitancy[];
extern const u8 gText_Contest_Fear[];
extern const u8 gText_AppealNumWhichMoveWillBePlayed[];
extern const u8 gText_AppealNumButItCantParticipate[];
const u8 *const gContestEffectDescriptionPointers[] =
{
gContestEffect00hDescription,
gContestEffect01hDescription,
gContestEffect02hDescription,
gContestEffect03hDescription,
gContestEffect04hDescription,
gContestEffect05hDescription,
gContestEffect06hDescription,
gContestEffect07hDescription,
gContestEffect08hDescription,
gContestEffect09hDescription,
gContestEffect0AhDescription,
gContestEffect0BhDescription,
gContestEffect0ChDescription,
gContestEffect0DhDescription,
gContestEffect0EhDescription,
gContestEffect0FhDescription,
gContestEffect10hDescription,
gContestEffect11hDescription,
gContestEffect12hDescription,
gContestEffect13hDescription,
gContestEffect14hDescription,
gContestEffect15hDescription,
gContestEffect16hDescription,
gContestEffect17hDescription,
gContestEffect18hDescription,
gContestEffect19hDescription,
gContestEffect1AhDescription,
gContestEffect1BhDescription,
gContestEffect1ChDescription,
gContestEffect1DhDescription,
gContestEffect1EhDescription,
gContestEffect1FhDescription,
gContestEffect20hDescription,
gContestEffect21hDescription,
gContestEffect22hDescription,
gContestEffect23hDescription,
gContestEffect24hDescription,
gContestEffect25hDescription,
gContestEffect26hDescription,
gContestEffect27hDescription,
gContestEffect28hDescription,
gContestEffect29hDescription,
gContestEffect2AhDescription,
gContestEffect2BhDescription,
gContestEffect2ChDescription,
gContestEffect2DhDescription,
gContestEffect2EhDescription,
gContestEffect2FhDescription
[CONTEST_EFFECT_HIGHLY_APPEALING] = gText_HighlyAppealingMove,
[CONTEST_EFFECT_USER_MORE_EASILY_STARTLED] = gText_UserMoreEasilyStartled,
[CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES] = gText_GreatAppealButNoMoreToEnd,
[CONTEST_EFFECT_REPETITION_NOT_BORING] = gText_UsedRepeatedlyWithoutBoringJudge,
[CONTEST_EFFECT_AVOID_STARTLE_ONCE] = gText_AvoidStartledByOthersOnce,
[CONTEST_EFFECT_AVOID_STARTLE] = gText_AvoidStartledByOthers,
[CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY] = gText_AvoidStartledByOthersLittle,
[CONTEST_EFFECT_USER_LESS_EASILY_STARTLED] = gText_UserLessLikelyStartled,
[CONTEST_EFFECT_STARTLE_FRONT_MON] = gText_SlightlyStartleFrontMon,
[CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS] = gText_SlightlyStartleAppealed,
[CONTEST_EFFECT_STARTLE_PREV_MON] = gText_StartleAppealedBeforeUser,
[CONTEST_EFFECT_STARTLE_PREV_MONS] = gText_StartleAllAppealed,
[CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON] = gText_BadlyStartleFrontMon,
[CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS] = gText_BadlyStartleAppealed,
[CONTEST_EFFECT_STARTLE_PREV_MON_2] = gText_StartleAppealedBeforeUser2,
[CONTEST_EFFECT_STARTLE_PREV_MONS_2] = gText_StartleAllAppealed2,
[CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION] = gText_ShiftJudgesAttentionFromOthers,
[CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION] = gText_StartleMonHasJudgesAttention,
[CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN] = gText_JamOthersMissesTurn,
[CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL] = gText_StartleMonsMadeSameTypeAppeal,
[CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL] = gText_BadlyStartleCoolAppeals,
[CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL] = gText_BadlyStartleBeautyAppeals,
[CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL] = gText_BadlyStartleCuteAppeals,
[CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL] = gText_BadlyStartleSmartAppeals,
[CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL] = gText_BadlyStartleToughAppeals,
[CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS] = gText_MakeMonAfterUserNervous,
[CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS] = gText_MakeAllMonsAfterUserNervous,
[CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS] = gText_WorsenConditionOfThoseMadeAppeals,
[CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION] = gText_BadlyStartleMonsGoodCondition,
[CONTEST_EFFECT_BETTER_IF_FIRST] = gText_AppealGreatIfPerformedFirst,
[CONTEST_EFFECT_BETTER_IF_LAST] = gText_AppealGreatIfPerformedLast,
[CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES] = gText_AppealAsGoodAsThoseBeforeIt,
[CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE] = gText_AppealAsGoodAsOneBeforeIt,
[CONTEST_EFFECT_BETTER_WHEN_LATER] = gText_AppealBetterLaterItsPerformed,
[CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING] = gText_AppealVariesDependingOnTiming,
[CONTEST_EFFECT_BETTER_IF_SAME_TYPE] = gText_WorksWellIfSameTypeAsBefore,
[CONTEST_EFFECT_BETTER_IF_DIFF_TYPE] = gText_WorksWellIfDifferentTypeAsBefore,
[CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL] = gText_AffectedByAppealInFront,
[CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS] = gText_UpsConditionHelpsPreventNervousness,
[CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION] = gText_AppealWorksWellIfConditionGood,
[CONTEST_EFFECT_NEXT_APPEAL_EARLIER] = gText_NextAppealMadeEarlier,
[CONTEST_EFFECT_NEXT_APPEAL_LATER] = gText_NextAppealMadeLater,
[CONTEST_EFFECT_MAKE_SCRAMBLING_TURN_ORDER_EASIER] = gText_TurnOrderMoreEasilyScrambled,
[CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER] = gText_ScrambleOrderOfNextAppeals,
[CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST] = gText_AppealExcitesAudienceInAnyContest,
[CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS] = gText_BadlyStartlesMonsGoodAppeals,
[CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED] = gText_AppealBestMoreCrowdExcited,
[CONTEST_EFFECT_DONT_EXCITE_AUDIENCE] = gText_TemporarilyStopCrowdExcited
};
// Unreferenced array of pointers to move names.
// All of the moves except Conversion are combo starters, so this may have
// been an early list of combo starters.
const u8 *const gUnknown_8587D10[] =
static const u8 *const sUnusedComboMoveNameTexts[] =
{
gUnusedContestMoveName0,
gUnusedContestMoveName0,
gUnusedContestMoveName1,
gUnusedContestMoveName2,
gUnusedContestMoveName3,
gUnusedContestMoveName4,
gUnusedContestMoveName5,
gUnusedContestMoveName6,
gUnusedContestMoveName7,
gUnusedContestMoveName8,
gUnusedContestMoveName9,
gUnusedContestMoveName10,
gUnusedContestMoveName11,
gUnusedContestMoveName12
gText_RainDance,
gText_RainDance,
gText_Rage,
gText_FocusEnergy,
gText_Hypnosis,
gText_Softboiled,
gText_HornAttack,
gText_SwordsDance,
gText_Conversion,
gText_SunnyDay,
gText_Rest2,
gText_Vicegrip,
gText_DefenseCurl,
gText_LockOn
};
const u8 *const gContestMoveTypeTextPointers[] =
{
gContestMoveTypeCoolText,
gContestMoveTypeBeautyText,
gContestMoveTypeCuteText,
gContestMoveTypeSmartText,
gContestMoveTypeToughText
[CONTEST_CATEGORY_COOL] = gContestMoveTypeCoolText,
[CONTEST_CATEGORY_BEAUTY] = gContestMoveTypeBeautyText,
[CONTEST_CATEGORY_CUTE] = gContestMoveTypeCuteText,
[CONTEST_CATEGORY_SMART] = gContestMoveTypeSmartText,
[CONTEST_CATEGORY_TOUGH] = gContestMoveTypeToughText
};
const u8 *const gUnknown_08587D5C[] =
static const u8 *const sUnusedAppealResultTexts[] =
{
gText_0827D5C1,
gText_0827D5DC,
gText_0827D600,
gText_0827D612,
gText_0827D612,
gText_0827D62D,
gText_0827D654,
gText_0827D67E,
gText_0827D69C,
gText_0827D6BA,
gText_0827D6E5,
gText_0827D706,
gText_0827D71D
gText_ButAppealWasJammed,
gText_FollowedAnotherMonsLead,
gText_ButItMessedUp,
gText_WentBetterThanUsual,
gText_WentBetterThanUsual,
gText_JudgeLookedAwayForSomeReason,
gText_WorkedHardToBuildOnPastMistakes,
gText_CantMakeAnyMoreMoves,
gText_WorkedFrighteninglyWell,
gText_WorkedHardAsStandoutMon,
gText_JudgedLookedOnExpectantly,
gText_WorkedRatherWell,
gText_WorkedLittleBetterThanUsual
};
const u8 *const gUnknown_08587D90[] =
// Takes the .attentionLevel of a contestant as an index. Only 0-5 are used
static const u8 *const sRoundResultTexts[] =
{
gText_0827D743,
gText_0827D764,
gText_0827D785,
gText_0827D7A5,
gText_0827D7C8,
gText_0827D7E8,
gText_0827D831,
gText_0827D855,
gText_0827D830,
gText_0827D872,
gText_0827D88F,
gText_0827D8B5,
gText_0827D8E4,
gText_0827D8FE,
gText_0827D926,
gText_0827D947,
gText_0827D961,
gText_0827D986,
gText_0827D9B1,
gText_0827D9D9,
gText_0827DA03,
gText_0827DA31,
gText_0827DA5B,
gText_0827DA85,
gText_0827DAB2,
gText_0827DADA,
gText_0827DB03,
gText_0827D830,
gText_0827D830,
gText_0827D830,
gText_0827DB1F,
gText_0827DB4E
gText_MonFailedToStandOutAtAll,
gText_MonDidntStandOutVeryMuch,
gText_MonCaughtALittleAttention,
gText_MonAttractedALotOfAttention,
gText_MonCommandedTotalAttention,
gText_MonHasntMadeItsAppeal,
gText_JudgesViewsOnMonHeldFirm, // here below unused
gText_MonsXChangedPerceptions,
gText_EmptyContestString,
gText_MonsAppealEffectWoreOff,
gText_SpecialAppealsEffectWoreOff,
gText_EveryonesAppealsMadeToLookSame,
gText_CheapenedMonsAppeal,
gText_CheapenedAppealOfThoseAhead,
gText_StoleAttentionAwayFromMon,
gText_CheapenedMonsAppeal2,
gText_SeverelyCheapenedOtherAppeals,
gText_AnticipationSwelledForMonsAppealNext,
gText_CheapenedAppealOfThoseAhead2,
gText_CheapenedJudgesFavoriteAppeal,
gText_AppealsOfOthersCheapenedByHalf,
gText_StoodOutToMakeUpForBeingJammed,
gText_CantParticipateInAppealsAnyMore,
gText_TouchedJudgeForFantasticAppeal,
gText_AnticipationRoseForUpcomingAppeals,
gText_StoodOutAsMuchAsSpecialAppeals,
gText_StoodOutAsMuchAsMon,
gText_EmptyContestString,
gText_EmptyContestString,
gText_EmptyContestString,
gText_JammedAppealsMadeEvenLessNoticeable,
gText_EveryonesAppealsMadeSame
};
const u8 *const gUnknown_08587E10[] =
static const u8 *const sAppealResultTexts[] =
{
gText_827DB75,
gText_827DBB0,
gText_827DBE0,
gText_827DC0F,
gText_827DC45,
gText_827DC7C,
gText_827DCB4,
gText_827DCE7,
gText_827DD12,
gText_827DD3D,
gText_827DD6F,
gText_827DD8E,
gText_827DDC7,
gText_827DDF2,
gText_827DE14,
gText_827DE44,
gText_827DE73,
gText_827DEA5,
gText_827DED9,
gText_827DF02,
gText_827DF3A,
gText_827DF63,
gText_827DF8C,
gText_827DFB8,
gText_827DFE2,
gText_827E00C,
gText_827E02F,
gText_827E05F,
gText_827E08B,
gText_827E0B5,
gText_827E0DD,
gText_827E107,
gText_827E143,
gText_827E17F,
gText_827E1BB,
gText_827E1F3,
gText_827E220,
gText_827E254,
gText_827E289,
gText_827E2C5,
gText_0827E2FE,
gText_0827E32E,
gText_0827E35B,
gText_0827E38D,
gText_0827E3C1,
gText_0827E3EB,
gText_0827E416,
gText_0827E448,
gText_0827E473,
gText_0827E4A6,
gText_0827E4D5,
gText_0827E504,
gText_0827E531,
gText_0827E55A,
gText_0827E5B2,
gText_0827E5D0,
gText_0827E606,
gText_0827E638,
gText_0827E658,
gText_0827E68B,
gText_0827E6C4,
gText_0827E7BA
[CONTEST_STRING_MORE_CONSCIOUS] = gText_BecameMoreConsciousOfOtherMons,
[CONTEST_STRING_NO_APPEAL] = gText_MonCantMakeAnAppealAfterThis,
[CONTEST_STRING_SETTLE_DOWN] = gText_SettledDownJustLittleBit,
[CONTEST_STRING_OBLIVIOUS_TO_OTHERS] = gText_BecameObliviousToOtherMons,
[CONTEST_STRING_LESS_AWARE] = gText_BecameLessAwareOfOtherMons,
[CONTEST_STRING_STOPPED_CARING] = gText_StoppedCaringAboutOtherMons,
[CONTEST_STRING_STARTLE_ATTEMPT] = gText_TriedToStartleOtherMons,
[CONTEST_STRING_DAZZLE_ATTEMPT] = gText_TriedToDazzleOthers,
[CONTEST_STRING_JUDGE_LOOK_AWAY2] = gText_JudgeLookedAwayFromMon,
[CONTEST_STRING_UNNERVE_ATTEMPT] = gText_TriedToUnnerveNextMon,
[CONTEST_STRING_NERVOUS] = gText_MonBecameNervous,
[CONTEST_STRING_UNNERVE_WAITING] = gText_AppealTriedToUnnerveWaitingMons,
[CONTEST_STRING_TAUNT_WELL] = gText_TauntedMonsDoingWell,
[CONTEST_STRING_REGAINED_FORM] = gText_MonRegainedItsForm,
[CONTEST_STRING_JAM_WELL] = gText_TriedToJamMonDoingWell,
[CONTEST_STRING_HUSTLE_STANDOUT] = gText_StandoutMonHustledEvenMore,
[CONTEST_STRING_WORK_HARD_UNNOTICED] = gText_LargelyUnnoticedMonWorkedHard,
[CONTEST_STRING_WORK_BEFORE] = gText_WorkedAsMuchAsMonBefore,
[CONTEST_STRING_APPEAL_NOT_WELL] = gText_MonsAppealDidNotGoWell,
[CONTEST_STRING_WORK_PRECEDING] = gText_WorkedAsMuchAsPrecedingMon,
[CONTEST_STRING_APPEAL_NOT_WELL2] = gText_MonsAppealDidNotGoWell2,
[CONTEST_STRING_APPEAL_NOT_SHOWN_WELL] = gText_MonsAppealDidNotGoWell3,
[CONTEST_STRING_APPEAL_SLIGHTLY_WELL] = gText_MonsAppealWentSlightlyWell,
[CONTEST_STRING_APPEAL_PRETTY_WELL] = gText_MonsAppealWentPrettyWell,
[CONTEST_STRING_APPEAL_EXCELLENTLY] = gText_MonsAppealWentExcellently,
[CONTEST_STRING_APPEAL_DUD] = gText_MonsAppealWasDud,
[CONTEST_STRING_APPEAL_NOT_VERY_WELL] = gText_MonsAppealDidNotWorkVeryWell,
[CONTEST_STRING_APPEAL_SLIGHTLY_WELL2] = gText_MonsAppealWentSlightlyWell2,
[CONTEST_STRING_APPEAL_PRETTY_WELL2] = gText_MonsAppealWentPrettyWell2,
[CONTEST_STRING_APPEAL_VERY_WELL] = gText_MonsAppealWentVeryWell,
[CONTEST_STRING_APPEAL_EXCELLENTLY2] = gText_MonsAppealWentExcellently2,
[CONTEST_STRING_SAME_TYPE_GOOD] = gText_SameTypeAsOneBeforeGood,
[CONTEST_STRING_DIFF_TYPE_GOOD] = gText_NotSameTypeAsOneBeforeGood,
[CONTEST_STRING_STOOD_OUT_AS_MUCH] = gText_StoodOutMuchMoreThanMonBefore,
[CONTEST_STRING_NOT_AS_WELL] = gText_DidntDoAsWellAsMonBefore,
[CONTEST_STRING_CONDITION_ROSE] = gText_MonsConditionRoseAboveUsual,
[CONTEST_STRING_HOT_STATUS] = gText_MonsHotStatusMadeGreatAppeal,
[CONTEST_STRING_MOVE_UP_LINE] = gText_MovedUpInLineForNextAppeal,
[CONTEST_STRING_MOVE_BACK_LINE] = gText_MovedBackInLineForNextAppeal,
[CONTEST_STRING_SCRAMBLE_ORDER] = gText_ScrambledUpOrderForNextTurn,
[CONTEST_STRING_JUDGE_EXPECTANTLY2] = gText_JudgeLookedAtMonExpectantly,
[CONTEST_STRING_WENT_OVER_WELL] = gText_AppealComboWentOverWell,
[CONTEST_STRING_WENT_OVER_VERY_WELL] = gText_AppealComboWentOverVeryWell,
[CONTEST_STRING_APPEAL_COMBO_EXCELLENTLY] = gText_AppealComboWentOverExcellently,
[CONTEST_STRING_AVERT_GAZE] = gText_MonManagedToAvertGaze,
[CONTEST_STRING_AVOID_SEEING] = gText_MonManagedToAvoidSeeingIt,
[CONTEST_STRING_NOT_FAZED] = gText_MonIsntFazedByThatSortOfThing,
[CONTEST_STRING_LITTLE_DISTRACTED] = gText_MonBecameALittleDistracted,
[CONTEST_STRING_ATTEMPT_STARTLE] = gText_TriedToStartleOtherPokemon,
[CONTEST_STRING_LOOKED_DOWN] = gText_MonLookedDownOutOfDistraction,
[CONTEST_STRING_TURNED_BACK] = gText_MonTurnedBackOutOfDistraction,
[CONTEST_STRING_UTTER_CRY] = gText_MonCouldntHelpUtteringCry,
[CONTEST_STRING_LEAPT_UP] = gText_MonCouldntHelpLeapingUp,
[CONTEST_STRING_TRIPPED_OVER] = gText_MonTrippedOutOfDistraction,
[CONTEST_STRING_MESSED_UP2] = gText_ButItMessedUp2,
[CONTEST_STRING_FAILED_TARGET_NERVOUS] = gText_ButItFailedToMakeTargetNervous,
[CONTEST_STRING_FAILED_ANYONE_NERVOUS] = gText_ButItFailedToMakeAnyoneNervous,
[CONTEST_STRING_IGNORED] = gText_ButItWasIgnored,
[CONTEST_STRING_NO_CONDITION_IMPROVE] = gText_CouldntImproveItsCondition,
[CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL] = gText_BadConditionResultedInWeakAppeal,
[CONTEST_STRING_UNAFFECTED] = gText_MonWasUnaffected,
[CONTEST_STRING_ATTRACTED_ATTENTION] = gText_AttractedCrowdsAttention
};
const u8 *const gUnknown_08587F08[] =
static const u8 *const sContestConditions[] =
{
gText_0827E85F,
gText_0827E868,
gText_0827E86F,
gText_0827E878,
gText_0827E882
[CONTEST_CATEGORY_COOL] = gText_Contest_Coolness,
[CONTEST_CATEGORY_BEAUTY] = gText_Contest_Beauty,
[CONTEST_CATEGORY_CUTE] = gText_Contest_Cuteness,
[CONTEST_CATEGORY_SMART] = gText_Contest_Smartness,
[CONTEST_CATEGORY_TOUGH] = gText_Contest_Toughness
};
const u8 *const gUnknown_08587F1C[] =
static const u8 *const sInvalidContestMoveNames[] =
{
gText_0827E894,
gText_0827E89E,
gText_0827E8AA,
gText_0827E8B4,
gText_0827E8BF,
gText_0827E8CA
[CONTEST_CATEGORY_COOL] = gText_CoolMove,
[CONTEST_CATEGORY_BEAUTY] = gText_BeautyMove,
[CONTEST_CATEGORY_CUTE] = gText_CuteMove,
[CONTEST_CATEGORY_SMART] = gText_SmartMove,
[CONTEST_CATEGORY_TOUGH] = gText_ToughMove,
[CONTEST_CATEGORIES_COUNT] = gText_3QuestionMarks
};
+123 -122
View File
@@ -1,123 +1,124 @@
const u32 *const gUnknown_085A6BE8[][2] = {
{gItemIcon_QuestionMark, gItemIconPalette_QuestionMark},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB7AA0, gUnknown_08DB7B34},
{gUnknown_08DB7B5C, gUnknown_08DB7BEC},
{gUnknown_08DB7C08, gUnknown_08DB7CE8},
{gUnknown_08DB7D08, gUnknown_08DB7DCC},
{gUnknown_08DB7DF4, gUnknown_08DB7EA0},
{gUnknown_08DB7EC4, gUnknown_08DB7F60},
{gUnknown_08DB7F7C, gUnknown_08DB8070},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB808C, gUnknown_08DB8138},
{gUnknown_08DB8160, gUnknown_08DB8218},
{gUnknown_08DB823C, gUnknown_08DB8300},
{gUnknown_08DB8328, gUnknown_08DB8430},
{gUnknown_08DB8458, gUnknown_08DB8528},
{gUnknown_08DB854C, gUnknown_08DB862C},
{gUnknown_08DB8654, gUnknown_08DB86C4},
{gUnknown_08DB86E0, gUnknown_08DB8750},
{gUnknown_08DB876C, gUnknown_08DB87DC},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB87F8, gUnknown_08DB88D8},
{gUnknown_08DB8900, gUnknown_08DB89E0},
{gUnknown_08DB8A08, gUnknown_08DB8A68},
{gUnknown_08DB8A84, gUnknown_08DB8B40},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB8B68, gUnknown_08DB8C40},
{gUnknown_08DB8C5C, gUnknown_08DB8CF4},
{NULL, NULL},
{gUnknown_08DB8D18, gUnknown_08DB8DB0},
{gUnknown_08DB8DD4, gUnknown_08DB8E80},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB8EA0, gUnknown_08DB8F58},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB8F7C, gUnknown_08DB9038},
{gUnknown_08DB9058, gUnknown_08DB9130},
{gUnknown_08DB9154, gUnknown_08DB9218},
{gUnknown_08DB9234, gUnknown_08DB92FC},
{gUnknown_08DB931C, gUnknown_08DB93E8},
{gUnknown_08DB940C, gUnknown_08DB94CC},
{gUnknown_08DB94E8, gUnknown_08DB95AC},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB95D0, gUnknown_08DB96C4},
{gUnknown_08DB96EC, gUnknown_08DB97F4},
{gUnknown_08DB981C, gUnknown_08DB9908},
{gUnknown_08DB9930, gUnknown_08DB9A54},
{gUnknown_08DB9A7C, gUnknown_08DB9B7C},
{gUnknown_08DB9BA4, gUnknown_08DB9CB0},
{gUnknown_08DB9CD8, gUnknown_08DB9DAC},
{gUnknown_08DB9F08, gUnknown_08DB9FFC},
{gUnknown_08DB9DD4, gUnknown_08DB9EE4},
{gUnknown_08DBA020, gUnknown_08DBA12C}
const u32 *const gDecorIconTable[][2] =
{
[DECOR_NONE] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark},
[DECOR_SMALL_DESK] = {NULL, NULL},
[DECOR_POKEMON_DESK] = {NULL, NULL},
[DECOR_HEAVY_DESK] = {gDecorIcon_HeavyDesk, gDecorIconPalette_HeavyDesk},
[DECOR_RAGGED_DESK] = {gDecorIcon_RaggedDesk, gDecorIconPalette_RaggedDesk},
[DECOR_COMFORT_DESK] = {gDecorIcon_ComfortDesk, gDecorIconPalette_ComfortDesk},
[DECOR_PRETTY_DESK] = {gDecorIcon_PrettyDesk, gDecorIconPalette_PrettyDesk},
[DECOR_BRICK_DESK] = {gDecorIcon_BrickDesk, gDecorIconPalette_BrickDesk},
[DECOR_CAMP_DESK] = {gDecorIcon_CampDesk, gDecorIconPalette_CampDesk},
[DECOR_HARD_DESK] = {gDecorIcon_HardDesk, gDecorIconPalette_HardDesk},
[DECOR_SMALL_CHAIR] = {NULL, NULL},
[DECOR_POKEMON_CHAIR] = {NULL, NULL},
[DECOR_HEAVY_CHAIR] = {NULL, NULL},
[DECOR_PRETTY_CHAIR] = {NULL, NULL},
[DECOR_COMFORT_CHAIR] = {NULL, NULL},
[DECOR_RAGGED_CHAIR] = {NULL, NULL},
[DECOR_BRICK_CHAIR] = {NULL, NULL},
[DECOR_CAMP_CHAIR] = {NULL, NULL},
[DECOR_HARD_CHAIR] = {NULL, NULL},
[DECOR_RED_PLANT] = {gDecorIcon_RedPlant, gDecorIconPalette_RedPlant},
[DECOR_TROPICAL_PLANT] = {gDecorIcon_TropicalPlant, gDecorIconPalette_TropicalPlant},
[DECOR_PRETTY_FLOWERS] = {gDecorIcon_PrettyFlowers, gDecorIconPalette_PrettyFlowers},
[DECOR_COLORFUL_PLANT] = {gDecorIcon_ColorfulPlant, gDecorIconPalette_ColorfulPlant},
[DECOR_BIG_PLANT] = {gDecorIcon_BigPlant, gDecorIconPalette_BigPlant},
[DECOR_GORGEOUS_PLANT] = {gDecorIcon_GorgeousPlant, gDecorIconPalette_GorgeousPlant},
[DECOR_RED_BRICK] = {gDecorIcon_RedBrick, gDecorIconPalette_RedBrick},
[DECOR_YELLOW_BRICK] = {gDecorIcon_YellowBrick, gDecorIconPalette_YellowBrick},
[DECOR_BLUE_BRICK] = {gDecorIcon_BlueBrick, gDecorIconPalette_BlueBrick},
[DECOR_RED_BALLOON] = {NULL, NULL},
[DECOR_BLUE_BALLOON] = {NULL, NULL},
[DECOR_YELLOW_BALLOON] = {NULL, NULL},
[DECOR_RED_TENT] = {gDecorIcon_RedTent, gDecorIconPalette_RedTent},
[DECOR_BLUE_TENT] = {gDecorIcon_BlueTent, gDecorIconPalette_BlueTent},
[DECOR_SOLID_BOARD] = {gDecorIcon_SolidBoard, gDecorIconPalette_SolidBoard},
[DECOR_SLIDE] = {gDecorIcon_Slide, gDecorIconPalette_Slide},
[DECOR_FENCE_LENGTH] = {NULL, NULL},
[DECOR_FENCE_WIDTH] = {NULL, NULL},
[DECOR_TIRE] = {gDecorIcon_Tire, gDecorIconPalette_Tire},
[DECOR_STAND] = {gDecorIcon_Stand, gDecorIconPalette_Stand},
[DECOR_MUD_BALL] = {NULL, NULL},
[DECOR_BREAKABLE_DOOR] = {gDecorIcon_BreakableDoor, gDecorIconPalette_BreakableDoor},
[DECOR_SAND_ORNAMENT] = {gDecorIcon_SandOrnament, gDecorIconPalette_SandOrnament},
[DECOR_SILVER_SHIELD] = {NULL, NULL},
[DECOR_GOLD_SHIELD] = {NULL, NULL},
[DECOR_GLASS_ORNAMENT] = {gDecorIcon_GlassOrnament, gDecorIconPalette_GlassOrnament},
[DECOR_TV] = {NULL, NULL},
[DECOR_ROUND_TV] = {NULL, NULL},
[DECOR_CUTE_TV] = {NULL, NULL},
[DECOR_GLITTER_MAT] = {NULL, NULL},
[DECOR_JUMP_MAT] = {NULL, NULL},
[DECOR_SPIN_MAT] = {NULL, NULL},
[DECOR_C_LOW_NOTE_MAT] = {NULL, NULL},
[DECOR_D_NOTE_MAT] = {NULL, NULL},
[DECOR_E_NOTE_MAT] = {NULL, NULL},
[DECOR_F_NOTE_MAT] = {NULL, NULL},
[DECOR_G_NOTE_MAT] = {NULL, NULL},
[DECOR_A_NOTE_MAT] = {NULL, NULL},
[DECOR_B_NOTE_MAT] = {NULL, NULL},
[DECOR_C_HIGH_NOTE_MAT] = {NULL, NULL},
[DECOR_SURF_MAT] = {gDecorIcon_SurfMat, gDecorIconPalette_SurfMat},
[DECOR_THUNDER_MAT] = {gDecorIcon_ThunderMat, gDecorIconPalette_ThunderMat},
[DECOR_FIRE_BLAST_MAT] = {gDecorIcon_FireBlastMat, gDecorIconPalette_FireBlastMat},
[DECOR_POWDER_SNOW_MAT] = {gDecorIcon_PowderSnowMat, gDecorIconPalette_PowderSnowMat},
[DECOR_ATTRACT_MAT] = {gDecorIcon_AttractMat, gDecorIconPalette_AttractMat},
[DECOR_FISSURE_MAT] = {gDecorIcon_FissureMat, gDecorIconPalette_FissureMat},
[DECOR_SPIKES_MAT] = {gDecorIcon_SpikesMat, gDecorIconPalette_SpikesMat},
[DECOR_BALL_POSTER] = {NULL, NULL},
[DECOR_GREEN_POSTER] = {NULL, NULL},
[DECOR_RED_POSTER] = {NULL, NULL},
[DECOR_BLUE_POSTER] = {NULL, NULL},
[DECOR_CUTE_POSTER] = {NULL, NULL},
[DECOR_PIKA_POSTER] = {NULL, NULL},
[DECOR_LONG_POSTER] = {NULL, NULL},
[DECOR_SEA_POSTER] = {NULL, NULL},
[DECOR_SKY_POSTER] = {NULL, NULL},
[DECOR_KISS_POSTER] = {NULL, NULL},
[DECOR_PICHU_DOLL] = {NULL, NULL},
[DECOR_PIKACHU_DOLL] = {NULL, NULL},
[DECOR_MARILL_DOLL] = {NULL, NULL},
[DECOR_TOGEPI_DOLL] = {NULL, NULL},
[DECOR_CYNDAQUIL_DOLL] = {NULL, NULL},
[DECOR_CHIKORITA_DOLL] = {NULL, NULL},
[DECOR_TOTODILE_DOLL] = {NULL, NULL},
[DECOR_JIGGLYPUFF_DOLL] = {NULL, NULL},
[DECOR_MEOWTH_DOLL] = {NULL, NULL},
[DECOR_CLEFAIRY_DOLL] = {NULL, NULL},
[DECOR_DITTO_DOLL] = {NULL, NULL},
[DECOR_SMOOCHUM_DOLL] = {NULL, NULL},
[DECOR_TREECKO_DOLL] = {NULL, NULL},
[DECOR_TORCHIC_DOLL] = {NULL, NULL},
[DECOR_MUDKIP_DOLL] = {NULL, NULL},
[DECOR_DUSKULL_DOLL] = {NULL, NULL},
[DECOR_WYNAUT_DOLL] = {NULL, NULL},
[DECOR_BALTOY_DOLL] = {NULL, NULL},
[DECOR_KECLEON_DOLL] = {NULL, NULL},
[DECOR_AZURILL_DOLL] = {NULL, NULL},
[DECOR_SKITTY_DOLL] = {NULL, NULL},
[DECOR_SWABLU_DOLL] = {NULL, NULL},
[DECOR_GULPIN_DOLL] = {NULL, NULL},
[DECOR_LOTAD_DOLL] = {NULL, NULL},
[DECOR_SEEDOT_DOLL] = {NULL, NULL},
[DECOR_PIKA_CUSHION] = {NULL, NULL},
[DECOR_ROUND_CUSHION] = {NULL, NULL},
[DECOR_KISS_CUSHION] = {NULL, NULL},
[DECOR_ZIGZAG_CUSHION] = {NULL, NULL},
[DECOR_SPIN_CUSHION] = {NULL, NULL},
[DECOR_DIAMOND_CUSHION] = {NULL, NULL},
[DECOR_BALL_CUSHION] = {NULL, NULL},
[DECOR_GRASS_CUSHION] = {NULL, NULL},
[DECOR_FIRE_CUSHION] = {NULL, NULL},
[DECOR_WATER_CUSHION] = {NULL, NULL},
[DECOR_SNORLAX_DOLL] = {gDecorIcon_SnorlaxDoll, gDecorIconPalette_SnorlaxDoll},
[DECOR_RHYDON_DOLL] = {gDecorIcon_RhydonDoll, gDecorIconPalette_RhydonDoll},
[DECOR_LAPRAS_DOLL] = {gDecorIcon_LaprasDoll, gDecorIconPalette_LaprasDoll},
[DECOR_VENUSAUR_DOLL] = {gDecorIcon_VenusaurDoll, gDecorIconPalette_VenusaurDoll},
[DECOR_CHARIZARD_DOLL] = {gDecorIcon_CharizardDoll, gDecorIconPalette_CharizardDoll},
[DECOR_BLASTOISE_DOLL] = {gDecorIcon_BlastoiseDoll, gDecorIconPalette_BlastoiseDoll},
[DECOR_WAILMER_DOLL] = {gDecorIcon_WailmerDoll, gDecorIconPalette_WailmerDoll},
[DECOR_REGIROCK_DOLL] = {gDecorIcon_RegirockDoll, gDecorIconPalette_RegirockDoll},
[DECOR_REGICE_DOLL] = {gDecorIcon_RegiceDoll, gDecorIconPalette_RegiceDoll},
[DECOR_REGISTEEL_DOLL] = {gDecorIcon_RegisteelDoll, gDecorIconPalette_RegisteelDoll}
};
@@ -326,7 +326,7 @@ const u32 gFieldEffectObjectPic_SandDisguisePlaceholder[] = INCBIN_U32("graphics
const u32 gFieldEffectObjectPic_HotSpringsWater[] = INCBIN_U32("graphics/event_objects/pics/effects/hot_springs_water.4bpp");
const u16 gFieldEffectObjectPalette2[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_02.gbapal");
const u32 gFieldEffectObjectPic_JumpOutOfAsh[] = INCBIN_U32("graphics/event_objects/pics/effects/jump_out_of_ash.4bpp");
const u32 gFieldEffectObjectPic_Unknown33[] = INCBIN_U32("graphics/event_objects/pics/effects/unknown_33.4bpp");
const u32 gFieldEffectObjectPic_LavaridgeGymWarp[] = INCBIN_U32("graphics/event_objects/pics/effects/lavaridge_gym_warp.4bpp");
const u32 gFieldEffectObjectPic_Bubbles[] = INCBIN_U32("graphics/event_objects/pics/effects/bubbles.4bpp");
const u32 gFieldEffectObjectPic_Unknown35[] = INCBIN_U32("graphics/event_objects/pics/effects/unknown_35.4bpp");
const u16 gFieldEffectObjectPalette3[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_03.gbapal");
@@ -489,11 +489,11 @@ const struct EventObjectGraphicsInfo *const gEventObjectGraphicsInfoPointers[] =
};
const struct EventObjectGraphicsInfo *const gMauvilleOldManGraphicsInfoPointers[] = {
&gEventObjectGraphicsInfo_Bard,
&gEventObjectGraphicsInfo_Hipster,
&gEventObjectGraphicsInfo_Trader,
&gEventObjectGraphicsInfo_Storyteller,
&gEventObjectGraphicsInfo_Giddy,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan1,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan2,
[MAUVILLE_MAN_BARD] = &gEventObjectGraphicsInfo_Bard,
[MAUVILLE_MAN_HIPSTER] = &gEventObjectGraphicsInfo_Hipster,
[MAUVILLE_MAN_TRADER] = &gEventObjectGraphicsInfo_Trader,
[MAUVILLE_MAN_STORYTELLER] = &gEventObjectGraphicsInfo_Storyteller,
[MAUVILLE_MAN_GIDDY] = &gEventObjectGraphicsInfo_Giddy,
[MAUVILLE_MAN_UNUSED1] = &gEventObjectGraphicsInfo_UnusedMauvilleOldMan1,
[MAUVILLE_MAN_UNUSED2] = &gEventObjectGraphicsInfo_UnusedMauvilleOldMan2,
};
File diff suppressed because it is too large Load Diff
@@ -31,7 +31,7 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29;
const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass;
const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater;
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh;
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown33;
const struct SpriteTemplate gFieldEffectObjectTemplate_LavaridgeGymWarp;
const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles;
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35;
const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
@@ -70,7 +70,7 @@ const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
&gFieldEffectObjectTemplate_ShortGrass,
&gFieldEffectObjectTemplate_HotSpringsWater,
&gFieldEffectObjectTemplate_JumpOutOfAsh,
&gFieldEffectObjectTemplate_Unknown33,
&gFieldEffectObjectTemplate_LavaridgeGymWarp,
&gFieldEffectObjectTemplate_Bubbles,
&gFieldEffectObjectTemplate_Unknown35,
&gFieldEffectObjectTemplate_Rayquaza,
+29 -11
View File
@@ -892,19 +892,28 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_JumpOutOfAsh[] =
gFieldEffectObjectImageAnim_850D54C,
};
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh = {0xFFFF, 0x100D, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_JumpOutOfAsh, gFieldEffectObjectPicTable_JumpOutOfAsh, gDummySpriteAffineAnimTable, sub_80B7CAC};
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh =
{
.tileTag = 0xFFFF,
.paletteTag = 0x100D,
.oam = &gEventObjectBaseOam_16x16,
.anims = gFieldEffectObjectImageAnimTable_JumpOutOfAsh,
.images = gFieldEffectObjectPicTable_JumpOutOfAsh,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_PopOutOfAsh
};
const struct SpritePalette gFieldEffectObjectPaletteInfo2 = {gFieldEffectObjectPalette2, 0x100D};
const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown33[] = {
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 0),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 1),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 2),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 3),
overworld_frame(gFieldEffectObjectPic_Unknown33, 2, 2, 4),
const struct SpriteFrameImage gFieldEffectObjectPicTable_LavaridgeGymWarp[] = {
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 0),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 1),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 2),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 3),
overworld_frame(gFieldEffectObjectPic_LavaridgeGymWarp, 2, 2, 4),
};
const union AnimCmd gFieldEffectObjectImageAnim_850D5B0[] =
const union AnimCmd gFieldEffectObjectImageAnim_LavaridgeGymWarp[] =
{
ANIMCMD_FRAME(0, 6),
ANIMCMD_FRAME(1, 6),
@@ -914,12 +923,21 @@ const union AnimCmd gFieldEffectObjectImageAnim_850D5B0[] =
ANIMCMD_END,
};
const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown33[] =
const union AnimCmd *const gFieldEffectObjectImageAnimTable_LavaridgeGymWarp[] =
{
gFieldEffectObjectImageAnim_850D5B0,
gFieldEffectObjectImageAnim_LavaridgeGymWarp,
};
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown33 = {0xFFFF, 0x100D, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown33, gFieldEffectObjectPicTable_Unknown33, gDummySpriteAffineAnimTable, sub_80B7A58};
const struct SpriteTemplate gFieldEffectObjectTemplate_LavaridgeGymWarp =
{
.tileTag = 0xFFFF,
.paletteTag = 0x100D,
.oam = &gEventObjectBaseOam_16x16,
.anims = gFieldEffectObjectImageAnimTable_LavaridgeGymWarp,
.images = gFieldEffectObjectPicTable_LavaridgeGymWarp,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_LavaridgeGymWarp
};
const struct SpriteFrameImage gFieldEffectObjectPicTable_Bubbles[] = {
overworld_frame(gFieldEffectObjectPic_Bubbles, 2, 4, 0),
@@ -170,8 +170,8 @@ u8 MovementAction_SetFixedPriority_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_ClearFixedPriority_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_InitAffineAnim_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_ClearAffineAnim_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_Unknown1_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_Unknown2_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_HideReflection_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_ShowReflection_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_WalkDownStartAffine_Step0(struct EventObject *, struct Sprite *);
u8 MovementAction_WalkDownStartAffine_Step1(struct EventObject *, struct Sprite *);
u8 MovementAction_WalkDownAffine_Step0(struct EventObject *, struct Sprite *);
@@ -358,8 +358,8 @@ u8 (*const gMovementActionFuncs_SetFixedPriority[])(struct EventObject *, struct
u8 (*const gMovementActionFuncs_ClearFixedPriority[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_InitAffineAnim[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_HideReflection[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_ShowReflection[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkDownStartAffine[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkDownAffine[])(struct EventObject *, struct Sprite *);
u8 (*const gMovementActionFuncs_AcroWheelieFaceDown[])(struct EventObject *, struct Sprite *);
@@ -518,8 +518,8 @@ u8 (*const *const gMovementActionFuncs[])(struct EventObject *, struct Sprite *)
[MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY] = gMovementActionFuncs_ClearFixedPriority,
[MOVEMENT_ACTION_INIT_AFFINE_ANIM] = gMovementActionFuncs_InitAffineAnim,
[MOVEMENT_ACTION_CLEAR_AFFINE_ANIM] = gMovementActionFuncs_ClearAffineAnim,
[MOVEMENT_ACTION_UNKNOWN1] = gMovementActionFuncs_Unknown1,
[MOVEMENT_ACTION_UNKNOWN2] = gMovementActionFuncs_Unknown2,
[MOVEMENT_ACTION_HIDE_REFLECTION] = gMovementActionFuncs_HideReflection,
[MOVEMENT_ACTION_SHOW_REFLECTION] = gMovementActionFuncs_ShowReflection,
[MOVEMENT_ACTION_WALK_DOWN_START_AFFINE] = gMovementActionFuncs_WalkDownStartAffine,
[MOVEMENT_ACTION_WALK_DOWN_AFFINE] = gMovementActionFuncs_WalkDownAffine,
[MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN] = gMovementActionFuncs_AcroWheelieFaceDown,
@@ -1197,13 +1197,13 @@ u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct
MovementAction_Finish,
};
u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *) = {
MovementAction_Unknown1_Step0,
u8 (*const gMovementActionFuncs_HideReflection[])(struct EventObject *, struct Sprite *) = {
MovementAction_HideReflection_Step0,
MovementAction_Finish,
};
u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *) = {
MovementAction_Unknown2_Step0,
u8 (*const gMovementActionFuncs_ShowReflection[])(struct EventObject *, struct Sprite *) = {
MovementAction_ShowReflection_Step0,
MovementAction_Finish,
};
+84 -84
View File
@@ -1,125 +1,125 @@
const u32 gUnknown_08DB7AA0[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.4bpp.lz");
const u32 gUnknown_08DB7B34[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.gbapal.lz");
const u32 gDecorIcon_HeavyDesk[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.4bpp.lz");
const u32 gDecorIconPalette_HeavyDesk[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.gbapal.lz");
const u32 gUnknown_08DB7B5C[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.4bpp.lz");
const u32 gUnknown_08DB7BEC[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.gbapal.lz");
const u32 gDecorIcon_RaggedDesk[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.4bpp.lz");
const u32 gDecorIconPalette_RaggedDesk[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.gbapal.lz");
const u32 gUnknown_08DB7C08[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.4bpp.lz");
const u32 gUnknown_08DB7CE8[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.gbapal.lz");
const u32 gDecorIcon_ComfortDesk[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.4bpp.lz");
const u32 gDecorIconPalette_ComfortDesk[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.gbapal.lz");
const u32 gUnknown_08DB7D08[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.4bpp.lz");
const u32 gUnknown_08DB7DCC[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.gbapal.lz");
const u32 gDecorIcon_PrettyDesk[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.4bpp.lz");
const u32 gDecorIconPalette_PrettyDesk[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.gbapal.lz");
const u32 gUnknown_08DB7DF4[] = INCBIN_U32("graphics/decorations/decor_brick_desk.4bpp.lz");
const u32 gUnknown_08DB7EA0[] = INCBIN_U32("graphics/decorations/decor_brick_desk.gbapal.lz");
const u32 gDecorIcon_BrickDesk[] = INCBIN_U32("graphics/decorations/decor_brick_desk.4bpp.lz");
const u32 gDecorIconPalette_BrickDesk[] = INCBIN_U32("graphics/decorations/decor_brick_desk.gbapal.lz");
const u32 gUnknown_08DB7EC4[] = INCBIN_U32("graphics/decorations/decor_camp_desk.4bpp.lz");
const u32 gUnknown_08DB7F60[] = INCBIN_U32("graphics/decorations/decor_camp_desk.gbapal.lz");
const u32 gDecorIcon_CampDesk[] = INCBIN_U32("graphics/decorations/decor_camp_desk.4bpp.lz");
const u32 gDecorIconPalette_CampDesk[] = INCBIN_U32("graphics/decorations/decor_camp_desk.gbapal.lz");
const u32 gUnknown_08DB7F7C[] = INCBIN_U32("graphics/decorations/decor_hard_desk.4bpp.lz");
const u32 gUnknown_08DB8070[] = INCBIN_U32("graphics/decorations/decor_hard_desk.gbapal.lz");
const u32 gDecorIcon_HardDesk[] = INCBIN_U32("graphics/decorations/decor_hard_desk.4bpp.lz");
const u32 gDecorIconPalette_HardDesk[] = INCBIN_U32("graphics/decorations/decor_hard_desk.gbapal.lz");
const u32 gUnknown_08DB808C[] = INCBIN_U32("graphics/decorations/decor_red_plant.4bpp.lz");
const u32 gUnknown_08DB8138[] = INCBIN_U32("graphics/decorations/decor_red_plant.gbapal.lz");
const u32 gDecorIcon_RedPlant[] = INCBIN_U32("graphics/decorations/decor_red_plant.4bpp.lz");
const u32 gDecorIconPalette_RedPlant[] = INCBIN_U32("graphics/decorations/decor_red_plant.gbapal.lz");
const u32 gUnknown_08DB8160[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.4bpp.lz");
const u32 gUnknown_08DB8218[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.gbapal.lz");
const u32 gDecorIcon_TropicalPlant[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.4bpp.lz");
const u32 gDecorIconPalette_TropicalPlant[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.gbapal.lz");
const u32 gUnknown_08DB823C[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.4bpp.lz");
const u32 gUnknown_08DB8300[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.gbapal.lz");
const u32 gDecorIcon_PrettyFlowers[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.4bpp.lz");
const u32 gDecorIconPalette_PrettyFlowers[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.gbapal.lz");
const u32 gUnknown_08DB8328[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.4bpp.lz");
const u32 gUnknown_08DB8430[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.gbapal.lz");
const u32 gDecorIcon_ColorfulPlant[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.4bpp.lz");
const u32 gDecorIconPalette_ColorfulPlant[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.gbapal.lz");
const u32 gUnknown_08DB8458[] = INCBIN_U32("graphics/decorations/decor_big_plant.4bpp.lz");
const u32 gUnknown_08DB8528[] = INCBIN_U32("graphics/decorations/decor_big_plant.gbapal.lz");
const u32 gDecorIcon_BigPlant[] = INCBIN_U32("graphics/decorations/decor_big_plant.4bpp.lz");
const u32 gDecorIconPalette_BigPlant[] = INCBIN_U32("graphics/decorations/decor_big_plant.gbapal.lz");
const u32 gUnknown_08DB854C[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.4bpp.lz");
const u32 gUnknown_08DB862C[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.gbapal.lz");
const u32 gDecorIcon_GorgeousPlant[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.4bpp.lz");
const u32 gDecorIconPalette_GorgeousPlant[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.gbapal.lz");
const u32 gUnknown_08DB8654[] = INCBIN_U32("graphics/decorations/decor_red_brick.4bpp.lz");
const u32 gUnknown_08DB86C4[] = INCBIN_U32("graphics/decorations/decor_red_brick.gbapal.lz");
const u32 gDecorIcon_RedBrick[] = INCBIN_U32("graphics/decorations/decor_red_brick.4bpp.lz");
const u32 gDecorIconPalette_RedBrick[] = INCBIN_U32("graphics/decorations/decor_red_brick.gbapal.lz");
const u32 gUnknown_08DB86E0[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.4bpp.lz");
const u32 gUnknown_08DB8750[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.gbapal.lz");
const u32 gDecorIcon_YellowBrick[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.4bpp.lz");
const u32 gDecorIconPalette_YellowBrick[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.gbapal.lz");
const u32 gUnknown_08DB876C[] = INCBIN_U32("graphics/decorations/decor_blue_brick.4bpp.lz");
const u32 gUnknown_08DB87DC[] = INCBIN_U32("graphics/decorations/decor_blue_brick.gbapal.lz");
const u32 gDecorIcon_BlueBrick[] = INCBIN_U32("graphics/decorations/decor_blue_brick.4bpp.lz");
const u32 gDecorIconPalette_BlueBrick[] = INCBIN_U32("graphics/decorations/decor_blue_brick.gbapal.lz");
const u32 gUnknown_08DB87F8[] = INCBIN_U32("graphics/decorations/decor_red_tent.4bpp.lz");
const u32 gUnknown_08DB88D8[] = INCBIN_U32("graphics/decorations/decor_red_tent.gbapal.lz");
const u32 gDecorIcon_RedTent[] = INCBIN_U32("graphics/decorations/decor_red_tent.4bpp.lz");
const u32 gDecorIconPalette_RedTent[] = INCBIN_U32("graphics/decorations/decor_red_tent.gbapal.lz");
const u32 gUnknown_08DB8900[] = INCBIN_U32("graphics/decorations/decor_blue_tent.4bpp.lz");
const u32 gUnknown_08DB89E0[] = INCBIN_U32("graphics/decorations/decor_blue_tent.gbapal.lz");
const u32 gDecorIcon_BlueTent[] = INCBIN_U32("graphics/decorations/decor_blue_tent.4bpp.lz");
const u32 gDecorIconPalette_BlueTent[] = INCBIN_U32("graphics/decorations/decor_blue_tent.gbapal.lz");
const u32 gUnknown_08DB8A08[] = INCBIN_U32("graphics/decorations/decor_solid_board.4bpp.lz");
const u32 gUnknown_08DB8A68[] = INCBIN_U32("graphics/decorations/decor_solid_board.gbapal.lz");
const u32 gDecorIcon_SolidBoard[] = INCBIN_U32("graphics/decorations/decor_solid_board.4bpp.lz");
const u32 gDecorIconPalette_SolidBoard[] = INCBIN_U32("graphics/decorations/decor_solid_board.gbapal.lz");
const u32 gUnknown_08DB8A84[] = INCBIN_U32("graphics/decorations/decor_slide.4bpp.lz");
const u32 gUnknown_08DB8B40[] = INCBIN_U32("graphics/decorations/decor_slide.gbapal.lz");
const u32 gDecorIcon_Slide[] = INCBIN_U32("graphics/decorations/decor_slide.4bpp.lz");
const u32 gDecorIconPalette_Slide[] = INCBIN_U32("graphics/decorations/decor_slide.gbapal.lz");
const u32 gUnknown_08DB8B68[] = INCBIN_U32("graphics/decorations/decor_tire.4bpp.lz");
const u32 gUnknown_08DB8C40[] = INCBIN_U32("graphics/decorations/decor_tire.gbapal.lz");
const u32 gDecorIcon_Tire[] = INCBIN_U32("graphics/decorations/decor_tire.4bpp.lz");
const u32 gDecorIconPalette_Tire[] = INCBIN_U32("graphics/decorations/decor_tire.gbapal.lz");
const u32 gUnknown_08DB8C5C[] = INCBIN_U32("graphics/decorations/decor_stand.4bpp.lz");
const u32 gUnknown_08DB8CF4[] = INCBIN_U32("graphics/decorations/decor_stand.gbapal.lz");
const u32 gDecorIcon_Stand[] = INCBIN_U32("graphics/decorations/decor_stand.4bpp.lz");
const u32 gDecorIconPalette_Stand[] = INCBIN_U32("graphics/decorations/decor_stand.gbapal.lz");
const u32 gUnknown_08DB8D18[] = INCBIN_U32("graphics/decorations/decor_breakable_door.4bpp.lz");
const u32 gUnknown_08DB8DB0[] = INCBIN_U32("graphics/decorations/decor_breakable_door.gbapal.lz");
const u32 gDecorIcon_BreakableDoor[] = INCBIN_U32("graphics/decorations/decor_breakable_door.4bpp.lz");
const u32 gDecorIconPalette_BreakableDoor[] = INCBIN_U32("graphics/decorations/decor_breakable_door.gbapal.lz");
const u32 gUnknown_08DB8DD4[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.4bpp.lz");
const u32 gUnknown_08DB8E80[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.gbapal.lz");
const u32 gDecorIcon_SandOrnament[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.4bpp.lz");
const u32 gDecorIconPalette_SandOrnament[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.gbapal.lz");
const u32 gUnknown_08DB8EA0[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.4bpp.lz");
const u32 gUnknown_08DB8F58[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.gbapal.lz");
const u32 gDecorIcon_GlassOrnament[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.4bpp.lz");
const u32 gDecorIconPalette_GlassOrnament[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.gbapal.lz");
const u32 gUnknown_08DB8F7C[] = INCBIN_U32("graphics/decorations/decor_surf_mat.4bpp.lz");
const u32 gUnknown_08DB9038[] = INCBIN_U32("graphics/decorations/decor_surf_mat.gbapal.lz");
const u32 gDecorIcon_SurfMat[] = INCBIN_U32("graphics/decorations/decor_surf_mat.4bpp.lz");
const u32 gDecorIconPalette_SurfMat[] = INCBIN_U32("graphics/decorations/decor_surf_mat.gbapal.lz");
const u32 gUnknown_08DB9058[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.4bpp.lz");
const u32 gUnknown_08DB9130[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.gbapal.lz");
const u32 gDecorIcon_ThunderMat[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.4bpp.lz");
const u32 gDecorIconPalette_ThunderMat[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.gbapal.lz");
const u32 gUnknown_08DB9154[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.4bpp.lz");
const u32 gUnknown_08DB9218[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.gbapal.lz");
const u32 gDecorIcon_FireBlastMat[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.4bpp.lz");
const u32 gDecorIconPalette_FireBlastMat[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.gbapal.lz");
const u32 gUnknown_08DB9234[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.4bpp.lz");
const u32 gUnknown_08DB92FC[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.gbapal.lz");
const u32 gDecorIcon_PowderSnowMat[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.4bpp.lz");
const u32 gDecorIconPalette_PowderSnowMat[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.gbapal.lz");
const u32 gUnknown_08DB931C[] = INCBIN_U32("graphics/decorations/decor_attract_mat.4bpp.lz");
const u32 gUnknown_08DB93E8[] = INCBIN_U32("graphics/decorations/decor_attract_mat.gbapal.lz");
const u32 gDecorIcon_AttractMat[] = INCBIN_U32("graphics/decorations/decor_attract_mat.4bpp.lz");
const u32 gDecorIconPalette_AttractMat[] = INCBIN_U32("graphics/decorations/decor_attract_mat.gbapal.lz");
const u32 gUnknown_08DB940C[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.4bpp.lz");
const u32 gUnknown_08DB94CC[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.gbapal.lz");
const u32 gDecorIcon_FissureMat[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.4bpp.lz");
const u32 gDecorIconPalette_FissureMat[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.gbapal.lz");
const u32 gUnknown_08DB94E8[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.4bpp.lz");
const u32 gUnknown_08DB95AC[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.gbapal.lz");
const u32 gDecorIcon_SpikesMat[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.4bpp.lz");
const u32 gDecorIconPalette_SpikesMat[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.gbapal.lz");
const u32 gUnknown_08DB95D0[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.4bpp.lz");
const u32 gUnknown_08DB96C4[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.gbapal.lz");
const u32 gDecorIcon_SnorlaxDoll[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.4bpp.lz");
const u32 gDecorIconPalette_SnorlaxDoll[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.gbapal.lz");
const u32 gUnknown_08DB96EC[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.4bpp.lz");
const u32 gUnknown_08DB97F4[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.gbapal.lz");
const u32 gDecorIcon_RhydonDoll[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.4bpp.lz");
const u32 gDecorIconPalette_RhydonDoll[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.gbapal.lz");
const u32 gUnknown_08DB981C[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.4bpp.lz");
const u32 gUnknown_08DB9908[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.gbapal.lz");
const u32 gDecorIcon_LaprasDoll[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.4bpp.lz");
const u32 gDecorIconPalette_LaprasDoll[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.gbapal.lz");
const u32 gUnknown_08DB9930[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.4bpp.lz");
const u32 gUnknown_08DB9A54[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.gbapal.lz");
const u32 gDecorIcon_VenusaurDoll[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.4bpp.lz");
const u32 gDecorIconPalette_VenusaurDoll[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.gbapal.lz");
const u32 gUnknown_08DB9A7C[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.4bpp.lz");
const u32 gUnknown_08DB9B7C[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.gbapal.lz");
const u32 gDecorIcon_CharizardDoll[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.4bpp.lz");
const u32 gDecorIconPalette_CharizardDoll[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.gbapal.lz");
const u32 gUnknown_08DB9BA4[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.4bpp.lz");
const u32 gUnknown_08DB9CB0[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.gbapal.lz");
const u32 gDecorIcon_BlastoiseDoll[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.4bpp.lz");
const u32 gDecorIconPalette_BlastoiseDoll[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.gbapal.lz");
const u32 gUnknown_08DB9CD8[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.4bpp.lz");
const u32 gUnknown_08DB9DAC[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.gbapal.lz");
const u32 gDecorIcon_WailmerDoll[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.4bpp.lz");
const u32 gDecorIconPalette_WailmerDoll[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.gbapal.lz");
const u32 gUnknown_08DB9DD4[] = INCBIN_U32("graphics/decorations/decor_regice_doll.4bpp.lz");
const u32 gUnknown_08DB9EE4[] = INCBIN_U32("graphics/decorations/decor_regice_doll.gbapal.lz");
const u32 gDecorIcon_RegiceDoll[] = INCBIN_U32("graphics/decorations/decor_regice_doll.4bpp.lz");
const u32 gDecorIconPalette_RegiceDoll[] = INCBIN_U32("graphics/decorations/decor_regice_doll.gbapal.lz");
const u32 gUnknown_08DB9F08[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.4bpp.lz");
const u32 gUnknown_08DB9FFC[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.gbapal.lz");
const u32 gDecorIcon_RegirockDoll[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.4bpp.lz");
const u32 gDecorIconPalette_RegirockDoll[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.gbapal.lz");
const u32 gUnknown_08DBA020[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.4bpp.lz");
const u32 gUnknown_08DBA12C[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.gbapal.lz");
const u32 gDecorIcon_RegisteelDoll[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.4bpp.lz");
const u32 gDecorIconPalette_RegisteelDoll[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.gbapal.lz");
+6 -6
View File
@@ -572,12 +572,12 @@ const u32 gMonShinyPalette_Magneton[] = INCBIN_U32("graphics/pokemon/magneton/sh
const u8 gMonIcon_Magneton[] = INCBIN_U8("graphics/pokemon/magneton/icon.4bpp");
const u8 gMonFootprint_Magneton[] = INCBIN_U8("graphics/pokemon/magneton/footprint.1bpp");
const u32 gMonStillFrontPic_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetch_d/front.4bpp.lz");
const u32 gMonPalette_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetch_d/normal.gbapal.lz");
const u32 gMonBackPic_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetch_d/back.4bpp.lz");
const u32 gMonShinyPalette_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetch_d/shiny.gbapal.lz");
const u8 gMonIcon_Farfetchd[] = INCBIN_U8("graphics/pokemon/farfetch_d/icon.4bpp");
const u8 gMonFootprint_Farfetchd[] = INCBIN_U8("graphics/pokemon/farfetch_d/footprint.1bpp");
const u32 gMonStillFrontPic_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetchd/front.4bpp.lz");
const u32 gMonPalette_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetchd/normal.gbapal.lz");
const u32 gMonBackPic_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetchd/back.4bpp.lz");
const u32 gMonShinyPalette_Farfetchd[] = INCBIN_U32("graphics/pokemon/farfetchd/shiny.gbapal.lz");
const u8 gMonIcon_Farfetchd[] = INCBIN_U8("graphics/pokemon/farfetchd/icon.4bpp");
const u8 gMonFootprint_Farfetchd[] = INCBIN_U8("graphics/pokemon/farfetchd/footprint.1bpp");
const u32 gMonStillFrontPic_Doduo[] = INCBIN_U32("graphics/pokemon/doduo/front.4bpp.lz");
const u32 gMonPalette_Doduo[] = INCBIN_U32("graphics/pokemon/doduo/normal.gbapal.lz");
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -236,7 +236,7 @@ const u8 gItemEffect_PPMax[9] = {
};
const u8 gItemEffect_GuardSpec[8] = {
[3] = ITEM3_MIST,
[3] = ITEM3_GUARD_SPEC,
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
@@ -377,7 +377,7 @@ const u8 gItemEffect_QualotBerry[10] = {
[9] = 2,
};
const u8 gItemEffect_HondrewBerry[10] = {
const u8 gItemEffect_HondewBerry[10] = {
[5] = ITEM5_EV_SPATK | ITEM5_FRIENDSHIP_ALL,
[6] = -10,
[7] = 10,
@@ -469,7 +469,7 @@ const u8 *const gItemEffectTable[] =
[ITEM_POMEG_BERRY - ITEM_POTION] = gItemEffect_PomegBerry,
[ITEM_KELPSY_BERRY - ITEM_POTION] = gItemEffect_KelpsyBerry,
[ITEM_QUALOT_BERRY - ITEM_POTION] = gItemEffect_QualotBerry,
[ITEM_HONDEW_BERRY - ITEM_POTION] = gItemEffect_HondrewBerry,
[ITEM_HONDEW_BERRY - ITEM_POTION] = gItemEffect_HondewBerry,
[ITEM_GREPA_BERRY - ITEM_POTION] = gItemEffect_GrepaBerry,
[ITEM_TAMATO_BERRY - ITEM_POTION] = gItemEffect_TamatoBerry,
[LAST_BERRY_INDEX - ITEM_POTION] = NULL
-1
View File
@@ -1,5 +1,4 @@
#define LEVEL_UP_MOVE(lvl, move) ((lvl << 9) | move)
#define LEVEL_UP_END 0xffff
static const u16 sBulbasaurLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
+2 -2
View File
@@ -2,7 +2,7 @@ const u8 gFacilityClassToPicIndex[] =
{
[FACILITY_CLASS_HIKER] = TRAINER_PIC_HIKER,
[FACILITY_CLASS_AQUA_GRUNT_M] = TRAINER_PIC_AQUA_GRUNT_M,
[FACILITY_CLASS_POKEMON_BREEDER_F] = TRAINER_PIC_POKEMON_BREEDER_F,
[FACILITY_CLASS_PKMN_BREEDER_F] = TRAINER_PIC_POKEMON_BREEDER_F,
[FACILITY_CLASS_COOLTRAINER_M] = TRAINER_PIC_COOLTRAINER_M,
[FACILITY_CLASS_BIRD_KEEPER] = TRAINER_PIC_BIRD_KEEPER,
[FACILITY_CLASS_COLLECTOR] = TRAINER_PIC_COLLECTOR,
@@ -88,7 +88,7 @@ const u8 gFacilityClassToTrainerClass[] =
{
[FACILITY_CLASS_HIKER] = TRAINER_CLASS_HIKER,
[FACILITY_CLASS_AQUA_GRUNT_M] = TRAINER_CLASS_TEAM_AQUA,
[FACILITY_CLASS_POKEMON_BREEDER_F] = TRAINER_CLASS_PKMN_BREEDER,
[FACILITY_CLASS_PKMN_BREEDER_F] = TRAINER_CLASS_PKMN_BREEDER,
[FACILITY_CLASS_COOLTRAINER_M] = TRAINER_CLASS_COOLTRAINER,
[FACILITY_CLASS_BIRD_KEEPER] = TRAINER_CLASS_BIRD_KEEPER,
[FACILITY_CLASS_COLLECTOR] = TRAINER_CLASS_COLLECTOR,
+1 -32
View File
@@ -1,35 +1,4 @@
#define TUTOR_MOVE_MEGA_PUNCH 0
#define TUTOR_MOVE_SWORDS_DANCE 1
#define TUTOR_MOVE_MEGA_KICK 2
#define TUTOR_MOVE_BODY_SLAM 3
#define TUTOR_MOVE_DOUBLE_EDGE 4
#define TUTOR_MOVE_COUNTER 5
#define TUTOR_MOVE_SEISMIC_TOSS 6
#define TUTOR_MOVE_MIMIC 7
#define TUTOR_MOVE_METRONOME 8
#define TUTOR_MOVE_SOFT_BOILED 9
#define TUTOR_MOVE_DREAM_EATER 10
#define TUTOR_MOVE_THUNDER_WAVE 11
#define TUTOR_MOVE_EXPLOSION 12
#define TUTOR_MOVE_ROCK_SLIDE 13
#define TUTOR_MOVE_SUBSTITUTE 14
#define TUTOR_MOVE_DYNAMIC_PUNCH 15
#define TUTOR_MOVE_ROLLOUT 16
#define TUTOR_MOVE_PSYCH_UP 17
#define TUTOR_MOVE_SNORE 18
#define TUTOR_MOVE_ICY_WIND 19
#define TUTOR_MOVE_ENDURE 20
#define TUTOR_MOVE_MUD_SLAP 21
#define TUTOR_MOVE_ICE_PUNCH 22
#define TUTOR_MOVE_SWAGGER 23
#define TUTOR_MOVE_SLEEP_TALK 24
#define TUTOR_MOVE_SWIFT 25
#define TUTOR_MOVE_DEFENSE_CURL 26
#define TUTOR_MOVE_THUNDER_PUNCH 27
#define TUTOR_MOVE_FIRE_PUNCH 28
#define TUTOR_MOVE_FURY_CUTTER 29
const u16 gTutorMoves[] =
const u16 gTutorMoves[TUTOR_MOVE_COUNT] =
{
[TUTOR_MOVE_MEGA_PUNCH] = MOVE_MEGA_PUNCH,
[TUTOR_MOVE_SWORDS_DANCE] = MOVE_SWORDS_DANCE,
File diff suppressed because it is too large Load Diff
+391 -396
View File
@@ -1,399 +1,394 @@
#define MCFLAVOR(name) {gMatchCallFlavorText_##name##_Strategy, \
gMatchCallFlavorText_##name##_Pokemon, \
gMatchCallFlavorText_##name##_Intro1, \
gMatchCallFlavorText_##name##_Intro2}
const u8 gMatchCallFlavorText_AromaLady_Rose_Strategy[] = _("Becalm fighting emotions.");
const u8 gMatchCallFlavorText_AromaLady_Rose_Pokemon[] = _("Fragrant GRASS POKéMON.");
const u8 gMatchCallFlavorText_AromaLady_Rose_Intro1[] = _("Soothing aromas make the");
const u8 gMatchCallFlavorText_AromaLady_Rose_Intro2[] = _("body and mind healthy.");
const u8 gMatchCallFlavorText_RuinManiac_Andres_Strategy[] = _("I'm not very good at this.");
const u8 gMatchCallFlavorText_RuinManiac_Andres_Pokemon[] = _("Ruin-exploration partners.");
const u8 gMatchCallFlavorText_RuinManiac_Andres_Intro1[] = _("I am searching for undersea");
const u8 gMatchCallFlavorText_RuinManiac_Andres_Intro2[] = _("ruins and relics.");
const u8 gMatchCallFlavorText_RuinManiac_Dusty_Strategy[] = _("Overwhelm with power!");
const u8 gMatchCallFlavorText_RuinManiac_Dusty_Pokemon[] = _("Craggy ROCK POKéMON.");
const u8 gMatchCallFlavorText_RuinManiac_Dusty_Intro1[] = _("In search of ancient lore,");
const u8 gMatchCallFlavorText_RuinManiac_Dusty_Intro2[] = _("I travel the world.");
const u8 gMatchCallFlavorText_Tuber_Lola_Strategy[] = _("I'm going to try hard!");
const u8 gMatchCallFlavorText_Tuber_Lola_Pokemon[] = _("Good swimmer POKéMON.");
const u8 gMatchCallFlavorText_Tuber_Lola_Intro1[] = _("I wish I could swim without");
const u8 gMatchCallFlavorText_Tuber_Lola_Intro2[] = _("using an inner tube.");
const u8 gMatchCallFlavorText_Tuber_Ricky_Strategy[] = _("I don't know. I'll try hard.");
const u8 gMatchCallFlavorText_Tuber_Ricky_Pokemon[] = _("WATER POKéMON are buddies.");
const u8 gMatchCallFlavorText_Tuber_Ricky_Intro1[] = _("It's not like I can't swim.");
const u8 gMatchCallFlavorText_Tuber_Ricky_Intro2[] = _("I just like my inner tube.");
const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Strategy[] = _("We split our duties.");
const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Pokemon[] = _("We like friendly POKéMON.");
const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Intro1[] = _("We enjoy POKéMON together");
const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Intro2[] = _("as sister and brother.");
const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Strategy[] = _("I finish with power moves!");
const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Pokemon[] = _("A mix of different types.");
const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Intro1[] = _("I aim to become the ultimate");
const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Intro2[] = _("TRAINER!");
const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Strategy[] = _("Exploit the foe's weakness.");
const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Pokemon[] = _("Balance is crucial.");
const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Intro1[] = _("My goal is to become the");
const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Intro2[] = _("POKéMON CHAMPION.");
const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Strategy[] = _("Upset the opponent.");
const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Pokemon[] = _("Type doesn't matter.");
const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Intro1[] = _("I'm a top student at the");
const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Intro2[] = _("TRAINER'S SCHOOL.");
const u8 gMatchCallFlavorText_HexManiac_Valerie_Strategy[] = _("Slow, steady suffering.");
const u8 gMatchCallFlavorText_HexManiac_Valerie_Pokemon[] = _("Scary to meet at night.");
const u8 gMatchCallFlavorText_HexManiac_Valerie_Intro1[] = _("I see things that others");
const u8 gMatchCallFlavorText_HexManiac_Valerie_Intro2[] = _("can't see...");
const u8 gMatchCallFlavorText_Lady_Cindy_Strategy[] = _("Anything to win.");
const u8 gMatchCallFlavorText_Lady_Cindy_Pokemon[] = _("Gorgeous type!");
const u8 gMatchCallFlavorText_Lady_Cindy_Intro1[] = _("I have a pool specially for");
const u8 gMatchCallFlavorText_Lady_Cindy_Intro2[] = _("my POKéMON at home.");
const u8 gMatchCallFlavorText_Beauty_Thalia_Strategy[] = _("You'll fall under my spell!");
const u8 gMatchCallFlavorText_Beauty_Thalia_Pokemon[] = _("Mature WATER type.");
const u8 gMatchCallFlavorText_Beauty_Thalia_Intro1[] = _("I dream of cruising around");
const u8 gMatchCallFlavorText_Beauty_Thalia_Intro2[] = _("the world on a luxury liner.");
const u8 gMatchCallFlavorText_Beauty_Jessica_Strategy[] = _("I'll lead you astray.");
const u8 gMatchCallFlavorText_Beauty_Jessica_Pokemon[] = _("Cute, of course.");
const u8 gMatchCallFlavorText_Beauty_Jessica_Intro1[] = _("I love the SAFARI ZONE.");
const u8 gMatchCallFlavorText_Beauty_Jessica_Intro2[] = _("I seem to end up there.");
const u8 gMatchCallFlavorText_RichBoy_Winston_Strategy[] = _("Strategy? Who needs it?");
const u8 gMatchCallFlavorText_RichBoy_Winston_Pokemon[] = _("I spent big money on it!");
const u8 gMatchCallFlavorText_RichBoy_Winston_Intro1[] = _("I, being rich, sleep in a");
const u8 gMatchCallFlavorText_RichBoy_Winston_Intro2[] = _("custom POKéMON bed.");
const u8 gMatchCallFlavorText_PokeManiac_Steve_Strategy[] = _("Wrestle down with power.");
const u8 gMatchCallFlavorText_PokeManiac_Steve_Pokemon[] = _("Took all night to catch.");
const u8 gMatchCallFlavorText_PokeManiac_Steve_Intro1[] = _("Big, burly, and buff");
const u8 gMatchCallFlavorText_PokeManiac_Steve_Intro2[] = _("POKéMON are the best...");
const u8 gMatchCallFlavorText_Swimmer_Tony_Strategy[] = _("Ram at full speed!");
const u8 gMatchCallFlavorText_Swimmer_Tony_Pokemon[] = _("Funky WATER type!");
const u8 gMatchCallFlavorText_Swimmer_Tony_Intro1[] = _("If I can't be out swimming,");
const u8 gMatchCallFlavorText_Swimmer_Tony_Intro2[] = _("I'll be pumping weights.");
const u8 gMatchCallFlavorText_BlackBelt_Nob_Strategy[] = _("Grand slam pummeling!");
const u8 gMatchCallFlavorText_BlackBelt_Nob_Pokemon[] = _("FIGHTING type.");
const u8 gMatchCallFlavorText_BlackBelt_Nob_Intro1[] = _("Not to brag, but I can bust");
const u8 gMatchCallFlavorText_BlackBelt_Nob_Intro2[] = _("ten roof tiles!");
const u8 gMatchCallFlavorText_BlackBelt_Koji_Strategy[] = _("Witness karate power!");
const u8 gMatchCallFlavorText_BlackBelt_Koji_Pokemon[] = _("My partners in training!");
const u8 gMatchCallFlavorText_BlackBelt_Koji_Intro1[] = _("Let us discuss matters of");
const u8 gMatchCallFlavorText_BlackBelt_Koji_Intro2[] = _("the world with bare fists!");
const u8 gMatchCallFlavorText_Guitarist_Fernando_Strategy[] = _("Rock to stunning sounds!");
const u8 gMatchCallFlavorText_Guitarist_Fernando_Pokemon[] = _("Electric-and-sound combo!");
const u8 gMatchCallFlavorText_Guitarist_Fernando_Intro1[] = _("My compositions will shock");
const u8 gMatchCallFlavorText_Guitarist_Fernando_Intro2[] = _("you and stun you!");
const u8 gMatchCallFlavorText_Guitarist_Dalton_Strategy[] = _("I'll electrify you!");
const u8 gMatchCallFlavorText_Guitarist_Dalton_Pokemon[] = _("They're ELECTRIC!");
const u8 gMatchCallFlavorText_Guitarist_Dalton_Intro1[] = _("I want to make people cry");
const u8 gMatchCallFlavorText_Guitarist_Dalton_Intro2[] = _("with songs from my heart.");
const u8 gMatchCallFlavorText_Kindler_Bernie_Strategy[] = _("Burn it all down!");
const u8 gMatchCallFlavorText_Kindler_Bernie_Pokemon[] = _("Burn-inducing POKéMON.");
const u8 gMatchCallFlavorText_Kindler_Bernie_Intro1[] = _("When you light a campfire,");
const u8 gMatchCallFlavorText_Kindler_Bernie_Intro2[] = _("be sure there's some water.");
const u8 gMatchCallFlavorText_Camper_Ethan_Strategy[] = _("Hang in and be tenacious!");
const u8 gMatchCallFlavorText_Camper_Ethan_Pokemon[] = _("I'll raise any POKéMON.");
const u8 gMatchCallFlavorText_Camper_Ethan_Intro1[] = _("POKéMON raised in the wild");
const u8 gMatchCallFlavorText_Camper_Ethan_Intro2[] = _("grow strong!");
const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Strategy[] = _("Our love lets us prevail.");
const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Pokemon[] = _("We've had them for years.");
const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Intro1[] = _("Married 50 years, we've");
const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Intro2[] = _("devotedly raised POKéMON.");
const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Strategy[] = _("Attack in waves!");
const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Pokemon[] = _("BUG POKéMON are cool.");
const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Intro1[] = _("I go into the forest every");
const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Intro2[] = _("day to catch BUG POKéMON.");
const u8 gMatchCallFlavorText_Psychic_Cameron_Strategy[] = _("Daze and confuse!");
const u8 gMatchCallFlavorText_Psychic_Cameron_Pokemon[] = _("Ones with weird powers.");
const u8 gMatchCallFlavorText_Psychic_Cameron_Intro1[] = _("I can see through exactly");
const u8 gMatchCallFlavorText_Psychic_Cameron_Intro2[] = _("what you're thinking!");
const u8 gMatchCallFlavorText_Psychic_Jacki_Strategy[] = _("Battle at full power.");
const u8 gMatchCallFlavorText_Psychic_Jacki_Pokemon[] = _("POKéMON of many mysteries.");
const u8 gMatchCallFlavorText_Psychic_Jacki_Intro1[] = _("When we spoke, I was really");
const u8 gMatchCallFlavorText_Psychic_Jacki_Intro2[] = _("using telepathy.");
const u8 gMatchCallFlavorText_Gentleman_Walter_Strategy[] = _("Calm and collected.");
const u8 gMatchCallFlavorText_Gentleman_Walter_Pokemon[] = _("POKéMON of distinction.");
const u8 gMatchCallFlavorText_Gentleman_Walter_Intro1[] = _("We enjoy a spot of tea");
const u8 gMatchCallFlavorText_Gentleman_Walter_Intro2[] = _("every day. It's imported.");
const u8 gMatchCallFlavorText_SchoolKid_Karen_Strategy[] = _("I use my head to battle.");
const u8 gMatchCallFlavorText_SchoolKid_Karen_Pokemon[] = _("I love any kind of POKéMON!");
const u8 gMatchCallFlavorText_SchoolKid_Karen_Intro1[] = _("My daddy gives me spending");
const u8 gMatchCallFlavorText_SchoolKid_Karen_Intro2[] = _("money if I ace a test.");
const u8 gMatchCallFlavorText_SchoolKid_Jerry_Strategy[] = _("My knowledge rules!");
const u8 gMatchCallFlavorText_SchoolKid_Jerry_Pokemon[] = _("Any smart POKéMON!");
const u8 gMatchCallFlavorText_SchoolKid_Jerry_Intro1[] = _("I want to be a POKéMON");
const u8 gMatchCallFlavorText_SchoolKid_Jerry_Intro2[] = _("researcher in the future.");
const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Strategy[] = _("We talk it over first.");
const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Pokemon[] = _("POKéMON that we both like.");
const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Intro1[] = _("We're senior and junior");
const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Intro2[] = _("students into POKéMON!");
const u8 gMatchCallFlavorText_Pokefan_Isabel_Strategy[] = _("Go for it, my dears!");
const u8 gMatchCallFlavorText_Pokefan_Isabel_Pokemon[] = _("I have no likes or dislikes.");
const u8 gMatchCallFlavorText_Pokefan_Isabel_Intro1[] = _("While out shopping for");
const u8 gMatchCallFlavorText_Pokefan_Isabel_Intro2[] = _("supper, I battle too.");
const u8 gMatchCallFlavorText_Pokefan_Miguel_Strategy[] = _("I battle with love!");
const u8 gMatchCallFlavorText_Pokefan_Miguel_Pokemon[] = _("A POKéMON raised with love!");
const u8 gMatchCallFlavorText_Pokefan_Miguel_Intro1[] = _("It's important to build");
const u8 gMatchCallFlavorText_Pokefan_Miguel_Intro2[] = _("trust with your POKéMON.");
const u8 gMatchCallFlavorText_Expert_Timothy_Strategy[] = _("I see through your moves!");
const u8 gMatchCallFlavorText_Expert_Timothy_Pokemon[] = _("The essence of FIGHTING.");
const u8 gMatchCallFlavorText_Expert_Timothy_Intro1[] = _("I'm not ready to give way");
const u8 gMatchCallFlavorText_Expert_Timothy_Intro2[] = _("to the young yet!");
const u8 gMatchCallFlavorText_Expert_Shelby_Strategy[] = _("Attack while defending.");
const u8 gMatchCallFlavorText_Expert_Shelby_Pokemon[] = _("The FIGHTING type.");
const u8 gMatchCallFlavorText_Expert_Shelby_Intro1[] = _("Being old, I have my own");
const u8 gMatchCallFlavorText_Expert_Shelby_Intro2[] = _("style of battling.");
const u8 gMatchCallFlavorText_Youngster_Calvin_Strategy[] = _("I do what I can.");
const u8 gMatchCallFlavorText_Youngster_Calvin_Pokemon[] = _("I use different types.");
const u8 gMatchCallFlavorText_Youngster_Calvin_Intro1[] = _("I'm going to keep working");
const u8 gMatchCallFlavorText_Youngster_Calvin_Intro2[] = _("until I beat a GYM LEADER.");
const u8 gMatchCallFlavorText_Fisherman_Elliot_Strategy[] = _("I battle patiently.");
const u8 gMatchCallFlavorText_Fisherman_Elliot_Pokemon[] = _("WATER POKéMON to battle!");
const u8 gMatchCallFlavorText_Fisherman_Elliot_Intro1[] = _("I'm the world's only guy to");
const u8 gMatchCallFlavorText_Fisherman_Elliot_Intro2[] = _("catch a huge POKéMON!");
const u8 gMatchCallFlavorText_Triathlete_Isaiah_Strategy[] = _("Exploit the environment!");
const u8 gMatchCallFlavorText_Triathlete_Isaiah_Pokemon[] = _("All hail the WATER type!");
const u8 gMatchCallFlavorText_Triathlete_Isaiah_Intro1[] = _("I won't be beaten by some");
const u8 gMatchCallFlavorText_Triathlete_Isaiah_Intro2[] = _("beach bum SWIMMER!");
const u8 gMatchCallFlavorText_Triathlete_Maria_Strategy[] = _("Speed above all!");
const u8 gMatchCallFlavorText_Triathlete_Maria_Pokemon[] = _("I use a speedy POKéMON.");
const u8 gMatchCallFlavorText_Triathlete_Maria_Intro1[] = _("A marathon is a challenge");
const u8 gMatchCallFlavorText_Triathlete_Maria_Intro2[] = _("against your own self.");
const u8 gMatchCallFlavorText_Triathlete_Abigail_Strategy[] = _("Defense is crucial.");
const u8 gMatchCallFlavorText_Triathlete_Abigail_Pokemon[] = _("My POKéMON is solid.");
const u8 gMatchCallFlavorText_Triathlete_Abigail_Intro1[] = _("I started this for dieting,");
const u8 gMatchCallFlavorText_Triathlete_Abigail_Intro2[] = _("but I got right into it.");
const u8 gMatchCallFlavorText_Triathlete_Dylan_Strategy[] = _("Strike before stricken!");
const u8 gMatchCallFlavorText_Triathlete_Dylan_Pokemon[] = _("A fast-running POKéMON!");
const u8 gMatchCallFlavorText_Triathlete_Dylan_Intro1[] = _("If you ran and ran, you'd");
const u8 gMatchCallFlavorText_Triathlete_Dylan_Intro2[] = _("become one with the wind.");
const u8 gMatchCallFlavorText_Triathlete_Katelyn_Strategy[] = _("All-out offensive!");
const u8 gMatchCallFlavorText_Triathlete_Katelyn_Pokemon[] = _("WATER POKéMON rule!");
const u8 gMatchCallFlavorText_Triathlete_Katelyn_Intro1[] = _("I must swim over 6 miles");
const u8 gMatchCallFlavorText_Triathlete_Katelyn_Intro2[] = _("every day.");
const u8 gMatchCallFlavorText_Triathlete_Benjamin_Strategy[] = _("Push and push again!");
const u8 gMatchCallFlavorText_Triathlete_Benjamin_Pokemon[] = _("The strength of STEEL.");
const u8 gMatchCallFlavorText_Triathlete_Benjamin_Intro1[] = _("If you're sweating, get");
const u8 gMatchCallFlavorText_Triathlete_Benjamin_Intro2[] = _("fluids into you regularly.");
const u8 gMatchCallFlavorText_Triathlete_Pablo_Strategy[] = _("Draw the power of WATER.");
const u8 gMatchCallFlavorText_Triathlete_Pablo_Pokemon[] = _("Toughened WATER POKéMON.");
const u8 gMatchCallFlavorText_Triathlete_Pablo_Intro1[] = _("Training POKéMON is good,");
const u8 gMatchCallFlavorText_Triathlete_Pablo_Intro2[] = _("but don't neglect yourself.");
const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Strategy[] = _("It's about POKéMON power!");
const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Pokemon[] = _("See the power of DRAGONS!");
const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Intro1[] = _("I'll become legendary as the");
const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Intro2[] = _("strongest one day!");
const u8 gMatchCallFlavorText_BirdKeeper_Robert_Strategy[] = _("I'll show you my technique!");
const u8 gMatchCallFlavorText_BirdKeeper_Robert_Pokemon[] = _("Elegantly wheeling BIRDS.");
const u8 gMatchCallFlavorText_BirdKeeper_Robert_Intro1[] = _("My BIRD POKéMON, deliver my");
const u8 gMatchCallFlavorText_BirdKeeper_Robert_Intro2[] = _("love to that girl!");
const u8 gMatchCallFlavorText_NinjaBoy_Lao_Strategy[] = _("You'll suffer from poison!");
const u8 gMatchCallFlavorText_NinjaBoy_Lao_Pokemon[] = _("Poisonous POKéMON.");
const u8 gMatchCallFlavorText_NinjaBoy_Lao_Intro1[] = _("I undertake training so");
const u8 gMatchCallFlavorText_NinjaBoy_Lao_Intro2[] = _("that I may become a ninja.");
const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Strategy[] = _("The first strike wins!");
const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Pokemon[] = _("Speedy FIGHTING type.");
const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Intro1[] = _("If my POKéMON lose,");
const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Intro2[] = _("I'll carry on the fight!");
const u8 gMatchCallFlavorText_ParasolLady_Madeline_Strategy[] = _("Go, go, my POKéMON!");
const u8 gMatchCallFlavorText_ParasolLady_Madeline_Pokemon[] = _("I'll raise anything.");
const u8 gMatchCallFlavorText_ParasolLady_Madeline_Intro1[] = _("UV rays are your skin's");
const u8 gMatchCallFlavorText_ParasolLady_Madeline_Intro2[] = _("enemy. Get protected.");
const u8 gMatchCallFlavorText_Swimmer_Jenny_Strategy[] = _("No mercy!");
const u8 gMatchCallFlavorText_Swimmer_Jenny_Pokemon[] = _("Cute WATER POKéMON.");
const u8 gMatchCallFlavorText_Swimmer_Jenny_Intro1[] = _("I have too many fans.");
const u8 gMatchCallFlavorText_Swimmer_Jenny_Intro2[] = _("I was interviewed on TV.");
const u8 gMatchCallFlavorText_Picnicker_Diana_Strategy[] = _("I think about this & that.");
const u8 gMatchCallFlavorText_Picnicker_Diana_Pokemon[] = _("I like all POKéMON.");
const u8 gMatchCallFlavorText_Picnicker_Diana_Intro1[] = _("What lies beyond that");
const u8 gMatchCallFlavorText_Picnicker_Diana_Intro2[] = _("yonder hill?");
const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Strategy[] = _("We battle together!");
const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Pokemon[] = _("We train together!");
const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Intro1[] = _("We like the same POKéMON,");
const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Intro2[] = _("but different desserts.");
const u8 gMatchCallFlavorText_Sailor_Ernest_Strategy[] = _("I force things with power!");
const u8 gMatchCallFlavorText_Sailor_Ernest_Pokemon[] = _("WATER and FIGHTING types.");
const u8 gMatchCallFlavorText_Sailor_Ernest_Intro1[] = _("Seamen are rough spirits!");
const u8 gMatchCallFlavorText_Sailor_Ernest_Intro2[] = _("Any complaints?");
const u8 gMatchCallFlavorText_Sailor_Cory_Strategy[] = _("Up for a fight anytime!");
const u8 gMatchCallFlavorText_Sailor_Cory_Pokemon[] = _("WATER POKéMON are my faves!");
const u8 gMatchCallFlavorText_Sailor_Cory_Intro1[] = _("If you want to shout loud,");
const u8 gMatchCallFlavorText_Sailor_Cory_Intro2[] = _("suck in air with your belly!");
const u8 gMatchCallFlavorText_Collector_Edwin_Strategy[] = _("Protect POKéMON from harm.");
const u8 gMatchCallFlavorText_Collector_Edwin_Pokemon[] = _("I love rare POKéMON.");
const u8 gMatchCallFlavorText_Collector_Edwin_Intro1[] = _("I want to collect all the");
const u8 gMatchCallFlavorText_Collector_Edwin_Intro2[] = _("world's rare POKéMON.");
const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Strategy[] = _("I count on power.");
const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Pokemon[] = _("POKéMON are my children.");
const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Intro1[] = _("It takes knowledge and");
const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Intro2[] = _("love to raise POKéMON.");
const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Strategy[] = _("Full-on attack!");
const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Pokemon[] = _("Anything. I'll raise it.");
const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Intro1[] = _("I give them {POKEBLOCK}S for");
const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Intro2[] = _("going after CONTEST titles.");
const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Strategy[] = _("I raise POKéMON with care.");
const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Pokemon[] = _("Fun-to-raise POKéMON.");
const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Intro1[] = _("Treat every POKéMON you");
const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Intro2[] = _("meet with respect.");
const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Strategy[] = _("I believe in my POKéMON.");
const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Pokemon[] = _("I like strong POKéMON.");
const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Intro1[] = _("I'm training for rescue");
const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Intro2[] = _("work with my POKéMON.");
const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Strategy[] = _("Attack in waves!");
const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Pokemon[] = _("I use different types.");
const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Intro1[] = _("Those who destroy nature");
const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Intro2[] = _("must never be forgiven!");
const u8 gMatchCallFlavorText_Lass_Haley_Strategy[] = _("I'll show you some guts!");
const u8 gMatchCallFlavorText_Lass_Haley_Pokemon[] = _("Cute POKéMON are my faves!");
const u8 gMatchCallFlavorText_Lass_Haley_Intro1[] = _("After a battle, I always");
const u8 gMatchCallFlavorText_Lass_Haley_Intro2[] = _("bathe with my POKéMON.");
const u8 gMatchCallFlavorText_BugCatcher_James_Strategy[] = _("Lightning-fast attack!");
const u8 gMatchCallFlavorText_BugCatcher_James_Pokemon[] = _("BUG POKéMON are number 1!");
const u8 gMatchCallFlavorText_BugCatcher_James_Intro1[] = _("If you want to catch BUG");
const u8 gMatchCallFlavorText_BugCatcher_James_Intro2[] = _("POKéMON, wake up early.");
const u8 gMatchCallFlavorText_Hiker_Trent_Strategy[] = _("I battle with power.");
const u8 gMatchCallFlavorText_Hiker_Trent_Pokemon[] = _("Hard-bodied POKéMON.");
const u8 gMatchCallFlavorText_Hiker_Trent_Intro1[] = _("I've been planning a month");
const u8 gMatchCallFlavorText_Hiker_Trent_Intro2[] = _("for today's hike.");
const u8 gMatchCallFlavorText_Hiker_Sawyer_Strategy[] = _("I like it hot!");
const u8 gMatchCallFlavorText_Hiker_Sawyer_Pokemon[] = _("Hot POKéMON!");
const u8 gMatchCallFlavorText_Hiker_Sawyer_Intro1[] = _("As much as I love POKéMON,");
const u8 gMatchCallFlavorText_Hiker_Sawyer_Intro2[] = _("I surely like hiking!");
const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Strategy[] = _("Lovey-dovey strategy!");
const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Pokemon[] = _("Lovey-dovey POKéMON!");
const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Intro1[] = _("We're lovey-dovey!");
const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Intro2[] = _("Forever lovey-dovey!");
const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Strategy[] = _("We let it all hang out.");
const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Pokemon[] = _("The 1st POKéMON I caught.");
const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Intro1[] = _("POKéMON and I have grown");
const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Intro2[] = _("stronger together.");
const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Strategy[] = _("ROCK-type power attack.");
const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Pokemon[] = _("I prefer rock-hard POKéMON.");
const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Intro1[] = _("A LEADER of a big GYM bears");
const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Intro2[] = _("a lot of responsibility.");
const u8 gMatchCallFlavorText_TheBigHit_Brawly_Strategy[] = _("Direct physical action!");
const u8 gMatchCallFlavorText_TheBigHit_Brawly_Pokemon[] = _("FIGHTING POKéMON rule!");
const u8 gMatchCallFlavorText_TheBigHit_Brawly_Intro1[] = _("The world awaits me as the");
const u8 gMatchCallFlavorText_TheBigHit_Brawly_Intro2[] = _("next big wave!");
const u8 gMatchCallFlavorText_SwellShock_Wattson_Strategy[] = _("I choose to electrify.");
const u8 gMatchCallFlavorText_SwellShock_Wattson_Pokemon[] = _("Get shocked by electricity!");
const u8 gMatchCallFlavorText_SwellShock_Wattson_Intro1[] = _("One must never throw a");
const u8 gMatchCallFlavorText_SwellShock_Wattson_Intro2[] = _("match. Even I must not.");
const u8 gMatchCallFlavorText_PassionBurn_Flannery_Strategy[] = _("Battle aggressively.");
const u8 gMatchCallFlavorText_PassionBurn_Flannery_Pokemon[] = _("Burn with passion!");
const u8 gMatchCallFlavorText_PassionBurn_Flannery_Intro1[] = _("Completely wash away daily");
const u8 gMatchCallFlavorText_PassionBurn_Flannery_Intro2[] = _("fatigue in hot springs!");
const u8 gMatchCallFlavorText_ReliableOne_Dad_Strategy[] = _("I flexibly adapt my style.");
const u8 gMatchCallFlavorText_ReliableOne_Dad_Pokemon[] = _("Grown in a balanced manner.");
const u8 gMatchCallFlavorText_ReliableOne_Dad_Intro1[] = _("I walk the 30 minutes from");
const u8 gMatchCallFlavorText_ReliableOne_Dad_Intro2[] = _("home to here every day.");
const u8 gMatchCallFlavorText_SkyTamer_Winona_Strategy[] = _("I take advantage of speed.");
const u8 gMatchCallFlavorText_SkyTamer_Winona_Pokemon[] = _("Graceful sky dancers.");
const u8 gMatchCallFlavorText_SkyTamer_Winona_Intro1[] = _("The ultimate would be to");
const u8 gMatchCallFlavorText_SkyTamer_Winona_Intro2[] = _("live as one with nature.");
const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Strategy[] = _("We battle in cooperation.");
const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Pokemon[] = _("Always friendly POKéMON.");
const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Intro1[] = _("Papa has trouble telling");
const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Intro2[] = _("the two of us apart!");
const u8 gMatchCallFlavorText_DandyCharm_Juan_Strategy[] = _("I use splendid waterpower.");
const u8 gMatchCallFlavorText_DandyCharm_Juan_Pokemon[] = _("POKéMON of elegance!");
const u8 gMatchCallFlavorText_DandyCharm_Juan_Intro1[] = _("The adulation of beautiful");
const u8 gMatchCallFlavorText_DandyCharm_Juan_Intro2[] = _("ladies fills me with energy!");
const u8 gMatchCallFlavorText_EliteFour_Sidney_Strategy[] = _("Offense over defense!");
const u8 gMatchCallFlavorText_EliteFour_Sidney_Pokemon[] = _("The DARK side's beauties.");
const u8 gMatchCallFlavorText_EliteFour_Sidney_Intro1[] = _("They said I was a punk, but");
const u8 gMatchCallFlavorText_EliteFour_Sidney_Intro2[] = _("I'm one of the ELITE FOUR!");
const u8 gMatchCallFlavorText_EliteFour_Phoebe_Strategy[] = _("Confuse and confound.");
const u8 gMatchCallFlavorText_EliteFour_Phoebe_Pokemon[] = _("There's nothing definite.");
const u8 gMatchCallFlavorText_EliteFour_Phoebe_Intro1[] = _("I wonder how my grandma at");
const u8 gMatchCallFlavorText_EliteFour_Phoebe_Intro2[] = _("MT. PYRE is doing?");
const u8 gMatchCallFlavorText_EliteFour_Glacia_Strategy[] = _("I use items for help.");
const u8 gMatchCallFlavorText_EliteFour_Glacia_Pokemon[] = _("Flaming passion in icy cold!");
const u8 gMatchCallFlavorText_EliteFour_Glacia_Intro1[] = _("The ICE type can be better");
const u8 gMatchCallFlavorText_EliteFour_Glacia_Intro2[] = _("trained in this hot land.");
const u8 gMatchCallFlavorText_EliteFour_Drake_Strategy[] = _("Harness strong abilities.");
const u8 gMatchCallFlavorText_EliteFour_Drake_Pokemon[] = _("The raw power of DRAGONS!");
const u8 gMatchCallFlavorText_EliteFour_Drake_Intro1[] = _("I dedicate myself to the");
const u8 gMatchCallFlavorText_EliteFour_Drake_Intro2[] = _("POKéMON that saved me.");
const u8 gMatchCallFlavorText_Champion_Wallace_Strategy[] = _("Dignity and respect.");
const u8 gMatchCallFlavorText_Champion_Wallace_Pokemon[] = _("I prefer POKéMON of grace.");
const u8 gMatchCallFlavorText_Champion_Wallace_Intro1[] = _("I represent beauty as");
const u8 gMatchCallFlavorText_Champion_Wallace_Intro2[] = _("well as intelligence.");
const u8 *const gMatchCallMessages[][4] =
const u8 gText_MatchCallAromaLady_Rose_Strategy[] = _("Becalm fighting emotions.");
const u8 gText_MatchCallAromaLady_Rose_Pokemon[] = _("Fragrant GRASS POKéMON.");
const u8 gText_MatchCallAromaLady_Rose_Intro1[] = _("Soothing aromas make the");
const u8 gText_MatchCallAromaLady_Rose_Intro2[] = _("body and mind healthy.");
const u8 gText_MatchCallRuinManiac_Andres_Strategy[] = _("I'm not very good at this.");
const u8 gText_MatchCallRuinManiac_Andres_Pokemon[] = _("Ruin-exploration partners.");
const u8 gText_MatchCallRuinManiac_Andres_Intro1[] = _("I am searching for undersea");
const u8 gText_MatchCallRuinManiac_Andres_Intro2[] = _("ruins and relics.");
const u8 gText_MatchCallRuinManiac_Dusty_Strategy[] = _("Overwhelm with power!");
const u8 gText_MatchCallRuinManiac_Dusty_Pokemon[] = _("Craggy ROCK POKéMON.");
const u8 gText_MatchCallRuinManiac_Dusty_Intro1[] = _("In search of ancient lore,");
const u8 gText_MatchCallRuinManiac_Dusty_Intro2[] = _("I travel the world.");
const u8 gText_MatchCallTuber_Lola_Strategy[] = _("I'm going to try hard!");
const u8 gText_MatchCallTuber_Lola_Pokemon[] = _("Good swimmer POKéMON.");
const u8 gText_MatchCallTuber_Lola_Intro1[] = _("I wish I could swim without");
const u8 gText_MatchCallTuber_Lola_Intro2[] = _("using an inner tube.");
const u8 gText_MatchCallTuber_Ricky_Strategy[] = _("I don't know. I'll try hard.");
const u8 gText_MatchCallTuber_Ricky_Pokemon[] = _("WATER POKéMON are buddies.");
const u8 gText_MatchCallTuber_Ricky_Intro1[] = _("It's not like I can't swim.");
const u8 gText_MatchCallTuber_Ricky_Intro2[] = _("I just like my inner tube.");
const u8 gText_MatchCallSisAndBro_LilaAndRoy_Strategy[] = _("We split our duties.");
const u8 gText_MatchCallSisAndBro_LilaAndRoy_Pokemon[] = _("We like friendly POKéMON.");
const u8 gText_MatchCallSisAndBro_LilaAndRoy_Intro1[] = _("We enjoy POKéMON together");
const u8 gText_MatchCallSisAndBro_LilaAndRoy_Intro2[] = _("as sister and brother.");
const u8 gText_MatchCallCooltrainer_Cristin_Strategy[] = _("I finish with power moves!");
const u8 gText_MatchCallCooltrainer_Cristin_Pokemon[] = _("A mix of different types.");
const u8 gText_MatchCallCooltrainer_Cristin_Intro1[] = _("I aim to become the ultimate");
const u8 gText_MatchCallCooltrainer_Cristin_Intro2[] = _("TRAINER!");
const u8 gText_MatchCallCooltrainer_Brooke_Strategy[] = _("Exploit the foe's weakness.");
const u8 gText_MatchCallCooltrainer_Brooke_Pokemon[] = _("Balance is crucial.");
const u8 gText_MatchCallCooltrainer_Brooke_Intro1[] = _("My goal is to become the");
const u8 gText_MatchCallCooltrainer_Brooke_Intro2[] = _("POKéMON CHAMPION.");
const u8 gText_MatchCallCooltrainer_Wilton_Strategy[] = _("Upset the opponent.");
const u8 gText_MatchCallCooltrainer_Wilton_Pokemon[] = _("Type doesn't matter.");
const u8 gText_MatchCallCooltrainer_Wilton_Intro1[] = _("I'm a top student at the");
const u8 gText_MatchCallCooltrainer_Wilton_Intro2[] = _("TRAINER'S SCHOOL.");
const u8 gText_MatchCallHexManiac_Valerie_Strategy[] = _("Slow, steady suffering.");
const u8 gText_MatchCallHexManiac_Valerie_Pokemon[] = _("Scary to meet at night.");
const u8 gText_MatchCallHexManiac_Valerie_Intro1[] = _("I see things that others");
const u8 gText_MatchCallHexManiac_Valerie_Intro2[] = _("can't see...");
const u8 gText_MatchCallLady_Cindy_Strategy[] = _("Anything to win.");
const u8 gText_MatchCallLady_Cindy_Pokemon[] = _("Gorgeous type!");
const u8 gText_MatchCallLady_Cindy_Intro1[] = _("I have a pool specially for");
const u8 gText_MatchCallLady_Cindy_Intro2[] = _("my POKéMON at home.");
const u8 gText_MatchCallBeauty_Thalia_Strategy[] = _("You'll fall under my spell!");
const u8 gText_MatchCallBeauty_Thalia_Pokemon[] = _("Mature WATER type.");
const u8 gText_MatchCallBeauty_Thalia_Intro1[] = _("I dream of cruising around");
const u8 gText_MatchCallBeauty_Thalia_Intro2[] = _("the world on a luxury liner.");
const u8 gText_MatchCallBeauty_Jessica_Strategy[] = _("I'll lead you astray.");
const u8 gText_MatchCallBeauty_Jessica_Pokemon[] = _("Cute, of course.");
const u8 gText_MatchCallBeauty_Jessica_Intro1[] = _("I love the SAFARI ZONE.");
const u8 gText_MatchCallBeauty_Jessica_Intro2[] = _("I seem to end up there.");
const u8 gText_MatchCallRichBoy_Winston_Strategy[] = _("Strategy? Who needs it?");
const u8 gText_MatchCallRichBoy_Winston_Pokemon[] = _("I spent big money on it!");
const u8 gText_MatchCallRichBoy_Winston_Intro1[] = _("I, being rich, sleep in a");
const u8 gText_MatchCallRichBoy_Winston_Intro2[] = _("custom POKéMON bed.");
const u8 gText_MatchCallPokeManiac_Steve_Strategy[] = _("Wrestle down with power.");
const u8 gText_MatchCallPokeManiac_Steve_Pokemon[] = _("Took all night to catch.");
const u8 gText_MatchCallPokeManiac_Steve_Intro1[] = _("Big, burly, and buff");
const u8 gText_MatchCallPokeManiac_Steve_Intro2[] = _("POKéMON are the best...");
const u8 gText_MatchCallSwimmer_Tony_Strategy[] = _("Ram at full speed!");
const u8 gText_MatchCallSwimmer_Tony_Pokemon[] = _("Funky WATER type!");
const u8 gText_MatchCallSwimmer_Tony_Intro1[] = _("If I can't be out swimming,");
const u8 gText_MatchCallSwimmer_Tony_Intro2[] = _("I'll be pumping weights.");
const u8 gText_MatchCallBlackBelt_Nob_Strategy[] = _("Grand slam pummeling!");
const u8 gText_MatchCallBlackBelt_Nob_Pokemon[] = _("FIGHTING type.");
const u8 gText_MatchCallBlackBelt_Nob_Intro1[] = _("Not to brag, but I can bust");
const u8 gText_MatchCallBlackBelt_Nob_Intro2[] = _("ten roof tiles!");
const u8 gText_MatchCallBlackBelt_Koji_Strategy[] = _("Witness karate power!");
const u8 gText_MatchCallBlackBelt_Koji_Pokemon[] = _("My partners in training!");
const u8 gText_MatchCallBlackBelt_Koji_Intro1[] = _("Let us discuss matters of");
const u8 gText_MatchCallBlackBelt_Koji_Intro2[] = _("the world with bare fists!");
const u8 gText_MatchCallGuitarist_Fernando_Strategy[] = _("Rock to stunning sounds!");
const u8 gText_MatchCallGuitarist_Fernando_Pokemon[] = _("Electric-and-sound combo!");
const u8 gText_MatchCallGuitarist_Fernando_Intro1[] = _("My compositions will shock");
const u8 gText_MatchCallGuitarist_Fernando_Intro2[] = _("you and stun you!");
const u8 gText_MatchCallGuitarist_Dalton_Strategy[] = _("I'll electrify you!");
const u8 gText_MatchCallGuitarist_Dalton_Pokemon[] = _("They're ELECTRIC!");
const u8 gText_MatchCallGuitarist_Dalton_Intro1[] = _("I want to make people cry");
const u8 gText_MatchCallGuitarist_Dalton_Intro2[] = _("with songs from my heart.");
const u8 gText_MatchCallKindler_Bernie_Strategy[] = _("Burn it all down!");
const u8 gText_MatchCallKindler_Bernie_Pokemon[] = _("Burn-inducing POKéMON.");
const u8 gText_MatchCallKindler_Bernie_Intro1[] = _("When you light a campfire,");
const u8 gText_MatchCallKindler_Bernie_Intro2[] = _("be sure there's some water.");
const u8 gText_MatchCallCamper_Ethan_Strategy[] = _("Hang in and be tenacious!");
const u8 gText_MatchCallCamper_Ethan_Pokemon[] = _("I'll raise any POKéMON.");
const u8 gText_MatchCallCamper_Ethan_Intro1[] = _("POKéMON raised in the wild");
const u8 gText_MatchCallCamper_Ethan_Intro2[] = _("grow strong!");
const u8 gText_MatchCallOldCouple_JohnAndJay_Strategy[] = _("Our love lets us prevail.");
const u8 gText_MatchCallOldCouple_JohnAndJay_Pokemon[] = _("We've had them for years.");
const u8 gText_MatchCallOldCouple_JohnAndJay_Intro1[] = _("Married 50 years, we've");
const u8 gText_MatchCallOldCouple_JohnAndJay_Intro2[] = _("devotedly raised POKéMON.");
const u8 gText_MatchCallBugManiac_Jeffrey_Strategy[] = _("Attack in waves!");
const u8 gText_MatchCallBugManiac_Jeffrey_Pokemon[] = _("BUG POKéMON are cool.");
const u8 gText_MatchCallBugManiac_Jeffrey_Intro1[] = _("I go into the forest every");
const u8 gText_MatchCallBugManiac_Jeffrey_Intro2[] = _("day to catch BUG POKéMON.");
const u8 gText_MatchCallPsychic_Cameron_Strategy[] = _("Daze and confuse!");
const u8 gText_MatchCallPsychic_Cameron_Pokemon[] = _("Ones with weird powers.");
const u8 gText_MatchCallPsychic_Cameron_Intro1[] = _("I can see through exactly");
const u8 gText_MatchCallPsychic_Cameron_Intro2[] = _("what you're thinking!");
const u8 gText_MatchCallPsychic_Jacki_Strategy[] = _("Battle at full power.");
const u8 gText_MatchCallPsychic_Jacki_Pokemon[] = _("POKéMON of many mysteries.");
const u8 gText_MatchCallPsychic_Jacki_Intro1[] = _("When we spoke, I was really");
const u8 gText_MatchCallPsychic_Jacki_Intro2[] = _("using telepathy.");
const u8 gText_MatchCallGentleman_Walter_Strategy[] = _("Calm and collected.");
const u8 gText_MatchCallGentleman_Walter_Pokemon[] = _("POKéMON of distinction.");
const u8 gText_MatchCallGentleman_Walter_Intro1[] = _("We enjoy a spot of tea");
const u8 gText_MatchCallGentleman_Walter_Intro2[] = _("every day. It's imported.");
const u8 gText_MatchCallSchoolKid_Karen_Strategy[] = _("I use my head to battle.");
const u8 gText_MatchCallSchoolKid_Karen_Pokemon[] = _("I love any kind of POKéMON!");
const u8 gText_MatchCallSchoolKid_Karen_Intro1[] = _("My daddy gives me spending");
const u8 gText_MatchCallSchoolKid_Karen_Intro2[] = _("money if I ace a test.");
const u8 gText_MatchCallSchoolKid_Jerry_Strategy[] = _("My knowledge rules!");
const u8 gText_MatchCallSchoolKid_Jerry_Pokemon[] = _("Any smart POKéMON!");
const u8 gText_MatchCallSchoolKid_Jerry_Intro1[] = _("I want to be a POKéMON");
const u8 gText_MatchCallSchoolKid_Jerry_Intro2[] = _("researcher in the future.");
const u8 gText_MatchCallSrAndJr_AnnaAndMeg_Strategy[] = _("We talk it over first.");
const u8 gText_MatchCallSrAndJr_AnnaAndMeg_Pokemon[] = _("POKéMON that we both like.");
const u8 gText_MatchCallSrAndJr_AnnaAndMeg_Intro1[] = _("We're senior and junior");
const u8 gText_MatchCallSrAndJr_AnnaAndMeg_Intro2[] = _("students into POKéMON!");
const u8 gText_MatchCallPokefan_Isabel_Strategy[] = _("Go for it, my dears!");
const u8 gText_MatchCallPokefan_Isabel_Pokemon[] = _("I have no likes or dislikes.");
const u8 gText_MatchCallPokefan_Isabel_Intro1[] = _("While out shopping for");
const u8 gText_MatchCallPokefan_Isabel_Intro2[] = _("supper, I battle too.");
const u8 gText_MatchCallPokefan_Miguel_Strategy[] = _("I battle with love!");
const u8 gText_MatchCallPokefan_Miguel_Pokemon[] = _("A POKéMON raised with love!");
const u8 gText_MatchCallPokefan_Miguel_Intro1[] = _("It's important to build");
const u8 gText_MatchCallPokefan_Miguel_Intro2[] = _("trust with your POKéMON.");
const u8 gText_MatchCallExpert_Timothy_Strategy[] = _("I see through your moves!");
const u8 gText_MatchCallExpert_Timothy_Pokemon[] = _("The essence of FIGHTING.");
const u8 gText_MatchCallExpert_Timothy_Intro1[] = _("I'm not ready to give way");
const u8 gText_MatchCallExpert_Timothy_Intro2[] = _("to the young yet!");
const u8 gText_MatchCallExpert_Shelby_Strategy[] = _("Attack while defending.");
const u8 gText_MatchCallExpert_Shelby_Pokemon[] = _("The FIGHTING type.");
const u8 gText_MatchCallExpert_Shelby_Intro1[] = _("Being old, I have my own");
const u8 gText_MatchCallExpert_Shelby_Intro2[] = _("style of battling.");
const u8 gText_MatchCallYoungster_Calvin_Strategy[] = _("I do what I can.");
const u8 gText_MatchCallYoungster_Calvin_Pokemon[] = _("I use different types.");
const u8 gText_MatchCallYoungster_Calvin_Intro1[] = _("I'm going to keep working");
const u8 gText_MatchCallYoungster_Calvin_Intro2[] = _("until I beat a GYM LEADER.");
const u8 gText_MatchCallFisherman_Elliot_Strategy[] = _("I battle patiently.");
const u8 gText_MatchCallFisherman_Elliot_Pokemon[] = _("WATER POKéMON to battle!");
const u8 gText_MatchCallFisherman_Elliot_Intro1[] = _("I'm the world's only guy to");
const u8 gText_MatchCallFisherman_Elliot_Intro2[] = _("catch a huge POKéMON!");
const u8 gText_MatchCallTriathlete_Isaiah_Strategy[] = _("Exploit the environment!");
const u8 gText_MatchCallTriathlete_Isaiah_Pokemon[] = _("All hail the WATER type!");
const u8 gText_MatchCallTriathlete_Isaiah_Intro1[] = _("I won't be beaten by some");
const u8 gText_MatchCallTriathlete_Isaiah_Intro2[] = _("beach bum SWIMMER!");
const u8 gText_MatchCallTriathlete_Maria_Strategy[] = _("Speed above all!");
const u8 gText_MatchCallTriathlete_Maria_Pokemon[] = _("I use a speedy POKéMON.");
const u8 gText_MatchCallTriathlete_Maria_Intro1[] = _("A marathon is a challenge");
const u8 gText_MatchCallTriathlete_Maria_Intro2[] = _("against your own self.");
const u8 gText_MatchCallTriathlete_Abigail_Strategy[] = _("Defense is crucial.");
const u8 gText_MatchCallTriathlete_Abigail_Pokemon[] = _("My POKéMON is solid.");
const u8 gText_MatchCallTriathlete_Abigail_Intro1[] = _("I started this for dieting,");
const u8 gText_MatchCallTriathlete_Abigail_Intro2[] = _("but I got right into it.");
const u8 gText_MatchCallTriathlete_Dylan_Strategy[] = _("Strike before stricken!");
const u8 gText_MatchCallTriathlete_Dylan_Pokemon[] = _("A fast-running POKéMON!");
const u8 gText_MatchCallTriathlete_Dylan_Intro1[] = _("If you ran and ran, you'd");
const u8 gText_MatchCallTriathlete_Dylan_Intro2[] = _("become one with the wind.");
const u8 gText_MatchCallTriathlete_Katelyn_Strategy[] = _("All-out offensive!");
const u8 gText_MatchCallTriathlete_Katelyn_Pokemon[] = _("WATER POKéMON rule!");
const u8 gText_MatchCallTriathlete_Katelyn_Intro1[] = _("I must swim over 6 miles");
const u8 gText_MatchCallTriathlete_Katelyn_Intro2[] = _("every day.");
const u8 gText_MatchCallTriathlete_Benjamin_Strategy[] = _("Push and push again!");
const u8 gText_MatchCallTriathlete_Benjamin_Pokemon[] = _("The strength of STEEL.");
const u8 gText_MatchCallTriathlete_Benjamin_Intro1[] = _("If you're sweating, get");
const u8 gText_MatchCallTriathlete_Benjamin_Intro2[] = _("fluids into you regularly.");
const u8 gText_MatchCallTriathlete_Pablo_Strategy[] = _("Draw the power of WATER.");
const u8 gText_MatchCallTriathlete_Pablo_Pokemon[] = _("Toughened WATER POKéMON.");
const u8 gText_MatchCallTriathlete_Pablo_Intro1[] = _("Training POKéMON is good,");
const u8 gText_MatchCallTriathlete_Pablo_Intro2[] = _("but don't neglect yourself.");
const u8 gText_MatchCallDragonTamer_Nicolas_Strategy[] = _("It's about POKéMON power!");
const u8 gText_MatchCallDragonTamer_Nicolas_Pokemon[] = _("See the power of DRAGONS!");
const u8 gText_MatchCallDragonTamer_Nicolas_Intro1[] = _("I'll become legendary as the");
const u8 gText_MatchCallDragonTamer_Nicolas_Intro2[] = _("strongest one day!");
const u8 gText_MatchCallBirdKeeper_Robert_Strategy[] = _("I'll show you my technique!");
const u8 gText_MatchCallBirdKeeper_Robert_Pokemon[] = _("Elegantly wheeling BIRDS.");
const u8 gText_MatchCallBirdKeeper_Robert_Intro1[] = _("My BIRD POKéMON, deliver my");
const u8 gText_MatchCallBirdKeeper_Robert_Intro2[] = _("love to that girl!");
const u8 gText_MatchCallNinjaBoy_Lao_Strategy[] = _("You'll suffer from poison!");
const u8 gText_MatchCallNinjaBoy_Lao_Pokemon[] = _("Poisonous POKéMON.");
const u8 gText_MatchCallNinjaBoy_Lao_Intro1[] = _("I undertake training so");
const u8 gText_MatchCallNinjaBoy_Lao_Intro2[] = _("that I may become a ninja.");
const u8 gText_MatchCallBattleGirl_Cyndy_Strategy[] = _("The first strike wins!");
const u8 gText_MatchCallBattleGirl_Cyndy_Pokemon[] = _("Speedy FIGHTING type.");
const u8 gText_MatchCallBattleGirl_Cyndy_Intro1[] = _("If my POKéMON lose,");
const u8 gText_MatchCallBattleGirl_Cyndy_Intro2[] = _("I'll carry on the fight!");
const u8 gText_MatchCallParasolLady_Madeline_Strategy[] = _("Go, go, my POKéMON!");
const u8 gText_MatchCallParasolLady_Madeline_Pokemon[] = _("I'll raise anything.");
const u8 gText_MatchCallParasolLady_Madeline_Intro1[] = _("UV rays are your skin's");
const u8 gText_MatchCallParasolLady_Madeline_Intro2[] = _("enemy. Get protected.");
const u8 gText_MatchCallSwimmer_Jenny_Strategy[] = _("No mercy!");
const u8 gText_MatchCallSwimmer_Jenny_Pokemon[] = _("Cute WATER POKéMON.");
const u8 gText_MatchCallSwimmer_Jenny_Intro1[] = _("I have too many fans.");
const u8 gText_MatchCallSwimmer_Jenny_Intro2[] = _("I was interviewed on TV.");
const u8 gText_MatchCallPicnicker_Diana_Strategy[] = _("I think about this & that.");
const u8 gText_MatchCallPicnicker_Diana_Pokemon[] = _("I like all POKéMON.");
const u8 gText_MatchCallPicnicker_Diana_Intro1[] = _("What lies beyond that");
const u8 gText_MatchCallPicnicker_Diana_Intro2[] = _("yonder hill?");
const u8 gText_MatchCallTwins_AmyAndLiv_Strategy[] = _("We battle together!");
const u8 gText_MatchCallTwins_AmyAndLiv_Pokemon[] = _("We train together!");
const u8 gText_MatchCallTwins_AmyAndLiv_Intro1[] = _("We like the same POKéMON,");
const u8 gText_MatchCallTwins_AmyAndLiv_Intro2[] = _("but different desserts.");
const u8 gText_MatchCallSailor_Ernest_Strategy[] = _("I force things with power!");
const u8 gText_MatchCallSailor_Ernest_Pokemon[] = _("WATER and FIGHTING types.");
const u8 gText_MatchCallSailor_Ernest_Intro1[] = _("Seamen are rough spirits!");
const u8 gText_MatchCallSailor_Ernest_Intro2[] = _("Any complaints?");
const u8 gText_MatchCallSailor_Cory_Strategy[] = _("Up for a fight anytime!");
const u8 gText_MatchCallSailor_Cory_Pokemon[] = _("WATER POKéMON are my faves!");
const u8 gText_MatchCallSailor_Cory_Intro1[] = _("If you want to shout loud,");
const u8 gText_MatchCallSailor_Cory_Intro2[] = _("suck in air with your belly!");
const u8 gText_MatchCallCollector_Edwin_Strategy[] = _("Protect POKéMON from harm.");
const u8 gText_MatchCallCollector_Edwin_Pokemon[] = _("I love rare POKéMON.");
const u8 gText_MatchCallCollector_Edwin_Intro1[] = _("I want to collect all the");
const u8 gText_MatchCallCollector_Edwin_Intro2[] = _("world's rare POKéMON.");
const u8 gText_MatchCallPkmnBreeder_Lydia_Strategy[] = _("I count on power.");
const u8 gText_MatchCallPkmnBreeder_Lydia_Pokemon[] = _("POKéMON are my children.");
const u8 gText_MatchCallPkmnBreeder_Lydia_Intro1[] = _("It takes knowledge and");
const u8 gText_MatchCallPkmnBreeder_Lydia_Intro2[] = _("love to raise POKéMON.");
const u8 gText_MatchCallPkmnBreeder_Isaac_Strategy[] = _("Full-on attack!");
const u8 gText_MatchCallPkmnBreeder_Isaac_Pokemon[] = _("Anything. I'll raise it.");
const u8 gText_MatchCallPkmnBreeder_Isaac_Intro1[] = _("I give them {POKEBLOCK}S for");
const u8 gText_MatchCallPkmnBreeder_Isaac_Intro2[] = _("going after CONTEST titles.");
const u8 gText_MatchCallPkmnBreeder_Gabrielle_Strategy[] = _("I raise POKéMON with care.");
const u8 gText_MatchCallPkmnBreeder_Gabrielle_Pokemon[] = _("Fun-to-raise POKéMON.");
const u8 gText_MatchCallPkmnBreeder_Gabrielle_Intro1[] = _("Treat every POKéMON you");
const u8 gText_MatchCallPkmnBreeder_Gabrielle_Intro2[] = _("meet with respect.");
const u8 gText_MatchCallPkmnRanger_Catherine_Strategy[] = _("I believe in my POKéMON.");
const u8 gText_MatchCallPkmnRanger_Catherine_Pokemon[] = _("I like strong POKéMON.");
const u8 gText_MatchCallPkmnRanger_Catherine_Intro1[] = _("I'm training for rescue");
const u8 gText_MatchCallPkmnRanger_Catherine_Intro2[] = _("work with my POKéMON.");
const u8 gText_MatchCallPkmnRanger_Jackson_Strategy[] = _("Attack in waves!");
const u8 gText_MatchCallPkmnRanger_Jackson_Pokemon[] = _("I use different types.");
const u8 gText_MatchCallPkmnRanger_Jackson_Intro1[] = _("Those who destroy nature");
const u8 gText_MatchCallPkmnRanger_Jackson_Intro2[] = _("must never be forgiven!");
const u8 gText_MatchCallLass_Haley_Strategy[] = _("I'll show you some guts!");
const u8 gText_MatchCallLass_Haley_Pokemon[] = _("Cute POKéMON are my faves!");
const u8 gText_MatchCallLass_Haley_Intro1[] = _("After a battle, I always");
const u8 gText_MatchCallLass_Haley_Intro2[] = _("bathe with my POKéMON.");
const u8 gText_MatchCallBugCatcher_James_Strategy[] = _("Lightning-fast attack!");
const u8 gText_MatchCallBugCatcher_James_Pokemon[] = _("BUG POKéMON are number 1!");
const u8 gText_MatchCallBugCatcher_James_Intro1[] = _("If you want to catch BUG");
const u8 gText_MatchCallBugCatcher_James_Intro2[] = _("POKéMON, wake up early.");
const u8 gText_MatchCallHiker_Trent_Strategy[] = _("I battle with power.");
const u8 gText_MatchCallHiker_Trent_Pokemon[] = _("Hard-bodied POKéMON.");
const u8 gText_MatchCallHiker_Trent_Intro1[] = _("I've been planning a month");
const u8 gText_MatchCallHiker_Trent_Intro2[] = _("for today's hike.");
const u8 gText_MatchCallHiker_Sawyer_Strategy[] = _("I like it hot!");
const u8 gText_MatchCallHiker_Sawyer_Pokemon[] = _("Hot POKéMON!");
const u8 gText_MatchCallHiker_Sawyer_Intro1[] = _("As much as I love POKéMON,");
const u8 gText_MatchCallHiker_Sawyer_Intro2[] = _("I surely like hiking!");
const u8 gText_MatchCallYoungCouple_LoisAndHal_Strategy[] = _("Lovey-dovey strategy!");
const u8 gText_MatchCallYoungCouple_LoisAndHal_Pokemon[] = _("Lovey-dovey POKéMON!");
const u8 gText_MatchCallYoungCouple_LoisAndHal_Intro1[] = _("We're lovey-dovey!");
const u8 gText_MatchCallYoungCouple_LoisAndHal_Intro2[] = _("Forever lovey-dovey!");
const u8 gText_MatchCallPkmnTrainer_Wally_Strategy[] = _("We let it all hang out.");
const u8 gText_MatchCallPkmnTrainer_Wally_Pokemon[] = _("The 1st POKéMON I caught.");
const u8 gText_MatchCallPkmnTrainer_Wally_Intro1[] = _("POKéMON and I have grown");
const u8 gText_MatchCallPkmnTrainer_Wally_Intro2[] = _("stronger together.");
const u8 gText_MatchCallRockinWhiz_Roxanne_Strategy[] = _("ROCK-type power attack.");
const u8 gText_MatchCallRockinWhiz_Roxanne_Pokemon[] = _("I prefer rock-hard POKéMON.");
const u8 gText_MatchCallRockinWhiz_Roxanne_Intro1[] = _("A LEADER of a big GYM bears");
const u8 gText_MatchCallRockinWhiz_Roxanne_Intro2[] = _("a lot of responsibility.");
const u8 gText_MatchCallTheBigHit_Brawly_Strategy[] = _("Direct physical action!");
const u8 gText_MatchCallTheBigHit_Brawly_Pokemon[] = _("FIGHTING POKéMON rule!");
const u8 gText_MatchCallTheBigHit_Brawly_Intro1[] = _("The world awaits me as the");
const u8 gText_MatchCallTheBigHit_Brawly_Intro2[] = _("next big wave!");
const u8 gText_MatchCallSwellShock_Wattson_Strategy[] = _("I choose to electrify.");
const u8 gText_MatchCallSwellShock_Wattson_Pokemon[] = _("Get shocked by electricity!");
const u8 gText_MatchCallSwellShock_Wattson_Intro1[] = _("One must never throw a");
const u8 gText_MatchCallSwellShock_Wattson_Intro2[] = _("match. Even I must not.");
const u8 gText_MatchCallPassionBurn_Flannery_Strategy[] = _("Battle aggressively.");
const u8 gText_MatchCallPassionBurn_Flannery_Pokemon[] = _("Burn with passion!");
const u8 gText_MatchCallPassionBurn_Flannery_Intro1[] = _("Completely wash away daily");
const u8 gText_MatchCallPassionBurn_Flannery_Intro2[] = _("fatigue in hot springs!");
const u8 gText_MatchCallReliableOne_Dad_Strategy[] = _("I flexibly adapt my style.");
const u8 gText_MatchCallReliableOne_Dad_Pokemon[] = _("Grown in a balanced manner.");
const u8 gText_MatchCallReliableOne_Dad_Intro1[] = _("I walk the 30 minutes from");
const u8 gText_MatchCallReliableOne_Dad_Intro2[] = _("home to here every day.");
const u8 gText_MatchCallSkyTamer_Winona_Strategy[] = _("I take advantage of speed.");
const u8 gText_MatchCallSkyTamer_Winona_Pokemon[] = _("Graceful sky dancers.");
const u8 gText_MatchCallSkyTamer_Winona_Intro1[] = _("The ultimate would be to");
const u8 gText_MatchCallSkyTamer_Winona_Intro2[] = _("live as one with nature.");
const u8 gText_MatchCallMysticDuo_TateAndLiza_Strategy[] = _("We battle in cooperation.");
const u8 gText_MatchCallMysticDuo_TateAndLiza_Pokemon[] = _("Always friendly POKéMON.");
const u8 gText_MatchCallMysticDuo_TateAndLiza_Intro1[] = _("Papa has trouble telling");
const u8 gText_MatchCallMysticDuo_TateAndLiza_Intro2[] = _("the two of us apart!");
const u8 gText_MatchCallDandyCharm_Juan_Strategy[] = _("I use splendid waterpower.");
const u8 gText_MatchCallDandyCharm_Juan_Pokemon[] = _("POKéMON of elegance!");
const u8 gText_MatchCallDandyCharm_Juan_Intro1[] = _("The adulation of beautiful");
const u8 gText_MatchCallDandyCharm_Juan_Intro2[] = _("ladies fills me with energy!");
const u8 gText_MatchCallEliteFour_Sidney_Strategy[] = _("Offense over defense!");
const u8 gText_MatchCallEliteFour_Sidney_Pokemon[] = _("The DARK side's beauties.");
const u8 gText_MatchCallEliteFour_Sidney_Intro1[] = _("They said I was a punk, but");
const u8 gText_MatchCallEliteFour_Sidney_Intro2[] = _("I'm one of the ELITE FOUR!");
const u8 gText_MatchCallEliteFour_Phoebe_Strategy[] = _("Confuse and confound.");
const u8 gText_MatchCallEliteFour_Phoebe_Pokemon[] = _("There's nothing definite.");
const u8 gText_MatchCallEliteFour_Phoebe_Intro1[] = _("I wonder how my grandma at");
const u8 gText_MatchCallEliteFour_Phoebe_Intro2[] = _("MT. PYRE is doing?");
const u8 gText_MatchCallEliteFour_Glacia_Strategy[] = _("I use items for help.");
const u8 gText_MatchCallEliteFour_Glacia_Pokemon[] = _("Flaming passion in icy cold!");
const u8 gText_MatchCallEliteFour_Glacia_Intro1[] = _("The ICE type can be better");
const u8 gText_MatchCallEliteFour_Glacia_Intro2[] = _("trained in this hot land.");
const u8 gText_MatchCallEliteFour_Drake_Strategy[] = _("Harness strong abilities.");
const u8 gText_MatchCallEliteFour_Drake_Pokemon[] = _("The raw power of DRAGONS!");
const u8 gText_MatchCallEliteFour_Drake_Intro1[] = _("I dedicate myself to the");
const u8 gText_MatchCallEliteFour_Drake_Intro2[] = _("POKéMON that saved me.");
const u8 gText_MatchCallChampion_Wallace_Strategy[] = _("Dignity and respect.");
const u8 gText_MatchCallChampion_Wallace_Pokemon[] = _("I prefer POKéMON of grace.");
const u8 gText_MatchCallChampion_Wallace_Intro1[] = _("I represent beauty as");
const u8 gText_MatchCallChampion_Wallace_Intro2[] = _("well as intelligence.");
const u8 *const gMatchCallFlavorTexts[REMATCH_TABLE_ENTRIES][CHECK_PAGE_ENTRY_COUNT] =
{
[REMATCH_ROSE] = MCFLAVOR(AromaLady_Rose),
[REMATCH_ANDRES] = MCFLAVOR(RuinManiac_Andres),
+1214
View File
File diff suppressed because it is too large Load Diff
+535 -535
View File
File diff suppressed because it is too large Load Diff
+297 -297
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -26,7 +26,12 @@
"type": "fishing_mons",
"encounter_rates": [
70, 30, 60, 20, 20, 40, 40, 15, 4, 1
]
],
"groups": {
"old_rod": [0, 1],
"good_rod": [2, 3, 4],
"super_rod": [5, 6, 7, 8, 9]
}
}
],
"encounters": [
+13 -1
View File
@@ -3,13 +3,25 @@
## for wild_encounter_group in wild_encounter_groups
{% if wild_encounter_group.for_maps %}
## for wild_encounter_field in wild_encounter_group.fields
{% if not existsIn(wild_encounter_field, "groups") %}
## for encounter_rate in wild_encounter_field.encounter_rates
{% if trackVar(encounter_rate, 100) %}
{% if loop.index == 0 %}
#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ loop.index }} {{ encounter_rate }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ loop.index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ subtract(loop.index, 1) }} + {{ encounter_rate }}{% endif %} {{ setVarInt(wild_encounter_field.type, loop.index) }}
## endfor
#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_TOTAL (ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ getVar(wild_encounter_field.type) }})
{% else %}
## for field_subgroup_key, field_subgroup_subarray in wild_encounter_field.groups
## for field_subgroup_index in field_subgroup_subarray
{% if loop.index == 0 %}
#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_{{ upper(field_subgroup_key) }}_SLOT_{{ field_subgroup_index }} {{ at(wild_encounter_field.encounter_rates, field_subgroup_index) }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_{{ upper(field_subgroup_key) }}_SLOT_{{ field_subgroup_index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_{{ upper(field_subgroup_key) }}_SLOT_{{ getVar("previous_slot") }} + {{ at(wild_encounter_field.encounter_rates, field_subgroup_index) }}{% endif %}{{ setVarInt(concat(wild_encounter_field.type, field_subgroup_key), field_subgroup_index) }}{{ setVarInt("previous_slot", field_subgroup_index) }}
## endfor
#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_{{ upper(field_subgroup_key) }}_TOTAL (ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_{{ upper(field_subgroup_key) }}_SLOT_{{ getVar(concat(wild_encounter_field.type, field_subgroup_key)) }})
## endfor
{% endif %}
## endfor
{% endif %}
## for encounter in wild_encounter_group.encounters
{% if existsIn(encounter, "land_mons") %}
+146 -155
View File
@@ -3,14 +3,11 @@
#include "battle.h"
#include "daycare.h"
#include "string_util.h"
#include "constants/species.h"
#include "constants/items.h"
#include "mail.h"
#include "pokemon_storage_system.h"
#include "event_data.h"
#include "random.h"
#include "main.h"
#include "constants/moves.h"
#include "egg_hatch.h"
#include "text.h"
#include "menu.h"
@@ -22,9 +19,10 @@
#include "party_menu.h"
#include "list_menu.h"
#include "overworld.h"
#define EGG_MOVES_ARRAY_COUNT 10
#define EGG_LVL_UP_MOVES_ARRAY_COUNT 50
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/region_map_sections.h"
#include "constants/species.h"
// this file's functions
static void ClearDaycareMonMail(struct DayCareMail *mail);
@@ -34,10 +32,10 @@ static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y);
// RAM buffers used to assist with BuildEggMoveset()
EWRAM_DATA static u16 sHatchedEggLevelUpMoves[EGG_LVL_UP_MOVES_ARRAY_COUNT] = {0};
EWRAM_DATA static u16 sHatchedEggFatherMoves[4] = {0};
EWRAM_DATA static u16 sHatchedEggFinalMoves[4] = {0};
EWRAM_DATA static u16 sHatchedEggFatherMoves[MAX_MON_MOVES] = {0};
EWRAM_DATA static u16 sHatchedEggFinalMoves[MAX_MON_MOVES] = {0};
EWRAM_DATA static u16 sHatchedEggEggMoves[EGG_MOVES_ARRAY_COUNT] = {0};
EWRAM_DATA static u16 sHatchedEggMotherMoves[4] = {0};
EWRAM_DATA static u16 sHatchedEggMotherMoves[MAX_MON_MOVES] = {0};
#include "data/pokemon/egg_moves.h"
@@ -52,11 +50,13 @@ static const struct WindowTemplate sDaycareLevelMenuWindowTemplate =
.baseBlock = 8
};
// Indices here are assigned by Task_HandleDaycareLevelMenuInput to VAR_RESULT,
// which is copied to VAR_0x8004 and used as an index for GetDaycareCost
static const struct ListMenuItem sLevelMenuItems[] =
{
{gExpandedPlaceholder_Empty, 0},
{gExpandedPlaceholder_Empty, 1},
{gText_Exit, 5}
{gText_ExpandedPlaceholder_Empty, 0},
{gText_ExpandedPlaceholder_Empty, 1},
{gText_Exit, DAYCARE_LEVEL_MENU_EXIT}
};
static const struct ListMenuTemplate sDaycareListMenuLevelTemplate =
@@ -91,7 +91,7 @@ static const u8 *const sCompatibilityMessages[] =
static const u8 sJapaneseEggNickname[] = _("タマゴ"); // "tamago" ("egg" in Japanese)
u8 *GetMonNick(struct Pokemon *mon, u8 *dest)
u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest)
{
u8 nickname[POKEMON_NAME_LENGTH * 2];
@@ -99,7 +99,7 @@ u8 *GetMonNick(struct Pokemon *mon, u8 *dest)
return StringCopy10(dest, nickname);
}
u8 *GetBoxMonNick(struct BoxPokemon *mon, u8 *dest)
u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest)
{
u8 nickname[POKEMON_NAME_LENGTH * 2];
@@ -169,7 +169,7 @@ static void StorePokemonInDaycare(struct Pokemon *mon, struct DaycareMon *daycar
u8 mailId;
StringCopy(daycareMon->mail.OT_name, gSaveBlock2Ptr->playerName);
GetMonNick(mon, daycareMon->mail.monName);
GetMonNickname2(mon, daycareMon->mail.monName);
StripExtCtrlCodes(daycareMon->mail.monName);
daycareMon->mail.gameLanguage = LANGUAGE_ENGLISH;
daycareMon->mail.monLanguage = GetMonData(mon, MON_DATA_LANGUAGE);
@@ -202,8 +202,8 @@ void StoreSelectedPokemonInDaycare(void)
static void ShiftDaycareSlots(struct DayCare *daycare)
{
// This condition is only satisfied when the player takes out the first pokemon from the daycare.
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != 0
&& GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) == 0)
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != SPECIES_NONE
&& GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) == SPECIES_NONE)
{
daycare->mons[0].mon = daycare->mons[1].mon;
ZeroBoxMonData(&daycare->mons[1].mon);
@@ -231,11 +231,8 @@ static void ApplyDaycareExperience(struct Pokemon *mon)
while ((learnedMove = MonTryLearningNewMove(mon, firstMove)) != 0)
{
firstMove = FALSE;
if (learnedMove == 0xFFFF)
{
// Mon already knows 4 moves.
if (learnedMove == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToMon(mon, gMoveToLearn);
}
}
}
else
@@ -254,7 +251,7 @@ static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon)
u32 experience;
struct Pokemon pokemon;
GetBoxMonNick(&daycareMon->mon, gStringVar1);
GetBoxMonNickname(&daycareMon->mon, gStringVar1);
species = GetBoxMonData(&daycareMon->mon, MON_DATA_SPECIES);
BoxMonToMon(&daycareMon->mon, &pokemon);
@@ -314,7 +311,7 @@ static u8 GetNumLevelsGainedForDaycareMon(struct DaycareMon *daycareMon)
{
u8 numLevelsGained = GetNumLevelsGainedFromSteps(daycareMon);
ConvertIntToDecimalStringN(gStringVar2, numLevelsGained, STR_CONV_MODE_LEFT_ALIGN, 2);
GetBoxMonNick(&daycareMon->mon, gStringVar1);
GetBoxMonNickname(&daycareMon->mon, gStringVar1);
return numLevelsGained;
}
@@ -323,7 +320,7 @@ static u32 GetDaycareCostForSelectedMon(struct DaycareMon *daycareMon)
u32 cost;
u8 numLevelsGained = GetNumLevelsGainedFromSteps(daycareMon);
GetBoxMonNick(&daycareMon->mon, gStringVar1);
GetBoxMonNickname(&daycareMon->mon, gStringVar1);
cost = 100 + 100 * numLevelsGained;
ConvertIntToDecimalStringN(gStringVar2, cost, STR_CONV_MODE_LEFT_ALIGN, 5);
return cost;
@@ -419,18 +416,18 @@ static u16 GetEggSpecies(u16 species)
return species;
}
static s32 GetSlotToInheritNature(struct DayCare *daycare)
static s32 GetParentToInheritNature(struct DayCare *daycare)
{
u32 species[DAYCARE_MON_COUNT];
s32 i;
s32 dittoCount;
s32 slot = -1;
s32 parent = -1;
// search for female gender
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
if (GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE)
slot = i;
parent = i;
}
// search for ditto
@@ -438,50 +435,52 @@ static s32 GetSlotToInheritNature(struct DayCare *daycare)
{
species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES);
if (species[i] == SPECIES_DITTO)
dittoCount++, slot = i;
dittoCount++, parent = i;
}
// coin flip on ...two Dittos
if (dittoCount == 2)
if (dittoCount == DAYCARE_MON_COUNT)
{
if (Random() >= USHRT_MAX / 2)
slot = 0;
parent = 0;
else
slot = 1;
parent = 1;
}
// nature inheritance only if holds everstone
if (GetBoxMonData(&daycare->mons[slot].mon, MON_DATA_HELD_ITEM) != ITEM_EVERSTONE
// Don't inherit nature if not holding Everstone
if (GetBoxMonData(&daycare->mons[parent].mon, MON_DATA_HELD_ITEM) != ITEM_EVERSTONE
|| Random() >= USHRT_MAX / 2)
{
return -1;
}
return slot;
return parent;
}
static void _TriggerPendingDaycareEgg(struct DayCare *daycare)
{
s32 natureSlot;
s32 parent;
s32 natureTries = 0;
SeedRng2(gMain.vblankCounter2);
natureSlot = GetSlotToInheritNature(daycare);
parent = GetParentToInheritNature(daycare);
if (natureSlot < 0)
// don't inherit nature
if (parent < 0)
{
daycare->offspringPersonality = (Random2() << 0x10) | ((Random() % 0xfffe) + 1);
daycare->offspringPersonality = (Random2() << 16) | ((Random() % 0xfffe) + 1);
}
// inherit nature
else
{
u8 wantedNature = GetNatureFromPersonality(GetBoxMonData(&daycare->mons[natureSlot].mon, MON_DATA_PERSONALITY, NULL));
u8 wantedNature = GetNatureFromPersonality(GetBoxMonData(&daycare->mons[parent].mon, MON_DATA_PERSONALITY, NULL));
u32 personality;
do
{
personality = (Random2() << 0x10) | (Random());
personality = (Random2() << 16) | (Random());
if (wantedNature == GetNatureFromPersonality(personality) && personality != 0)
break; // we found a personality with the same nature
break; // found a personality with the same nature
natureTries++;
} while (natureTries <= 2400);
@@ -492,9 +491,10 @@ static void _TriggerPendingDaycareEgg(struct DayCare *daycare)
FlagSet(FLAG_PENDING_DAYCARE_EGG);
}
// Functionally unused
static void _TriggerPendingDaycareMaleEgg(struct DayCare *daycare)
{
daycare->offspringPersonality = (Random()) | (0x8000);
daycare->offspringPersonality = (Random()) | (EGG_GENDER_MALE);
FlagSet(FLAG_PENDING_DAYCARE_EGG);
}
@@ -503,6 +503,7 @@ void TriggerPendingDaycareEgg(void)
_TriggerPendingDaycareEgg(&gSaveBlock1Ptr->daycare);
}
// Unused
static void TriggerPendingDaycareMaleEgg(void)
{
_TriggerPendingDaycareMaleEgg(&gSaveBlock1Ptr->daycare);
@@ -532,9 +533,9 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv)
static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
{
u8 i;
u8 selectedIvs[3];
u8 selectedIvs[INHERITED_IV_COUNT];
u8 availableIVs[NUM_STATS];
u8 whichParent[ARRAY_COUNT(selectedIvs)];
u8 whichParents[INHERITED_IV_COUNT];
u8 iv;
// Initialize a list of IV indices.
@@ -544,48 +545,46 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
}
// Select the 3 IVs that will be inherited.
for (i = 0; i < ARRAY_COUNT(selectedIvs); i++)
for (i = 0; i < INHERITED_IV_COUNT; i++)
{
// Randomly pick an IV from the available list.
// Randomly pick an IV from the available list and stop from being chosen again.
selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)];
// Remove the selected IV index from the available IV indices.
RemoveIVIndexFromList(availableIVs, i);
}
// Determine which parent each of the selected IVs should inherit from.
for (i = 0; i < ARRAY_COUNT(selectedIvs); i++)
for (i = 0; i < INHERITED_IV_COUNT; i++)
{
whichParent[i] = Random() % 2;
whichParents[i] = Random() % DAYCARE_MON_COUNT;
}
// Set each of inherited IVs on the egg mon.
for (i = 0; i < ARRAY_COUNT(selectedIvs); i++)
for (i = 0; i < INHERITED_IV_COUNT; i++)
{
switch (selectedIvs[i])
{
case 0:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_HP_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_HP_IV);
SetMonData(egg, MON_DATA_HP_IV, &iv);
break;
case 1:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_ATK_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_ATK_IV);
SetMonData(egg, MON_DATA_ATK_IV, &iv);
break;
case 2:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_DEF_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_DEF_IV);
SetMonData(egg, MON_DATA_DEF_IV, &iv);
break;
case 3:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPEED_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_SPEED_IV);
SetMonData(egg, MON_DATA_SPEED_IV, &iv);
break;
case 4:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPATK_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_SPATK_IV);
SetMonData(egg, MON_DATA_SPATK_IV, &iv);
break;
case 5:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPDEF_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_SPDEF_IV);
SetMonData(egg, MON_DATA_SPDEF_IV, &iv);
break;
}
@@ -638,14 +637,14 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
numSharedParentMoves = 0;
for (i = 0; i < MAX_MON_MOVES; i++)
{
sHatchedEggMotherMoves[i] = 0;
sHatchedEggFatherMoves[i] = 0;
sHatchedEggFinalMoves[i] = 0;
sHatchedEggMotherMoves[i] = MOVE_NONE;
sHatchedEggFatherMoves[i] = MOVE_NONE;
sHatchedEggFinalMoves[i] = MOVE_NONE;
}
for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++)
sHatchedEggEggMoves[i] = 0;
sHatchedEggEggMoves[i] = MOVE_NONE;
for (i = 0; i < EGG_LVL_UP_MOVES_ARRAY_COUNT; i++)
sHatchedEggLevelUpMoves[i] = 0;
sHatchedEggLevelUpMoves[i] = MOVE_NONE;
numLevelUpMoves = GetLevelUpMovesBySpecies(GetMonData(egg, MON_DATA_SPECIES), sHatchedEggLevelUpMoves);
for (i = 0; i < MAX_MON_MOVES; i++)
@@ -664,7 +663,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
if (sHatchedEggFatherMoves[i] == sHatchedEggEggMoves[j])
{
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xFFFF)
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]);
break;
}
@@ -683,7 +682,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
if (sHatchedEggFatherMoves[i] == ItemIdToBattleMoveId(ITEM_TM01_FOCUS_PUNCH + j) && CanMonLearnTMHM(egg, j))
{
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xFFFF)
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]);
}
}
@@ -708,7 +707,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
if (sHatchedEggLevelUpMoves[j] != MOVE_NONE && sHatchedEggFinalMoves[i] == sHatchedEggLevelUpMoves[j])
{
if (GiveMoveToMon(egg, sHatchedEggFinalMoves[i]) == 0xFFFF)
if (GiveMoveToMon(egg, sHatchedEggFinalMoves[i]) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFinalMoves[i]);
break;
}
@@ -753,7 +752,7 @@ static void GiveVoltTackleIfLightBall(struct Pokemon *mon, struct DayCare *dayca
if (motherItem == ITEM_LIGHT_BALL || fatherItem == ITEM_LIGHT_BALL)
{
if (GiveMoveToMon(mon, MOVE_VOLT_TACKLE) == 0xFFFF)
if (GiveMoveToMon(mon, MOVE_VOLT_TACKLE) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToMon(mon, MOVE_VOLT_TACKLE);
}
}
@@ -761,13 +760,10 @@ static void GiveVoltTackleIfLightBall(struct Pokemon *mon, struct DayCare *dayca
static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parentSlots)
{
u16 i;
u16 species[2];
u16 species[DAYCARE_MON_COUNT];
u16 eggSpecies;
// Determine which of the daycare mons is the mother and father of the egg.
// The 0th index of the parentSlots array is considered the mother slot, and the
// 1st index is the father slot.
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES);
if (species[i] == SPECIES_DITTO)
@@ -783,11 +779,11 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent
}
eggSpecies = GetEggSpecies(species[parentSlots[0]]);
if (eggSpecies == SPECIES_NIDORAN_F && daycare->offspringPersonality & 0x8000)
if (eggSpecies == SPECIES_NIDORAN_F && daycare->offspringPersonality & EGG_GENDER_MALE)
{
eggSpecies = SPECIES_NIDORAN_M;
}
if (eggSpecies == SPECIES_ILLUMISE && daycare->offspringPersonality & 0x8000)
if (eggSpecies == SPECIES_ILLUMISE && daycare->offspringPersonality & EGG_GENDER_MALE)
{
eggSpecies = SPECIES_VOLBEAT;
}
@@ -795,19 +791,19 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent
// Make Ditto the "mother" slot if the other daycare mon is male.
if (species[parentSlots[1]] == SPECIES_DITTO && GetBoxMonGender(&daycare->mons[parentSlots[0]].mon) != MON_FEMALE)
{
u8 temp = parentSlots[1];
u8 ditto = parentSlots[1];
parentSlots[1] = parentSlots[0];
parentSlots[0] = temp;
parentSlots[0] = ditto;
}
return eggSpecies;
}
static void _GiveEggFromDaycare(struct DayCare *daycare) // give_egg
static void _GiveEggFromDaycare(struct DayCare *daycare)
{
struct Pokemon egg;
u16 species;
u8 parentSlots[2]; // 0th index is "mother" daycare slot, 1st is "father"
u8 parentSlots[DAYCARE_MON_COUNT];
bool8 isEgg;
species = DetermineEggSpeciesAndParentSlots(daycare, parentSlots);
@@ -835,7 +831,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLocation;
u8 isEgg;
CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, FALSE, 0, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, FALSE, 0, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
@@ -846,7 +842,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
SetMonData(mon, MON_DATA_LANGUAGE, &language);
if (setHotSpringsLocation)
{
metLocation = 253; // hot springs; see PokemonSummaryScreen_PrintEggTrainerMemo
metLocation = METLOC_SPECIAL_EGG;
SetMonData(mon, MON_DATA_MET_LOCATION, &metLocation);
}
@@ -862,7 +858,7 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *
u8 language;
personality = daycare->offspringPersonality;
CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, TRUE, personality, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
@@ -878,7 +874,7 @@ void GiveEggFromDaycare(void)
_GiveEggFromDaycare(&gSaveBlock1Ptr->daycare);
}
static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
static bool8 TryProduceOrHatchEgg(struct DayCare *daycare)
{
u32 i, validEggs = 0;
@@ -888,15 +884,16 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
daycare->mons[i].steps++, validEggs++;
}
// try to trigger poke sex
if (daycare->offspringPersonality == 0 && validEggs == 2 && (daycare->mons[1].steps & 0xFF) == 0xFF)
// Check if an egg should be produced
if (daycare->offspringPersonality == 0 && validEggs == DAYCARE_MON_COUNT && (daycare->mons[1].steps & 0xFF) == 0xFF)
{
u8 loveScore = GetDaycareCompatibilityScore(daycare);
if (loveScore > (Random() * 100u) / USHRT_MAX)
u8 compatability = GetDaycareCompatibilityScore(daycare);
if (compatability > (Random() * 100u) / USHRT_MAX)
TriggerPendingDaycareEgg();
}
if (++daycare->stepCounter == 255) // hatch an egg
// Hatch Egg
if (++daycare->stepCounter == 255)
{
u32 steps;
u8 toSub = GetEggStepsToSubtract();
@@ -909,7 +906,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
continue;
steps = GetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP);
if (steps != 0) // subtract needed steps
if (steps != 0)
{
if (steps >= toSub)
steps -= toSub;
@@ -918,7 +915,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
SetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP, &steps);
}
else // hatch the egg
else
{
gSpecialVar_0x8004 = i;
return TRUE;
@@ -926,12 +923,12 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
}
}
return FALSE; // no hatching
return FALSE;
}
bool8 ShouldEggHatch(void)
{
return _DoEggActions_CheckHatch(&gSaveBlock1Ptr->daycare);
return TryProduceOrHatchEgg(&gSaveBlock1Ptr->daycare);
}
static bool8 IsEggPending(struct DayCare *daycare)
@@ -947,20 +944,20 @@ static void _GetDaycareMonNicknames(struct DayCare *daycare)
u8 text[12];
if (GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) != 0)
{
GetBoxMonNick(&daycare->mons[0].mon, gStringVar1);
GetBoxMonNickname(&daycare->mons[0].mon, gStringVar1);
GetBoxMonData(&daycare->mons[0].mon, MON_DATA_OT_NAME, text);
StringCopy(gStringVar3, text);
}
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != 0)
{
GetBoxMonNick(&daycare->mons[1].mon, gStringVar2);
GetBoxMonNickname(&daycare->mons[1].mon, gStringVar2);
}
}
u16 GetSelectedMonNickAndSpecies(void)
u16 GetSelectedMonNicknameAndSpecies(void)
{
GetBoxMonNick(&gPlayerParty[GetCursorSelectionMonId()].box, gStringVar1);
GetBoxMonNickname(&gPlayerParty[GetCursorSelectionMonId()].box, gStringVar1);
return GetBoxMonData(&gPlayerParty[GetCursorSelectionMonId()].box, MON_DATA_SPECIES);
}
@@ -971,26 +968,19 @@ void GetDaycareMonNicknames(void)
u8 GetDaycareState(void)
{
// The daycare can be in 4 possible states:
// 0: default state--no deposited mons, no egg
// 1: there is an egg waiting for the player to pick it up
// 2: there is a single pokemon in the daycare
// 3: there are two pokemon in the daycare, no egg
u8 numMons;
if (IsEggPending(&gSaveBlock1Ptr->daycare))
{
// There is an Egg waiting for the player.
return 1;
return DAYCARE_EGG_WAITING;
}
numMons = CountPokemonInDaycare(&gSaveBlock1Ptr->daycare);
if (numMons != 0)
{
return numMons + 1;
return numMons + 1; // DAYCARE_ONE_MON or DAYCARE_TWO_MONS
}
return 0;
return DAYCARE_NO_MONS;
}
static u8 GetDaycarePokemonCount(void)
@@ -1002,15 +992,15 @@ static u8 GetDaycarePokemonCount(void)
return 0;
}
// Determine if the two given egg group lists contain any of the
// same egg groups.
static bool8 EggGroupsOverlap(u16 *eggGroups1, u16 *eggGroups2)
{
// Determine if the two given egg group lists contain any of the
// same egg groups.
s32 i, j;
for (i = 0; i < 2; i++)
for (i = 0; i < EGG_GROUPS_PER_MON; i++)
{
for (j = 0; j < 2; j++)
for (j = 0; j < EGG_GROUPS_PER_MON; j++)
{
if (eggGroups1[i] == eggGroups2[j])
return TRUE;
@@ -1023,12 +1013,12 @@ static bool8 EggGroupsOverlap(u16 *eggGroups1, u16 *eggGroups2)
static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
{
u32 i;
u16 eggGroups[2][2];
u16 species[2];
u32 trainerIds[2];
u32 genders[2];
u16 eggGroups[DAYCARE_MON_COUNT][EGG_GROUPS_PER_MON];
u16 species[DAYCARE_MON_COUNT];
u32 trainerIds[DAYCARE_MON_COUNT];
u32 genders[DAYCARE_MON_COUNT];
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
u32 personality;
@@ -1042,41 +1032,42 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
// check unbreedable egg group
if (eggGroups[0][0] == EGG_GROUP_UNDISCOVERED || eggGroups[1][0] == EGG_GROUP_UNDISCOVERED)
return 0;
return PARENTS_INCOMPATIBLE;
// two Ditto can't breed
if (eggGroups[0][0] == EGG_GROUP_DITTO && eggGroups[1][0] == EGG_GROUP_DITTO)
return 0;
return PARENTS_INCOMPATIBLE;
// now that we checked, one ditto can breed with any other mon
// one parent is Ditto
if (eggGroups[0][0] == EGG_GROUP_DITTO || eggGroups[1][0] == EGG_GROUP_DITTO)
{
if (trainerIds[0] == trainerIds[1]) // same trainer
return 20;
if (trainerIds[0] == trainerIds[1])
return PARENTS_LOW_COMPATIBILITY;
return 50; // different trainers, more chance of poke sex
return PARENTS_MED_COMPATABILITY;
}
// neither parent is Ditto
else
{
if (genders[0] == genders[1]) // no homo
return 0;
if (genders[0] == genders[1])
return PARENTS_INCOMPATIBLE;
if (genders[0] == MON_GENDERLESS || genders[1] == MON_GENDERLESS)
return 0;
if (!EggGroupsOverlap(eggGroups[0], eggGroups[1])) // not compatible with each other
return 0;
return PARENTS_INCOMPATIBLE;
if (!EggGroupsOverlap(eggGroups[0], eggGroups[1]))
return PARENTS_INCOMPATIBLE;
if (species[0] == species[1]) // same species
if (species[0] == species[1])
{
if (trainerIds[0] == trainerIds[1]) // same species and trainer
return 50;
if (trainerIds[0] == trainerIds[1])
return PARENTS_MED_COMPATABILITY; // same species, same trainer
return 70; // different trainers, same species
return PARENTS_MAX_COMPATABILITY; // same species, different trainers
}
else
{
if (trainerIds[0] != trainerIds[1]) // different trainers, different species
return 50;
if (trainerIds[0] != trainerIds[1])
return PARENTS_MED_COMPATABILITY; // different species, different trainers
return 20; // different species, same trainer
return PARENTS_LOW_COMPATIBILITY; // different species, same trainer
}
}
}
@@ -1093,13 +1084,13 @@ void SetDaycareCompatibilityString(void)
relationshipScore = GetDaycareCompatibilityScoreFromSave();
whichString = 0;
if (relationshipScore == 0)
if (relationshipScore == PARENTS_INCOMPATIBLE)
whichString = 3;
if (relationshipScore == 20)
if (relationshipScore == PARENTS_LOW_COMPATIBILITY)
whichString = 2;
if (relationshipScore == 50)
if (relationshipScore == PARENTS_MED_COMPATABILITY)
whichString = 1;
if (relationshipScore == 70)
if (relationshipScore == PARENTS_MAX_COMPATABILITY)
whichString = 0;
StringCopy(gStringVar4, sCompatibilityMessages[whichString]);
@@ -1108,20 +1099,20 @@ void SetDaycareCompatibilityString(void)
bool8 NameHasGenderSymbol(const u8 *name, u8 genderRatio)
{
u8 i;
u8 symbolsCount[2]; // male, female
symbolsCount[0] = symbolsCount[1] = 0;
u8 symbolsCount[GENDER_COUNT];
symbolsCount[MALE] = symbolsCount[FEMALE] = 0;
for (i = 0; name[i] != EOS; i++)
{
if (name[i] == CHAR_MALE)
symbolsCount[0]++;
symbolsCount[MALE]++;
if (name[i] == CHAR_FEMALE)
symbolsCount[1]++;
symbolsCount[FEMALE]++;
}
if (genderRatio == MON_MALE && symbolsCount[0] != 0 && symbolsCount[1] == 0)
if (genderRatio == MON_MALE && symbolsCount[MALE] != 0 && symbolsCount[FEMALE] == 0)
return TRUE;
if (genderRatio == MON_FEMALE && symbolsCount[1] != 0 && symbolsCount[0] == 0)
if (genderRatio == MON_FEMALE && symbolsCount[FEMALE] != 0 && symbolsCount[MALE] == 0)
return TRUE;
return FALSE;
@@ -1150,13 +1141,13 @@ static u8 *AppendMonGenderSymbol(u8 *name, struct BoxPokemon *boxMon)
static void GetDaycareLevelMenuText(struct DayCare *daycare, u8 *dest)
{
u8 monNames[2][20];
u8 monNames[DAYCARE_MON_COUNT][20];
u8 i;
*dest = EOS;
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
GetBoxMonNick(&daycare->mons[i].mon, monNames[i]);
GetBoxMonNickname(&daycare->mons[i].mon, monNames[i]);
AppendMonGenderSymbol(monNames[i], &daycare->mons[i].mon);
}
@@ -1174,7 +1165,7 @@ static void GetDaycareLevelMenuLevelText(struct DayCare *daycare, u8 *dest)
u8 text[20];
*dest = EOS;
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
StringAppend(dest, gText_Lv);
level = GetLevelAfterDaycareSteps(&daycare->mons[i].mon, daycare->mons[i].steps);
@@ -1206,13 +1197,13 @@ static void DaycareAddTextPrinter(u8 windowId, const u8 *text, u32 x, u32 y)
AddTextPrinter(&printer, 0xFF, NULL);
}
static void DaycarePrintMonNick(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
static void DaycarePrintMonNickname(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
{
u8 nick[POKEMON_NAME_LENGTH * 2];
u8 nickname[POKEMON_NAME_LENGTH * 2];
GetBoxMonNick(&daycare->mons[daycareSlotId].mon, nick);
AppendMonGenderSymbol(nick, &daycare->mons[daycareSlotId].mon);
DaycareAddTextPrinter(windowId, nick, 8, y);
GetBoxMonNickname(&daycare->mons[daycareSlotId].mon, nickname);
AppendMonGenderSymbol(nickname, &daycare->mons[daycareSlotId].mon);
DaycareAddTextPrinter(windowId, nickname, 8, y);
}
static void DaycarePrintMonLvl(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
@@ -1234,7 +1225,7 @@ static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y)
{
if (daycareSlotId < (unsigned) DAYCARE_MON_COUNT)
{
DaycarePrintMonNick(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y);
DaycarePrintMonNickname(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y);
DaycarePrintMonLvl(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y);
}
}
@@ -1254,8 +1245,8 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId)
case 1:
gSpecialVar_Result = input;
break;
case 5:
gSpecialVar_Result = 2;
case DAYCARE_LEVEL_MENU_EXIT:
gSpecialVar_Result = DAYCARE_EXITED_LEVEL_MENU;
break;
}
DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL);
@@ -1266,7 +1257,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId)
}
else if (gMain.newKeys & B_BUTTON)
{
gSpecialVar_Result = 2;
gSpecialVar_Result = DAYCARE_EXITED_LEVEL_MENU;
DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL);
ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE);
RemoveWindow(gTasks[taskId].tWindowId);
@@ -1301,6 +1292,6 @@ void ShowDaycareLevelMenu(void)
void ChooseSendDaycareMon(void)
{
sub_81B9328();
ChooseMonForDaycare();
gMain.savedCallback = CB2_ReturnToField;
}
+1 -1
View File
@@ -1,5 +1,5 @@
#include "global.h"
#include "alloc.h"
#include "malloc.h"
#include "data.h"
#include "decompress.h"
#include "pokemon.h"
+94 -91
View File
@@ -1,5 +1,5 @@
#include "global.h"
#include "alloc.h"
#include "malloc.h"
#include "decompress.h"
#include "decoration.h"
#include "decoration_inventory.h"
@@ -14,6 +14,7 @@
#include "graphics.h"
#include "international_string_util.h"
#include "item_icon.h"
#include "item_menu.h"
#include "list_menu.h"
#include "main.h"
#include "menu.h"
@@ -40,6 +41,7 @@
#define PLACE_DECORATION_SELECTOR_TAG 0xbe5
#define PLACE_DECORATION_PLAYER_TAG 0x008
#define NUM_DECORATION_FLAGS (FLAG_DECORATION_14 - FLAG_DECORATION_0)
struct DecorationItemsMenu
{
@@ -69,8 +71,8 @@ struct DecorRearrangementDataBuffer
EWRAM_DATA u8 *gCurDecorationItems = NULL;
EWRAM_DATA static u8 sDecorationActionsCursorPos = 0;
EWRAM_DATA static u8 sNumOwnedDecorationsInCurCategory = 0;
EWRAM_DATA static u8 sSecretBaseItemsIndicesBuffer[16] = {};
EWRAM_DATA static u8 sPlayerRoomItemsIndicesBuffer[12] = {};
EWRAM_DATA static u8 sSecretBaseItemsIndicesBuffer[DECOR_MAX_SECRET_BASE] = {};
EWRAM_DATA static u8 sPlayerRoomItemsIndicesBuffer[DECOR_MAX_PLAYERS_HOUSE] = {};
EWRAM_DATA static u16 sDecorationsCursorPos = 0;
EWRAM_DATA static u16 sDecorationsScrollOffset = 0;
EWRAM_DATA u8 gCurDecorationIndex = 0;
@@ -86,7 +88,7 @@ EWRAM_DATA static u8 sDecor_CameraSpriteObjectIdx1 = 0;
EWRAM_DATA static u8 sDecor_CameraSpriteObjectIdx2 = 0;
EWRAM_DATA static u8 sDecorationLastDirectionMoved = 0;
EWRAM_DATA static struct OamData sDecorSelectorOam = {};
EWRAM_DATA static struct DecorRearrangementDataBuffer sDecorRearrangementDataBuffer[16] = {};
EWRAM_DATA static struct DecorRearrangementDataBuffer sDecorRearrangementDataBuffer[DECOR_MAX_SECRET_BASE] = {};
EWRAM_DATA static u8 sCurDecorSelectedInRearrangement = 0;
static void HandleDecorationActionsMenuInput(u8 taskId);
@@ -128,34 +130,34 @@ void SetUpPlacingDecorationPlayerAvatar(u8 taskId, struct PlaceDecorationGraphic
void sub_812826C(u8 taskId);
void sub_81283BC(u8 taskId);
void sub_8128414(u8 taskId);
void sub_8128950(u8 taskId);
void sub_81289D0(u8 taskId);
void sub_81289F0(u8 taskId);
void AttemptPlaceDecoration(u8 taskId);
void PlaceDecorationPrompt(u8 taskId);
void PlaceDecoration(u8 taskId);
void sub_8128AAC(u8 taskId);
void sub_8128B80(u8 taskId);
void sub_8128BA0(u8 taskId);
void CancelDecoratingPrompt(u8 taskId);
void CancelDecorating(u8 taskId);
void sub_8128BBC(u8 taskId);
void c1_overworld_prev_quest(u8 taskId);
void sub_8128CD4(void);
void sub_8128DE0(void);
void sub_8128FD8(u8 taskId);
void sub_8129020(u8 taskId);
void ContinueDecorating(u8 taskId);
void CantPlaceDecorationPrompt(u8 taskId);
void sub_81292D0(struct Sprite *sprite);
void sub_81292E8(struct Sprite *sprite);
u8 gpu_pal_decompress_alloc_tag_and_upload(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor);
const u32 *GetDecorationIconPicOrPalette(u16 decor, u8 mode);
bool8 sub_81299AC(u8 taskId);
void sub_8129ABC(u8 taskId);
void sub_8129B34(u8 taskId);
void ContinuePuttingAwayDecorations(u8 taskId);
void sub_8129BCC(u8 taskId);
void sub_8129BF8(u8 taskId);
void sub_8129C74(u8 taskId);
void sub_8129D64(u8 taskId);
void ContinuePuttingAwayDecorationsPrompt(u8 taskId);
void sub_812A0E8(u8 taskId);
void sub_812A1A0(u8 taskId);
void sub_812A1C0(u8 taskId);
void sub_812A1F0(u8 taskId);
void sub_812A210(u8 taskId);
void ReturnDecorationPrompt(u8 taskId);
void PutAwayDecoration(u8 taskId);
void StopPuttingAwayDecorationsPrompt(u8 taskId);
void StopPuttingAwayDecorations(u8 taskId);
void sub_812A22C(u8 taskId);
void sub_812A25C(u8 taskId);
void sub_812A334(void);
@@ -163,8 +165,8 @@ void sub_812A36C(struct Sprite *sprite);
void sub_812A39C(void);
void sub_812A3C8(void);
void sub_812A3D4(u8 taskId);
void sub_812A458(u8 taskId);
void sub_812A478(u8 taskId);
void TossDecorationPrompt(u8 taskId);
void TossDecoration(u8 taskId);
#include "data/decoration/tiles.h"
#include "data/decoration/description.h"
@@ -344,16 +346,16 @@ const struct SpritePalette gUnknown_085A72BC =
.tag = PLACE_DECORATION_SELECTOR_TAG,
};
const struct YesNoFuncTable gUnknown_085A72C4 =
const struct YesNoFuncTable sPlaceDecorationYesNoFunctions =
{
.yesFunc = sub_81289F0,
.noFunc = sub_8128FD8,
.yesFunc = PlaceDecoration,
.noFunc = ContinueDecorating,
};
const struct YesNoFuncTable gUnknown_085A72CC =
const struct YesNoFuncTable sCancelDecoratingYesNoFunctions =
{
.yesFunc = sub_8128BA0,
.noFunc = sub_8128FD8,
.yesFunc = CancelDecorating,
.noFunc = ContinueDecorating,
};
const struct YesNoFuncTable gUnknown_085A72D4[] =
@@ -390,16 +392,16 @@ const u16 gUnknown_085A7308[] = INCBIN_U16("graphics/decorations/unk_85a7308.gba
const u16 gUnknown_085A7328[] = INCBIN_U16("graphics/decorations/unk_85a7328.gbapal");
const struct YesNoFuncTable gUnknown_085A7348 =
const struct YesNoFuncTable sReturnDecorationYesNoFunctions =
{
.yesFunc = sub_812A1C0,
.noFunc = sub_8129B34,
.yesFunc = PutAwayDecoration,
.noFunc = ContinuePuttingAwayDecorations,
};
const struct YesNoFuncTable gUnknown_085A7350 =
const struct YesNoFuncTable sStopPuttingAwayDecorationsYesNoFunctions =
{
.yesFunc = sub_812A210,
.noFunc = sub_8129B34,
.yesFunc = StopPuttingAwayDecorations,
.noFunc = ContinuePuttingAwayDecorations,
};
const u8 gUnknown_085A7358[] = INCBIN_U8("graphics/misc/decoration_unk_85a7358.4bpp");
@@ -458,9 +460,9 @@ const struct SpriteTemplate gUnknown_085A7404 =
sub_812A36C
};
const struct YesNoFuncTable gUnknown_085A741C =
const struct YesNoFuncTable sTossDecorationYesNoFunctions =
{
.yesFunc = sub_812A478,
.yesFunc = TossDecoration,
.noFunc = sub_8127A30,
};
@@ -607,7 +609,7 @@ static void DecorationMenuAction_PutAway(u8 taskId)
{
RemoveDecorationWindow(0);
ClearDialogWindowAndFrame(0, 0);
FadeScreen(1, 0);
FadeScreen(FADE_TO_BLACK, 0);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_8129ABC;
}
@@ -633,7 +635,7 @@ static void DecorationMenuAction_Cancel(u8 taskId)
RemoveDecorationWindow(0);
if (!gDecorationContext.isPlayerRoom)
{
ScriptContext1_SetupScript(gUnknown_0823B4E8);
ScriptContext1_SetupScript(SecretBase_EventScript_PCCancel);
DestroyTask(taskId);
}
else
@@ -1235,12 +1237,12 @@ void ShowDecorationOnMap(u16 mapX, u16 mapY, u16 decoration)
}
}
void sub_8127E18(void)
void SetDecoration(void)
{
u8 i;
u8 j;
for (i = 0; i < 14; i++)
for (i = 0; i < NUM_DECORATION_FLAGS; i++)
{
if (FlagGet(FLAG_DECORATION_1 + i) == TRUE)
{
@@ -1291,7 +1293,7 @@ void sub_8127F68(u8 taskId)
{
if (sub_8127F38() == TRUE)
{
FadeScreen(1, 0);
FadeScreen(FADE_TO_BLACK, 0);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_8128060;
}
@@ -1331,7 +1333,7 @@ void sub_8128060(u8 taskId)
ConfigureCameraObjectForPlacingDecoration(&sPlaceDecorationGraphicsDataBuffer, gCurDecorationItems[gCurDecorationIndex]);
sub_812826C(taskId);
SetUpPlacingDecorationPlayerAvatar(taskId, &sPlaceDecorationGraphicsDataBuffer);
pal_fill_black();
FadeInFromBlack();
gPaletteFade.bufferTransferDisabled = FALSE;
gTasks[taskId].data[2] = 2;
break;
@@ -1339,7 +1341,7 @@ void sub_8128060(u8 taskId)
if (IsWeatherNotFadingIn() == TRUE)
{
gTasks[taskId].data[12] = 0;
sub_8128FD8(taskId);
ContinueDecorating(taskId);
}
break;
}
@@ -1427,7 +1429,7 @@ void sub_81283BC(u8 taskId)
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 1;
gSprites[sDecor_CameraSpriteObjectIdx2].data[7] = 1;
sub_8128DE0();
sub_8128950(taskId);
AttemptPlaceDecoration(taskId);
}
void sub_8128414(u8 taskId)
@@ -1437,7 +1439,7 @@ void sub_8128414(u8 taskId)
gSprites[sDecor_CameraSpriteObjectIdx2].data[7] = 1;
sub_8128DE0();
StringExpandPlaceholders(gStringVar4, gText_CancelDecorating);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8128B80);
DisplayItemMessageOnField(taskId, gStringVar4, CancelDecoratingPrompt);
}
bool8 sub_8128484(u8 behaviorAt, u16 behaviorBy)
@@ -1472,7 +1474,7 @@ bool8 sub_81284F4(u16 behaviorAt, const struct Decoration *decoration)
return FALSE;
}
bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration)
{
u8 i;
u8 j;
@@ -1586,28 +1588,28 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
return TRUE;
}
void sub_8128950(u8 taskId)
void AttemptPlaceDecoration(u8 taskId)
{
if (sub_812853C(taskId, &gDecorations[gCurDecorationItems[gCurDecorationIndex]]) == TRUE)
if (CanPlaceDecoration(taskId, &gDecorations[gCurDecorationItems[gCurDecorationIndex]]) == TRUE)
{
StringExpandPlaceholders(gStringVar4, gText_PlaceItHere);
DisplayItemMessageOnField(taskId, gStringVar4, sub_81289D0);
DisplayItemMessageOnField(taskId, gStringVar4, PlaceDecorationPrompt);
}
else
{
PlaySE(SE_HAZURE);
StringExpandPlaceholders(gStringVar4, gText_CantBePlacedHere);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8129020);
DisplayItemMessageOnField(taskId, gStringVar4, CantPlaceDecorationPrompt);
}
}
void sub_81289D0(u8 taskId)
void PlaceDecorationPrompt(u8 taskId)
{
DisplayYesNoMenuDefaultYes();
DoYesNoFuncWithChoice(taskId, &gUnknown_085A72C4);
DoYesNoFuncWithChoice(taskId, &sPlaceDecorationYesNoFunctions);
}
void sub_81289F0(u8 taskId)
void PlaceDecoration(u8 taskId)
{
ClearDialogWindowAndFrame(0, 0);
sub_8128AAC(taskId);
@@ -1619,7 +1621,7 @@ void sub_81289F0(u8 taskId)
{
sCurDecorMapX = gTasks[taskId].data[0] - 7;
sCurDecorMapY = gTasks[taskId].data[1] - 7;
ScriptContext1_SetupScript(EventScript_275D1F);
ScriptContext1_SetupScript(SecretBase_EventScript_SetDecoration);
}
gSprites[sDecor_CameraSpriteObjectIdx1].pos1.y += 2;
@@ -1645,7 +1647,7 @@ void sub_8128AAC(u8 taskId)
if (!gDecorationContext.isPlayerRoom)
{
for (i = 0; i < 16; i++)
for (i = 0; i < DECOR_MAX_SECRET_BASE; i++)
{
if (sSecretBaseItemsIndicesBuffer[i] == 0)
{
@@ -1656,7 +1658,7 @@ void sub_8128AAC(u8 taskId)
}
else
{
for (i = 0; i < 12; i++)
for (i = 0; i < DECOR_MAX_PLAYERS_HOUSE; i++)
{
if (sPlayerRoomItemsIndicesBuffer[i] == 0)
{
@@ -1667,13 +1669,13 @@ void sub_8128AAC(u8 taskId)
}
}
void sub_8128B80(u8 taskId)
void CancelDecoratingPrompt(u8 taskId)
{
DisplayYesNoMenuDefaultYes();
DoYesNoFuncWithChoice(taskId, &gUnknown_085A72CC);
DoYesNoFuncWithChoice(taskId, &sCancelDecoratingYesNoFunctions);
}
void sub_8128BA0(u8 taskId)
void CancelDecorating(u8 taskId)
{
ClearDialogWindowAndFrame(0, 0);
sub_8128BBC(taskId);
@@ -1681,7 +1683,7 @@ void sub_8128BA0(u8 taskId)
void sub_8128BBC(u8 taskId)
{
FadeScreen(1, 0);
FadeScreen(FADE_TO_BLACK, 0);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = c1_overworld_prev_quest;
}
@@ -1718,7 +1720,7 @@ void sub_8128C64(u8 taskId)
data[2]++;
break;
case 1:
ScriptContext1_SetupScript(EventScript_275D0C);
ScriptContext1_SetupScript(SecretBase_EventScript_InitDecorations);
data[2]++;
break;
case 2:
@@ -1737,7 +1739,7 @@ void sub_8128CD4(void)
u8 taskId;
ScriptContext2_Enable();
pal_fill_black();
FadeInFromBlack();
taskId = CreateTask(sub_8128C64, 8);
sub_8127580(taskId);
gTasks[taskId].data[2] = 0;
@@ -1857,7 +1859,7 @@ void sub_8128E18(u8 taskId)
}
}
void sub_8128FD8(u8 taskId)
void ContinueDecorating(u8 taskId)
{
ClearDialogWindowAndFrame(0, 1);
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0;
@@ -1865,10 +1867,10 @@ void sub_8128FD8(u8 taskId)
gTasks[taskId].func = sub_8128E18;
}
void sub_8129020(u8 taskId)
void CantPlaceDecorationPrompt(u8 taskId)
{
if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON)
sub_8128FD8(taskId);
ContinueDecorating(taskId);
}
void sub_8129048(struct PlaceDecorationGraphicsDataBuffer *data)
@@ -2043,7 +2045,7 @@ const u32 *GetDecorationIconPicOrPalette(u16 decor, u8 mode)
if (decor > NUM_DECORATIONS)
decor = DECOR_NONE;
return gUnknown_085A6BE8[decor][mode];
return gDecorIconTable[decor][mode];
}
u8 AddDecorationIconObjectFromEventObject(u16 tilesTag, u16 paletteTag, u8 decor)
@@ -2095,7 +2097,7 @@ u8 AddDecorationIconObject(u8 decor, s16 x, s16 y, u8 priority, u16 tilesTag, u1
gSprites[spriteId].pos2.x = x + 4;
gSprites[spriteId].pos2.y = y + 4;
}
else if (gUnknown_085A6BE8[decor][0] == NULL)
else if (gDecorIconTable[decor][0] == NULL)
{
spriteId = AddDecorationIconObjectFromEventObject(tilesTag, paletteTag, decor);
if (spriteId == MAX_SPRITES)
@@ -2152,7 +2154,8 @@ void sub_8129708(void)
}
}
void sub_81297AC(void)
// Unused
void GetEventObjectLocalIdByFlag(void)
{
u8 i;
@@ -2206,7 +2209,7 @@ void sub_81298EC(u8 taskId)
case 1:
if (!gPaletteFade.active) {
DrawWholeMapView();
ScriptContext1_SetupScript(EventScript_275D2E);
ScriptContext1_SetupScript(SecretBase_EventScript_PutAwayDecoration);
ClearDialogWindowAndFrame(0, 1);
gTasks[taskId].data[2] = 2;
}
@@ -2214,14 +2217,14 @@ void sub_81298EC(u8 taskId)
case 2:
ScriptContext2_Enable();
IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId);
pal_fill_black();
FadeInFromBlack();
gTasks[taskId].data[2] = 3;
break;
case 3:
if (IsWeatherNotFadingIn() == TRUE)
{
StringExpandPlaceholders(gStringVar4, gText_DecorationReturnedToPC);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8129D64);
DisplayItemMessageOnField(taskId, gStringVar4, ContinuePuttingAwayDecorationsPrompt);
if (gMapHeader.regionMapSectionId == MAPSEC_SECRET_BASE)
TV_PutSecretBaseVisitOnTheAir();
}
@@ -2277,20 +2280,20 @@ void sub_8129ABC(u8 taskId)
break;
case 1:
SetUpPuttingAwayDecorationPlayerAvatar();
pal_fill_black();
FadeInFromBlack();
data[2] = 2;
break;
case 2:
if (IsWeatherNotFadingIn() == TRUE)
{
data[12] = 1;
sub_8129B34(taskId);
ContinuePuttingAwayDecorations(taskId);
}
break;
}
}
void sub_8129B34(u8 taskId)
void ContinuePuttingAwayDecorations(u8 taskId)
{
ClearDialogWindowAndFrame(0, 1);
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0;
@@ -2316,7 +2319,7 @@ void sub_8129BF8(u8 taskId)
gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE;
gSprites[sDecor_CameraSpriteObjectIdx1].callback = SpriteCallbackDummy;
StringExpandPlaceholders(gStringVar4, gText_StopPuttingAwayDecorations);
DisplayItemMessageOnField(taskId, gStringVar4, sub_812A1F0);
DisplayItemMessageOnField(taskId, gStringVar4, StopPuttingAwayDecorationsPrompt);
}
void sub_8129C74(u8 taskId)
@@ -2328,7 +2331,7 @@ void sub_8129C74(u8 taskId)
if (sCurDecorSelectedInRearrangement != 0)
{
StringExpandPlaceholders(gStringVar4, gText_ReturnDecorationToPC);
DisplayItemMessageOnField(taskId, gStringVar4, sub_812A1A0);
DisplayItemMessageOnField(taskId, gStringVar4, ReturnDecorationPrompt);
}
else
{
@@ -2339,20 +2342,20 @@ void sub_8129C74(u8 taskId)
gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE;
gSprites[sDecor_CameraSpriteObjectIdx1].callback = SpriteCallbackDummy;
StringExpandPlaceholders(gStringVar4, gText_StopPuttingAwayDecorations);
DisplayItemMessageOnField(taskId, gStringVar4, sub_812A1F0);
DisplayItemMessageOnField(taskId, gStringVar4, StopPuttingAwayDecorationsPrompt);
}
else
{
StringExpandPlaceholders(gStringVar4, gText_NoDecorationHere);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8129D64);
DisplayItemMessageOnField(taskId, gStringVar4, ContinuePuttingAwayDecorationsPrompt);
}
}
}
void sub_8129D64(u8 taskId)
void ContinuePuttingAwayDecorationsPrompt(u8 taskId)
{
if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON)
sub_8129B34(taskId);
ContinuePuttingAwayDecorations(taskId);
}
void sub_8129D8C(u8 decor, struct DecorRearrangementDataBuffer *data)
@@ -2542,26 +2545,26 @@ void sub_812A0E8(u8 taskId)
}
}
void sub_812A1A0(u8 taskId)
void ReturnDecorationPrompt(u8 taskId)
{
DisplayYesNoMenuDefaultYes();
DoYesNoFuncWithChoice(taskId, &gUnknown_085A7348);
DoYesNoFuncWithChoice(taskId, &sReturnDecorationYesNoFunctions);
}
void sub_812A1C0(u8 taskId)
void PutAwayDecoration(u8 taskId)
{
FadeScreen(1, 0);
FadeScreen(FADE_TO_BLACK, 0);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_81298EC;
}
void sub_812A1F0(u8 taskId)
void StopPuttingAwayDecorationsPrompt(u8 taskId)
{
DisplayYesNoMenuDefaultYes();
DoYesNoFuncWithChoice(taskId, &gUnknown_085A7350);
DoYesNoFuncWithChoice(taskId, &sStopPuttingAwayDecorationsYesNoFunctions);
}
void sub_812A210(u8 taskId)
void StopPuttingAwayDecorations(u8 taskId)
{
ClearDialogWindowAndFrame(0, 0);
sub_812A22C(taskId);
@@ -2569,7 +2572,7 @@ void sub_812A210(u8 taskId)
void sub_812A22C(u8 taskId)
{
FadeScreen(1, 0);
FadeScreen(FADE_TO_BLACK, 0);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_812A25C;
}
@@ -2604,7 +2607,7 @@ void sub_812A2C4(u8 taskId)
data[2]++;
break;
case 1:
ScriptContext1_SetupScript(EventScript_275D0C);
ScriptContext1_SetupScript(SecretBase_EventScript_InitDecorations);
data[2]++;
break;
case 2:
@@ -2622,7 +2625,7 @@ void sub_812A334(void)
{
u8 taskId;
pal_fill_black();
FadeInFromBlack();
DrawDialogueFrame(0, 1);
InitDecorationActionsWindow();
taskId = CreateTask(sub_812A2C4, 8);
@@ -2658,7 +2661,7 @@ void sub_812A3D4(u8 taskId)
{
StringCopy(gStringVar1, gDecorations[gCurDecorationItems[gCurDecorationIndex]].name);
StringExpandPlaceholders(gStringVar4, gText_DecorationWillBeDiscarded);
DisplayItemMessageOnField(taskId, gStringVar4, sub_812A458);
DisplayItemMessageOnField(taskId, gStringVar4, TossDecorationPrompt);
}
else
{
@@ -2667,13 +2670,13 @@ void sub_812A3D4(u8 taskId)
}
}
void sub_812A458(u8 taskId)
void TossDecorationPrompt(u8 taskId)
{
DisplayYesNoMenuDefaultYes();
DoYesNoFuncWithChoice(taskId, &gUnknown_085A741C);
DoYesNoFuncWithChoice(taskId, &sTossDecorationYesNoFunctions);
}
void sub_812A478(u8 taskId)
void TossDecoration(u8 taskId)
{
gCurDecorationItems[gCurDecorationIndex] = DECOR_NONE;
sNumOwnedDecorationsInCurCategory = GetNumOwnedDecorationsInCategory(sCurDecorationCategory);
+4 -4
View File
@@ -3,7 +3,7 @@
#include "easy_chat.h"
#include "event_data.h"
#include "link.h"
#include "alloc.h"
#include "malloc.h"
#include "random.h"
#include "text.h"
#include "tv.h"
@@ -25,12 +25,12 @@ void InitDewfordTrend(void)
for (i = 0; i < 5; i++)
{
gSaveBlock1Ptr->easyChatPairs[i].words[0] = sub_811EE38(EC_GROUP_CONDITIONS);
gSaveBlock1Ptr->easyChatPairs[i].words[0] = GetRandomEasyChatWordFromGroup(EC_GROUP_CONDITIONS);
if (Random() & 1)
gSaveBlock1Ptr->easyChatPairs[i].words[1] = sub_811EE38(EC_GROUP_LIFESTYLE);
gSaveBlock1Ptr->easyChatPairs[i].words[1] = GetRandomEasyChatWordFromGroup(EC_GROUP_LIFESTYLE);
else
gSaveBlock1Ptr->easyChatPairs[i].words[1] = sub_811EE38(EC_GROUP_HOBBIES);
gSaveBlock1Ptr->easyChatPairs[i].words[1] = GetRandomEasyChatWordFromGroup(EC_GROUP_HOBBIES);
gSaveBlock1Ptr->easyChatPairs[i].unk1_6 = Random() & 1;
sub_8122B28(&(gSaveBlock1Ptr->easyChatPairs[i]));
+1 -1
View File
@@ -5,7 +5,7 @@
#include "gpu_regs.h"
#include "scanline_effect.h"
#include "task.h"
#include "alloc.h"
#include "malloc.h"
#include "decompress.h"
#include "bg.h"
#include "window.h"

Some files were not shown because too many files have changed in this diff Show More