mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-13 19:45:40 -05:00
sub_8068A84
This commit is contained in:
@@ -6,173 +6,6 @@
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start sub_8068A84
|
||||
sub_8068A84:
|
||||
push {r4-r7,lr}
|
||||
adds r6, r0, 0
|
||||
movs r4, 0
|
||||
movs r5, 0
|
||||
ldr r7, _08068AE0
|
||||
_08068A8E:
|
||||
movs r0, 0x64
|
||||
muls r0, r5
|
||||
ldr r1, _08068AE4
|
||||
adds r0, r1
|
||||
ldr r1, [r7]
|
||||
adds r2, r1, r0
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08068AB2
|
||||
movs r1, 0xE
|
||||
ldrsh r0, [r2, r1]
|
||||
bl GetBodySize
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r4, r0
|
||||
_08068AB2:
|
||||
adds r5, 0x1
|
||||
cmp r5, 0x3
|
||||
ble _08068A8E
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r6, r1]
|
||||
bl GetBodySize
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r4, r0
|
||||
cmp r4, 0x6
|
||||
ble _08068B04
|
||||
ldr r0, _08068AE8
|
||||
adds r1, r6, 0
|
||||
movs r2, 0
|
||||
bl PrintColoredPokeNameToBuffer
|
||||
ldrb r0, [r6, 0x4]
|
||||
cmp r0, 0x4A
|
||||
bne _08068AF0
|
||||
ldr r0, _08068AEC
|
||||
b _08068BB2
|
||||
.align 2, 0
|
||||
_08068AE0: .4byte gRecruitedPokemonRef
|
||||
_08068AE4: .4byte 0x00008df8
|
||||
_08068AE8: .4byte gFormatBuffer_Monsters
|
||||
_08068AEC: .4byte gUnknown_80FE0F4
|
||||
_08068AF0:
|
||||
cmp r0, 0x47
|
||||
bne _08068AFC
|
||||
ldr r0, _08068AF8
|
||||
b _08068BB2
|
||||
.align 2, 0
|
||||
_08068AF8: .4byte gUnknown_80FE0F8
|
||||
_08068AFC:
|
||||
ldr r0, _08068B00
|
||||
b _08068BB2
|
||||
.align 2, 0
|
||||
_08068B00: .4byte gUnknown_80FE0AC
|
||||
_08068B04:
|
||||
movs r5, 0
|
||||
ldr r2, _08068B6C
|
||||
_08068B08:
|
||||
movs r0, 0x64
|
||||
muls r0, r5
|
||||
ldr r1, _08068B70
|
||||
adds r0, r1
|
||||
ldr r1, [r2]
|
||||
adds r4, r1, r0
|
||||
ldrb r1, [r4]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08068B80
|
||||
adds r0, r4, 0
|
||||
adds r1, r6, 0
|
||||
ldr r2, _08068B74
|
||||
bl xxx_pokemonstruct_to_pokemon2_808DE50
|
||||
ldrh r0, [r4]
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
orrs r1, r0
|
||||
strh r1, [r4]
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0x19
|
||||
bgt _08068B3E
|
||||
movs r0, 0x1A
|
||||
strh r0, [r4, 0x8]
|
||||
_08068B3E:
|
||||
ldrh r0, [r4]
|
||||
movs r1, 0x2
|
||||
orrs r0, r1
|
||||
strh r0, [r4]
|
||||
strh r5, [r4, 0xC]
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x40
|
||||
strb r2, [r0, 0x2]
|
||||
strb r2, [r0, 0x1]
|
||||
strb r2, [r0]
|
||||
ldr r0, _08068B78
|
||||
adds r1, r6, 0
|
||||
movs r2, 0x6
|
||||
bl PrintColoredPokeNameToBuffer
|
||||
ldrb r0, [r6, 0x4]
|
||||
cmp r0, 0x4A
|
||||
beq _08068BB0
|
||||
cmp r0, 0x47
|
||||
beq _08068BD0
|
||||
ldr r0, _08068B7C
|
||||
b _08068BB2
|
||||
.align 2, 0
|
||||
_08068B6C: .4byte gRecruitedPokemonRef
|
||||
_08068B70: .4byte 0x00008df8
|
||||
_08068B74: .4byte 0x000055aa
|
||||
_08068B78: .4byte gFormatBuffer_Monsters
|
||||
_08068B7C: .4byte gUnknown_80FE134
|
||||
_08068B80:
|
||||
adds r5, 0x1
|
||||
cmp r5, 0x3
|
||||
ble _08068B08
|
||||
ldr r0, _08068B9C
|
||||
adds r1, r6, 0
|
||||
movs r2, 0x6
|
||||
bl PrintColoredPokeNameToBuffer
|
||||
ldrb r0, [r6, 0x4]
|
||||
cmp r0, 0x4A
|
||||
bne _08068BA4
|
||||
ldr r0, _08068BA0
|
||||
b _08068BB2
|
||||
.align 2, 0
|
||||
_08068B9C: .4byte gFormatBuffer_Monsters
|
||||
_08068BA0: .4byte gUnknown_80FE0F4
|
||||
_08068BA4:
|
||||
cmp r0, 0x47
|
||||
bne _08068BC4
|
||||
ldr r0, _08068BAC
|
||||
b _08068BB2
|
||||
.align 2, 0
|
||||
_08068BAC: .4byte gUnknown_80FE0F8
|
||||
_08068BB0:
|
||||
ldr r0, _08068BC0
|
||||
_08068BB2:
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
b _08068BD0
|
||||
.align 2, 0
|
||||
_08068BC0: .4byte gUnknown_80FE168
|
||||
_08068BC4:
|
||||
ldr r0, _08068BD8
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
_08068BD0:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08068BD8: .4byte gUnknown_80FE0AC
|
||||
thumb_func_end sub_8068A84
|
||||
|
||||
thumb_func_start sub_8068BDC
|
||||
sub_8068BDC:
|
||||
|
||||
@@ -62,7 +62,7 @@ typedef struct PokemonStruct2
|
||||
/* 0x2 */ bool8 isTeamLeader;
|
||||
/* 0x3 */ u8 level;
|
||||
/* 0x4 */ DungeonLocation dungeonLocation;
|
||||
/* 0x8 */ u16 IQ;
|
||||
/* 0x8 */ s16 IQ;
|
||||
s16 unkA;
|
||||
u16 unkC;
|
||||
/* 0xE */ s16 speciesNum;
|
||||
@@ -172,7 +172,7 @@ struct unkStruct_808D144
|
||||
/* 0x16 */ u16 level;
|
||||
/* 0x18 */ u16 IQ;
|
||||
s16 offenseAtk[2]; // atk, spatt, def, spdef (not sure why s16/u16 and not u8)
|
||||
s16 offenseDef[2];
|
||||
s16 offenseDef[2];
|
||||
/* 0x24 */ u32 currExp;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#include "pokemon_3.h"
|
||||
#include "text.h"
|
||||
#include "moves.h"
|
||||
#include "string_format.h"
|
||||
#include "dungeon_message.h"
|
||||
#include "constants/dungeon.h"
|
||||
|
||||
// monster_sbin.s
|
||||
// data_8106A4C.s
|
||||
@@ -239,7 +242,7 @@ void sub_806890C(void)
|
||||
if (PokemonFlag1(pokeStruct) && PokemonFlag2(pokeStruct)) {
|
||||
xxx_pokemonstruct_index_to_pokemon2_808DE30(&gRecruitedPokemonRef->pokemon2[index],speciesId);
|
||||
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) {
|
||||
struct DungeonLocation dungeonLoc = {.id = 0, .floor = 1};
|
||||
struct DungeonLocation dungeonLoc = {.id = DUNGEON_TINY_WOODS, .floor = 1};
|
||||
sub_808CFD0(&stack,pokeStruct->speciesNum,0,0,&dungeonLoc,0);
|
||||
gRecruitedPokemonRef->pokemon2[index].level = stack.level;
|
||||
gRecruitedPokemonRef->pokemon2[index].IQ = stack.IQ;
|
||||
@@ -260,7 +263,78 @@ void sub_806890C(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(; index < 4; index++) {
|
||||
for (; index < 4; index++) {
|
||||
gRecruitedPokemonRef->pokemon2[index].unk0 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
extern u8 *gUnknown_80FE168[];
|
||||
extern u8 *gUnknown_80FE134[];
|
||||
extern u8 *gUnknown_80FE0F4[];
|
||||
extern u8 *gUnknown_80FE0F8[];
|
||||
extern u8 *gUnknown_80FE0AC[];
|
||||
|
||||
void sub_8068A84(PokemonStruct1 *pokemon)
|
||||
{
|
||||
s32 i, totalBodySize;
|
||||
|
||||
totalBodySize = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
PokemonStruct2 *ptr = &gRecruitedPokemonRef->pokemon2[i];
|
||||
if (PokemonFlag1Struct2(ptr)) {
|
||||
totalBodySize += GetBodySize(ptr->speciesNum);
|
||||
}
|
||||
}
|
||||
|
||||
totalBodySize += GetBodySize(pokemon->speciesNum);
|
||||
if (totalBodySize >= 7) {
|
||||
PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,0);
|
||||
if (pokemon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE0F4,1);
|
||||
}
|
||||
else if (pokemon->dungeonLocation.id == DUNGEON_RESCUE_TEAM_BASE) {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE0F8,1);
|
||||
}
|
||||
else {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE0AC,1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < 4; i++) {
|
||||
PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[i];
|
||||
if (!PokemonFlag1Struct2(monPtr)) {
|
||||
xxx_pokemonstruct_to_pokemon2_808DE50(monPtr,pokemon,0x55aa);
|
||||
monPtr->unk0 |= 1;
|
||||
if (monPtr->IQ < 0x1a) {
|
||||
monPtr->IQ = 0x1a;
|
||||
}
|
||||
monPtr->unk0 |= 2;
|
||||
monPtr->unkC = i;
|
||||
ZeroOutItem(&monPtr->itemSlot);
|
||||
PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,6);
|
||||
if (pokemon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE168,1);
|
||||
}
|
||||
else if (pokemon->dungeonLocation.id == DUNGEON_RESCUE_TEAM_BASE) {
|
||||
;
|
||||
}
|
||||
else {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE134,1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
PrintColoredPokeNameToBuffer(gFormatBuffer_Monsters[0],pokemon,6);
|
||||
if (pokemon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE0F4,1);
|
||||
}
|
||||
else if (pokemon->dungeonLocation.id == DUNGEON_RESCUE_TEAM_BASE) {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE0F8,1);
|
||||
}
|
||||
else {
|
||||
DisplayDungeonMessage(0,*gUnknown_80FE0AC,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user