diff --git a/data/data_8107224.s b/data/data_8107224.s deleted file mode 100644 index d7dae24db..000000000 --- a/data/data_8107224.s +++ /dev/null @@ -1,13 +0,0 @@ -.section .rodata - - - -.string "pksdir0\0" @Mewtwo -.string "pksdir0\0" @Entei -.string "pksdir0\0" @Raikou -.string "pksdir0\0" @Suicune -.string "pksdir0\0" @HoOh -.string "pksdir0\0" @Latios -.string "pksdir0\0" @ regis - -.align 2,0 diff --git a/ld_script.txt b/ld_script.txt index 9d436f92b..8039b2ca1 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -292,7 +292,13 @@ SECTIONS { src/dungeon_cutscene_magma_cavern.o(.text); src/dungeon_cutscene_rayquaza.o(.text); src/dungeon_cutscene_mankey.o(.text); - src/dungeon_cutscenes.o(.text); + src/dungeon_cutscene_mewtwo.o(.text); + src/dungeon_cutscene_entei.o(.text); + src/dungeon_cutscene_raikou.o(.text); + src/dungeon_cutscene_suicune.o(.text); + src/dungeon_cutscene_hooh.o(.text); + src/dungeon_cutscene_latios.o(.text); + src/dungeon_cutscene_regis.o(.text); src/dungeon_cutscene_jirachi.o(.text); src/dungeon_cutscene_lugia.o(.text); src/dungeon_cutscene_kyogre.o(.text); @@ -651,7 +657,13 @@ SECTIONS { src/dungeon_cutscene_magma_cavern.o(.rodata); src/dungeon_cutscene_rayquaza.o(.rodata); src/dungeon_cutscene_mankey.o(.rodata); - data/data_8107224.o(.rodata); + src/dungeon_cutscene_mewtwo.o(.rodata); + src/dungeon_cutscene_entei.o(.rodata); + src/dungeon_cutscene_raikou.o(.rodata); + src/dungeon_cutscene_suicune.o(.rodata); + src/dungeon_cutscene_hooh.o(.rodata); + src/dungeon_cutscene_latios.o(.rodata); + src/dungeon_cutscene_regis.o(.rodata); src/dungeon_cutscene_jirachi.o(.rodata); src/dungeon_cutscene_lugia.o(.rodata); src/dungeon_cutscene_kyogre.o(.rodata); diff --git a/src/dungeon_cutscene_entei.c b/src/dungeon_cutscene_entei.c new file mode 100644 index 000000000..de9ca4909 --- /dev/null +++ b/src/dungeon_cutscene_entei.c @@ -0,0 +1,195 @@ +#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_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 EnteiScreenFlash(void); + +void sub_8089C44(void) +{ + Entity * leaderEntity; + Entity * EnteiEntity; + + leaderEntity = xxx_call_GetLeader(); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); +} + +void sub_8089C90(void) +{ + Entity * leaderEntity; + Entity * EnteiEntity; + + leaderEntity = xxx_call_GetLeader(); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + if (HasRecruitedMon(MONSTER_ENTEI)) { + sub_8068FE0(EnteiEntity,0x21c,0); + } + else { + SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); +} + +void sub_8089CFC(u8 param_1, u8 param_2) +{ + if ((param_2 == 0x20 || param_2 == 0x21 || param_2 == 0x22) && (param_1 == 0x12)) { + sub_8097FA8(0x15); + gDungeon->unk2 = 1; + } +} + +void EnteiPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * EnteiEntity; + + leaderEntity = xxx_call_GetLeader(); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiPreFightDialogue_1); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiPreFightDialogue_2); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiPreFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void EnteiReFightDialogue(void) +{ + Entity * leaderEntity; + Entity * EnteiEntity; + + leaderEntity = xxx_call_GetLeader(); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiReFightDialogue_1); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiReFightDialogue_2); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiReFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void EnteiPostStoryPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * EnteiEntity; + + leaderEntity = xxx_call_GetLeader(); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); + if (HasRecruitedMon(MONSTER_ENTEI)) { + sub_80866C4(&gEnteiPostStoryPreFightDialogue_4); + } + else { + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_1); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_2); + EnteiScreenFlash(); + DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void EnteiScreenFlash(void) +{ + s32 iVar1; + + PlaySoundEffect(0x1ed); + for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1, iVar1 / 2, iVar1 / 2, 1, 1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1, 0, 0, 1, 1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1, iVar1 / 2, iVar1 / 2, 1, 1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + sub_8085EB0(); +} + diff --git a/src/dungeon_cutscene_hooh.c b/src/dungeon_cutscene_hooh.c new file mode 100644 index 000000000..9f7e1e663 --- /dev/null +++ b/src/dungeon_cutscene_hooh.c @@ -0,0 +1,245 @@ +#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_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 HoOhDropInEffect(Entity * param_1); +static void HoOhScreenFlash(void); + +void sub_808A608(void) +{ + Entity * leaderEntity; + Entity * HoOhEntity; + + leaderEntity = xxx_call_GetLeader(); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); + DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); + sub_80867F4(); + sub_8086838(0,0,0); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); + sub_8086A3C(HoOhEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -6); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); +} + +void sub_808A668(void) +{ + Entity * leaderEntity; + Entity * HoOhEntity; + + leaderEntity = xxx_call_GetLeader(); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); + DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); + sub_80867F4(); + sub_8086838(0,0,0); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + if (HasRecruitedMon(MONSTER_HO_OH)) { + sub_8068FE0(HoOhEntity,0x21c,0); + } + else { + SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); + sub_8086A3C(HoOhEntity); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 6); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); +} + +void sub_808A6E8(u8 param_1, u8 param_2) +{ + if ((param_2 == 0x29 || param_2 == 0x2A) && (param_1 == 0x15)) { + sub_8097FA8(0x1A); + gDungeon->unk2 = 1; + } +} + +void sub_808A718(void) +{ + sub_8086854(); +} + +void HoOhPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * HoOhEntity; + PixelPos local_14; + + leaderEntity = xxx_call_GetLeader(); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); + local_14.x = leaderEntity->pixelPos.x; + local_14.y = leaderEntity->pixelPos.y + -0x1000; + ShiftCameraToPosition(&local_14,0x88); + sub_803E708(0x40,70); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_1); + sub_803E708(10,70); + HoOhScreenFlash(); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_2); + sub_803E708(10,70); + sub_80855E4(sub_80868F4); + sub_808680C(); + PlaySoundEffect(0x1c5); + sub_803E708(0xfa,70); + HoOhDropInEffect(HoOhEntity); + StopSoundEffect(0x1c5); + sub_808682C(); + sub_80855E4(sub_8086910); + sub_8085930(DIRECTION_NORTH); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_3); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_4); + sub_803E708(0x1e,70); + sub_803E708(0x1e,70); + HoOhScreenFlash(); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_5); + HoOhScreenFlash(); + DisplayDungeonDialogue(&gHoOhPreFightDialogue_6); + sub_803E708(10,70); + SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void HoOhReFightDialogue(void) +{ + Entity * leaderEntity; + Entity * HoOhEntity; + PixelPos local_14; + + leaderEntity = xxx_call_GetLeader(); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); + + local_14.x = leaderEntity->pixelPos.x; + local_14.y = leaderEntity->pixelPos.y + -0x1000; + ShiftCameraToPosition(&local_14,0x88); + sub_803E708(0x40,70); + if (HasRecruitedMon(MONSTER_HO_OH)) { + sub_80866C4(&HoOhReFightDialogue_5); + } + else { + DisplayDungeonDialogue(&HoOhReFightDialogue_1); + HoOhScreenFlash(); + sub_80855E4(sub_80868F4); + sub_808680C(); + sub_803E708(10,70); + HoOhDropInEffect(HoOhEntity); + sub_808682C(); + sub_80855E4(sub_8086910); + sub_8085930(DIRECTION_NORTH); + DisplayDungeonDialogue(&HoOhReFightDialogue_2); + HoOhScreenFlash(); + DisplayDungeonDialogue(&HoOhReFightDialogue_3); + HoOhScreenFlash(); + DisplayDungeonDialogue(&HoOhReFightDialogue_4); + sub_803E708(10,70); + SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void HoOhDropInEffect(Entity * param_1) +{ + s24_8 iVar1; + s24_8 iVar2; + + GetEntInfo(param_1)->unk15E = 0; + iVar2 = IntToF248(200); + iVar1 = IntToF248(12); + PlaySoundEffect(0x1f8); + while( 1 ) { + iVar2.raw -= iVar1.raw; + iVar1 = F248_Sub(iVar1, FloatToF248(0.375)); + if (F248LessThanFloat(iVar1, 0.08)) { + iVar1 = FloatToF248_2(0.08); + } + if (F248LessThanInt(iVar2, 0)) break; + GetEntInfo(param_1)->unk174 = iVar2; + DungeonRunFrameActions(70); + } + GetEntInfo(param_1)->unk174 = IntToF248_2(0); +} + +static void HoOhScreenFlash(void) +{ + s32 iVar1; + + PlaySoundEffect(0x1ed); + for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + sub_8085EB0(); +} diff --git a/src/dungeon_cutscene_latios.c b/src/dungeon_cutscene_latios.c new file mode 100644 index 000000000..47d9b9305 --- /dev/null +++ b/src/dungeon_cutscene_latios.c @@ -0,0 +1,204 @@ +#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 s32 gDungeonBrightness; + +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_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 LatiosScreenFlash(void); + +void sub_808A9E4(void) +{ + Entity * leaderEntity; + Entity * LatiosEntity; + + leaderEntity = xxx_call_GetLeader(); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + SetFacingDirection(LatiosEntity, DIRECTION_NORTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 4); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); +} + +void sub_808AA3C(void) +{ + Entity * leaderEntity; + Entity * LatiosEntity; + + leaderEntity = xxx_call_GetLeader(); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + SetFacingDirection(LatiosEntity, DIRECTION_NORTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); +} + +void sub_808AA94(void) +{ + Entity * leaderEntity; + Entity * LatiosEntity; + + leaderEntity = xxx_call_GetLeader(); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + sub_8068FE0(LatiosEntity,0x21c,0); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); +} + +void sub_808AAF0(u8 param_1, u8 param_2) +{ + if ((param_2 == 0x2B || param_2 == 0x2C || param_2 == 0x2D) && (param_1 == 0x16)) { + sub_8097FA8(0x1C); + gDungeon->unk2 = 1; + } +} + +void LatiosPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * LatiosEntity; + PixelPos local_18; + DungeonPos local_19; + + leaderEntity = xxx_call_GetLeader(); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); + + local_18.x = LatiosEntity->pixelPos.x; + local_18.y = LatiosEntity->pixelPos.y + (0x80 << 6); + local_19.y = 0x70; + local_19.x = 0xFC; + sub_8085EC8(0x1bd,0,0,&local_19,1); + + sub_803E708(0x1e,70); + sub_8086448(); + ShiftCameraToPosition(&local_18,0x18); + sub_803E708(2,70); + SpriteShockEffect(LatiosEntity); + sub_803E708(0x20,70); + sub_808692C(); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_1); + LatiosScreenFlash(); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_2); + LatiosScreenFlash(); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void LatiosReFightDialogue(void) +{ + Entity * leaderEntity; + Entity * LatiosEntity; + + leaderEntity = xxx_call_GetLeader(); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); + sub_8086448(); + sub_808692C(); + DisplayDungeonDialogue(&gLatiosReFightDialogue_1); + LatiosScreenFlash(); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_2); + LatiosScreenFlash(); + DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void sub_808AC3C(void) +{ + sub_8086448(); + // There appears to be no one here + sub_80866C4(&gUnknown_8104FC8); +} + +static void LatiosScreenFlash(void) +{ + s32 iVar1; + + PlaySoundEffect(0x1ee); + gDungeonBrightness = 0x1f; + for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + sub_8085EB0(); +} diff --git a/src/dungeon_cutscene_mewtwo.c b/src/dungeon_cutscene_mewtwo.c new file mode 100644 index 000000000..eda53d643 --- /dev/null +++ b/src/dungeon_cutscene_mewtwo.c @@ -0,0 +1,221 @@ +#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_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 MewtwoDropInEffect(Entity *mewtwoEntity); +static void MewtwoScreenFlash(void); + +void sub_8089914(void) +{ + Entity *leaderEntity; + Entity *MewtwoEntity; + + leaderEntity = xxx_call_GetLeader(); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); + DungeonStopBGM(); + gDungeon->unk7 = 1; + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); + sub_8086A3C(MewtwoEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); +} + +void sub_8089978(void) +{ + Entity *leaderEntity; + Entity *MewtwoEntity; + + leaderEntity = xxx_call_GetLeader(); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); + DungeonStopBGM(); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + if(HasRecruitedMon(MONSTER_MEWTWO)){ + DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); + sub_8068FE0(MewtwoEntity,0x21c,0); + } + else { + gDungeon->unk7 = 1; + SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); + sub_8086A3C(MewtwoEntity); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); +} + +void sub_8089A00(u8 param_1, u8 param_2) +{ + if ((param_2 == 0x1d || param_2 == 0x1e || param_2 == 0x1f) && (param_1 == 0x11)) { + sub_8097FA8(0x13); + gDungeon->unk2 = 1; + } +} + +void MewtwoPreFightDialogue(void) +{ + Entity *leaderEntity; + Entity *MewtwoEntity; + + leaderEntity = xxx_call_GetLeader(); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); + sub_8086448(); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1); + sub_803E708(10,0x46); + DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); + sub_8086794(); + sub_803E708(0x1e,0x46); + MewtwoDropInEffect(MewtwoEntity); + sub_803E708(0x3c,0x46); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_2); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_3); + sub_803E708(10,0x46); + MewtwoScreenFlash(); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_4); + MewtwoScreenFlash(); + DisplayDungeonDialogue(&gMewtwoPreFightDialogue_5); + sub_803E708(10,0x46); + SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void MewtwoReFightDialogue(void) +{ + Entity *leaderEntity; + Entity *MewtwoEntity; + + leaderEntity = xxx_call_GetLeader(); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); + sub_8086448(); + if(HasRecruitedMon(MONSTER_MEWTWO)) { + sub_80866C4(&gMewtwoReFightDialogue_5); + } + else { + DisplayDungeonDialogue(&gMewtwoReFightDialogue_1); + DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); + sub_8086794(); + MewtwoDropInEffect(MewtwoEntity); + sub_803E708(0x3c,0x46); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_2); + MewtwoScreenFlash(); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_3); + MewtwoScreenFlash(); + DisplayDungeonDialogue(&gMewtwoReFightDialogue_4); + SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void MewtwoDropInEffect(Entity *mewtwoEntity) +{ + s24_8 iVar1; + s24_8 iVar2; + + GetEntInfo(mewtwoEntity)->unk15E = 0; + iVar2 = IntToF248_2(200); + iVar1 = IntToF248_2(4); + PlaySoundEffect(0x1f8); + while( 1 ) { + iVar2.raw -= iVar1.raw; + iVar1 = F248_Sub(iVar1, FloatToF248_2(0.045)); + if (F248LessThanFloat(iVar1, 0.12)) { + iVar1 = FloatToF248_2(0.12); + } + if (F248LessThanInt(iVar2, 0)) break; + GetEntInfo(mewtwoEntity)->unk174 = iVar2; + DungeonRunFrameActions(0x46); + } + GetEntInfo(mewtwoEntity)->unk174 = IntToF248_2(0); +} + +static void MewtwoScreenFlash(void) +{ + int iVar1; + + PlaySoundEffect(0x1f6); + for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(10,0x46); + for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,0,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(10,0x46); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(0x46); + } + sub_803E708(10,0x46); + sub_8085EB0(); +} + + diff --git a/src/dungeon_cutscene_placeholder.c b/src/dungeon_cutscene_placeholder.c deleted file mode 100644 index 4a6719c28..000000000 --- a/src/dungeon_cutscene_placeholder.c +++ /dev/null @@ -1,65 +0,0 @@ -#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_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); - diff --git a/src/dungeon_cutscene_raikou.c b/src/dungeon_cutscene_raikou.c new file mode 100644 index 000000000..87fd1fd76 --- /dev/null +++ b/src/dungeon_cutscene_raikou.c @@ -0,0 +1,220 @@ +#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_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 RaikouScreenFlash(void); + +void sub_8089EFC(void) +{ + Entity * leaderEntity; + Entity * RaikouEntity; + + leaderEntity = xxx_call_GetLeader(); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); +} + +void sub_8089F44(void) +{ + Entity * leaderEntity; + Entity * RaikouEntity; + + leaderEntity = xxx_call_GetLeader(); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); +} + +void sub_8089F8C(void) +{ + Entity * leaderEntity; + Entity * RaikouEntity; + + leaderEntity = xxx_call_GetLeader(); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + if (HasRecruitedMon(MONSTER_RAIKOU)) { + sub_8068FE0(RaikouEntity,0x21c,0); + } + else { + SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); +} + +void sub_8089FF0(u8 param_1, u8 param_2) +{ + if ((param_2 == 0x23 || param_2 == 0x24 || param_2 == 0x25) && (param_1 == 0x13)) { + sub_8097FA8(0x17); + gDungeon->unk2 = 1; + } +} + +void RaikouPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * RaikouEntity; + + leaderEntity = xxx_call_GetLeader(); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_1); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_2); + gDungeon->weather.unkE265 = WEATHER_RAIN; + sub_807EAA0(0,1); + sub_803E708(10,70); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_3); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_4); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_5); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouPreFightDialogue_6); + sub_803E708(10,70); + SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void RaikouReFightDialogue(void) +{ + Entity * leaderEntity; + Entity * RaikouEntity; + + leaderEntity = xxx_call_GetLeader(); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); + gDungeon->weather.unkE265 = WEATHER_RAIN; + sub_807EAA0(0,1); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouReFightDialogue_1); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouReFightDialogue_2); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouReFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void RaikouPostStoryPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * RaikouEntity; + + leaderEntity = xxx_call_GetLeader(); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); + if (HasRecruitedMon(MONSTER_RAIKOU)) { + sub_80866C4(&gRaikouPostStoryPreFightDialogue_4); + } + else { + gDungeon->weather.unkE265 = WEATHER_RAIN; + sub_807EAA0(0,1); + DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_1); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_2); + RaikouScreenFlash(); + DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void RaikouScreenFlash(void) +{ + s32 iVar1; + + PlaySoundEffect(0x1f6); + for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + sub_8085EB0(); +} + diff --git a/src/dungeon_cutscene_regis.c b/src/dungeon_cutscene_regis.c new file mode 100644 index 000000000..fd6d4b068 --- /dev/null +++ b/src/dungeon_cutscene_regis.c @@ -0,0 +1,363 @@ +#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_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_808B1CC(u8 itemID); +static void SetupRegiFacingDirection(Entity *regiEntity); +static void SetupRegirockFightHP(Entity *r0); +static void SetupRegiceFightHP(Entity *r0); +static void SetupRegisteelFightHP(Entity *r0); + +void sub_808ACC0(void) +{ + Entity * entity; + + if (HasRecruitedMon(MONSTER_REGIROCK)) { + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGIROCK); + sub_8068FE0(entity,0x21c,0); + sub_8097FA8(0x22); + sub_8097FA8(0x1d); + sub_808B1CC(ITEM_ROCK_PART); + } + else if (sub_80860A8(ITEM_ROCK_PART) != 0) { + sub_8098044(0x22); + sub_8097FA8(0x1d); + } + else if (sub_80860A8(ITEM_MUSIC_BOX) != 0) { + sub_8098044(0x22); + sub_8097FA8(0x1d); + } + else { + sub_8098044(0x22); + sub_8098044(0x1d); + sub_80855E4(SetupRegiFacingDirection); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGIROCK); + } +} + +void sub_808AD48(void) +{ + Entity * entity; + + if (HasRecruitedMon(MONSTER_REGICE)) { + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGICE); + sub_8068FE0(entity,0x21c,0); + sub_8097FA8(0x22); + sub_8097FA8(0x1d); + sub_808B1CC(ITEM_ICE_PART); + } + else if (sub_80860A8(ITEM_ICE_PART) != 0) { + sub_8098044(0x22); + sub_8097FA8(0x1d); + } + else if (sub_80860A8(ITEM_MUSIC_BOX) != 0) { + sub_8098044(0x22); + sub_8097FA8(0x1d); + } + else { + sub_8098044(0x22); + sub_8098044(0x1d); + sub_80855E4(SetupRegiFacingDirection); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGICE); + } +} + +void sub_808ADCC(void) +{ + + Entity * entity; + + if (HasRecruitedMon(MONSTER_REGISTEEL)) { + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGISTEEL); + sub_8068FE0(entity,0x21c,0); + sub_8097FA8(0x22); + sub_8097FA8(0x1d); + sub_808B1CC(ITEM_STEEL_PART); + } + else if (sub_80860A8(ITEM_STEEL_PART) != 0) { + sub_8098044(0x22); + sub_8097FA8(0x1d); + } + else if (sub_80860A8(ITEM_MUSIC_BOX) != 0) { + sub_8098044(0x22); + sub_8097FA8(0x1d); + } + else { + sub_8098044(0x22); + sub_8098044(0x1d); + sub_80855E4(SetupRegiFacingDirection); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGISTEEL); + } +} + +void sub_808AE54(u8 param_1,u8 param_2,DungeonPos *param_3) +{ + Entity * leaderEntity; + s16 IDStack[2]; + Item item; + + + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_2 == 0x2E) && (param_1 == 0x17)) { + sub_808B1CC(ITEM_NOTHING); + if (!sub_8098100(0x1d)) { + ItemIdToSlot(&item,ITEM_ROCK_PART,0); + sub_80464C8(GetLeader(),param_3,&item); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + // Something fell from Regirock's body + // Regirock was apparently guarding this item + DisplayDungeonDialogue(&gRegirockPostFightDialogue_1); + } + } +} + +void sub_808AEC8(u8 param_1,u8 param_2,DungeonPos *param_3) +{ + Entity * leaderEntity; + s16 IDStack[2]; + Item item; + + + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_2 == 0x2F) && (param_1 == 0x18)) { + sub_808B1CC(ITEM_NOTHING); + if (!sub_8098100(0x1d)) { + ItemIdToSlot(&item,ITEM_ICE_PART,0); + sub_80464C8(GetLeader(),param_3,&item); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + // Something fell from Regice's body + // Regice was apparently guarding this item + DisplayDungeonDialogue(&gRegicePostFightDialogue_1); + } + } +} + +void sub_808AF3C(u8 param_1,u8 param_2,DungeonPos *param_3) +{ + Entity * leaderEntity; + s16 IDStack[2]; + Item item; + + + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_2 == 0x30) && (param_1 == 0x19)) { + sub_808B1CC(ITEM_NOTHING); + if (!sub_8098100(0x1d)) { + ItemIdToSlot(&item,ITEM_STEEL_PART,0); + sub_80464C8(GetLeader(),param_3, &item); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + // Something fell from Registeel's body + // Registeel was apparently guarding this item + DisplayDungeonDialogue(&gRegisteelPostFightDialogue_1); + } + } +} + +void sub_808AFB0(u8 param_1) +{ + Entity * leaderEntity; + s16 IDStack [2]; + + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_1 == 0x2E) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ROCK_PART) != 0)) { + sub_8097FD0(0x1d); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); + // {POKEMON_0} obtained the Rock Part that Regirock was guarding + DisplayDungeonDialogue(&gRegirockPostFightDialogue_2); + sub_80421C0(0,0xd4); + sub_803E708(10,70); + sub_8046D20(); + } +} + +void sub_808B030(u8 param_1) +{ + Entity * leaderEntity; + s16 IDStack [2]; + + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_1 == 0x2F) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ICE_PART) != 0)) { + sub_8097FD0(0x1d); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); + // {POKEMON_0} obtained the Ice Part that Regice was guarding + DisplayDungeonDialogue(&gRegicePostFightDialogue_2); + sub_80421C0(0,0xd4); + sub_803E708(10,70); + sub_8046D20(); + } +} + +void sub_808B0B0(u8 param_1) +{ + Entity * leaderEntity; + s16 IDStack [2]; + + leaderEntity = xxx_call_GetLeader(); + sub_8052D44(IDStack,leaderEntity,0); + if (!sub_8098100(0x22) && (param_1 == 0x30) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_STEEL_PART) != 0)) { + sub_8097FD0(0x1d); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0); + // {POKEMON_0} obtained the Steel Part that Registeel was guarding + DisplayDungeonDialogue(&gRegisteelPostFightDialogue_2); + sub_80421C0(0,0xd4); + sub_803E708(10,70); + sub_8046D20(); + } +} + +void RegirockPreFightDialogue(void) +{ + if (!sub_8098100(0x22)) { + sub_8085930(DIRECTION_NORTH); + // INTRUDER ALERT + // EXTERMINATE + DisplayDungeonDialogue(&gRegirockPreFightDialogue_1); + sub_803E708(10,70); + sub_808563C(SetupRegirockFightHP); + } +} + +void RegicePreFightDialogue(void) +{ + if (!sub_8098100(0x22)) { + sub_8085930(DIRECTION_NORTH); + // INTRUDER ALERT + // EXTERMINATE + DisplayDungeonDialogue(&gRegicePreFightDialogue_1); + sub_803E708(10,70); + sub_808563C(SetupRegiceFightHP); + } +} + +void RegisteelPreFightDialogue(void) +{ + if (!sub_8098100(0x22)) { + sub_8085930(DIRECTION_NORTH); + // INTRUDER ALERT + // EXTERMINATE + DisplayDungeonDialogue(&gRegisteelPreFightDialogue_1); + sub_803E708(10,70); + sub_808563C(SetupRegisteelFightHP); + } +} + +static void sub_808B1CC(u8 itemID) +{ + Entity *entity; + Tile *tile; + DungeonPos pos; + Item item; + + pos.x = gDungeon->unk644.unk40; + pos.y = gDungeon->unk644.unk42; + if ((pos.x < 0) || (pos.y < 0)) { + entity = GetLeader(); + if (entity == NULL) { + gDungeon->unk2 = 1; + return; + } + pos.x = entity->pos.x; + pos.y = entity->pos.y; + } + sub_807FE04(&pos, 0); + tile = GetTileMut(pos.x, pos.y); + tile->terrainType = tile->terrainType | TERRAIN_TYPE_STAIRS; + if (((itemID != ITEM_NOTHING) && (sub_80860A8(itemID) == 0)) && + (sub_80860A8(ITEM_MUSIC_BOX) == 0)) { + ItemIdToSlot(&item,itemID,0); + pos.y--; + AddItemToDungeonAt(&pos,&item,1); + } + sub_8049ED4(); + ShowWholeRevealedDungeonMap(); +} + +static void SetupRegiFacingDirection(Entity *regiEntity) +{ + GetEntInfo(regiEntity)->action.direction = DIRECTION_NORTH; + sub_806CE68(regiEntity, DIRECTION_NORTH); +} + +static void SetupRegirockFightHP(Entity *r0) +{ + SetupBossFightHP(r0, 450, MUS_BOSS_BATTLE); +} + +static void SetupRegiceFightHP(Entity *r0) +{ + SetupBossFightHP(r0, 450, MUS_BOSS_BATTLE); +} + +static void SetupRegisteelFightHP(Entity *r0) +{ + SetupBossFightHP(r0, 450, MUS_BOSS_BATTLE); +} + + + diff --git a/src/dungeon_cutscene_suicune.c b/src/dungeon_cutscene_suicune.c new file mode 100644 index 000000000..140864a4b --- /dev/null +++ b/src/dungeon_cutscene_suicune.c @@ -0,0 +1,243 @@ +#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_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_808A528(Entity * param_1); +static void SuicuneScreenFlash(void); + +void sub_808A264(void) +{ + Entity * leaderEntity; + Entity * SuicuneEntity; + + leaderEntity = xxx_call_GetLeader(); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + sub_80855E4(sub_8086A3C); + SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); + sub_8086A3C(SuicuneEntity); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); +} + +void sub_808A2C0(void) +{ + Entity * leaderEntity; + Entity * SuicuneEntity; + + leaderEntity = xxx_call_GetLeader(); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); +} + +void sub_808A308(void) +{ + Entity * leaderEntity; + Entity * SuicuneEntity; + + leaderEntity = xxx_call_GetLeader(); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); + DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); + sub_80854D4(); + sub_8085930(DIRECTION_NORTH); + if (HasRecruitedMon(MONSTER_SUICUNE)) { + sub_8068FE0(SuicuneEntity,0x21c,0); + } + else { + SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); + } + sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); +} + +void sub_808A36C(u8 param_1, u8 param_2) +{ + if ((param_2 == 0x26 || param_2 == 0x27 || param_2 == 0x28) && (param_1 == 0x14)) { + sub_8097FA8(0x19); + gDungeon->unk2 = 1; + } +} + +void SuicunePreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * SuicuneEntity; + + leaderEntity = xxx_call_GetLeader(); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); + sub_8086448(); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_1); + sub_803E708(10,70); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_2); + sub_803E708(10,70); + sub_80426C8(1,2); + sub_803E708(0x3c,70); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_3); + sub_803E708(10,70); + sub_808A528(SuicuneEntity); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_4); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_5); + SuicuneScreenFlash(); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_6); + SuicuneScreenFlash(); + DisplayDungeonDialogue(&gSuicunePreFightDialogue_7); + sub_803E708(10,70); + SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void SuicuneReFightDialogue(void) +{ + Entity * leaderEntity; + Entity * SuicuneEntity; + + leaderEntity = xxx_call_GetLeader(); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); + DisplayDungeonDialogue(&gSuicuneReFightDialogue_1); + SuicuneScreenFlash(); + DisplayDungeonDialogue(&gSuicuneReFightDialogue_2); + SuicuneScreenFlash(); + DisplayDungeonDialogue(&gSuicuneReFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); +} + +void SuicunePostStoryPreFightDialogue(void) +{ + Entity * leaderEntity; + Entity * SuicuneEntity; + + leaderEntity = xxx_call_GetLeader(); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); + if (HasRecruitedMon(MONSTER_SUICUNE)) { + sub_80866C4(&gSuicunePostStoryPreFightDialogue_4); + } + else { + DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_1); + SuicuneScreenFlash(); + DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_2); + SuicuneScreenFlash(); + DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_3); + sub_803E708(10,70); + SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); + ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); + } +} + +static void sub_808A528(Entity * param_1) +{ + s24_8 iVar1; + s24_8 iVar2; + + GetEntInfo(param_1)->unk15E = 0; + iVar2 = IntToF248(200); + iVar1 = IntToF248(12); + PlaySoundEffect(0x1f8); + while( 1 ) { + iVar2.raw -= iVar1.raw; + iVar1 = F248_Sub(iVar1, FloatToF248(0.375)); + if (F248LessThanFloat(iVar1, 0.08)) { + iVar1 = FloatToF248_2(0.08); + } + if (F248LessThanInt(iVar2, 0)) break; + GetEntInfo(param_1)->unk174 = iVar2; + DungeonRunFrameActions(70); + } + GetEntInfo(param_1)->unk174 = IntToF248_2(0); +} + +static void SuicuneScreenFlash(void) +{ + s32 iVar1; + + PlaySoundEffect(0x1ee); + for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) + { + SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); + DungeonRunFrameActions(70); + } + sub_803E708(10,70); + sub_8085EB0(); +} + diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c deleted file mode 100644 index f6424f1a0..000000000 --- a/src/dungeon_cutscenes.c +++ /dev/null @@ -1,1397 +0,0 @@ -#include "global.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 u32 gDungeonBrightness; - -extern const struct MenuItem gUnknown_810579C[]; -extern const u64 gUnknown_8107544[]; -extern const u8 *const gUnknown_8105798; - - - - -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_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); - - -void sub_808BBA8(Entity * ); -void DeoxysScreenFlash(void); -void sub_8086A54(Entity *); -void ZapdosScreenFlash(s32 numFlashes); -void ZapdosDropInEffect(Entity *); -void SetupDeoxysFightHP(Entity *r0); -void sub_808C550(void); -void sub_808C590(Entity *r0); -void SetupDeoxysFacingDirection(Entity *r0); -void sub_808C9B0(Entity *); -void sub_808C8E0(Entity *param_1); -void sub_808C360(void); -void KyogreScreenFlash(void); -void sub_808C0CC(void); -void LugiaScreenFlash(void); -void LugiaScreenFlash2(void); -void nullsub_99(void); -void JirachiWish(void); -void JirachiSpinEffect(Entity *jirachiEntity); -void JirachiWishGrantDialogue(Entity *jirachiEntity); -void JirachiDropInEffect(Entity *jirachiEntity); -u8 JirachiFriendAreaSearch(void); -void sub_808B1CC(u8 itemID); -void CreateJirachiWishWarpTile(void); -void EnteiScreenFlash(void); -void RaikouScreenFlash(void); -void sub_808A528(Entity * param_1); -void SuicuneScreenFlash(void); -void HoOhDropInEffect(Entity * param_1); -void HoOhScreenFlash(void); -void LatiosScreenFlash(void); -void SetupRegiFacingDirection(Entity *entity); -void SetupRegirockFightHP(Entity *entity); -void SetupRegiceFightHP(Entity *entity); -void SetupRegisteelFightHP(Entity *entity); -void sub_808B50C(void); -void MewtwoDropInEffect(Entity *param_1); -void MewtwoScreenFlash(void); -void sub_80898F8(Entity *entity); -void sub_8089908(Entity *entity); -void RayquazaDropInEffect(Entity *param_1); -void RayquazaScreenFlash(void); -void sub_80891F0(void); -void sub_8089294(void); -void GroudonScreenFlash2(void); -void SceneGroudonMovement(Entity * param_1); -void GroudonScreenFlash(void); -void ArticunoScreenFlash(void); -void sub_8088484(Entity *param_1); -void sub_8088574(void); -void MoltresDropInEffect(Entity * param_1); -void MoltresScreenFlash1(s32 r0, s32 r1); -void MoltresScreenFlash2(s32 r0, s32 r1); -void MoltresScreenFlash3(void); -void MoltresScreenDarken(void); -void EnableJirachiWishWarpTile(void); -void sub_808BB3C(DungeonPos *pos); -void sub_8087144(); -void SkarmoryEntry(Entity *); - - -// FILE SPLIT - - -// FILE SPLIT - - -// FILE SPLIT - - - -// SPLIT - - - -// File Split - - - -// - - -// FILE SPLIT - - - - -// File split - - - -// File split - - - -// File split - -void sub_8089914(void) -{ - Entity *leaderEntity; - Entity *MewtwoEntity; - - leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); - DungeonStopBGM(); - gDungeon->unk7 = 1; - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); - sub_8086A3C(MewtwoEntity); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); -} - -void sub_8089978(void) -{ - Entity *leaderEntity; - Entity *MewtwoEntity; - - leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); - DungeonStopBGM(); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - if(HasRecruitedMon(MONSTER_MEWTWO)){ - DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); - sub_8068FE0(MewtwoEntity,0x21c,0); - } - else { - gDungeon->unk7 = 1; - SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); - sub_8086A3C(MewtwoEntity); - } - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); -} - -void sub_8089A00(u8 param_1, u8 param_2) -{ - if ((param_2 == 0x1d || param_2 == 0x1e || param_2 == 0x1f) && (param_1 == 0x11)) { - sub_8097FA8(0x13); - gDungeon->unk2 = 1; - } -} - -void MewtwoPreFightDialogue(void) -{ - Entity *leaderEntity; - Entity *MewtwoEntity; - - leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); - sub_8086448(); - DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1); - sub_803E708(10,0x46); - DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); - sub_8086794(); - sub_803E708(0x1e,0x46); - MewtwoDropInEffect(MewtwoEntity); - sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(&gMewtwoPreFightDialogue_2); - DisplayDungeonDialogue(&gMewtwoPreFightDialogue_3); - sub_803E708(10,0x46); - MewtwoScreenFlash(); - DisplayDungeonDialogue(&gMewtwoPreFightDialogue_4); - MewtwoScreenFlash(); - DisplayDungeonDialogue(&gMewtwoPreFightDialogue_5); - sub_803E708(10,0x46); - SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void MewtwoReFightDialogue(void) -{ - Entity *leaderEntity; - Entity *MewtwoEntity; - - leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); - sub_8086448(); - if(HasRecruitedMon(MONSTER_MEWTWO)) { - sub_80866C4(&gMewtwoReFightDialogue_5); - } - else { - DisplayDungeonDialogue(&gMewtwoReFightDialogue_1); - DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE); - sub_8086794(); - MewtwoDropInEffect(MewtwoEntity); - sub_803E708(0x3c,0x46); - DisplayDungeonDialogue(&gMewtwoReFightDialogue_2); - MewtwoScreenFlash(); - DisplayDungeonDialogue(&gMewtwoReFightDialogue_3); - MewtwoScreenFlash(); - DisplayDungeonDialogue(&gMewtwoReFightDialogue_4); - SetupBossFightHP(MewtwoEntity,900,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void MewtwoDropInEffect(Entity *mewtwoEntity) -{ - s24_8 iVar1; - s24_8 iVar2; - - GetEntInfo(mewtwoEntity)->unk15E = 0; - iVar2 = IntToF248_2(200); - iVar1 = IntToF248_2(4); - PlaySoundEffect(0x1f8); - while( 1 ) { - iVar2.raw -= iVar1.raw; - iVar1 = F248_Sub(iVar1, FloatToF248_2(0.045)); - if (F248LessThanFloat(iVar1, 0.12)) { - iVar1 = FloatToF248_2(0.12); - } - if (F248LessThanInt(iVar2, 0)) break; - GetEntInfo(mewtwoEntity)->unk174 = iVar2; - DungeonRunFrameActions(0x46); - } - GetEntInfo(mewtwoEntity)->unk174 = IntToF248_2(0); -} - -void MewtwoScreenFlash(void) -{ - int iVar1; - - PlaySoundEffect(0x1f6); - for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(10,0x46); - for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,0,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(10,0x46); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(0x46); - } - sub_803E708(10,0x46); - sub_8085EB0(); -} - -void sub_8089C44(void) -{ - Entity * leaderEntity; - Entity * EnteiEntity; - - leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); -} - - -void sub_8089C90(void) -{ - Entity * leaderEntity; - Entity * EnteiEntity; - - leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - if (HasRecruitedMon(MONSTER_ENTEI)) { - sub_8068FE0(EnteiEntity,0x21c,0); - } - else { - SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); - } - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); -} - -void sub_8089CFC(u8 param_1, u8 param_2) -{ - if ((param_2 == 0x20 || param_2 == 0x21 || param_2 == 0x22) && (param_1 == 0x12)) { - sub_8097FA8(0x15); - gDungeon->unk2 = 1; - } -} - -void EnteiPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * EnteiEntity; - - leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiPreFightDialogue_1); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiPreFightDialogue_2); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiPreFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void EnteiReFightDialogue(void) -{ - Entity * leaderEntity; - Entity * EnteiEntity; - - leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiReFightDialogue_1); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiReFightDialogue_2); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiReFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void EnteiPostStoryPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * EnteiEntity; - - leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); - if (HasRecruitedMon(MONSTER_ENTEI)) { - sub_80866C4(&gEnteiPostStoryPreFightDialogue_4); - } - else { - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_1); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_2); - EnteiScreenFlash(); - DisplayDungeonDialogue(&gEnteiPostStoryPreFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(EnteiEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void EnteiScreenFlash(void) -{ - s32 iVar1; - - PlaySoundEffect(0x1ed); - for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1, iVar1 / 2, iVar1 / 2, 1, 1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1, 0, 0, 1, 1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1, iVar1 / 2, iVar1 / 2, 1, 1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - sub_8085EB0(); -} - -void sub_8089EFC(void) -{ - Entity * leaderEntity; - Entity * RaikouEntity; - - leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); -} - - -void sub_8089F44(void) -{ - Entity * leaderEntity; - Entity * RaikouEntity; - - leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); -} - - -void sub_8089F8C(void) -{ - Entity * leaderEntity; - Entity * RaikouEntity; - - leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - if (HasRecruitedMon(MONSTER_RAIKOU)) { - sub_8068FE0(RaikouEntity,0x21c,0); - } - else { - SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); - } - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); -} - -void sub_8089FF0(u8 param_1, u8 param_2) -{ - if ((param_2 == 0x23 || param_2 == 0x24 || param_2 == 0x25) && (param_1 == 0x13)) { - sub_8097FA8(0x17); - gDungeon->unk2 = 1; - } -} - -void RaikouPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * RaikouEntity; - - leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); - DisplayDungeonDialogue(&gRaikouPreFightDialogue_1); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouPreFightDialogue_2); - gDungeon->weather.unkE265 = WEATHER_RAIN; - sub_807EAA0(0,1); - sub_803E708(10,70); - DisplayDungeonDialogue(&gRaikouPreFightDialogue_3); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouPreFightDialogue_4); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouPreFightDialogue_5); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouPreFightDialogue_6); - sub_803E708(10,70); - SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void RaikouReFightDialogue(void) -{ - Entity * leaderEntity; - Entity * RaikouEntity; - - leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); - gDungeon->weather.unkE265 = WEATHER_RAIN; - sub_807EAA0(0,1); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouReFightDialogue_1); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouReFightDialogue_2); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouReFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void RaikouPostStoryPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * RaikouEntity; - - leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); - if (HasRecruitedMon(MONSTER_RAIKOU)) { - sub_80866C4(&gRaikouPostStoryPreFightDialogue_4); - } - else { - gDungeon->weather.unkE265 = WEATHER_RAIN; - sub_807EAA0(0,1); - DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_1); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_2); - RaikouScreenFlash(); - DisplayDungeonDialogue(&gRaikouPostStoryPreFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(RaikouEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void RaikouScreenFlash(void) -{ - s32 iVar1; - - PlaySoundEffect(0x1f6); - for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - sub_8085EB0(); -} - -void sub_808A264(void) -{ - Entity * leaderEntity; - Entity * SuicuneEntity; - - leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); - sub_8086A3C(SuicuneEntity); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); -} - -void sub_808A2C0(void) -{ - Entity * leaderEntity; - Entity * SuicuneEntity; - - leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); -} - -void sub_808A308(void) -{ - Entity * leaderEntity; - Entity * SuicuneEntity; - - leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - if (HasRecruitedMon(MONSTER_SUICUNE)) { - sub_8068FE0(SuicuneEntity,0x21c,0); - } - else { - SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); - } - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); -} - -void sub_808A36C(u8 param_1, u8 param_2) -{ - if ((param_2 == 0x26 || param_2 == 0x27 || param_2 == 0x28) && (param_1 == 0x14)) { - sub_8097FA8(0x19); - gDungeon->unk2 = 1; - } -} - -void SuicunePreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * SuicuneEntity; - - leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); - sub_8086448(); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_1); - sub_803E708(10,70); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_2); - sub_803E708(10,70); - sub_80426C8(1,2); - sub_803E708(0x3c,70); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_3); - sub_803E708(10,70); - sub_808A528(SuicuneEntity); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_4); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_5); - SuicuneScreenFlash(); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_6); - SuicuneScreenFlash(); - DisplayDungeonDialogue(&gSuicunePreFightDialogue_7); - sub_803E708(10,70); - SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void SuicuneReFightDialogue(void) -{ - Entity * leaderEntity; - Entity * SuicuneEntity; - - leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); - DisplayDungeonDialogue(&gSuicuneReFightDialogue_1); - SuicuneScreenFlash(); - DisplayDungeonDialogue(&gSuicuneReFightDialogue_2); - SuicuneScreenFlash(); - DisplayDungeonDialogue(&gSuicuneReFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void SuicunePostStoryPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * SuicuneEntity; - - leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); - if (HasRecruitedMon(MONSTER_SUICUNE)) { - sub_80866C4(&gSuicunePostStoryPreFightDialogue_4); - } - else { - DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_1); - SuicuneScreenFlash(); - DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_2); - SuicuneScreenFlash(); - DisplayDungeonDialogue(&gSuicunePostStoryPreFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(SuicuneEntity,0x28a,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void sub_808A528(Entity * param_1) -{ - s24_8 iVar1; - s24_8 iVar2; - - GetEntInfo(param_1)->unk15E = 0; - iVar2 = IntToF248(200); - iVar1 = IntToF248(12); - PlaySoundEffect(0x1f8); - while( 1 ) { - iVar2.raw -= iVar1.raw; - iVar1 = F248_Sub(iVar1, FloatToF248(0.375)); - if (F248LessThanFloat(iVar1, 0.08)) { - iVar1 = FloatToF248_2(0.08); - } - if (F248LessThanInt(iVar2, 0)) break; - GetEntInfo(param_1)->unk174 = iVar2; - DungeonRunFrameActions(70); - } - GetEntInfo(param_1)->unk174 = IntToF248_2(0); -} - -void SuicuneScreenFlash(void) -{ - s32 iVar1; - - PlaySoundEffect(0x1ee); - for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - sub_8085EB0(); -} - -void sub_808A608(void) -{ - Entity * leaderEntity; - Entity * HoOhEntity; - - leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); - DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); - sub_80867F4(); - sub_8086838(0,0,0); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); - sub_8086A3C(HoOhEntity); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -6); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); -} - -void sub_808A668(void) -{ - Entity * leaderEntity; - Entity * HoOhEntity; - - leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); - DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); - sub_80867F4(); - sub_8086838(0,0,0); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - if (HasRecruitedMon(MONSTER_HO_OH)) { - sub_8068FE0(HoOhEntity,0x21c,0); - } - else { - SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); - sub_8086A3C(HoOhEntity); - } - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 6); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); -} - -void sub_808A6E8(u8 param_1, u8 param_2) -{ - if ((param_2 == 0x29 || param_2 == 0x2A) && (param_1 == 0x15)) { - sub_8097FA8(0x1A); - gDungeon->unk2 = 1; - } -} - -void sub_808A718(void) -{ - sub_8086854(); -} - -void HoOhPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * HoOhEntity; - PixelPos local_14; - - leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); - local_14.x = leaderEntity->pixelPos.x; - local_14.y = leaderEntity->pixelPos.y + -0x1000; - ShiftCameraToPosition(&local_14,0x88); - sub_803E708(0x40,70); - DisplayDungeonDialogue(&gHoOhPreFightDialogue_1); - sub_803E708(10,70); - HoOhScreenFlash(); - DisplayDungeonDialogue(&gHoOhPreFightDialogue_2); - sub_803E708(10,70); - sub_80855E4(sub_80868F4); - sub_808680C(); - PlaySoundEffect(0x1c5); - sub_803E708(0xfa,70); - HoOhDropInEffect(HoOhEntity); - StopSoundEffect(0x1c5); - sub_808682C(); - sub_80855E4(sub_8086910); - sub_8085930(DIRECTION_NORTH); - DisplayDungeonDialogue(&gHoOhPreFightDialogue_3); - DisplayDungeonDialogue(&gHoOhPreFightDialogue_4); - sub_803E708(0x1e,70); - sub_803E708(0x1e,70); - HoOhScreenFlash(); - DisplayDungeonDialogue(&gHoOhPreFightDialogue_5); - HoOhScreenFlash(); - DisplayDungeonDialogue(&gHoOhPreFightDialogue_6); - sub_803E708(10,70); - SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void HoOhReFightDialogue(void) -{ - Entity * leaderEntity; - Entity * HoOhEntity; - PixelPos local_14; - - leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); - - local_14.x = leaderEntity->pixelPos.x; - local_14.y = leaderEntity->pixelPos.y + -0x1000; - ShiftCameraToPosition(&local_14,0x88); - sub_803E708(0x40,70); - if (HasRecruitedMon(MONSTER_HO_OH)) { - sub_80866C4(&HoOhReFightDialogue_5); - } - else { - DisplayDungeonDialogue(&HoOhReFightDialogue_1); - HoOhScreenFlash(); - sub_80855E4(sub_80868F4); - sub_808680C(); - sub_803E708(10,70); - HoOhDropInEffect(HoOhEntity); - sub_808682C(); - sub_80855E4(sub_8086910); - sub_8085930(DIRECTION_NORTH); - DisplayDungeonDialogue(&HoOhReFightDialogue_2); - HoOhScreenFlash(); - DisplayDungeonDialogue(&HoOhReFightDialogue_3); - HoOhScreenFlash(); - DisplayDungeonDialogue(&HoOhReFightDialogue_4); - sub_803E708(10,70); - SetupBossFightHP(HoOhEntity,800,MUS_BATTLE_WITH_RAYQUAZA); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); - } -} - -void HoOhDropInEffect(Entity * param_1) -{ - s24_8 iVar1; - s24_8 iVar2; - - GetEntInfo(param_1)->unk15E = 0; - iVar2 = IntToF248(200); - iVar1 = IntToF248(12); - PlaySoundEffect(0x1f8); - while( 1 ) { - iVar2.raw -= iVar1.raw; - iVar1 = F248_Sub(iVar1, FloatToF248(0.375)); - if (F248LessThanFloat(iVar1, 0.08)) { - iVar1 = FloatToF248_2(0.08); - } - if (F248LessThanInt(iVar2, 0)) break; - GetEntInfo(param_1)->unk174 = iVar2; - DungeonRunFrameActions(70); - } - GetEntInfo(param_1)->unk174 = IntToF248_2(0); -} - -void HoOhScreenFlash(void) -{ - s32 iVar1; - - PlaySoundEffect(0x1ed); - for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - sub_8085EB0(); -} - -void sub_808A9E4(void) -{ - Entity * leaderEntity; - Entity * LatiosEntity; - - leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - SetFacingDirection(LatiosEntity, DIRECTION_NORTH); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 4); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); -} - -void sub_808AA3C(void) -{ - Entity * leaderEntity; - Entity * LatiosEntity; - - leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - SetFacingDirection(LatiosEntity, DIRECTION_NORTH); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); -} - -void sub_808AA94(void) -{ - Entity * leaderEntity; - Entity * LatiosEntity; - - leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - sub_80854D4(); - sub_8085930(DIRECTION_NORTH); - sub_80855E4(sub_8086A3C); - sub_8068FE0(LatiosEntity,0x21c,0); - sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); -} - -void sub_808AAF0(u8 param_1, u8 param_2) -{ - if ((param_2 == 0x2B || param_2 == 0x2C || param_2 == 0x2D) && (param_1 == 0x16)) { - sub_8097FA8(0x1C); - gDungeon->unk2 = 1; - } -} - -void LatiosPreFightDialogue(void) -{ - Entity * leaderEntity; - Entity * LatiosEntity; - PixelPos local_18; - DungeonPos local_19; - - leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); - - local_18.x = LatiosEntity->pixelPos.x; - local_18.y = LatiosEntity->pixelPos.y + (0x80 << 6); - local_19.y = 0x70; - local_19.x = 0xFC; - sub_8085EC8(0x1bd,0,0,&local_19,1); - - sub_803E708(0x1e,70); - sub_8086448(); - ShiftCameraToPosition(&local_18,0x18); - sub_803E708(2,70); - SpriteShockEffect(LatiosEntity); - sub_803E708(0x20,70); - sub_808692C(); - DisplayDungeonDialogue(&gLatiosPreFightDialogue_1); - LatiosScreenFlash(); - DisplayDungeonDialogue(&gLatiosPreFightDialogue_2); - LatiosScreenFlash(); - DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void LatiosReFightDialogue(void) -{ - Entity * leaderEntity; - Entity * LatiosEntity; - - leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); - sub_8086448(); - sub_808692C(); - DisplayDungeonDialogue(&gLatiosReFightDialogue_1); - LatiosScreenFlash(); - DisplayDungeonDialogue(&gLatiosPreFightDialogue_2); - LatiosScreenFlash(); - DisplayDungeonDialogue(&gLatiosPreFightDialogue_3); - sub_803E708(10,70); - SetupBossFightHP(LatiosEntity,600,MUS_BOSS_BATTLE); - ShiftCameraToPosition(&leaderEntity->pixelPos,0x10); -} - -void sub_808AC3C(void) -{ - sub_8086448(); - // There appears to be no one here - sub_80866C4(&gUnknown_8104FC8); -} - -void LatiosScreenFlash(void) -{ - s32 iVar1; - - PlaySoundEffect(0x1ee); - gDungeonBrightness = 0x1f; - for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) - { - SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - DungeonRunFrameActions(70); - } - sub_803E708(10,70); - sub_8085EB0(); -} - -void sub_808ACC0(void) -{ - Entity * entity; - - if (HasRecruitedMon(MONSTER_REGIROCK)) { - entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGIROCK); - sub_8068FE0(entity,0x21c,0); - sub_8097FA8(0x22); - sub_8097FA8(0x1d); - sub_808B1CC(ITEM_ROCK_PART); - } - else if (sub_80860A8(ITEM_ROCK_PART) != 0) { - sub_8098044(0x22); - sub_8097FA8(0x1d); - } - else if (sub_80860A8(ITEM_MUSIC_BOX) != 0) { - sub_8098044(0x22); - sub_8097FA8(0x1d); - } - else { - sub_8098044(0x22); - sub_8098044(0x1d); - sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGIROCK); - } -} - -void sub_808AD48(void) -{ - Entity * entity; - - if (HasRecruitedMon(MONSTER_REGICE)) { - entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGICE); - sub_8068FE0(entity,0x21c,0); - sub_8097FA8(0x22); - sub_8097FA8(0x1d); - sub_808B1CC(ITEM_ICE_PART); - } - else if (sub_80860A8(ITEM_ICE_PART) != 0) { - sub_8098044(0x22); - sub_8097FA8(0x1d); - } - else if (sub_80860A8(ITEM_MUSIC_BOX) != 0) { - sub_8098044(0x22); - sub_8097FA8(0x1d); - } - else { - sub_8098044(0x22); - sub_8098044(0x1d); - sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGICE); - } -} - -void sub_808ADCC(void) -{ - - Entity * entity; - - if (HasRecruitedMon(MONSTER_REGISTEEL)) { - entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGISTEEL); - sub_8068FE0(entity,0x21c,0); - sub_8097FA8(0x22); - sub_8097FA8(0x1d); - sub_808B1CC(ITEM_STEEL_PART); - } - else if (sub_80860A8(ITEM_STEEL_PART) != 0) { - sub_8098044(0x22); - sub_8097FA8(0x1d); - } - else if (sub_80860A8(ITEM_MUSIC_BOX) != 0) { - sub_8098044(0x22); - sub_8097FA8(0x1d); - } - else { - sub_8098044(0x22); - sub_8098044(0x1d); - sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGISTEEL); - } -} - -void sub_808AE54(u8 param_1,u8 param_2,DungeonPos *param_3) -{ - Entity * leaderEntity; - s16 IDStack[2]; - Item item; - - - leaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,leaderEntity,0); - if (!sub_8098100(0x22) && (param_2 == 0x2E) && (param_1 == 0x17)) { - sub_808B1CC(ITEM_NOTHING); - if (!sub_8098100(0x1d)) { - ItemIdToSlot(&item,ITEM_ROCK_PART,0); - sub_80464C8(GetLeader(),param_3,&item); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - // Something fell from Regirock's body - // Regirock was apparently guarding this item - DisplayDungeonDialogue(&gRegirockPostFightDialogue_1); - } - } -} - - -void sub_808AEC8(u8 param_1,u8 param_2,DungeonPos *param_3) -{ - Entity * leaderEntity; - s16 IDStack[2]; - Item item; - - - leaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,leaderEntity,0); - if (!sub_8098100(0x22) && (param_2 == 0x2F) && (param_1 == 0x18)) { - sub_808B1CC(ITEM_NOTHING); - if (!sub_8098100(0x1d)) { - ItemIdToSlot(&item,ITEM_ICE_PART,0); - sub_80464C8(GetLeader(),param_3,&item); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - // Something fell from Regice's body - // Regice was apparently guarding this item - DisplayDungeonDialogue(&gRegicePostFightDialogue_1); - } - } -} - -void sub_808AF3C(u8 param_1,u8 param_2,DungeonPos *param_3) -{ - Entity * leaderEntity; - s16 IDStack[2]; - Item item; - - - leaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,leaderEntity,0); - if (!sub_8098100(0x22) && (param_2 == 0x30) && (param_1 == 0x19)) { - sub_808B1CC(ITEM_NOTHING); - if (!sub_8098100(0x1d)) { - ItemIdToSlot(&item,ITEM_STEEL_PART,0); - sub_80464C8(GetLeader(),param_3, &item); - DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); - // Something fell from Registeel's body - // Registeel was apparently guarding this item - DisplayDungeonDialogue(&gRegisteelPostFightDialogue_1); - } - } -} - -void sub_808AFB0(u8 param_1) -{ - Entity * leaderEntity; - s16 IDStack [2]; - - leaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,leaderEntity,0); - if (!sub_8098100(0x22) && (param_1 == 0x2E) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ROCK_PART) != 0)) { - sub_8097FD0(0x1d); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); - // {POKEMON_0} obtained the Rock Part that Regirock was guarding - DisplayDungeonDialogue(&gRegirockPostFightDialogue_2); - sub_80421C0(0,0xd4); - sub_803E708(10,70); - sub_8046D20(); - } -} - -void sub_808B030(u8 param_1) -{ - Entity * leaderEntity; - s16 IDStack [2]; - - leaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,leaderEntity,0); - if (!sub_8098100(0x22) && (param_1 == 0x2F) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ICE_PART) != 0)) { - sub_8097FD0(0x1d); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); - // {POKEMON_0} obtained the Ice Part that Regice was guarding - DisplayDungeonDialogue(&gRegicePostFightDialogue_2); - sub_80421C0(0,0xd4); - sub_803E708(10,70); - sub_8046D20(); - } -} - -void sub_808B0B0(u8 param_1) -{ - Entity * leaderEntity; - s16 IDStack [2]; - - leaderEntity = xxx_call_GetLeader(); - sub_8052D44(IDStack,leaderEntity,0); - if (!sub_8098100(0x22) && (param_1 == 0x30) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_STEEL_PART) != 0)) { - sub_8097FD0(0x1d); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0); - // {POKEMON_0} obtained the Steel Part that Registeel was guarding - DisplayDungeonDialogue(&gRegisteelPostFightDialogue_2); - sub_80421C0(0,0xd4); - sub_803E708(10,70); - sub_8046D20(); - } -} - -void RegirockPreFightDialogue(void) -{ - if (!sub_8098100(0x22)) { - sub_8085930(DIRECTION_NORTH); - // INTRUDER ALERT - // EXTERMINATE - DisplayDungeonDialogue(&gRegirockPreFightDialogue_1); - sub_803E708(10,70); - sub_808563C(SetupRegirockFightHP); - } -} - -void RegicePreFightDialogue(void) -{ - if (!sub_8098100(0x22)) { - sub_8085930(DIRECTION_NORTH); - // INTRUDER ALERT - // EXTERMINATE - DisplayDungeonDialogue(&gRegicePreFightDialogue_1); - sub_803E708(10,70); - sub_808563C(SetupRegiceFightHP); - } -} - -void RegisteelPreFightDialogue(void) -{ - if (!sub_8098100(0x22)) { - sub_8085930(DIRECTION_NORTH); - // INTRUDER ALERT - // EXTERMINATE - DisplayDungeonDialogue(&gRegisteelPreFightDialogue_1); - sub_803E708(10,70); - sub_808563C(SetupRegisteelFightHP); - } -} - -void sub_808B1CC(u8 itemID) -{ - Entity *entity; - Tile *tile; - DungeonPos pos; - Item item; - - pos.x = gDungeon->unk644.unk40; - pos.y = gDungeon->unk644.unk42; - if ((pos.x < 0) || (pos.y < 0)) { - entity = GetLeader(); - if (entity == NULL) { - gDungeon->unk2 = 1; - return; - } - pos.x = entity->pos.x; - pos.y = entity->pos.y; - } - sub_807FE04(&pos, 0); - tile = GetTileMut(pos.x, pos.y); - tile->terrainType = tile->terrainType | TERRAIN_TYPE_STAIRS; - if (((itemID != ITEM_NOTHING) && (sub_80860A8(itemID) == 0)) && - (sub_80860A8(ITEM_MUSIC_BOX) == 0)) { - ItemIdToSlot(&item,itemID,0); - pos.y--; - AddItemToDungeonAt(&pos,&item,1); - } - sub_8049ED4(); - ShowWholeRevealedDungeonMap(); -} - -void SetupRegiFacingDirection(Entity *regiEntity) -{ - GetEntInfo(regiEntity)->action.direction = DIRECTION_NORTH; - sub_806CE68(regiEntity, DIRECTION_NORTH); -} - - -void SetupRegirockFightHP(Entity *r0) -{ - SetupBossFightHP(r0, 450, MUS_BOSS_BATTLE); -} - - -void SetupRegiceFightHP(Entity *r0) -{ - SetupBossFightHP(r0, 450, MUS_BOSS_BATTLE); -} - - -void SetupRegisteelFightHP(Entity *r0) -{ - SetupBossFightHP(r0, 450, MUS_BOSS_BATTLE); -} - - - - - - - -