Decomped TargetLeader()

This commit is contained in:
AnonymousRandomPerson
2022-10-16 20:47:07 -04:00
parent f54f3b02b1
commit 42986de336
8 changed files with 1170 additions and 1160 deletions

File diff suppressed because it is too large Load Diff

1142
asm/code_8072CA8.s Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
#ifndef GUARD_DUNGEON_AI_LEADER_H
#define GUARD_DUNGEON_AI_LEADER_H
#include "dungeon_entity.h"
bool8 TargetLeader(struct DungeonEntity *pokemon);
#endif

View File

@@ -1,6 +1,7 @@
#ifndef GUARD_POKEMON_3_H
#define GUARD_POKEMON_3_H
bool8 TacticsTargetLeader(u8 tactic);
bool8 HasIQForSkill(s32 pokeIQ, u8 IQSkillIndex);
void SetIQSkill(u8 *param_1, u32 skillIndex);
bool8 IsIQSkillSet(u8 *IQSkillsEnabled, u32 IQSkill);

View File

@@ -236,6 +236,8 @@ SECTIONS {
src/dungeon_ai_targeting.o(.text);
src/dungeon_pokemon_attributes.o(.text);
asm/code_80718D8.o(.text);
src/dungeon_ai_leader.o(.text);
asm/code_8072CA8.o(.text);
src/dungeon_ai_items.o(.text);
src/code_8073CF0.o(.text);
asm/code_8073CF0.o(.text);

12
src/dungeon_ai_leader.c Normal file
View File

@@ -0,0 +1,12 @@
#include "global.h"
#include "dungeon_ai_leader.h"
#include "pokemon_3.h"
bool8 TargetLeader(struct DungeonEntity *pokemon)
{
if (pokemon->entityData->isEnemy)
{
return FALSE;
}
return TacticsTargetLeader(pokemon->entityData->tactic);
}

View File

@@ -7,6 +7,7 @@
#include "constants/targeting.h"
#include "constants/tactic.h"
#include "dungeon_action.h"
#include "dungeon_ai_leader.h"
#include "dungeon_ai_movement_1.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_capabilities_1.h"
@@ -25,7 +26,6 @@
#define CORRIDOR_VISIBILITY 2
extern void DecideMovement(struct DungeonEntity *pokemon, bool8 showRunAwayEffect);
extern bool8 TargetLeader(struct DungeonEntity *pokemon);
extern bool8 CanCrossWalls(struct DungeonEntity *pokemon);
extern struct DungeonEntity *GetLeaderEntityIfVisible(struct DungeonEntity *pokemon);

View File

@@ -10,7 +10,7 @@ extern u32 gIQSkillNames[];
extern u32 gIQSkillDescriptions[];
extern u32 gTacticsDescriptions[];
extern u8 *gTactics[];
extern u8 gTacticsTargetLeader[];
extern bool8 gTacticsTargetLeader[];
extern s16 gReqTacticLvls[];
extern s32 gReqIQSkillPts[];
@@ -481,9 +481,9 @@ u32 GetTacticsDescription(u8 r0)
return gTacticsDescriptions[r0];
}
u8 TacticsTargetLeader(u8 r0)
bool8 TacticsTargetLeader(u8 tactic)
{
return gTacticsTargetLeader[r0];
return gTacticsTargetLeader[tactic];
}
void GetAvailTacticsforLvl(u8 *tacticsBuffer, s32 pokeLevel)