Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thepit v2 #70

Merged
merged 7 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -1234,3 +1234,5 @@ EventScript_End:
.include "data/maps/PitArenaBeachCave04/scripts.inc"

.include "data/maps/PitBackRoom/scripts.inc"

.include "data/maps/PitFinalBoss/scripts.inc"
1 change: 1 addition & 0 deletions data/layouts/PitFinalBoss/border.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����
1 change: 1 addition & 0 deletions data/layouts/PitFinalBoss/map.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}�������������������������������;;;;;;;;;;;;;xyz{|;;;;;;;;;;;;;;;;;;;;;;;;;;�����;;;;;;;;;;;;;;;;;;;;;;;;;;�����;;;;;;;;;;;;;;;;;;;;;;;;;;�����;;;;;;;;;;;;;;;;;;;;;;;;;;��B�B�B�;;;;;;;;;;;;;;;;;;;;;;;;;;8b@BABBB:b;;;;;;;;;;;;;;;;;;;;;;;;;8R@b@BIBJBBb:R;;;;;;;;;;;;CCCCCCCCCCC8B@RHbPQRBbBRFBCCCCCCCCCCCKKKKKKKKKKL2@BHR@bXbYbXbBbBRBBN2KKKKKKKKKKSSSSSSSSTU@2@B@RPZQZRBRBBB2UVSSSSSSSS[[[[[[\]@AH2@B@RXRXRYRXRXRBRBBB2AB]^[[[[[[\]]]]]@A@AH2@BPZZQRZZRBBB2ABAB]]]]]^@AAAAA@AHA@2@BXBXBXBYXBXBXBBBB2ABIBAAAAAB@AAAAAHAHA@2PZZZQ2ZZZRB2ABIBIIIIIBHAAAAAHA@AH2X2X2X2X2Y2X2X2X2X2B2IBIBIIIIIBHAAAAA@AHAPZZZZZZZZZRIBIBIIIIIB@AAAAAHAHAX2X2X2X2X2X2X2X2X2X2X2IBIBIIIIIBHAAAAAHAPZZZZZZZZZZZZZRIBIIIIIBHAAAAAHAX2X2X2X2X2X2X2X2X2X2X2X2X2X2X2IBIIIIIBHAAAAAPZZZZZZZZZZZZZZZZZRIIIIIB
10 changes: 10 additions & 0 deletions data/layouts/layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -4870,6 +4870,16 @@
"secondary_tileset": "gTileset_PitZeldaHouse",
"border_filepath": "data/layouts/PitBackRoom/border.bin",
"blockdata_filepath": "data/layouts/PitBackRoom/map.bin"
},
{
"id": "LAYOUT_PIT_FINAL_BOSS",
"name": "PitFinalBoss_Layout",
"width": 31,
"height": 23,
"primary_tileset": "gTileset_Building",
"secondary_tileset": "gTileset_BattlePyramid",
"border_filepath": "data/layouts/PitFinalBoss/border.bin",
"blockdata_filepath": "data/layouts/PitFinalBoss/map.bin"
}
]
}
53 changes: 53 additions & 0 deletions data/maps/PitFinalBoss/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"id": "MAP_PIT_FINAL_BOSS",
"name": "PitFinalBoss",
"layout": "LAYOUT_PIT_FINAL_BOSS",
"music": "MUS_ABANDONED_SHIP",
"region_map_section": "MAPSEC_PIT_BOSS",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_UNDERGROUND",
"allow_cycling": false,
"allow_escaping": false,
"allow_running": true,
"show_map_name": false,
"battle_scene": "MAP_BATTLE_SCENE_NORMAL",
"connections": 0,
"object_events": [
{
"graphics_id": "OBJ_EVENT_GFX_VAR_F",
"x": 15,
"y": 8,
"elevation": 0,
"movement_type": "MOVEMENT_TYPE_FACE_DOWN",
"movement_range_x": 0,
"movement_range_y": 0,
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "PitBoss_BossEncounter",
"flag": "FLAG_BOSS_ENCOUNTER"
},
{
"graphics_id": "OBJ_EVENT_GFX_TRICK_HOUSE_STATUE",
"x": 15,
"y": 8,
"elevation": 0,
"movement_type": "MOVEMENT_TYPE_NONE",
"movement_range_x": 0,
"movement_range_y": 0,
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "Pit_EndGameStatue",
"flag": "FLAG_END_GAME_STATUE"
}
],
"warp_events": [

],
"coord_events": [

],
"bg_events": [

]
}
15 changes: 15 additions & 0 deletions data/maps/PitFinalBoss/scripts.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PitFinalBoss_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, PitFinalBoss_OnTransition
map_script MAP_SCRIPT_ON_FRAME_TABLE, PitFinalBoss_OnFrameTable
.byte 0

