diff --git a/data/data_8107224.s b/data/data_8107224.s index b7d4f2227..5322d8304 100644 --- a/data/data_8107224.s +++ b/data/data_8107224.s @@ -1,22 +1,18 @@ .section .rodata - +.string "pksdir0\0" @Groudon +.string "pksdir0\0" @Ray +.string "pksdir0\0" @Entei +.string "pksdir0\0" @Raikou +.string "pksdir0\0" @Suicune +.string "pksdir0\0" @HoOh +.string "pksdir0\0" @Latios .string "pksdir0\0" .string "pksdir0\0" .string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -@ ??? +.string "pksdir0\0" @ +@ ??? Jirachi .string "pksdir0\0" .global gUnknown_81074FC @@ -24,34 +20,18 @@ gUnknown_81074FC: @ 81074FC .byte 0x4e, 0x4f, 0x50, 0x51, 0x4a, 0x49, 0x3e, 0x38 @ ??? -.string "pksdir0\0" +.string "pksdir0\0" @ lugia @ ??? -.string "pksdir0\0" +.string "pksdir0\0" @kyorge @ ??? -.string "pksdir0\0" +.string "pksdir0\0" @ deoxys @ ??? -.string "pksdir0\0" +.string "pksdir0\0" @celebi @ ??? -.string "pksdir0\0" +.string "pksdir0\0" @unk @ ??? -.string "pksdir0\0" +.string "pksdir0\0" @ medicham @ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" - -.global gUnknown_8107544 -gUnknown_8107544: @ 8107544 -.byte 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 +.string "pksdir0\0" @ smeargle .align 2,0 diff --git a/include/dungeon_portrait_placement.h b/include/dungeon_portrait_placement.h new file mode 100644 index 000000000..7f6a1c8cb --- /dev/null +++ b/include/dungeon_portrait_placement.h @@ -0,0 +1,14 @@ +#ifndef GUARD_DUNGEON_PORTRAIT_PLACEMENT_H +#define GUARD_DUNGEON_PORTRAIT_PLACEMENT_H + +#include "structs/str_position.h" + +struct PortraitPlacementInfo +{ + DungeonPos pos; + bool8 flip; +}; + +const struct PortraitPlacementInfo *GetPortraitPlacementInfo(u8 id); + +#endif diff --git a/ld_script.txt b/ld_script.txt index dc709b798..53ca5656a 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -285,7 +285,11 @@ SECTIONS { src/dungeon_cutscene_skarmory.o(.text); src/dungeon_cutscene_meanies.o(.text); src/dungeon_cutscene_zapdos.o(.text); + src/dungeon_cutscene_moltres.o(.text); + src/dungeon_cutscene_articuno.o(.text); + src/dungeon_cutscene_empty_summit.o(.text); src/dungeon_cutscenes.o(.text); + src/dungeon_portrait_placement.o(.text); src/pokemon.o(.text); src/pokemon_3.o(.text); src/dungeon.o(.text); @@ -628,7 +632,11 @@ SECTIONS { src/dungeon_cutscene_skarmory.o(.rodata); src/dungeon_cutscene_meanies.o(.rodata); src/dungeon_cutscene_zapdos.o(.rodata); + src/dungeon_cutscene_moltres.o(.rodata); + src/dungeon_cutscene_articuno.o(.rodata); + src/dungeon_cutscene_empty_summit.o(.rodata); data/data_8107224.o(.rodata); + src/dungeon_portrait_placement.o(.rodata); src/pokemon.o(.rodata); data/data_81076E4.o(.rodata); src/game_options.o(.rodata); diff --git a/src/dungeon_cutscene_articuno.c b/src/dungeon_cutscene_articuno.c new file mode 100644 index 000000000..397c2b230 --- /dev/null +++ b/src/dungeon_cutscene_articuno.c @@ -0,0 +1,321 @@ +#include "global.h" +#include "globaldata.h" +#include "code_800DAC0.h" +#include "code_800E9A8.h" +#include "code_803E46C.h" +#include "code_803E668.h" +#include "code_8041AD0.h" +#include "code_804267C.h" +#include "code_80861A8.h" +#include "code_806CD90.h" +#include "code_80869E4.h" +#include "constants/bg_music.h" +#include "constants/direction.h" +#include "constants/friend_area.h" +#include "constants/weather.h" +#include "dungeon_items.h" +#include "dungeon_leader.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_music.h" +#include "dungeon_misc.h" +#include "dungeon_logic.h" +#include "dungeon_random.h" +#include "dungeon_util_1.h" +#include "dungeon_util.h" +#include "exclusive_pokemon.h" +#include "friend_area.h" +#include "items.h" +#include "pokemon_3.h" +#include "pokemon.h" +#include "position_util.h" +#include "trap.h" +#include "math.h" +#include "dungeon_config.h" +#include "dungeon_boss_dialogue.h" + +extern void sub_8042B0C(Entity *); +extern u8 sub_806FD18(Entity *); +extern void sub_806FDF4(Entity *, Entity *, Entity **); +extern s32 GetCameraXPos(void); +extern s32 GetCameraYPos(void); +extern void sub_803F878(u32, s32); +extern void BgColorCallNullsub4(void); +extern void sub_8085EB0(void); +extern void sub_8049884(void); +extern void sub_8049B8C(void); +extern void ShowWholeRevealedDungeonMap(void); +extern void sub_8086A54(Entity *); +extern void ResetMonEntityData(EntityInfo *, u32); +extern void sub_808BBA8(Entity * ); +extern void sub_8041888(u32); +extern u32 sub_80861F8(u32, Entity *, u32); +extern u8 sub_80860A8(u32); +extern void sub_8052D44(s16 *, Entity *, Entity *); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); +extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); +extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32); +extern void sub_807EAA0(u32, u32); +extern void sub_8072008(Entity *, Entity *, s16, u32, u32); +extern void sub_8085374(void); +extern u32 GetRandomFloorItem(u32); +extern bool8 sub_8085B80(struct_8085B80 *); +extern void sub_8086A3C(Entity *pokemon); +extern void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex); +extern u8 sub_8086AE4(s16 _index); + +static void sub_8088484(Entity *param_1); +static void ArticunoScreenFlash(void); +static void sub_8088574(void); + +void sub_8087F54(void) +{ + Entity *leaderEntity; + Entity *articunoEntity; + + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_8085374(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + SetFacingDirection(articunoEntity, DIRECTION_SOUTH); + sub_8086A3C(articunoEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); +} + +void sub_8087FB4(void) +{ + Entity *articunoEntity; + + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_8085374(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + SetFacingDirection(articunoEntity, DIRECTION_SOUTH); + sub_806CDD4(articunoEntity, 0xF, DIRECTION_SOUTH); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); +} + +void sub_8087FF8(void) +{ + Entity *leaderEntity; + Entity *articunoEntity; + + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); + sub_8085374(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + if (sub_8086AE4(MONSTER_ARTICUNO)) { + sub_8068FE0(articunoEntity,0x21c,0); + } + else { + sub_8072008(articunoEntity,articunoEntity,gArticunoConfigLevel,0,0); + SetFacingDirection(articunoEntity, DIRECTION_SOUTH); + sub_8086A3C(articunoEntity); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); +} + +void sub_8088088(u8 param_1, u8 param_2) +{ + if ((param_2 == 0xD || param_2 == 0xE || param_2 == 0xF) && (param_1 == 0xD)) { + sub_8097FA8(0x9); + gDungeon->unk2 = 1; + } +} + +void ArticunoPreFightDialogue(void) +{ + Entity *leaderEntity; + Entity *partnerEntity; + Entity *articunoEntity; + + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); + sub_8086448(); + SpriteLookAroundEffect(partnerEntity); + DisplayDungeonDialogue(gArticunoPreFightDialogue_1); + sub_803E708(10,0x46); + sub_8086598(); + DungeonStopBGM(); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_2); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_3); + sub_803E708(10,0x46); + SetFacingDirection(leaderEntity, DIRECTION_WEST); + sub_803E708(4,0x46); + SetFacingDirection(leaderEntity, DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + SetFacingDirection(leaderEntity, DIRECTION_WEST); + sub_803E708(4,0x46); + SetFacingDirection(leaderEntity, DIRECTION_SOUTHWEST); + sub_803E708(4,0x46); + SetFacingDirection(leaderEntity, DIRECTION_WEST); + sub_803E708(4,0x46); + SetFacingDirection(leaderEntity, DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + SetFacingDirection(leaderEntity, DIRECTION_WEST); + sub_803E708(10,0x46); + DisplayDungeonDialogue(gArticunoPreFightDialogue_4); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_5); + sub_803E708(10,0x46); + sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); + sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); + PlaySoundEffect(0x1d5); + SpriteLookAroundEffect(partnerEntity); + PlaySoundEffect(0x1d5); + SpriteLookAroundEffect(leaderEntity); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_6); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_7); + sub_803E708(10,0x46); + PlaySoundEffect(0); // snow flurry + gDungeon->weather.unkE265 = WEATHER_SNOW; + sub_807EAA0(0,1); + PlaySoundEffect(0x1ee); // flash effect? + sub_8088574(); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_8); + sub_803E708(10,0x46); + ArticunoScreenFlash(); + sub_8086738(); + PlaySoundEffect(0x1da); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_9); + sub_803E708(10,0x46); + PlaySoundEffect(0x1ea); + sub_8088484(articunoEntity); + sub_80865E8(); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_10); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_11); + sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPreFightDialogue_12); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); + sub_803E708(0x10,0x46); + SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void ArticunoReFightDialogue(void) +{ + Entity *leaderEntity; + Entity *articunoEntity; + + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); + gDungeon->weather.unkE265 = WEATHER_SNOW; + sub_807EAA0(0,1); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gArticunoReFightDialogue_1); + sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoReFightDialogue_2); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoReFightDialogue_3); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); + sub_803E708(0x28,0x46); + SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void ArticunoPostStoryPreFightDialogue(void) +{ + Entity *leaderEntity; + Entity *articunoEntity; + + leaderEntity = xxx_call_GetLeader(); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); + sub_8086448(); + if (sub_8086AE4(MONSTER_ARTICUNO)) { + sub_80866C4(&gUnknown_8102A9C); + } + else { + gDungeon->weather.unkE265 = WEATHER_SNOW; + sub_807EAA0(0,1); + ArticunoScreenFlash(); + sub_8086738(); + PlaySoundEffect(0x1da); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_1); + sub_803E708(10,0x46); + sub_8088484(articunoEntity); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_2); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_3); + sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_4); + ArticunoScreenFlash(); + DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_5); + sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); + sub_803E708(0x28,0x46); + SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void sub_8088484(Entity *param_1) +{ + int iVar1; + + GetEntInfo(param_1)->unk15C = 1; + GetEntInfo(param_1)->unk15E = 0; + PlaySoundEffect(0x1ea); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 5) + { + GetEntInfo(param_1)->unk174 = IntToF248_2(iVar1); + SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,0); + DungeonRunFrameActions(0x46); + } +} + +static void ArticunoScreenFlash(void) +{ + int iVar1; + + PlaySoundEffect(0x2ad); + for(iVar1 = 250; iVar1 > 0x95; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1 / 2,iVar1,iVar1,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(4,0x46); + for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) + { + SetDungeonBGColorRGB(0,iVar1,iVar1,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(4,0x46); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1 / 2,iVar1,iVar1,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(4,0x46); + sub_8085EB0(); +} + +static void sub_8088574(void) +{ + int iVar1; + + for(iVar1 = 0; iVar1 <= 80; iVar1 += 8) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,0,0); + DungeonRunFrameActions(0x46); + } +} diff --git a/src/dungeon_cutscene_empty_summit.c b/src/dungeon_cutscene_empty_summit.c new file mode 100644 index 000000000..1fac44d23 --- /dev/null +++ b/src/dungeon_cutscene_empty_summit.c @@ -0,0 +1,73 @@ +#include "global.h" +#include "globaldata.h" +#include "code_800DAC0.h" +#include "code_800E9A8.h" +#include "code_803E46C.h" +#include "code_803E668.h" +#include "code_8041AD0.h" +#include "code_804267C.h" +#include "code_80861A8.h" +#include "code_806CD90.h" +#include "code_80869E4.h" +#include "constants/bg_music.h" +#include "constants/direction.h" +#include "constants/friend_area.h" +#include "constants/weather.h" +#include "dungeon_items.h" +#include "dungeon_leader.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_music.h" +#include "dungeon_misc.h" +#include "dungeon_logic.h" +#include "dungeon_random.h" +#include "dungeon_util_1.h" +#include "dungeon_util.h" +#include "exclusive_pokemon.h" +#include "friend_area.h" +#include "items.h" +#include "pokemon_3.h" +#include "pokemon.h" +#include "position_util.h" +#include "trap.h" +#include "math.h" +#include "dungeon_config.h" +#include "dungeon_boss_dialogue.h" + +extern void sub_8086A3C(Entity *pokemon); + +void sub_80885A0(void) +{ + DungeonFadeOutBGM(0x3c); + sub_803E708(0x3c,0x46); + DungeonStopBGM(); + gDungeon->unk7 = 1; +} + +void sub_80885C4(void) +{ + Entity * leaderEntity; + + leaderEntity = xxx_call_GetLeader(); + DungeonFadeOutBGM(0x3c); + sub_803E708(0x3c,0x46); + DungeonStopBGM(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); +} + +void sub_8088608(void) +{ + gDungeon->unk2 = 1; +} + +void sub_8088618(void) +{ + sub_8086448(); + // The mountain's summit... + // But there is no one here + // It's time to go back + sub_80866C4(&gUnknown_8102B10); +} diff --git a/src/dungeon_cutscene_moltres.c b/src/dungeon_cutscene_moltres.c new file mode 100644 index 000000000..cc7ba121c --- /dev/null +++ b/src/dungeon_cutscene_moltres.c @@ -0,0 +1,370 @@ +#include "global.h" +#include "globaldata.h" +#include "code_800DAC0.h" +#include "code_800E9A8.h" +#include "code_803E46C.h" +#include "code_803E668.h" +#include "code_8041AD0.h" +#include "code_804267C.h" +#include "code_80861A8.h" +#include "code_806CD90.h" +#include "code_80869E4.h" +#include "constants/bg_music.h" +#include "constants/direction.h" +#include "constants/friend_area.h" +#include "constants/weather.h" +#include "dungeon_items.h" +#include "dungeon_leader.h" +#include "dungeon_map_access.h" +#include "dungeon_message.h" +#include "dungeon_music.h" +#include "dungeon_misc.h" +#include "dungeon_logic.h" +#include "dungeon_random.h" +#include "dungeon_util_1.h" +#include "dungeon_util.h" +#include "exclusive_pokemon.h" +#include "friend_area.h" +#include "items.h" +#include "pokemon_3.h" +#include "pokemon.h" +#include "position_util.h" +#include "trap.h" +#include "math.h" +#include "dungeon_config.h" +#include "dungeon_boss_dialogue.h" + +extern void sub_8042B0C(Entity *); +extern u8 sub_806FD18(Entity *); +extern void sub_806FDF4(Entity *, Entity *, Entity **); +extern s32 GetCameraXPos(void); +extern s32 GetCameraYPos(void); +extern void sub_803F878(u32, s32); +extern void BgColorCallNullsub4(void); +extern void sub_8085EB0(void); +extern void sub_8049884(void); +extern void sub_8049B8C(void); +extern void ShowWholeRevealedDungeonMap(void); +extern void sub_8086A54(Entity *); +extern void ResetMonEntityData(EntityInfo *, u32); +extern void sub_808BBA8(Entity * ); +extern void sub_8041888(u32); +extern u32 sub_80861F8(u32, Entity *, u32); +extern u8 sub_80860A8(u32); +extern void sub_8052D44(s16 *, Entity *, Entity *); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); +extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); +extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32); +extern void sub_807EAA0(u32, u32); +extern void sub_8072008(Entity *, Entity *, s16, u32, u32); +extern void sub_8085374(void); +extern u32 GetRandomFloorItem(u32); +extern bool8 sub_8085B80(struct_8085B80 *); +extern void sub_8086A3C(Entity *pokemon); +extern void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex); +extern u8 sub_8086AE4(s16 _index); +extern void sub_8085F44(s32); + +static void MoltresDropInEffect(Entity * moltresEntity); +static void MoltresScreenFlash1(s32 xArg, s32 yArg); +static void MoltresScreenFlash2(s32 xArg, s32 yArg); +static void MoltresScreenFlash3(void); +static void MoltresScreenDarken(void); + +void sub_80877E8(void) +{ + Entity * leaderEntity; + Entity * moltresEntity; + + leaderEntity = xxx_call_GetLeader(); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); + DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); + sub_8085374(); + sub_80854D4(); + sub_8085930(DIRECTION_WEST); + sub_80855E4(sub_8086A3C); + SetFacingDirection(moltresEntity, DIRECTION_SOUTH); + sub_8086A3C(moltresEntity); + sub_8085860(leaderEntity->pos.x + -3,leaderEntity->pos.y + -2); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MOLTRES); +} + +void sub_8087848(void) +{ + Entity *leaderEntity; + Entity *moltresEntity; + + u32 XPos; + s32 YPos; + + leaderEntity = xxx_call_GetLeader(); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); + DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); + sub_80854D4(); + sub_8085930(DIRECTION_WEST); + sub_80855E4(sub_8086A3C); + if (sub_8086AE4(MONSTER_MOLTRES)) { + sub_8068FE0(moltresEntity,0x21c,0); + } + else { + sub_8072008(moltresEntity,moltresEntity,gMoltresConfigLevel,0,0); + SetFacingDirection(moltresEntity, DIRECTION_SOUTH); + sub_8086A3C(moltresEntity); + } + sub_8085860(leaderEntity->pos.x - 5, leaderEntity->pos.y); + XPos = GetCameraXPos(); + YPos = GetCameraYPos(); + sub_803F878(XPos, YPos + -0x1000); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MOLTRES); +} + +void sub_80878F4(u8 param_1, u8 param_2) +{ + if ((param_2 == 0xA || param_2 == 0xB || param_2 == 0xC) && (param_1 == 0x9)) { + sub_8097FA8(0x7); + gDungeon->unk2 = 1; + } +} + +void MoltresPreFightDialogue(void) +{ + Entity *leaderEntity; + Entity *partnerEntity; + Entity *moltresEntity; + + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); + MoltresScreenFlash1(0xc,5); + sub_8086500(); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_1); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,1,DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + SpriteLookAroundEffect(partnerEntity); + sub_803E708(10,0x46); + DisplayDungeonDialogue(gMoltresPreFightDialogue_2); + sub_803E708(10,0x46); + MoltresScreenFlash1(0xc,5); + MoltresScreenFlash2(9,5); + DisplayDungeonDialogue(gMoltresPreFightDialogue_3); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + DisplayDungeonDialogue(gMoltresPreFightDialogue_4); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); + sub_8086690(); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_5); + sub_803E708(10,0x46); + sub_8085930(DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + sub_8085930(DIRECTION_NORTH); + PlaySoundEffect(0x2f2); + DungeonStopBGM(); + MoltresScreenDarken(); + DisplayDungeonDialogue(gMoltresPreFightDialogue_6); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_7); + sub_803E708(10,0x46); + PlaySoundEffect(0x1cf); + sub_80856E0(partnerEntity, DIRECTION_NORTH); + sub_803E708(10,0x46); + DisplayDungeonDialogue(gMoltresPreFightDialogue_8); + sub_803E708(10,0x46); + MoltresScreenFlash3(); + PlaySoundEffect(0x1da); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_9); + sub_803E708(10,0x46); + MoltresScreenFlash1(9,5); + MoltresScreenFlash2(0xb,5); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_10); + sub_803E708(10,0x46); + MoltresScreenFlash1(0xc,5); + MoltresScreenFlash2(9,5); + MoltresDropInEffect(moltresEntity); + sub_808663C(); + MoltresScreenFlash3(); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_11); + sub_803E708(10,0x46); + MoltresScreenFlash2(0xb,6); + DisplayDungeonDialogue(&gMoltresPreFightDialogue_12); + sub_803E708(10,0x46); + SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void MoltresReFightDialogue(void) +{ + Entity *leaderEntity; + Entity *partnerEntity; + Entity *moltresEntity; + + leaderEntity = xxx_call_GetLeader(); + partnerEntity = GetPartnerEntity(); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); + MoltresScreenFlash1(10,5); + sub_8086500(); + sub_803E708(10,0x46); + SpriteLookAroundEffect(partnerEntity); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gMoltresReFightDialogue_1); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + DisplayDungeonDialogue(gMoltresReFightDialogue_2); + sub_803E708(10,0x46); + sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); + sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); + sub_8086690(); + MoltresScreenDarken(); + sub_803E708(10,0x46); + sub_8085930(DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + sub_8085930(DIRECTION_NORTH); + MoltresDropInEffect(moltresEntity); + sub_808663C(); + MoltresScreenFlash3(); + DisplayDungeonDialogue(&gMoltresReFightDialogue_3); + sub_803E708(10,0x46); + MoltresScreenFlash2(0xb,6); + DisplayDungeonDialogue(gMoltresReFightDialogue_4); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gMoltresReFightDialogue_5); + sub_803E708(10,0x46); + SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void MoltresPostStoryPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * moltresEntity; + + leaderEntity = xxx_call_GetLeader(); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); + MoltresScreenFlash1(0xc,5); + sub_808654C(); + if (sub_8086AE4(MONSTER_MOLTRES)) { + sub_8085930(DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + sub_8085930(DIRECTION_NORTH); + sub_803E708(4,0x46); + sub_803E708(10,0x46); + DisplayDungeonDialogue(&gUnknown_8100D3C); + sub_803E708(10,0x46); + gDungeon->unk2 = 1; + } + else { + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_1); + sub_8085930(DIRECTION_NORTHWEST); + sub_803E708(4,0x46); + sub_8085930(DIRECTION_NORTH); + MoltresDropInEffect(moltresEntity); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_2); + MoltresScreenFlash1(0xc,5); + MoltresScreenFlash2(9,5); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_3); + MoltresScreenFlash3(); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_4); + MoltresScreenFlash2(0xb,6); + DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_5); + sub_803E708(10,0x46); + SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void MoltresDropInEffect(Entity * moltresEntity) +{ + s32 iVar1; + + GetEntInfo(moltresEntity)->unk15C = 1; + GetEntInfo(moltresEntity)->unk15E = 0; + GetEntInfo(moltresEntity)->unk174 = IntToF248_2(200); + PlaySoundEffect(0x1f8); + for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) + { + GetEntInfo(moltresEntity)->unk174 = IntToF248_2(iVar1); + DungeonRunFrameActions(0x46); + } +} + +static void MoltresScreenFlash1(s32 xArg, s32 yArg) +{ + s32 x, y; + DungeonPos newPos; + + x = X_POS_TO_PIXELPOS(xArg); + newPos.x = x / 256; + + y = Y_POS_TO_PIXELPOS(yArg); + newPos.y = y / 256; + + sub_8085EC8(370,16,0,&newPos,0); +} + +static void MoltresScreenFlash2(s32 xArg, s32 yArg) +{ + s32 r6; + s32 i, x, y; + DungeonPos newPos; + + x = X_POS_TO_PIXELPOS(xArg); + newPos.x = x / 256; + + y = Y_POS_TO_PIXELPOS(yArg); + newPos.y = y / 256; + + r6 = sub_8085EC8(370,22,0,&newPos,0); + PlaySoundEffect(0x1EC); + + for (i = 250; i >= 20; i -= 10) { + SetDungeonBGColorRGB(i, 0, 0, 1, 1); + DungeonRunFrameActions(0x46); + } + sub_803E708(0xA, 0x46); + + for (i = 250; i >= 0; i -= 10) { + SetDungeonBGColorRGB(i, 0, 0, 1, 1); + DungeonRunFrameActions(0x46); + } + sub_803E708(0xA, 0x46); + + sub_8085EB0(); + sub_8085F44(r6); +} + +static void MoltresScreenFlash3(void) +{ + int iVar1; + + PlaySoundEffect(0x1ed); + iVar1 = 0xfa; + for(iVar1 = 250; iVar1 > 9; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(0x1e,0x46); + PlaySoundEffect(0x1ed); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(0x1e,0x46); + sub_8085EB0(); +} + +static void MoltresScreenDarken(void) +{ + s32 iVar1; + + for(iVar1 = 0; iVar1 >= -80; iVar1 -= 8) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,0,0); + DungeonRunFrameActions(0x46); + } +} diff --git a/src/dungeon_cutscene_skarmory.c b/src/dungeon_cutscene_skarmory.c index 7096e2974..402ffa3c6 100644 --- a/src/dungeon_cutscene_skarmory.c +++ b/src/dungeon_cutscene_skarmory.c @@ -106,8 +106,7 @@ void sub_8086B94(void) void sub_8086BDC(u8 param_1, u8 param_2) { - param_2 += 0xFF; - if ((param_2 == 0 || param_2 == 1) && param_1 == 3) { + if ((param_2 == 1 || param_2 == 2) && param_1 == 3) { sub_8097FA8(1); gDungeon->unk2 = 1; } diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 06b356ef1..c5e5d383d 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -72,7 +72,7 @@ extern void sub_8086A3C(Entity *pokemon); extern void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex); extern u8 sub_8086AE4(s16 _index); -void sub_8085F44(s32); + void sub_808BBA8(Entity * ); void DeoxysScreenFlash(void); void sub_8086A54(Entity *); @@ -142,592 +142,17 @@ void SkarmoryEntry(Entity *); // FILE SPLIT -void sub_80877E8(void) -{ - Entity * leaderEntity; - Entity * moltresEntity; - - leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); - DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); - sub_8085374(); - sub_80854D4(); - sub_8085930(DIRECTION_WEST); - sub_80855E4(sub_8086A3C); - SetFacingDirection(moltresEntity, DIRECTION_SOUTH); - sub_8086A3C(moltresEntity); - sub_8085860(leaderEntity->pos.x + -3,leaderEntity->pos.y + -2); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MOLTRES); -} - -void sub_8087848(void) -{ - Entity *leaderEntity; - Entity *moltresEntity; - - u32 XPos; - s32 YPos; - - leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); - DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); - sub_80854D4(); - sub_8085930(DIRECTION_WEST); - sub_80855E4(sub_8086A3C); - if (sub_8086AE4(MONSTER_MOLTRES)) { - sub_8068FE0(moltresEntity,0x21c,0); - } - else { - sub_8072008(moltresEntity,moltresEntity,gMoltresConfigLevel,0,0); - SetFacingDirection(moltresEntity, DIRECTION_SOUTH); - sub_8086A3C(moltresEntity); - } - sub_8085860(leaderEntity->pos.x - 5, leaderEntity->pos.y); - XPos = GetCameraXPos(); - YPos = GetCameraYPos(); - sub_803F878(XPos, YPos + -0x1000); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MOLTRES); -} - -void sub_80878F4(u8 param_1, u8 param_2) -{ - if ((param_2 == 0xA || param_2 == 0xB || param_2 == 0xC) && (param_1 == 0x9)) { - sub_8097FA8(0x7); - gDungeon->unk2 = 1; - } -} - -void MoltresPreFightDialogue(void) -{ - Entity *leaderEntity; - Entity *partnerEntity; - Entity *moltresEntity; - - leaderEntity = xxx_call_GetLeader(); - partnerEntity = GetPartnerEntity(); - moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); - MoltresScreenFlash1(0xc,5); - sub_8086500(); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_1); - sub_803E708(10,0x46); - sub_80869E4(partnerEntity,4,1,DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - SpriteLookAroundEffect(partnerEntity); - sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresPreFightDialogue_2); - sub_803E708(10,0x46); - MoltresScreenFlash1(0xc,5); - MoltresScreenFlash2(9,5); - DisplayDungeonDialogue(gMoltresPreFightDialogue_3); - sub_803E708(10,0x46); - sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); - sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(gMoltresPreFightDialogue_4); - sub_803E708(10,0x46); - sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); - sub_8086690(); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_5); - sub_803E708(10,0x46); - sub_8085930(DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - sub_8085930(DIRECTION_NORTH); - PlaySoundEffect(0x2f2); - DungeonStopBGM(); - MoltresScreenDarken(); - DisplayDungeonDialogue(gMoltresPreFightDialogue_6); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_7); - sub_803E708(10,0x46); - PlaySoundEffect(0x1cf); - sub_80856E0(partnerEntity, DIRECTION_NORTH); - sub_803E708(10,0x46); - DisplayDungeonDialogue(gMoltresPreFightDialogue_8); - sub_803E708(10,0x46); - MoltresScreenFlash3(); - PlaySoundEffect(0x1da); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_9); - sub_803E708(10,0x46); - MoltresScreenFlash1(9,5); - MoltresScreenFlash2(0xb,5); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_10); - sub_803E708(10,0x46); - MoltresScreenFlash1(0xc,5); - MoltresScreenFlash2(9,5); - MoltresDropInEffect(moltresEntity); - sub_808663C(); - MoltresScreenFlash3(); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_11); - sub_803E708(10,0x46); - MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(&gMoltresPreFightDialogue_12); - sub_803E708(10,0x46); - SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void MoltresReFightDialogue(void) -{ - Entity *leaderEntity; - Entity *partnerEntity; - Entity *moltresEntity; - - leaderEntity = xxx_call_GetLeader(); - partnerEntity = GetPartnerEntity(); - moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); - MoltresScreenFlash1(10,5); - sub_8086500(); - sub_803E708(10,0x46); - SpriteLookAroundEffect(partnerEntity); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gMoltresReFightDialogue_1); - sub_803E708(10,0x46); - sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); - sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(gMoltresReFightDialogue_2); - sub_803E708(10,0x46); - sub_80869E4(partnerEntity,4,2,DIRECTION_WEST); - sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - sub_8086690(); - MoltresScreenDarken(); - sub_803E708(10,0x46); - sub_8085930(DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - sub_8085930(DIRECTION_NORTH); - MoltresDropInEffect(moltresEntity); - sub_808663C(); - MoltresScreenFlash3(); - DisplayDungeonDialogue(&gMoltresReFightDialogue_3); - sub_803E708(10,0x46); - MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(gMoltresReFightDialogue_4); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gMoltresReFightDialogue_5); - sub_803E708(10,0x46); - SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void MoltresPostStoryPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * moltresEntity; - - leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); - MoltresScreenFlash1(0xc,5); - sub_808654C(); - if (sub_8086AE4(MONSTER_MOLTRES)) { - sub_8085930(DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - sub_8085930(DIRECTION_NORTH); - sub_803E708(4,0x46); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gUnknown_8100D3C); - sub_803E708(10,0x46); - gDungeon->unk2 = 1; - } - else { - DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_1); - sub_8085930(DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - sub_8085930(DIRECTION_NORTH); - MoltresDropInEffect(moltresEntity); - DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_2); - MoltresScreenFlash1(0xc,5); - MoltresScreenFlash2(9,5); - DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_3); - MoltresScreenFlash3(); - DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_4); - MoltresScreenFlash2(0xb,6); - DisplayDungeonDialogue(&gMoltresPostStoryPreFightDialogue_5); - sub_803E708(10,0x46); - SetupBossFightHP(moltresEntity,400,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void MoltresDropInEffect(Entity * moltresEntity) -{ - s32 iVar1; - - GetEntInfo(moltresEntity)->unk15C = 1; - GetEntInfo(moltresEntity)->unk15E = 0; - GetEntInfo(moltresEntity)->unk174 = IntToF248_2(200); - PlaySoundEffect(0x1f8); - for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) - { - GetEntInfo(moltresEntity)->unk174 = IntToF248_2(iVar1); - DungeonRunFrameActions(0x46); - } -} - -void MoltresScreenFlash1(s32 xArg, s32 yArg) -{ - s32 x, y; - DungeonPos newPos; - - x = X_POS_TO_PIXELPOS(xArg); - newPos.x = x / 256; - - y = Y_POS_TO_PIXELPOS(yArg); - newPos.y = y / 256; - - sub_8085EC8(370,16,0,&newPos,0); -} - -void MoltresScreenFlash2(s32 xArg, s32 yArg) -{ - s32 r6; - s32 i, x, y; - DungeonPos newPos; - - x = X_POS_TO_PIXELPOS(xArg); - newPos.x = x / 256; - - y = Y_POS_TO_PIXELPOS(yArg); - newPos.y = y / 256; - - r6 = sub_8085EC8(370,22,0,&newPos,0); - PlaySoundEffect(0x1EC); - - for (i = 250; i >= 20; i -= 10) { - SetDungeonBGColorRGB(i, 0, 0, 1, 1); - DungeonRunFrameActions(0x46); - } - sub_803E708(0xA, 0x46); - - for (i = 250; i >= 0; i -= 10) { - SetDungeonBGColorRGB(i, 0, 0, 1, 1); - DungeonRunFrameActions(0x46); - } - sub_803E708(0xA, 0x46); - - sub_8085EB0(); - sub_8085F44(r6); -} - -void MoltresScreenFlash3(void) -{ - int iVar1; - - PlaySoundEffect(0x1ed); - iVar1 = 0xfa; - for(iVar1 = 250; iVar1 > 9; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(0x1e,0x46); - PlaySoundEffect(0x1ed); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(0x1e,0x46); - sub_8085EB0(); -} - -void MoltresScreenDarken(void) -{ - s32 iVar1; - - for(iVar1 = 0; iVar1 >= -80; iVar1 -= 8) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,0,0); - DungeonRunFrameActions(0x46); - } -} -void sub_8087F54(void) -{ - Entity *leaderEntity; - Entity *articunoEntity; +// SPLIT - leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_8085374(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - SetFacingDirection(articunoEntity, DIRECTION_SOUTH); - sub_8086A3C(articunoEntity); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); -} -void sub_8087FB4(void) -{ - Entity *articunoEntity; - articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_8085374(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - SetFacingDirection(articunoEntity, DIRECTION_SOUTH); - sub_806CDD4(articunoEntity, 0xF, DIRECTION_SOUTH); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); -} +// File Split -void sub_8087FF8(void) -{ - Entity *leaderEntity; - Entity *articunoEntity; - leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); - sub_8085374(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - if (sub_8086AE4(MONSTER_ARTICUNO)) { - sub_8068FE0(articunoEntity,0x21c,0); - } - else { - sub_8072008(articunoEntity,articunoEntity,gArticunoConfigLevel,0,0); - SetFacingDirection(articunoEntity, DIRECTION_SOUTH); - sub_8086A3C(articunoEntity); - } - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); -} -void sub_8088088(u8 param_1, u8 param_2) -{ - if ((param_2 == 0xD || param_2 == 0xE || param_2 == 0xF) && (param_1 == 0xD)) { - sub_8097FA8(0x9); - gDungeon->unk2 = 1; - } -} - -void ArticunoPreFightDialogue(void) -{ - Entity *leaderEntity; - Entity *partnerEntity; - Entity *articunoEntity; - - leaderEntity = xxx_call_GetLeader(); - partnerEntity = GetPartnerEntity(); - articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); - sub_8086448(); - SpriteLookAroundEffect(partnerEntity); - DisplayDungeonDialogue(gArticunoPreFightDialogue_1); - sub_803E708(10,0x46); - sub_8086598(); - DungeonStopBGM(); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_2); - sub_803E708(10,0x46); - sub_80869E4(partnerEntity,4,1,DIRECTION_EAST); - sub_80869E4(leaderEntity,4,2,DIRECTION_WEST); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_3); - sub_803E708(10,0x46); - SetFacingDirection(leaderEntity, DIRECTION_WEST); - sub_803E708(4,0x46); - SetFacingDirection(leaderEntity, DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - SetFacingDirection(leaderEntity, DIRECTION_WEST); - sub_803E708(4,0x46); - SetFacingDirection(leaderEntity, DIRECTION_SOUTHWEST); - sub_803E708(4,0x46); - SetFacingDirection(leaderEntity, DIRECTION_WEST); - sub_803E708(4,0x46); - SetFacingDirection(leaderEntity, DIRECTION_NORTHWEST); - sub_803E708(4,0x46); - SetFacingDirection(leaderEntity, DIRECTION_WEST); - sub_803E708(10,0x46); - DisplayDungeonDialogue(gArticunoPreFightDialogue_4); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_5); - sub_803E708(10,0x46); - sub_80869E4(leaderEntity,4,1,DIRECTION_NORTH); - sub_80869E4(partnerEntity,4,2,DIRECTION_NORTH); - PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(partnerEntity); - PlaySoundEffect(0x1d5); - SpriteLookAroundEffect(leaderEntity); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_6); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_7); - sub_803E708(10,0x46); - PlaySoundEffect(0); // snow flurry - gDungeon->weather.unkE265 = WEATHER_SNOW; - sub_807EAA0(0,1); - PlaySoundEffect(0x1ee); // flash effect? - sub_8088574(); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_8); - sub_803E708(10,0x46); - ArticunoScreenFlash(); - sub_8086738(); - PlaySoundEffect(0x1da); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_9); - sub_803E708(10,0x46); - PlaySoundEffect(0x1ea); - sub_8088484(articunoEntity); - sub_80865E8(); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_10); - sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_11); - sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPreFightDialogue_12); - sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); - sub_803E708(0x10,0x46); - SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void ArticunoReFightDialogue(void) -{ - Entity *leaderEntity; - Entity *articunoEntity; - - leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); - gDungeon->weather.unkE265 = WEATHER_SNOW; - sub_807EAA0(0,1); - sub_803E708(10,0x46); - DisplayDungeonDialogue(&gArticunoReFightDialogue_1); - sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoReFightDialogue_2); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoReFightDialogue_3); - sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); - sub_803E708(0x28,0x46); - SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void ArticunoPostStoryPreFightDialogue(void) -{ - Entity *leaderEntity; - Entity *articunoEntity; - - leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); - sub_8086448(); - if (sub_8086AE4(MONSTER_ARTICUNO)) { - sub_80866C4(&gUnknown_8102A9C); - } - else { - gDungeon->weather.unkE265 = WEATHER_SNOW; - sub_807EAA0(0,1); - ArticunoScreenFlash(); - sub_8086738(); - PlaySoundEffect(0x1da); - DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_1); - sub_803E708(10,0x46); - sub_8088484(articunoEntity); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_2); - sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_3); - sub_806CDD4(articunoEntity,0x10,DIRECTION_SOUTH); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_4); - ArticunoScreenFlash(); - DisplayDungeonDialogue(&gArticunoPostStoryPreFightDialogue_5); - sub_806CDD4(articunoEntity,0xf,DIRECTION_SOUTH); - sub_803E708(0x28,0x46); - SetupBossFightHP(articunoEntity,0x1c2,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void sub_8088484(Entity *param_1) -{ - int iVar1; - - GetEntInfo(param_1)->unk15C = 1; - GetEntInfo(param_1)->unk15E = 0; - PlaySoundEffect(0x1ea); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 5) - { - GetEntInfo(param_1)->unk174 = IntToF248_2(iVar1); - SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,0); - DungeonRunFrameActions(0x46); - } -} - -void ArticunoScreenFlash(void) -{ - int iVar1; - - PlaySoundEffect(0x2ad); - for(iVar1 = 250; iVar1 > 0x95; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1 / 2,iVar1,iVar1,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(4,0x46); - for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) - { - SetDungeonBGColorRGB(0,iVar1,iVar1,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(4,0x46); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1 / 2,iVar1,iVar1,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(4,0x46); - sub_8085EB0(); -} - -void sub_8088574(void) -{ - int iVar1; - - for(iVar1 = 0; iVar1 <= 80; iVar1 += 8) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,0,0); - DungeonRunFrameActions(0x46); - } -} - -void sub_80885A0(void) -{ - DungeonFadeOutBGM(0x3c); - sub_803E708(0x3c,0x46); - DungeonStopBGM(); - gDungeon->unk7 = 1; -} - -void sub_80885C4(void) -{ - Entity * leaderEntity; - - leaderEntity = xxx_call_GetLeader(); - DungeonFadeOutBGM(0x3c); - sub_803E708(0x3c,0x46); - DungeonStopBGM(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); -} - -void sub_8088608(void) -{ - gDungeon->unk2 = 1; -} - -void sub_8088618(void) -{ - sub_8086448(); - // The mountain's summit... - // But there is no one here - // It's time to go back - sub_80866C4(&gUnknown_8102B10); -} +// void sub_808862C(void) { @@ -1045,6 +470,8 @@ void GroudonScreenFlash2(void) sub_8085EB0(); } +// FILE SPLIT + void sub_8088DC0(void) { @@ -4079,7 +3506,4 @@ void sub_808CD9C(void) sub_80866C4(&gUnknown_810697C); } -const u64 *sub_808CDB0(u8 r0) -{ - return &gUnknown_8107544[r0]; -} + diff --git a/src/dungeon_message.c b/src/dungeon_message.c index ff2ae0523..2eee0a9a9 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -27,6 +27,7 @@ #include "text_2.h" #include "text_3.h" #include "dungeon_strings.h" +#include "dungeon_portrait_placement.h" void sub_80526D0(s32 r0); static bool8 sub_8052DC0(Entity *); @@ -381,14 +382,6 @@ void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) DisplayDungeonLoggableMessageFalse(pokemon, str); } -struct Struct_sub_808CDB0 -{ - DungeonPos pos; - bool8 flip; -}; - -extern const struct Struct_sub_808CDB0 *sub_808CDB0(s32 a0); - static const u16 sUnknownDialogueFlags[] = {0x30D, 0x10D, 0x30D, 0x10D, 0x301, 1, 0x11}; void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) @@ -465,7 +458,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) && dialogueInfo->spriteId != 0x80 && dialogueMonId != MONSTER_NONE) { - const struct Struct_sub_808CDB0 *strPtr = sub_808CDB0(dialogueInfo->spritePlacementId); + const struct PortraitPlacementInfo *placementInfo = GetPortraitPlacementInfo(dialogueInfo->spritePlacementId); monPortraitPtr = &monPortrait; monPortraitPtr->faceFile = GetDialogueSpriteDataPtr(dialogueMonId); @@ -473,9 +466,9 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo) monPortraitPtr->faceData = (PortraitGfx *) monPortraitPtr->faceFile->data; monPortraitPtr->unkE = 0; monPortraitPtr->spriteId = dialogueInfo->spriteId; - monPortraitPtr->flip = strPtr->flip; - monPortraitPtr->pos.x = strPtr->pos.x; - monPortraitPtr->pos.y = strPtr->pos.y; + monPortraitPtr->flip = placementInfo->flip; + monPortraitPtr->pos.x = placementInfo->pos.x; + monPortraitPtr->pos.y = placementInfo->pos.y; if (monPortraitPtr->pos.y < 2) { monPortraitPtr->pos.y = 2; } diff --git a/src/dungeon_portrait_placement.c b/src/dungeon_portrait_placement.c new file mode 100644 index 000000000..d2013e8bc --- /dev/null +++ b/src/dungeon_portrait_placement.c @@ -0,0 +1,34 @@ +#include "global.h" +#include "globaldata.h" +#include "dungeon_portrait_placement.h" + +// Note: this file is not part of overlay5. It's most likely arm9.bin, but I couldn't locate the address + +static const struct PortraitPlacementInfo gUnknown_8107544[] = { + [0] = {{2, 8}, FALSE}, + [1] = {{12, 5}, FALSE}, + [2] = {{2, 8}, FALSE}, + [3] = {{23, 8}, TRUE}, + [4] = {{7, 8}, FALSE}, + [5] = {{18, 8}, TRUE}, + [6] = {{13, 5}, TRUE}, + [7] = {{2, 8}, TRUE}, + [8] = {{23, 8}, FALSE}, + [9] = {{7, 8}, TRUE}, + [10] = {{18, 8}, FALSE}, + [11] = {{12, 1}, FALSE}, + [12] = {{2, 2}, FALSE}, + [13] = {{23, 2}, TRUE}, + [14] = {{7, 1}, FALSE}, + [15] = {{18, 1}, TRUE}, + [16] = {{13, 1}, TRUE}, + [17] = {{2, 2}, TRUE}, + [18] = {{23, 2}, FALSE}, + [19] = {{7, 1}, TRUE}, + [20] = {{18, 1}, FALSE}, +}; + +const struct PortraitPlacementInfo *GetPortraitPlacementInfo(u8 id) +{ + return &gUnknown_8107544[id]; +}