mirror of
https://github.com/pret/pmd-red.git
synced 2024-11-26 22:40:33 +00:00
DisplayYouReachedDestFloorStr
This commit is contained in:
parent
68dcdcef5b
commit
2c2b5ed409
@ -5,305 +5,7 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8052D44
|
||||
sub_8052D44:
|
||||
push {r4-r7,lr}
|
||||
adds r7, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r6, r2, 0
|
||||
adds r0, r4, 0
|
||||
bl EntityExists
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, 0
|
||||
beq _08052D70
|
||||
ldr r0, _08052D6C
|
||||
adds r1, r4, 0
|
||||
movs r2, 0
|
||||
bl SetMessageArgument
|
||||
ldr r0, [r4, 0x70]
|
||||
ldrh r0, [r0, 0x4]
|
||||
strh r0, [r7]
|
||||
b _08052D7A
|
||||
.align 2, 0
|
||||
_08052D6C: .4byte gAvailablePokemonNames
|
||||
_08052D70:
|
||||
ldr r0, _08052D9C
|
||||
ldr r1, _08052DA0
|
||||
bl strcpy
|
||||
strh r5, [r7]
|
||||
_08052D7A:
|
||||
adds r0, r6, 0
|
||||
bl EntityExists
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0
|
||||
beq _08052DA8
|
||||
ldr r0, _08052DA4
|
||||
adds r1, r6, 0
|
||||
movs r2, 0
|
||||
bl SetMessageArgument
|
||||
ldr r0, [r6, 0x70]
|
||||
ldrh r0, [r0, 0x4]
|
||||
strh r0, [r7, 0x2]
|
||||
b _08052DB2
|
||||
.align 2, 0
|
||||
_08052D9C: .4byte gAvailablePokemonNames
|
||||
_08052DA0: .4byte gUnknown_80F7AF8
|
||||
_08052DA4: .4byte gUnknown_202DFE8
|
||||
_08052DA8:
|
||||
ldr r0, _08052DB8
|
||||
ldr r1, _08052DBC
|
||||
bl strcpy
|
||||
strh r4, [r7, 0x2]
|
||||
_08052DB2:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08052DB8: .4byte gUnknown_202DFE8
|
||||
_08052DBC: .4byte gUnknown_80F7AF8
|
||||
thumb_func_end sub_8052D44
|
||||
|
||||
thumb_func_start sub_8052DC0
|
||||
sub_8052DC0:
|
||||
push {lr}
|
||||
bl sub_8045888
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8052DC0
|
||||
|
||||
thumb_func_start sub_8052DD0
|
||||
sub_8052DD0:
|
||||
push {r4-r6,lr}
|
||||
bl GetLeader
|
||||
adds r5, r0, 0
|
||||
ldr r6, _08052E68
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08052E46
|
||||
ldr r6, _08052E6C
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08052E46
|
||||
ldr r6, _08052E70
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08052E46
|
||||
ldr r0, _08052E74
|
||||
ldr r0, [r0]
|
||||
ldr r1, _08052E78
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x1
|
||||
bne _08052EB6
|
||||
ldr r6, _08052E7C
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08052E46
|
||||
ldr r6, _08052E80
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08052E46
|
||||
ldr r6, _08052E84
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08052E88
|
||||
_08052E46:
|
||||
adds r0, r4, 0
|
||||
bl SetTutorialFlag
|
||||
bl sub_8083E28
|
||||
ldr r4, [r6, 0x4]
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_80522E8
|
||||
b _08052EB6
|
||||
.align 2, 0
|
||||
_08052E68: .4byte gUnknown_80FF020
|
||||
_08052E6C: .4byte gUnknown_80FF080
|
||||
_08052E70: .4byte gUnknown_80FF0D8
|
||||
_08052E74: .4byte gDungeon
|
||||
_08052E78: .4byte 0x00000644
|
||||
_08052E7C: .4byte gUnknown_80FF13C
|
||||
_08052E80: .4byte gUnknown_80FF1B4
|
||||
_08052E84: .4byte gMovementTutorial
|
||||
_08052E88:
|
||||
ldr r6, _08052EBC
|
||||
ldr r4, [r6]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08052EB6
|
||||
adds r0, r4, 0
|
||||
bl SetTutorialFlag
|
||||
bl sub_8083E28
|
||||
ldr r4, [r6, 0x4]
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_80522E8
|
||||
_08052EB6:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08052EBC: .4byte gHungerTutorial
|
||||
thumb_func_end sub_8052DD0
|
||||
|
||||
thumb_func_start HandleOnPickupTutorial
|
||||
HandleOnPickupTutorial:
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
adds r5, r4, 0
|
||||
adds r0, r4, 0
|
||||
bl GetItemCategory
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x3
|
||||
bne _08052EE0
|
||||
ldr r5, _08052EDC
|
||||
b _08052F22
|
||||
.align 2, 0
|
||||
_08052EDC: .4byte gFoodTutorial
|
||||
_08052EE0:
|
||||
cmp r4, 0x37
|
||||
bne _08052EEC
|
||||
ldr r5, _08052EE8
|
||||
b _08052F22
|
||||
.align 2, 0
|
||||
_08052EE8: .4byte gOranTutorial
|
||||
_08052EEC:
|
||||
cmp r4, 0x43
|
||||
bne _08052EF8
|
||||
ldr r5, _08052EF4
|
||||
b _08052F22
|
||||
.align 2, 0
|
||||
_08052EF4: .4byte gCheriTutorial
|
||||
_08052EF8:
|
||||
cmp r4, 0x48
|
||||
bne _08052F04
|
||||
ldr r5, _08052F00
|
||||
b _08052F22
|
||||
.align 2, 0
|
||||
_08052F00: .4byte gBlastSeedTutorial
|
||||
_08052F04:
|
||||
cmp r4, 0x7
|
||||
bne _08052F10
|
||||
ldr r5, _08052F0C
|
||||
b _08052F22
|
||||
.align 2, 0
|
||||
_08052F0C: .4byte gUnknown_80FF4A0
|
||||
_08052F10:
|
||||
cmp r4, 0x42
|
||||
bne _08052F1C
|
||||
ldr r5, _08052F18
|
||||
b _08052F22
|
||||
.align 2, 0
|
||||
_08052F18: .4byte gPechaTutorial
|
||||
_08052F1C:
|
||||
cmp r4, 0x45
|
||||
bne _08052F4C
|
||||
ldr r5, _08052F48
|
||||
_08052F22:
|
||||
ldr r4, [r5]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08052F74
|
||||
adds r0, r4, 0
|
||||
bl SetTutorialFlag
|
||||
bl sub_8083E28
|
||||
ldr r1, [r5, 0x4]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
b _08052F74
|
||||
.align 2, 0
|
||||
_08052F48: .4byte gSleepSeedTutorial
|
||||
_08052F4C:
|
||||
cmp r5, 0x69
|
||||
bne _08052F74
|
||||
ldr r5, _08052F7C
|
||||
ldr r4, [r5]
|
||||
adds r0, r4, 0
|
||||
bl GetTutorialFlag
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08052F74
|
||||
adds r0, r4, 0
|
||||
bl SetTutorialFlag
|
||||
bl sub_8083E28
|
||||
ldr r1, [r5, 0x4]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
_08052F74:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08052F7C: .4byte gMoneyTutorial
|
||||
thumb_func_end HandleOnPickupTutorial
|
||||
|
||||
thumb_func_start sub_8052F80
|
||||
sub_8052F80:
|
||||
push {lr}
|
||||
ldr r0, _08052F9C
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0xA]
|
||||
cmp r0, 0
|
||||
beq _08052FA4
|
||||
ldr r0, _08052FA0
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
b _08052FB0
|
||||
.align 2, 0
|
||||
_08052F9C: .4byte gDungeon
|
||||
_08052FA0: .4byte gUnknown_80FF6F8
|
||||
_08052FA4:
|
||||
ldr r0, _08052FB4
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl DisplayDungeonMessage
|
||||
_08052FB0:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08052FB4: .4byte gUnknown_80FF6A4
|
||||
thumb_func_end sub_8052F80
|
||||
|
||||
thumb_func_start sub_8052FB8
|
||||
sub_8052FB8:
|
||||
|
@ -321,7 +321,7 @@ extern void DisplayPreFightDialogue(void);
|
||||
extern void sub_8071DA4(Entity *);
|
||||
extern void sub_803E748(void);
|
||||
extern void sub_8083D68(void);
|
||||
extern void sub_8052F80(void);
|
||||
extern void DisplayYouReachedDestFloorStr(void);
|
||||
extern void sub_803E7C8(void);
|
||||
extern void sub_8040A84(void);
|
||||
extern void sub_807E5AC(void);
|
||||
@ -723,7 +723,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
|
||||
if (gDungeon->unk9 != 0) {
|
||||
gDungeon->unk9 = 0;
|
||||
sub_8083D68();
|
||||
sub_8052F80();
|
||||
DisplayYouReachedDestFloorStr();
|
||||
}
|
||||
}
|
||||
gLeaderPointer = NULL;
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "file_system.h"
|
||||
#include "dungeon_util_1.h"
|
||||
#include "code_800D090.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "code_8045A00.h"
|
||||
#include "exclusive_pokemon.h"
|
||||
#include "dungeon_leader.h"
|
||||
|
||||
void sub_80526D0(s32 r0);
|
||||
extern bool8 sub_8045888(Entity *r0);
|
||||
@ -568,3 +572,130 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const
|
||||
sub_803EAF0(0, 0);
|
||||
return chosenMenuIndex;
|
||||
}
|
||||
|
||||
void sub_8052D44(s16 *ids, Entity *leader, Entity *partner)
|
||||
{
|
||||
if (EntityExists(leader)) {
|
||||
SetMessageArgument(gAvailablePokemonNames, leader, 0);
|
||||
ids[0] = GetEntInfo(leader)->apparentID;
|
||||
}
|
||||
else {
|
||||
strcpy(gAvailablePokemonNames, gUnknown_80F7AF8);
|
||||
ids[0] = 0;
|
||||
}
|
||||
|
||||
if (EntityExists(partner)) {
|
||||
SetMessageArgument(gUnknown_202DFE8, partner, 0);
|
||||
ids[1] = GetEntInfo(partner)->apparentID;
|
||||
}
|
||||
else {
|
||||
strcpy(gUnknown_202DFE8, gUnknown_80F7AF8);
|
||||
ids[1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_8052DC0(Entity *entity)
|
||||
{
|
||||
return sub_8045888(entity);
|
||||
}
|
||||
|
||||
struct TutorialFlagMsg
|
||||
{
|
||||
s32 flagId;
|
||||
const u8 *str;
|
||||
};
|
||||
|
||||
extern const struct TutorialFlagMsg gUnknown_80FF020;
|
||||
extern const struct TutorialFlagMsg gUnknown_80FF080;
|
||||
extern const struct TutorialFlagMsg gUnknown_80FF0D8;
|
||||
extern const struct TutorialFlagMsg gUnknown_80FF13C;
|
||||
extern const struct TutorialFlagMsg gUnknown_80FF1B4;
|
||||
extern const struct TutorialFlagMsg gMovementTutorial;
|
||||
extern const struct TutorialFlagMsg gHungerTutorial;
|
||||
extern const struct TutorialFlagMsg gFoodTutorial;
|
||||
extern const struct TutorialFlagMsg gOranTutorial;
|
||||
extern const struct TutorialFlagMsg gCheriTutorial;
|
||||
extern const struct TutorialFlagMsg gBlastSeedTutorial;
|
||||
extern const struct TutorialFlagMsg gUnknown_80FF4A0;
|
||||
extern const struct TutorialFlagMsg gPechaTutorial;
|
||||
extern const struct TutorialFlagMsg gSleepSeedTutorial;
|
||||
extern const struct TutorialFlagMsg gMoneyTutorial;
|
||||
|
||||
extern void sub_8083E28(void);
|
||||
|
||||
static inline bool32 DislayTutorialMsg(Entity *leader, const struct TutorialFlagMsg *tutorial, bool32 unkFunctionCall)
|
||||
{
|
||||
const u8 *str;
|
||||
s32 flag = tutorial->flagId;
|
||||
bool8 flagDone = GetTutorialFlag(flag);
|
||||
|
||||
if (!flagDone) {
|
||||
SetTutorialFlag(flag);
|
||||
sub_8083E28();
|
||||
str = tutorial->str;
|
||||
DisplayDungeonMessage(NULL, str, TRUE);
|
||||
if (unkFunctionCall) {
|
||||
sub_80522E8(leader, str);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_8052DD0(void)
|
||||
{
|
||||
Entity *leader = GetLeader();
|
||||
|
||||
if (DislayTutorialMsg(leader, &gUnknown_80FF020, TRUE)) return;
|
||||
if (DislayTutorialMsg(leader, &gUnknown_80FF080, TRUE)) return;
|
||||
if (DislayTutorialMsg(leader, &gUnknown_80FF0D8, TRUE)) return;
|
||||
if (gDungeon->dungeonLocation.id == DUNGEON_THUNDERWAVE_CAVE) {
|
||||
if (DislayTutorialMsg(leader, &gUnknown_80FF13C, TRUE)) return;
|
||||
if (DislayTutorialMsg(leader, &gUnknown_80FF1B4, TRUE)) return;
|
||||
if (DislayTutorialMsg(leader, &gMovementTutorial, TRUE)) return;
|
||||
if (DislayTutorialMsg(leader, &gHungerTutorial, TRUE)) return;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleOnPickupTutorial(u8 itemId)
|
||||
{
|
||||
u8 itemCategory = GetItemCategory(itemId);
|
||||
|
||||
if (itemCategory == CATEGORY_FOOD_GUMMIES) {
|
||||
DislayTutorialMsg(NULL, &gFoodTutorial, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_ORAN_BERRY) {
|
||||
DislayTutorialMsg(NULL, &gOranTutorial, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_CHERI_BERRY) {
|
||||
DislayTutorialMsg(NULL, &gCheriTutorial, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_BLAST_SEED) {
|
||||
DislayTutorialMsg(NULL, &gBlastSeedTutorial, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_GRAVELEROCK) {
|
||||
DislayTutorialMsg(NULL, &gUnknown_80FF4A0, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_PECHA_BERRY) {
|
||||
DislayTutorialMsg(NULL, &gPechaTutorial, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_SLEEP_SEED) {
|
||||
DislayTutorialMsg(NULL, &gSleepSeedTutorial, FALSE);
|
||||
}
|
||||
else if (itemId == ITEM_POKE) {
|
||||
DislayTutorialMsg(NULL, &gMoneyTutorial, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
extern const u8 *const gUnknown_80FF6F8;
|
||||
extern const u8 *const gUnknown_80FF6A4;
|
||||
|
||||
void DisplayYouReachedDestFloorStr(void)
|
||||
{
|
||||
if (gDungeon->unkA != 0) {
|
||||
DisplayDungeonMessage(NULL, gUnknown_80FF6F8, 1); // But the pokemon you seek isn't here...
|
||||
}
|
||||
else {
|
||||
DisplayDungeonMessage(NULL, gUnknown_80FF6A4, 1);
|
||||
}
|
||||
}
|
||||
|
@ -163,46 +163,23 @@ bool8 sub_8098134(s16 pokeID)
|
||||
return ((ptr->unk4[(index >> 5)] & (1 << (s16)(pokeID_s32_1 - ((index >> 5) * 0x20)))) != 0) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
void SetTutorialFlag(s32 param_1)
|
||||
void SetTutorialFlag(s32 index)
|
||||
{
|
||||
s32 index;
|
||||
struct ExclusivePokemonData *ptr;
|
||||
|
||||
ptr = gUnknown_203B498;
|
||||
if (param_1 < 0) {
|
||||
index = param_1 + 0x1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = param_1;
|
||||
}
|
||||
ptr->unk54[(index >> 5)] |= 1 << (param_1 - ((index >> 5) * 0x20));
|
||||
gUnknown_203B498->unk54[(index / 32)] |= (1 << (index - ((index / 32) * 32)));
|
||||
}
|
||||
|
||||
bool32 GetTutorialFlag(s32 param_1)
|
||||
bool32 GetTutorialFlag(s32 index)
|
||||
{
|
||||
s32 index;
|
||||
bool32 flag;
|
||||
struct ExclusivePokemonData *ptr;
|
||||
|
||||
if (param_1 > 0x1e) {
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
ptr = gUnknown_203B498;
|
||||
if (param_1 < 0) {
|
||||
index = param_1 + 0x1f;
|
||||
if (index > 0x1e) {
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = param_1;
|
||||
else {
|
||||
bool32 flag = gUnknown_203B498->unk54[(index / 32)] & (1 << (index - ((index / 32) * 32)));
|
||||
if (flag != 0) {
|
||||
flag = TRUE;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
flag = ptr->unk54[(index >> 5)] & 1 << (param_1 - ((index >> 5) * 0x20));
|
||||
if (flag != 0) {
|
||||
flag = TRUE;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 IsExclusivePokemonUnlocked(s16 pokeID)
|
||||
|
Loading…
Reference in New Issue
Block a user