PitFinalBoss_OnFrameTable:
map_script_2 VAR_TEMP_0, 0, PitBossArena_CheckForHeal
.2byte 0

PitFinalBoss_OnTransition:
callnative TrySetRandomMusic
setrespawn HEAL_LOCATION_PETALBURG_CITY
setflashlevel 0
return

3 changes: 2 additions & 1 deletion data/maps/map_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"PitArenaBeachCave",
"PitArenaBeachCave02",
"PitArenaBeachCave03",
"PitArenaBeachCave04"
"PitArenaBeachCave04",
"PitFinalBoss"
],
"gMapGroup_TownsAndRoutes": [
"PetalburgCity",
Expand Down
Binary file modified data/tilesets/secondary/battle_pyramid/metatiles.bin
Binary file not shown.
1 change: 1 addition & 0 deletions include/constants/map_groups.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#define MAP_PIT_ARENA_BEACH_CAVE02 (41 | (0 << 8))
#define MAP_PIT_ARENA_BEACH_CAVE03 (42 | (0 << 8))
#define MAP_PIT_ARENA_BEACH_CAVE04 (43 | (0 << 8))
#define MAP_PIT_FINAL_BOSS (44 | (0 << 8))

// gMapGroup_TownsAndRoutes
#define MAP_PETALBURG_CITY (0 | (1 << 8))
Expand Down
1 change: 1 addition & 0 deletions include/pit.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ u16 ReturnLastSpokenVarObjGfxId();
void BufferMapFloorString();
void WarpToRandomPitArena(void);
void SetRandomBossEncounter(void);
void ChooseFinalBossEncounter(void);
const struct TrainerMon *GetRandomBossEncounterAcePokemon(void);
u16 GetRandomBossEncounterTrainerPic(void);
const u8 *GetRandomBossEncounterBossName(void);
Expand Down
2 changes: 1 addition & 1 deletion src/data/map_group_count.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
static const u8 MAP_GROUP_COUNT[] = {44, 59, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0};
static const u8 MAP_GROUP_COUNT[] = {45, 59, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0};
4 changes: 2 additions & 2 deletions src/data/moves_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -16111,7 +16111,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.contestCategory = CONTEST_CATEGORY_SMART,
.contestComboStarterId = 0,
.contestComboMoves = {0},
.battleAnimScript = Move_SMART_STRIKE,
.battleAnimScript = Move_PIN_MISSILE,
},

[MOVE_PURIFY] =
Expand Down Expand Up @@ -18603,7 +18603,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.contestComboStarterId = 0,
.contestComboMoves = {0},
.battleAnimScript = Move_FIERY_WRATH,
.battleAnimScript = Move_OVERHEAT,
},

