match remaining data, use defines and document IsNotValidDungeon

This commit is contained in:
Seth Barberee 2024-03-10 17:37:59 -07:00
parent 6a4d257723
commit e6e032124d
6 changed files with 61 additions and 33 deletions

View File

@ -1890,29 +1890,5 @@ gFinalScenarioText: @ 8109CF4
@ 8109D30
#include "dungeon/dungeon_data.inc"
.global gUnknown_810A350
gUnknown_810A350: @ 810A350
@ replacing .incbin "baserom.gba", 0x0010a350, 0xb
.byte 0x18, 0x19, 0x1e, 0x27, 0x31, 0x32, 0x33, 0x36, 0x37, 0x3d, 0x3f
.align 2,0
.global gInvalidItemIDs
gInvalidItemIDs: @ 810A35B (item related)
@ replacing .incbin "baserom.gba", 0x0010a35b, 0x10
.byte 0xed, 0xee, 0xef, 0xb1, 0xe9, 0x24, 0xd8, 0xd2, 0xb0, 0xdc, 0x32, 0x33, 0x34, 0xc2, 0xec, 0xf0
.global gTacticsTargetLeader
gTacticsTargetLeader: @ 810A36B
@ replacing .incbin "baserom.gba", 0x0010a36b, 0xd
.byte 0x01
.byte 0x00
.byte 0x00
.byte 0x00
.byte 0x01
.byte 0x01
.byte 0x01
.byte 0x01
.byte 0x01
.byte 0x00
.byte 0x01
.byte 0x00
.byte 0x00

View File

@ -47,6 +47,6 @@ void PrintDungeonLocationtoBuffer(u8 *buffer, DungeonLocation *dungeonLocation);
u32 sub_80908D8(DungeonLocation *dungeon);
u8 sub_8090910(DungeonLocation *dungeon, u32 param_2);
bool8 sub_809095C(u8 dungeon);
bool8 IsNotValidDungeon(u8 dungeon);
#endif // GUARD_DUNGEON_H

View File

@ -90,7 +90,7 @@ bool8 ValidateWonderMail(WonderMail *data)
if(data->unk2 > 9)
return FALSE;
if(sub_809095C(data->unk4.dungeon.id))
if(IsNotValidDungeon(data->unk4.dungeon.id))
return FALSE;
if(data->unk4.dungeon.floor >= GetDungeonFloorCount(data->unk4.dungeon.id))
return FALSE;

View File

@ -1,3 +1,55 @@
const u8 gInvalidDungeonIDs[11] =
{
DUNGEON_BOSS_3,
DUNGEON_BOSS_4,
DUNGEON_BOSS_9,
DUNGEON_WONDROUS_SEA,
DUNGEON_AUTOPILOT,
DUNGEON_D50,
DUNGEON_D51,
DUNGEON_D54,
DUNGEON_POISON_MAZE,
DUNGEON_D61,
DUNGEON_OUT_ON_RESCUE
};
const u8 gInvalidItemIDs[0x10] =
{
ITEM_G_MACHINE_6,
ITEM_G_MACHINE_7,
ITEM_G_MACHINE_8,
ITEM_TM_SPIN_SLASH,
ITEM_SWITCH_BOX,
ITEM_ALERT_SPECS,
ITEM_POSSESS_ORB,
ITEM_REVIVER_ORB,
ITEM_TM_EXCAVATE,
ITEM_TOSS_ORB,
ITEM_RING_D,
ITEM_RING_E,
ITEM_RING_F,
ITEM_OBSERVER_ORB,
ITEM_BEATUP_ORB,
NUMBER_OF_ITEM_IDS
};
const bool8 gTacticsTargetLeader[NUM_TACTICS] =
{
[TACTIC_LETS_GO_TOGETHER] = TRUE,
[TACTIC_GO_THE_OTHER_WAY] = FALSE,
[TACTIC_GO_AFTER_FOES] = FALSE,
[TACTIC_AVOID_THE_FIRST_HIT] = FALSE,
[TACTIC_ALL_FOR_ONE] = TRUE,
[TACTIC_GROUP_SAFETY] = TRUE,
[TACTIC_AVOID_TROUBLE] = TRUE,
[TACTIC_BE_PATIENT] = TRUE,
[TACTIC_KEEP_YOUR_DISTANCE] = TRUE,
[TACTIC_WAIT_THERE] = FALSE,
[TACTIC_GET_AWAY] = TRUE,
[TACTIC_UNUSED] = FALSE
};
const s16 gReqTacticLvls[NUM_TACTICS] =
{
[TACTIC_LETS_GO_TOGETHER] = 1,

View File

@ -6,7 +6,7 @@
#include "random.h"
#include "code_8092334.h"
extern u8 gUnknown_810A350[];
extern u8 gInvalidDungeonIDs[];
extern u8 gDungeonFloorCount[];
extern u8 *gUnknown_8108084[];
@ -97,7 +97,7 @@ u8 sub_8090910(DungeonLocation *dungeon, u32 param_2)
}
}
bool8 sub_809095C(u8 dungeon)
bool8 IsNotValidDungeon(u8 dungeon)
{
s32 counter;
@ -107,10 +107,10 @@ bool8 sub_809095C(u8 dungeon)
else
{
counter = 0;
if (gUnknown_810A350[0] != DUNGEON_OUT_ON_RESCUE) {
for(; gUnknown_810A350[counter] != DUNGEON_OUT_ON_RESCUE; counter++)
if (gInvalidDungeonIDs[0] != DUNGEON_OUT_ON_RESCUE) {
for(; gInvalidDungeonIDs[counter] != DUNGEON_OUT_ON_RESCUE; counter++)
{
if (gUnknown_810A350[counter] == dungeon) return TRUE;
if (gInvalidDungeonIDs[counter] == dungeon) return TRUE;
}
}
return FALSE;

View File

@ -2,6 +2,7 @@
#include "pokemon.h"
#include "pokemon_3.h"
#include "random.h"
#include "constants/dungeon.h"
#include "constants/evolve_type.h"
#include "constants/evolution_status.h"
#include "constants/iq_skill.h"
@ -17,7 +18,6 @@ extern u8 *gIQSkillNames[];
extern u8 *gIQSkillDescriptions[];
extern u8 *gTacticsDescriptions[];
extern u8 *gTactics[];
extern bool8 gTacticsTargetLeader[];
extern u32 gIQSkillGroups[];
struct unkStruct_808E9EC