mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-26 00:15:48 -05:00
document luminous cave and some more kecleon
This commit is contained in:
parent
d7586163c4
commit
bbd78961d8
|
|
@ -5733,7 +5733,7 @@ _0809BD84:
|
|||
bl sub_8001658
|
||||
cmp r0, 0
|
||||
bne _0809BDB2
|
||||
bl sub_80247B4
|
||||
bl HasEvolutionCompleted
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0809BDB2
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct unkStruct_203B230
|
|||
{
|
||||
// size: 0x94
|
||||
s32 state;
|
||||
struct ItemSlot unk4;
|
||||
struct ItemSlot item;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
struct subStruct_203B240 *unk10[2];
|
||||
|
|
@ -121,11 +121,11 @@ void sub_801B590();
|
|||
void sub_801B480();
|
||||
|
||||
|
||||
u32 sub_801B3C0(struct ItemSlot *param_1)
|
||||
u32 sub_801B3C0(struct ItemSlot *item)
|
||||
{
|
||||
ResetSprites(1);
|
||||
gUnknown_203B230 = MemoryAlloc(sizeof(struct unkStruct_203B230),8);
|
||||
gUnknown_203B230->unk4 = *param_1;
|
||||
gUnknown_203B230->item = *item;
|
||||
sub_801317C(&gUnknown_203B230->unk88);
|
||||
gUnknown_203B230->unk24 = 0;
|
||||
sub_80140B4(gUnknown_203B230->unk28);
|
||||
|
|
@ -176,7 +176,7 @@ void sub_801B480(void)
|
|||
{
|
||||
case 0:
|
||||
sub_8008C54(gUnknown_203B230->unk24);
|
||||
gUnknown_203B230->unkC = sub_80913E0(&gUnknown_203B230->unk4, gUnknown_203B230->unk24, gUnknown_203B230->unk10);
|
||||
gUnknown_203B230->unkC = sub_80913E0(&gUnknown_203B230->item, gUnknown_203B230->unk24, gUnknown_203B230->unk10);
|
||||
gUnknown_203B230->unk20 = 0;
|
||||
break;
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -238,11 +238,11 @@ void sub_80198E8(void)
|
|||
void sub_8019944(void)
|
||||
{
|
||||
s32 slotIndex;
|
||||
s32 local_10;
|
||||
s32 menuAction;
|
||||
struct ItemSlot *itemSlot;
|
||||
|
||||
if (sub_80144A4(&local_10) == 0) {
|
||||
switch(local_10)
|
||||
if (sub_80144A4(&menuAction) == 0) {
|
||||
switch(menuAction)
|
||||
{
|
||||
case 5:
|
||||
for(slotIndex = 0; slotIndex < INVENTORY_SIZE; slotIndex++)
|
||||
|
|
@ -525,8 +525,8 @@ u32 sub_8019EDC(u8 r0)
|
|||
{
|
||||
struct ItemSlot_Alt slot;
|
||||
struct HeldItem *item;
|
||||
u32 r2;
|
||||
u32 r3;
|
||||
u32 itemIndex;
|
||||
u32 numItems;
|
||||
|
||||
if(r0 == 0)
|
||||
{
|
||||
|
|
@ -544,10 +544,10 @@ u32 sub_8019EDC(u8 r0)
|
|||
item = GetKecleonItemShopItem(sub_8019FB0());
|
||||
|
||||
// NOTE: needs seperate vars to match
|
||||
r2 = item->itemIndex << 16;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xff00ffff) | r2;
|
||||
r3 = item->numItems << 8;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xffff00ff) | r3;
|
||||
itemIndex = item->itemIndex << 16;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xff00ffff) | itemIndex;
|
||||
numItems = item->numItems << 8;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xffff00ff) | numItems;
|
||||
|
||||
if(GetStackBuyPrice((struct ItemSlot *)&slot) > gTeamInventory_203B460->teamMoney)
|
||||
{
|
||||
|
|
@ -671,7 +671,7 @@ void sub_801A0D8(void)
|
|||
struct HeldItem *heldItem;
|
||||
s32 buyPrice;
|
||||
s32 y;
|
||||
s32 iVar4;
|
||||
s32 index;
|
||||
u8 auStack204 [80];
|
||||
struct unkStruct_8090F58 local_7c;
|
||||
u8 auStack112 [80];
|
||||
|
|
@ -687,9 +687,9 @@ void sub_801A0D8(void)
|
|||
xxx_call_draw_string(gUnknown_203B214->unk1E * 8 + 10,0,gUnknown_80DB8E4,
|
||||
gUnknown_203B214->unk34,0);
|
||||
|
||||
for(iVar4 = 0; iVar4 < gUnknown_203B214->unk1A; iVar4++)
|
||||
for(index = 0; index < gUnknown_203B214->unk1A; index++)
|
||||
{
|
||||
temp_calc = (gUnknown_203B214->unk1E * gUnknown_203B214->unk1C) + iVar4;
|
||||
temp_calc = (gUnknown_203B214->unk1E * gUnknown_203B214->unk1C) + index;
|
||||
heldItem = GetKecleonItemShopItem(temp_calc);
|
||||
|
||||
index_shift = heldItem->itemIndex << 16;
|
||||
|
|
@ -707,12 +707,12 @@ void sub_801A0D8(void)
|
|||
sub_8090E14(auStack204,(struct ItemSlot *)&slot,&local_7c);
|
||||
buyPrice = GetStackBuyPrice((struct ItemSlot *)&slot);
|
||||
if (buyPrice <= gTeamInventory_203B460->teamMoney) {
|
||||
y = sub_8013800(gUnknown_203B214,iVar4);
|
||||
y = sub_8013800(gUnknown_203B214,index);
|
||||
xxx_call_draw_string(8,y,auStack204,gUnknown_203B214->unk34,0);
|
||||
}
|
||||
else {
|
||||
sprintf_2(auStack112,gUnknown_80DB8EC,auStack204);
|
||||
y = sub_8013800(gUnknown_203B214,iVar4);
|
||||
y = sub_8013800(gUnknown_203B214,index);
|
||||
xxx_call_draw_string(8,y,auStack112,gUnknown_203B214->unk34,0);
|
||||
}
|
||||
}
|
||||
|
|
@ -747,9 +747,9 @@ u32 sub_801A20C(u32 r0)
|
|||
u32 sub_801A2A8(u8 r0)
|
||||
{
|
||||
struct ItemSlot_Alt slot;
|
||||
struct HeldItem *return_var;
|
||||
u32 r2;
|
||||
u32 r3;
|
||||
struct HeldItem *item;
|
||||
u32 itemIndex;
|
||||
u32 numItems;
|
||||
|
||||
if(r0 == 0)
|
||||
{
|
||||
|
|
@ -764,13 +764,13 @@ u32 sub_801A2A8(u8 r0)
|
|||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case 1:
|
||||
return_var = GetKecleonWareShopItem(sub_801A37C());
|
||||
item = GetKecleonWareShopItem(sub_801A37C());
|
||||
|
||||
// NOTE: needs seperate vars to match
|
||||
r2 = return_var->itemIndex << 16;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xff00ffff) | r2;
|
||||
r3 = return_var->numItems << 8;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xffff00ff) | r3;
|
||||
itemIndex = item->itemIndex << 16;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xff00ffff) | itemIndex;
|
||||
numItems = item->numItems << 8;
|
||||
slot.temp.full_bits = (slot.temp.full_bits & 0xffff00ff) | numItems;
|
||||
|
||||
if(GetStackBuyPrice((struct ItemSlot *)&slot) > gTeamInventory_203B460->teamMoney)
|
||||
{
|
||||
|
|
@ -891,12 +891,12 @@ void sub_801A430(void)
|
|||
void sub_801A4A4(void)
|
||||
{
|
||||
struct HeldItem *heldItem;
|
||||
s32 iVar2;
|
||||
s32 buyPrice;
|
||||
s32 y;
|
||||
s32 iVar4;
|
||||
u8 auStack204 [80];
|
||||
s32 index;
|
||||
u8 buffer1 [80];
|
||||
struct unkStruct_8090F58 local_7c;
|
||||
u8 auStack112 [80];
|
||||
u8 buffer2 [80];
|
||||
struct ItemSlot_Alt slot;
|
||||
u8 temp_calc;
|
||||
|
||||
|
|
@ -909,9 +909,9 @@ void sub_801A4A4(void)
|
|||
xxx_call_draw_string(gUnknown_203B21C->unk1E * 8 + 10,0,gUnknown_80DB92C,
|
||||
gUnknown_203B21C->unk34,0);
|
||||
|
||||
for(iVar4 = 0; iVar4 < gUnknown_203B21C->unk1A; iVar4++)
|
||||
for(index = 0; index < gUnknown_203B21C->unk1A; index++)
|
||||
{
|
||||
temp_calc = (gUnknown_203B21C->unk1E * gUnknown_203B21C->unk1C) + iVar4;
|
||||
temp_calc = (gUnknown_203B21C->unk1E * gUnknown_203B21C->unk1C) + index;
|
||||
heldItem = GetKecleonWareShopItem(temp_calc);
|
||||
|
||||
index_shift = heldItem->itemIndex << 16;
|
||||
|
|
@ -926,16 +926,16 @@ void sub_801A4A4(void)
|
|||
local_7c.unk4 = 0;
|
||||
local_7c.unk6 = 0x58;
|
||||
local_7c.unk8 = 1;
|
||||
sub_8090E14(auStack204,(struct ItemSlot *)&slot,&local_7c);
|
||||
iVar2 = GetStackBuyPrice((struct ItemSlot *)&slot);
|
||||
if (iVar2 <= gTeamInventory_203B460->teamMoney) {
|
||||
y = sub_8013800(gUnknown_203B21C,iVar4);
|
||||
xxx_call_draw_string(8,y,auStack204,gUnknown_203B21C->unk34,0);
|
||||
sub_8090E14(buffer1,(struct ItemSlot *)&slot,&local_7c);
|
||||
buyPrice = GetStackBuyPrice((struct ItemSlot *)&slot);
|
||||
if (buyPrice <= gTeamInventory_203B460->teamMoney) {
|
||||
y = sub_8013800(gUnknown_203B21C,index);
|
||||
xxx_call_draw_string(8,y,buffer1,gUnknown_203B21C->unk34,0);
|
||||
}
|
||||
else {
|
||||
sprintf_2(auStack112,gUnknown_80DB934,auStack204);
|
||||
y = sub_8013800(gUnknown_203B21C,iVar4);
|
||||
xxx_call_draw_string(8,y,auStack112,gUnknown_203B21C->unk34,0);
|
||||
sprintf_2(buffer2,gUnknown_80DB934,buffer1);
|
||||
y = sub_8013800(gUnknown_203B21C,index);
|
||||
xxx_call_draw_string(8,y,buffer2,gUnknown_203B21C->unk34,0);
|
||||
}
|
||||
}
|
||||
sub_80073E0(gUnknown_203B21C->unk34);
|
||||
|
|
@ -982,7 +982,7 @@ u32 sub_801A5D8(u32 param_1,int param_2,struct UnkTextStruct2_sub *param_3,u32 p
|
|||
u32 sub_801A6E8(u8 param_1)
|
||||
{
|
||||
s32 index;
|
||||
struct ItemSlot local_10;
|
||||
struct ItemSlot item;
|
||||
|
||||
if (param_1 == 0) {
|
||||
sub_8013660(&gUnknown_203B224->unk54);
|
||||
|
|
@ -1009,8 +1009,8 @@ u32 sub_801A6E8(u8 param_1)
|
|||
PlayMenuSoundEffect(2);
|
||||
break;
|
||||
case 4:
|
||||
local_10 = gTeamInventory_203B460->teamItems[sub_801A8AC()];
|
||||
if (CanSellItem(local_10.itemIndex) && (GetStackSellPrice(&local_10) + gTeamInventory_203B460->teamMoney < 100000))
|
||||
item = gTeamInventory_203B460->teamItems[sub_801A8AC()];
|
||||
if (CanSellItem(item.itemIndex) && (GetStackSellPrice(&item) + gTeamInventory_203B460->teamMoney < 100000))
|
||||
PlayMenuSoundEffect(0);
|
||||
else
|
||||
PlayMenuSoundEffect(2);
|
||||
|
|
@ -1258,17 +1258,17 @@ bool8 sub_801ADA0(s32 param_1)
|
|||
|
||||
s32 sub_801AE24(u32 itemIndex)
|
||||
{
|
||||
struct ItemSlot uVar3;
|
||||
struct ItemSlot itemSlot;
|
||||
u16 count;
|
||||
s32 invIndex;
|
||||
|
||||
count = 0;
|
||||
for (invIndex = 0; invIndex < GetNumberOfFilledInventorySlots(); invIndex++) {
|
||||
if (gUnknown_203B224->unk4[invIndex] != 0) {
|
||||
uVar3 = gTeamInventory_203B460->teamItems[invIndex];
|
||||
if (uVar3.itemIndex == itemIndex) {
|
||||
if (IsThrowableItem(uVar3.itemIndex)) {
|
||||
count += uVar3.numItems;
|
||||
itemSlot = gTeamInventory_203B460->teamItems[invIndex];
|
||||
if (itemSlot.itemIndex == itemIndex) {
|
||||
if (IsThrowableItem(itemSlot.itemIndex)) {
|
||||
count += itemSlot.numItems;
|
||||
}
|
||||
else {
|
||||
count++;
|
||||
|
|
@ -1316,15 +1316,15 @@ void sub_801AEE4(s32 index, s32 value)
|
|||
|
||||
void Kecleon_SortItems(void)
|
||||
{
|
||||
struct ItemSlot *puVar1;
|
||||
u32 *puVar2;
|
||||
struct ItemSlot *itemSlotR;
|
||||
u32 *itemIDR;
|
||||
u32 *base;
|
||||
int orderL;
|
||||
int orderR;
|
||||
u32 puVar4;
|
||||
struct ItemSlot uVar5;
|
||||
int itemR;
|
||||
int itemL;
|
||||
s32 orderL;
|
||||
s32 orderR;
|
||||
u32 itemIDL;
|
||||
struct ItemSlot itemSlotL;
|
||||
s32 itemR;
|
||||
s32 itemL;
|
||||
|
||||
for (itemL = 0; itemL < GetNumberOfFilledInventorySlots() - 1; itemL++) {
|
||||
for (itemR = itemL + 1; itemR < GetNumberOfFilledInventorySlots(); itemR++) {
|
||||
|
|
@ -1333,16 +1333,16 @@ void Kecleon_SortItems(void)
|
|||
if ((orderL > orderR) || ((orderL == orderR) &&
|
||||
(gTeamInventory_203B460->teamItems[itemL].numItems < gTeamInventory_203B460->teamItems[itemR].numItems))) {
|
||||
|
||||
uVar5 = gTeamInventory_203B460->teamItems[itemL];
|
||||
puVar1 = &gTeamInventory_203B460->teamItems[itemR];
|
||||
gTeamInventory_203B460->teamItems[itemL] = *puVar1;
|
||||
*puVar1 = uVar5;
|
||||
itemSlotL = gTeamInventory_203B460->teamItems[itemL];
|
||||
itemSlotR = &gTeamInventory_203B460->teamItems[itemR];
|
||||
gTeamInventory_203B460->teamItems[itemL] = *itemSlotR;
|
||||
*itemSlotR = itemSlotL;
|
||||
|
||||
base = gUnknown_203B224->unk4;
|
||||
puVar4 = gUnknown_203B224->unk4[itemL];
|
||||
puVar2 = &base[itemR];
|
||||
base[itemL] = *puVar2;
|
||||
*puVar2 = puVar4;
|
||||
itemIDL = gUnknown_203B224->unk4[itemL];
|
||||
itemIDR = &base[itemR];
|
||||
base[itemL] = *itemIDR;
|
||||
*itemIDR = itemIDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -388,27 +388,27 @@ void DrawLoadScreenText(void)
|
|||
void sub_80397B4(void)
|
||||
{
|
||||
struct OpenedFile *clmkFile;
|
||||
int iVar3;
|
||||
int iVar4;
|
||||
s32 other_arg;
|
||||
int index;
|
||||
int x;
|
||||
s32 y;
|
||||
|
||||
clmkFile = OpenFileAndGetFileDataPtr(gClmkpatFileName,&gTitleMenuFileArchive); // clmkpat
|
||||
|
||||
for(iVar3 = 0; iVar3 < 64; iVar3++)
|
||||
for(index = 0; index < 64; index++)
|
||||
{
|
||||
SetBGPaletteBufferColorArray(iVar3 + 176,*(int *)((clmkFile->data) + 4) + iVar3 * 4);
|
||||
SetBGPaletteBufferColorArray(index + 176,*(int *)((clmkFile->data) + 4) + index * 4);
|
||||
}
|
||||
|
||||
iVar4 = 8;
|
||||
other_arg = 0x49;
|
||||
x = 8;
|
||||
y = 0x49;
|
||||
|
||||
// Draw the 12 legendary icons
|
||||
for(iVar3 = 0; iVar3 < 12; iVar3++)
|
||||
for(index = 0; index < 12; index++)
|
||||
{
|
||||
if (sub_80023E4(gUnknown_203B3B8[iVar3])) {
|
||||
sub_8007E20(0,iVar4,other_arg,0x10,0x10,*(int *)(clmkFile->data) + iVar3 * 0x80,
|
||||
gUnknown_203B388[iVar3]);
|
||||
iVar4 += 16;
|
||||
if (sub_80023E4(gUnknown_203B3B8[index])) {
|
||||
sub_8007E20(0,x,y,0x10,0x10,*(int *)(clmkFile->data) + index * 0x80,
|
||||
gUnknown_203B388[index]);
|
||||
x += 16;
|
||||
}
|
||||
}
|
||||
CloseFile(clmkFile);
|
||||
|
|
|
|||
|
|
@ -13,18 +13,18 @@
|
|||
struct unkStruct_203B2B0
|
||||
{
|
||||
// size: 0x174
|
||||
u8 unk0;
|
||||
bool8 evolutionComplete;
|
||||
u8 fill1[0x3];
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 evoItem1_itemIndex;
|
||||
u8 evoItem2_ItemIndex;
|
||||
u8 unk6;
|
||||
u16 unk8;
|
||||
u16 evolutionConditionStatus;
|
||||
/* 0xA */ s16 targetSpecies; // species # of the evolved pokemon (what we are evolving to)
|
||||
struct PokemonStruct *pokeStruct;
|
||||
/* 0x10 */ bool8 pokeRenamed;
|
||||
/* 0x14 */ u32 evoItem1_InvIndex; // inventory index of item
|
||||
/* 0x18 */ u32 evoItem2_InvIndex; // inventory index of item
|
||||
struct ItemSlot unk1C;
|
||||
struct ItemSlot chosenItem;
|
||||
u32 state;
|
||||
u32 fallbackState;
|
||||
u32 unk28;
|
||||
|
|
@ -156,6 +156,17 @@ enum
|
|||
LUMINOUS_CAVE_CANT_EVOLVE_YET = 0x1D,
|
||||
};
|
||||
|
||||
enum evolutionStatus
|
||||
{
|
||||
EVOLUTION_GOOD = 1,
|
||||
EVOLUTION_LACK_LEVEL = 1 << 1,
|
||||
EVOLUTION_NO_MORE = 1 << 2,
|
||||
EVOLUTION_LACK_ITEM = 1 << 3,
|
||||
EVOLUTION_LACK_IQ = 1 << 4,
|
||||
EVOLUTION_LACK_FRIEND_AREA = 1 << 5,
|
||||
EVOLUTION_LACK_ROOM = 1 << 6,
|
||||
};
|
||||
|
||||
u32 sub_802465C(void)
|
||||
{
|
||||
struct OpenedFile *faceFile;
|
||||
|
|
@ -168,7 +179,7 @@ u32 sub_802465C(void)
|
|||
gUnknown_203B2B0->unk30 = 0;
|
||||
gUnknown_203B2B0->pokeStruct = GetPlayerPokemonStruct();
|
||||
gUnknown_203B2B0->pokeRenamed = IsPokemonRenamed(gUnknown_203B2B0->pokeStruct);
|
||||
gUnknown_203B2B0->unk0 = 0;
|
||||
gUnknown_203B2B0->evolutionComplete = FALSE;
|
||||
faceFile = GetDialogueSpriteDataPtr(SPECIES_GULPIN);
|
||||
gUnknown_203B2B0->unk104 = faceFile;
|
||||
gUnknown_203B2B0->unk108 = faceFile->data;
|
||||
|
|
@ -226,9 +237,9 @@ u32 sub_80246F0(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
u8 sub_80247B4(void)
|
||||
bool8 HasEvolutionCompleted(void)
|
||||
{
|
||||
return gUnknown_203B2B0->unk0;
|
||||
return gUnknown_203B2B0->evolutionComplete;
|
||||
}
|
||||
|
||||
void CleanLuminousCave(void)
|
||||
|
|
@ -250,7 +261,7 @@ void UpdateLuminousCaveState(u32 newState)
|
|||
|
||||
void sub_8024804(void)
|
||||
{
|
||||
s32 iVar4;
|
||||
s32 index;
|
||||
|
||||
sub_8006518(gUnknown_203B2B0->unk114);
|
||||
switch(gUnknown_203B2B0->state) {
|
||||
|
|
@ -270,9 +281,9 @@ void sub_8024804(void)
|
|||
case LUMINOUS_CAVE_LACK_ITEM:
|
||||
break;
|
||||
default:
|
||||
for(iVar4 = 0; iVar4 < 4; iVar4++)
|
||||
for(index = 0; index < 4; index++)
|
||||
{
|
||||
gUnknown_203B2B0->unk114[iVar4] = gUnknown_80DC9E8;
|
||||
gUnknown_203B2B0->unk114[index] = gUnknown_80DC9E8;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -342,7 +353,7 @@ void UpdateLuminousCaveDialogue(void)
|
|||
break;
|
||||
case 9:
|
||||
case 0xe:
|
||||
sub_801B3C0(&gUnknown_203B2B0->unk1C);
|
||||
sub_801B3C0(&gUnknown_203B2B0->chosenItem);
|
||||
break;
|
||||
case LUMINOUS_CAVE_LACK_WHAT_NEEDED:
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_GIVE_ITEM_1;
|
||||
|
|
@ -355,19 +366,19 @@ void UpdateLuminousCaveDialogue(void)
|
|||
case LUMINOUS_CAVE_LET_US_BEGIN:
|
||||
sub_8025254();
|
||||
|
||||
if((gUnknown_203B2B0->unk8 & 1) != 0)
|
||||
if((gUnknown_203B2B0->evolutionConditionStatus & EVOLUTION_GOOD))
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_CHANGED_APPEARANCE;
|
||||
else if(gUnknown_203B2B0->unk8 == 4)
|
||||
else if(gUnknown_203B2B0->evolutionConditionStatus == EVOLUTION_NO_MORE)
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_CANT_EVOLVE_ANYMORE;
|
||||
else if(gUnknown_203B2B0->unk8 == 2)
|
||||
else if(gUnknown_203B2B0->evolutionConditionStatus == EVOLUTION_LACK_LEVEL)
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_LACK_LEVEL;
|
||||
else if(gUnknown_203B2B0->unk8 == 0x10)
|
||||
else if(gUnknown_203B2B0->evolutionConditionStatus == EVOLUTION_LACK_IQ)
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_LACK_IQ;
|
||||
else if(gUnknown_203B2B0->unk8 == 0x20)
|
||||
else if(gUnknown_203B2B0->evolutionConditionStatus == EVOLUTION_LACK_FRIEND_AREA)
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_LACK_FRIEND_AREA;
|
||||
else if(gUnknown_203B2B0->unk8 == 0x40)
|
||||
else if(gUnknown_203B2B0->evolutionConditionStatus == EVOLUTION_LACK_ROOM)
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_LACK_ROOM;
|
||||
else if(gUnknown_203B2B0->unk8 == 8)
|
||||
else if(gUnknown_203B2B0->evolutionConditionStatus == EVOLUTION_LACK_ITEM)
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_LACK_ITEM;
|
||||
else
|
||||
gUnknown_203B2B0->fallbackState = LUMINOUS_CAVE_CANT_EVOLVE_YET;
|
||||
|
|
@ -385,7 +396,7 @@ void UpdateLuminousCaveDialogue(void)
|
|||
strcpy(gAvailablePokemonNames,monName);
|
||||
monName = GetMonSpecies(gUnknown_203B2B0->targetSpecies);
|
||||
strcpy(gAvailablePokemonNames + 0x50,monName);
|
||||
gUnknown_203B2B0->unk0 = 1;
|
||||
gUnknown_203B2B0->evolutionComplete = TRUE;
|
||||
sub_80977D0();
|
||||
sub_808F734(gUnknown_203B2B0->pokeStruct,gUnknown_203B2B0->targetSpecies);
|
||||
nullsub_104();
|
||||
|
|
@ -478,7 +489,7 @@ void sub_8024D48(void)
|
|||
u8 *nullString;
|
||||
struct unkStruct_203B2B0 *preload;
|
||||
u32 defaultAction;
|
||||
s32 iVar4;
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
|
||||
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
|
||||
|
|
@ -497,11 +508,11 @@ void sub_8024D48(void)
|
|||
preload->unk34[3].text = nullString;
|
||||
preload->unk34[3].menuAction = defaultAction;
|
||||
|
||||
for(iVar4 = 0; iVar4 < loopMax; iVar4++)
|
||||
for(index = 0; index < loopMax; index++)
|
||||
{
|
||||
if(gUnknown_203B2B0->unk74[iVar4] == 0)
|
||||
if(gUnknown_203B2B0->unk74[index] == 0)
|
||||
{
|
||||
if(gUnknown_203B2B0->unk34[iVar4].menuAction == gUnknown_203B2B0->unk2C)
|
||||
if(gUnknown_203B2B0->unk34[index].menuAction == gUnknown_203B2B0->unk2C)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -514,7 +525,7 @@ void sub_8024DBC(void)
|
|||
u8 *nullString;
|
||||
struct unkStruct_203B2B0 *preload;
|
||||
u32 defaultAction;
|
||||
s32 iVar4;
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
|
||||
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
|
||||
|
|
@ -533,11 +544,11 @@ void sub_8024DBC(void)
|
|||
preload->unk34[3].text = nullString;
|
||||
preload->unk34[3].menuAction = defaultAction;
|
||||
|
||||
for(iVar4 = 0; iVar4 < loopMax; iVar4++)
|
||||
for(index = 0; index < loopMax; index++)
|
||||
{
|
||||
if(gUnknown_203B2B0->unk74[iVar4] == 0)
|
||||
if(gUnknown_203B2B0->unk74[index] == 0)
|
||||
{
|
||||
if(gUnknown_203B2B0->unk34[iVar4].menuAction == gUnknown_203B2B0->unk2C)
|
||||
if(gUnknown_203B2B0->unk34[index].menuAction == gUnknown_203B2B0->unk2C)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -550,7 +561,7 @@ void sub_8024E30(void)
|
|||
u8 *nullString;
|
||||
struct unkStruct_203B2B0 *preload;
|
||||
u32 defaultAction;
|
||||
s32 iVar4;
|
||||
s32 index;
|
||||
s32 loopMax;
|
||||
|
||||
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
|
||||
|
|
@ -567,11 +578,11 @@ void sub_8024E30(void)
|
|||
preload->unk34[2].text = nullString;
|
||||
preload->unk34[2].menuAction = defaultAction;
|
||||
|
||||
for(iVar4 = 0; iVar4 < loopMax; iVar4++)
|
||||
for(index = 0; index < loopMax; index++)
|
||||
{
|
||||
if(gUnknown_203B2B0->unk74[iVar4] == 0)
|
||||
if(gUnknown_203B2B0->unk74[index] == 0)
|
||||
{
|
||||
if(gUnknown_203B2B0->unk34[iVar4].menuAction == gUnknown_203B2B0->unk30)
|
||||
if(gUnknown_203B2B0->unk34[index].menuAction == gUnknown_203B2B0->unk30)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -660,11 +671,11 @@ void sub_8024FD4(void)
|
|||
case 3:
|
||||
gUnknown_203B2B0->evoItem1_InvIndex = sub_801A8AC();
|
||||
gUnknown_203B2B0->evoItem2_InvIndex = INVENTORY_SIZE;
|
||||
gUnknown_203B2B0->unk1C = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem1_InvIndex];
|
||||
gUnknown_203B2B0->chosenItem = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem1_InvIndex];
|
||||
UpdateLuminousCaveState(8);
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B2B0->unk1C = gTeamInventory_203B460->teamItems[sub_801A8AC()];
|
||||
gUnknown_203B2B0->chosenItem = gTeamInventory_203B460->teamItems[sub_801A8AC()];
|
||||
sub_8099690(0);
|
||||
UpdateLuminousCaveState(9);
|
||||
break;
|
||||
|
|
@ -683,14 +694,14 @@ void sub_8025058(void)
|
|||
if(gUnknown_203B2B0->evoItem1_InvIndex != sub_801A8AC())
|
||||
{
|
||||
gUnknown_203B2B0->evoItem2_InvIndex = sub_801A8AC();
|
||||
gUnknown_203B2B0->unk1C = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem2_InvIndex];
|
||||
gUnknown_203B2B0->chosenItem = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem2_InvIndex];
|
||||
UpdateLuminousCaveState(0xD);
|
||||
}
|
||||
else
|
||||
PlayMenuSoundEffect(2);
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B2B0->unk1C = gTeamInventory_203B460->teamItems[sub_801A8AC()];
|
||||
gUnknown_203B2B0->chosenItem = gTeamInventory_203B460->teamItems[sub_801A8AC()];
|
||||
sub_8099690(0);
|
||||
UpdateLuminousCaveState(0xE);
|
||||
break;
|
||||
|
|
@ -811,37 +822,37 @@ void LuminousCave_AdvancetoFallbackState(void)
|
|||
void sub_8025254(void)
|
||||
{
|
||||
if(gUnknown_203B2B0->evoItem1_InvIndex == INVENTORY_SIZE)
|
||||
gUnknown_203B2B0->unk4 = 0;
|
||||
gUnknown_203B2B0->evoItem1_itemIndex = 0;
|
||||
else
|
||||
{
|
||||
gUnknown_203B2B0->unk4 = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem1_InvIndex].itemIndex;
|
||||
gUnknown_203B2B0->evoItem1_itemIndex = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem1_InvIndex].itemIndex;
|
||||
}
|
||||
if(gUnknown_203B2B0->evoItem2_InvIndex == INVENTORY_SIZE)
|
||||
gUnknown_203B2B0->unk5 = 0;
|
||||
gUnknown_203B2B0->evoItem2_ItemIndex = 0;
|
||||
else
|
||||
{
|
||||
gUnknown_203B2B0->unk5 = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem2_InvIndex].itemIndex;
|
||||
gUnknown_203B2B0->evoItem2_ItemIndex = gTeamInventory_203B460->teamItems[gUnknown_203B2B0->evoItem2_InvIndex].itemIndex;
|
||||
}
|
||||
|
||||
gUnknown_203B2B0->unk6 = RandomCapped(0xFF);
|
||||
sub_808F468(gUnknown_203B2B0->pokeStruct, &gUnknown_203B2B0->unk4, 1);
|
||||
sub_808F468(gUnknown_203B2B0->pokeStruct, &gUnknown_203B2B0->evoItem1_itemIndex, 1);
|
||||
}
|
||||
|
||||
bool8 LuminousCave_HasOnly1Member(void)
|
||||
{
|
||||
s32 r3;
|
||||
s32 iVar3; // loop index
|
||||
s32 memberCount;
|
||||
s32 index;
|
||||
struct PokemonStruct *preload;
|
||||
|
||||
preload = &gRecruitedPokemonRef->pokemon[0];
|
||||
r3 = 0;
|
||||
for(iVar3 = 0; iVar3 < NUM_SPECIES; iVar3++, preload++)
|
||||
memberCount = 0;
|
||||
for(index = 0; index < NUM_SPECIES; index++, preload++)
|
||||
{
|
||||
if((preload->unk0 >> 1) & 1)
|
||||
r3++;
|
||||
memberCount++;
|
||||
}
|
||||
|
||||
if(r3 == 1)
|
||||
if(memberCount == 1)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user