[MOVE_THUNDEROUS_KICK] =
Expand Down
4 changes: 4 additions & 0 deletions src/map_name_popup.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ static void LoadMapNamePopUpWindowBgs(void)
{
popupThemeId = MAPPOPUP_THEME_BLACK;
}
if((mapNum | (mapGroup << 8)) == MAP_PIT_FINAL_BOSS)
{
popupThemeId = MAPPOPUP_THEME_BLACK;
}
if((mapNum | (mapGroup << 8)) == MAP_PIT_WILD_ENCOUNTER_FLOOR)
{
popupThemeId = MAPPOPUP_THEME_BLACK;
Expand Down
203 changes: 109 additions & 94 deletions src/pit_arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -2598,99 +2598,6 @@ static const struct RandomBossEncounters sRandomBossEncounterArray[] = {
#endif
},

{
.graphicsId = OBJ_EVENT_GFX_MAXIE,
.trainerPic = TRAINER_PIC_MAGMA_LEADER_MAXIE,
.bossName = COMPOUND_STRING("Maxie"),
.bossApproachText = COMPOUND_STRING("Clear out of the way! Don't you dare\n"
"interfere!$"),
.bossLoseText = COMPOUND_STRING("You've really done it...\p"
"You've shown a power that exceeds that\n"
"of the great Maxie!$"),
.bossAceText = COMPOUND_STRING("I shall educate you!\p$"),
#if (GEN_LATEST == GEN_3)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 252, 0, 252, 4, 0),
.lvl = 100,
.species = SPECIES_GROUDON,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_NAIVE,
.moves = {MOVE_BULK_UP, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_OVERHEAT}
},
#elif (GEN_LATEST == GEN_5)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(252, 252, 0, 0, 0, 4),
.lvl = 100,
.species = SPECIES_GROUDON,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_ADAMANT,
.moves = {MOVE_BULK_UP, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_FIRE_PUNCH}
},
#else
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(252, 252, 0, 0, 0, 4),
.lvl = 100,
.species = SPECIES_GROUDON,
.heldItem = ITEM_RED_ORB,
.ability = 0,
.nature = NATURE_ADAMANT,
.moves = {MOVE_BULK_UP, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_FIRE_PUNCH}
},
#endif
},

{
.graphicsId = OBJ_EVENT_GFX_ARCHIE,
.trainerPic = TRAINER_PIC_AQUA_LEADER_ARCHIE,
.bossName = COMPOUND_STRING("Archie"),
.bossApproachText = COMPOUND_STRING("I have waited so long for this day to\n"
"come...\p"
"For the realization of my dream, you\n"
"must disappear now!$"),
.bossLoseText = COMPOUND_STRING("I commend you. I must recognize that\n"
"you are truly gifted.$"),
.bossAceText = COMPOUND_STRING("It's the road's end for you!\p$"),
#if (GEN_LATEST == GEN_3)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 0, 0, 252, 252, 4),
.lvl = 100,
.species = SPECIES_KYOGRE,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_MODEST,
.moves = {MOVE_CALM_MIND, MOVE_HYDRO_PUMP, MOVE_THUNDER, MOVE_ICE_BEAM}
},
#elif (GEN_LATEST == GEN_5)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 0, 0, 252, 252, 4),
.lvl = 100,
.species = SPECIES_KYOGRE,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_MODEST,
.moves = {MOVE_CALM_MIND, MOVE_HYDRO_PUMP, MOVE_THUNDER, MOVE_ICE_BEAM}
},
#else
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 0, 0, 252, 252, 4),
.lvl = 100,
.species = SPECIES_KYOGRE,
.heldItem = ITEM_BLUE_ORB,
.ability = 0,
.nature = NATURE_MODEST,
.moves = {MOVE_CALM_MIND, MOVE_HYDRO_PUMP, MOVE_THUNDER, MOVE_ICE_BEAM}
},
#endif
},

{
.graphicsId = OBJ_EVENT_GFX_ERIKA,
.trainerPic = TRAINER_PIC_ERIKA,
Expand Down Expand Up @@ -3109,6 +3016,100 @@ static const struct RandomBossEncounters sRandomBossEncounterArray[] = {
},
},
#endif

{
.graphicsId = OBJ_EVENT_GFX_MAXIE,
.trainerPic = TRAINER_PIC_MAGMA_LEADER_MAXIE,
.bossName = COMPOUND_STRING("Maxie"),
.bossApproachText = COMPOUND_STRING("Clear out of the way! Don't you dare\n"
"interfere!$"),
.bossLoseText = COMPOUND_STRING("You've really done it...\p"
"You've shown a power that exceeds that\n"
"of the great Maxie!$"),
.bossAceText = COMPOUND_STRING("I shall educate you!\p$"),
#if (GEN_LATEST == GEN_3)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 252, 0, 252, 4, 0),
.lvl = 100,
.species = SPECIES_GROUDON,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_NAIVE,
.moves = {MOVE_BULK_UP, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_OVERHEAT}
},
#elif (GEN_LATEST == GEN_5)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(252, 252, 0, 0, 0, 4),
.lvl = 100,
.species = SPECIES_GROUDON,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_ADAMANT,
.moves = {MOVE_BULK_UP, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_FIRE_PUNCH}
},
#else
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(252, 252, 0, 0, 0, 4),
.lvl = 100,
.species = SPECIES_GROUDON,
.heldItem = ITEM_RED_ORB,
.ability = 0,
.nature = NATURE_ADAMANT,
.moves = {MOVE_BULK_UP, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_FIRE_PUNCH}
},
#endif
},

{
.graphicsId = OBJ_EVENT_GFX_ARCHIE,
.trainerPic = TRAINER_PIC_AQUA_LEADER_ARCHIE,
.bossName = COMPOUND_STRING("Archie"),
.bossApproachText = COMPOUND_STRING("I have waited so long for this day to\n"
"come...\p"
"For the realization of my dream, you\n"
"must disappear now!$"),
.bossLoseText = COMPOUND_STRING("I commend you. I must recognize that\n"
"you are truly gifted.$"),
.bossAceText = COMPOUND_STRING("It's the road's end for you!\p$"),
#if (GEN_LATEST == GEN_3)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 0, 0, 252, 252, 4),
.lvl = 100,
.species = SPECIES_KYOGRE,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_MODEST,
.moves = {MOVE_CALM_MIND, MOVE_HYDRO_PUMP, MOVE_THUNDER, MOVE_ICE_BEAM}
},
#elif (GEN_LATEST == GEN_5)
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 0, 0, 252, 252, 4),
.lvl = 100,
.species = SPECIES_KYOGRE,
.heldItem = ITEM_LEFTOVERS,
.ability = 0,
.nature = NATURE_MODEST,
.moves = {MOVE_CALM_MIND, MOVE_HYDRO_PUMP, MOVE_THUNDER, MOVE_ICE_BEAM}
},
#else
.trainerAce = {
.iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
.ev = TRAINER_PARTY_EVS(0, 0, 0, 252, 252, 4),
.lvl = 100,
.species = SPECIES_KYOGRE,
.heldItem = ITEM_BLUE_ORB,
.ability = 0,
.nature = NATURE_MODEST,
.moves = {MOVE_CALM_MIND, MOVE_HYDRO_PUMP, MOVE_THUNDER, MOVE_ICE_BEAM}
},
#endif
},

};

u8 *GetBossEncounterFlagPointer(u16 id)
Expand Down Expand Up @@ -3165,12 +3166,13 @@ void ClearAllRandomBossEncounters(void)
}
}

#define NUMBER_FINAL_BOSSES 2
void SetRandomBossEncounter(void)
{
bool8 reroll = FALSE;

do {
u16 index = Random() % RANDOM_BOSS_ENCOUNTER_COUNT;
u16 index = Random() % (RANDOM_BOSS_ENCOUNTER_COUNT - NUMBER_FINAL_BOSSES);
//index = RANDOM_BOSS_ENCOUNTER_COUNT - 3; //test
if(BossEncounterFlagGet(index))
{
Expand All @@ -3190,6 +3192,19 @@ void SetRandomBossEncounter(void)
} while (reroll);
}

void ChooseFinalBossEncounter(void)
{
u16 index = (RANDOM_BOSS_ENCOUNTER_COUNT - 1 - (Random() % NUMBER_FINAL_BOSSES));
//index = RANDOM_BOSS_ENCOUNTER_COUNT - 3; //test
BossEncounterFlagSet(index);
ClearTrainerFlag(TRAINER_RANDOM_PIT_BOSS);
ClearTrainerFlag(TRAINER_RANDOM_PIT_BOSS_DOUBLES);
VarSet(VAR_OBJ_GFX_ID_F, sRandomBossEncounterArray[index].graphicsId);
VarSet(VAR_CURRENT_BOSS, index);
FlagClear(FLAG_BOSS_ENCOUNTER);
}


const struct TrainerMon *GetRandomBossEncounterAcePokemon(void)
{
return &sRandomBossEncounterArray[VarGet(VAR_CURRENT_BOSS)].trainerAce;
Expand Down
Loading