summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2022-02-17 21:45:57 -0800
committerGitHub <noreply@github.com>2022-02-17 21:45:57 -0800
commit3555fb7c945ef5152910a84390ecbd1a38ea585d (patch)
tree4237c0ab086005ea05539b8de7c10b867eec43db /include
parent1d64db5214b455bbd6f50ad6369ec04420e03984 (diff)
parentece475a4804a64790cfa86dfa0ba577a732adee8 (diff)
Merge pull request #96 from AnonymousRandomPerson/master
Attack AI decomp
Diffstat (limited to 'include')
-rw-r--r--include/charge_move.h3
-rw-r--r--include/constants/move.h10
-rw-r--r--include/dungeon_ai.h2
-rw-r--r--include/dungeon_ai_attack.h13
-rw-r--r--include/dungeon_ai_attack_1.h9
-rw-r--r--include/dungeon_capabilities_1.h2
-rw-r--r--include/dungeon_pokemon_attributes.h16
-rw-r--r--include/dungeon_pokemon_attributes_1.h21
-rw-r--r--include/map.h2
-rw-r--r--include/moves.h11
-rw-r--r--include/pokemon_3.h2
-rw-r--r--include/status_checks.h2
-rw-r--r--include/targeting.h9
-rw-r--r--include/targeting_flags.h10
14 files changed, 84 insertions, 28 deletions
diff --git a/include/charge_move.h b/include/charge_move.h
index 9d10ac2..fd88a62 100644
--- a/include/charge_move.h
+++ b/include/charge_move.h
@@ -3,7 +3,10 @@
#include "dungeon_entity.h"
+// 0x570AC
+bool8 MoveMatchesChargingStatus(struct DungeonEntity *pokemon, struct PokemonMove *move);
// 0x570F4
+// checkCharge = Check for the move named Charge.
bool8 IsCharging(struct DungeonEntity *pokemon, bool8 checkCharge);
#endif
diff --git a/include/constants/move.h b/include/constants/move.h
index 4e3396b..15ae1b9 100644
--- a/include/constants/move.h
+++ b/include/constants/move.h
@@ -44,7 +44,7 @@ struct PokemonMove
u8 moveFlags;
bool8 sealed;
u16 moveID;
- u8 pp;
+ u8 PP;
u8 powerBoost; // How much the move is boosted by Ginsengs.
};
@@ -52,17 +52,19 @@ enum TargetingFlag
{
TARGETING_FLAG_TARGET_OTHER = 0x0,
TARGETING_FLAG_HEAL_TEAM = 0x1,
- TARGETING_FLAG_SWAP_POSITIONS = 0x2,
+ TARGETING_FLAG_LONG_RANGE = 0x2,
+ TARGETING_FLAG_BOOST_SELF = 0x3,
+ TARGETING_FLAG_MULTI_TURN = 0x4,
TARGETING_FLAG_ATTACK_ALL = 0x5,
TARGETING_FLAG_BOOST_TEAM = 0x6,
- TARGETING_FLAG_DONT_USE = 0xF,
+ TARGETING_FLAG_ITEM = 0xF,
TARGETING_FLAG_TARGET_FRONTAL_CONE = 0x10,
TARGETING_FLAG_TARGET_AROUND = 0x20,
TARGETING_FLAG_TARGET_ROOM = 0x30,
TARGETING_FLAG_TARGET_2_TILES_AHEAD = 0x40,
TARGETING_FLAG_TARGET_LINE = 0x50,
TARGETING_FLAG_TARGET_FLOOR = 0x60,
- TARGETING_FLAG_SELF_HEAL = 0x70,
+ TARGETING_FLAG_TARGET_SELF = 0x70,
TARGETING_FLAG_CUT_CORNERS = 0x80,
TARGETING_FLAG_SET_TRAP = 0x100,
TARGETING_FLAG_HEAL_HP = 0x200,
diff --git a/include/dungeon_ai.h b/include/dungeon_ai.h
index e02da08..e3f7a37 100644
--- a/include/dungeon_ai.h
+++ b/include/dungeon_ai.h
@@ -5,5 +5,7 @@
// 0x71494
bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon);
+// 0x71518
+bool8 ShouldAvoidEnemiesAndShowEffect(struct DungeonEntity *pokemon, bool8 showRunAwayEffect);
#endif
diff --git a/include/dungeon_ai_attack.h b/include/dungeon_ai_attack.h
index 75abcab..1878889 100644
--- a/include/dungeon_ai_attack.h
+++ b/include/dungeon_ai_attack.h
@@ -3,7 +3,16 @@
#include "dungeon_entity.h"
-// 0x7C9F8
-bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange);
+struct MoveTargetResults
+{
+ bool8 moveUsable;
+ u8 targetDir;
+ s32 moveWeight;
+};
+
+// 0x7BB94
+void DecideAttack(struct DungeonEntity *pokemon);
+// 0x7C04C
+s32 FindMoveTarget(struct MoveTargetResults *moveTargetResults, struct DungeonEntity *pokemon, struct PokemonMove *move);
#endif
diff --git a/include/dungeon_ai_attack_1.h b/include/dungeon_ai_attack_1.h
new file mode 100644
index 0000000..89a1f0d
--- /dev/null
+++ b/include/dungeon_ai_attack_1.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_DUNGEON_AI_ATTACK_1_H
+#define GUARD_DUNGEON_AI_ATTACK_1_H
+
+#include "dungeon_entity.h"
+
+// 0x7C9F8
+bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange);
+
+#endif
diff --git a/include/dungeon_capabilities_1.h b/include/dungeon_capabilities_1.h
index c19391b..1319230 100644
--- a/include/dungeon_capabilities_1.h
+++ b/include/dungeon_capabilities_1.h
@@ -7,6 +7,8 @@
bool8 CannotUseItems(struct DungeonEntity *pokemon);
// 0x70CD0
bool8 CannotAct(struct DungeonEntity *pokemon);
+// 0x70d04
+bool8 CannotAttack(struct DungeonEntity *pokemon, bool8 skipSleep);
// 0x70D6C
bool8 CanMoveInDirection(struct DungeonEntity *pokemon, u32 facingDir);
diff --git a/include/dungeon_pokemon_attributes.h b/include/dungeon_pokemon_attributes.h
index 941c966..40b13ee 100644
--- a/include/dungeon_pokemon_attributes.h
+++ b/include/dungeon_pokemon_attributes.h
@@ -5,5 +5,21 @@
// 0x71824
bool8 HasAbility(struct DungeonEntity *pokemon, u8 ability);
+// 0x71858
+bool8 HasType(struct DungeonEntity *pokemon, u8 type);
+// 0x71884
+bool8 CanSeeInvisible(struct DungeonEntity *pokemon);
+// 0x718AC
+bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic);
+// 0x718D8
+bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill);
+
+void LoadIQSkills(struct DungeonEntity *pokemon);
+bool8 CanSeeTeammate(struct DungeonEntity * pokemon);
+u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
+
+// 0x71A44
+s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
+bool8 ToolboxEnabled(struct DungeonEntityData *pokemon);
#endif
diff --git a/include/dungeon_pokemon_attributes_1.h b/include/dungeon_pokemon_attributes_1.h
deleted file mode 100644
index cdfa989..0000000
--- a/include/dungeon_pokemon_attributes_1.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef GUARD_DUNGEON_POKEMON_ATTRIBUTES_1_H
-#define GUARD_DUNGEON_POKEMON_ATTRIBUTES_1_H
-
-#include "dungeon_entity.h"
-
-// 0x71884
-bool8 CanSeeInvisible(struct DungeonEntity *pokemon);
-// 0x718AC
-bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic);
-// 0x718D8
-bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill);
-
-void LoadIQSkills(struct DungeonEntity *pokemon);
-bool8 CanSeeTeammate(struct DungeonEntity * pokemon);
-u8 GetMoveType_2(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
-
-// 0x71A44
-s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove);
-bool8 ToolboxEnabled(struct DungeonEntityData *pokemon);
-
-#endif
diff --git a/include/map.h b/include/map.h
index 9122f00..3601a14 100644
--- a/include/map.h
+++ b/include/map.h
@@ -38,7 +38,7 @@ struct MapTile
u8 unk8;
/* 0x9 */ u8 roomIndex;
// Bitwise flags for whether Pokémon can move to an adjacent tile. Bits correspond to directions in direction.h.
- // Different sets of flags are used for Pokémon that can cross special terrain, corresponding to Cthe rossableTerrain enum.
+ // Different sets of flags are used for Pokémon that can cross special terrain, corresponding to the CrossableTerrain enum.
/* 0xA */ u8 canMoveAdjacent[NUM_CROSSABLE_TERRAIN];
u8 fillE[0x10 - 0xE];
/* 0x10 */ struct DungeonEntity *pokemon; // Pokémon on the tile.
diff --git a/include/moves.h b/include/moves.h
index bba50b3..22f7ba6 100644
--- a/include/moves.h
+++ b/include/moves.h
@@ -3,6 +3,17 @@
#include "constants/move.h"
+// 0x92A88
+void InitPokemonMove(struct PokemonMove *move, u16 moveID);
+// 0x92AE0
+s16 GetMoveTargetingFlags(struct PokemonMove *move, u32 isAI);
+u8 GetMoveType(struct PokemonMove *move);
+// 0x92B90
+u8 GetMoveWeight(struct PokemonMove *move);
+s32 GetMovePower(struct PokemonMove *move);
+// 0x92BF4
u32 GetMoveMaxPP(struct PokemonMove *move);
+// 0x92C54
+bool8 MoveDealsDirectDamage(struct PokemonMove *move);
#endif
diff --git a/include/pokemon_3.h b/include/pokemon_3.h
index 968e2ef..c68da39 100644
--- a/include/pokemon_3.h
+++ b/include/pokemon_3.h
@@ -1,6 +1,8 @@
#ifndef GUARD_POKEMON_3_H
#define GUARD_POKEMON_3_H
+bool8 HasIQForSkill(s32 pokeIQ, u8 IQSkillIndex);
+void SetIQSkill(u8 *param_1, u32 skillIndex);
bool8 IsIQSkillSet(u8 *IQSkillsEnabled, u32 IQSkill);
#endif
diff --git a/include/status_checks.h b/include/status_checks.h
index 086711d..5bc80eb 100644
--- a/include/status_checks.h
+++ b/include/status_checks.h
@@ -3,6 +3,8 @@
#include "dungeon_entity.h"
+extern const s16 gConfusedAttackChance;
+
// 0x7001C
bool8 HasStatusAffectingActions(struct DungeonEntity *pokemon);
diff --git a/include/targeting.h b/include/targeting.h
new file mode 100644
index 0000000..7330398
--- /dev/null
+++ b/include/targeting.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_TARGETING_H
+#define GUARD_TARGETING_H
+
+#include "dungeon_entity.h"
+
+// 0x69DCC
+void TargetTileInFront(struct DungeonEntity *pokemon);
+
+#endif
diff --git a/include/targeting_flags.h b/include/targeting_flags.h
new file mode 100644
index 0000000..54e7063
--- /dev/null
+++ b/include/targeting_flags.h
@@ -0,0 +1,10 @@
+#ifndef GUARD_TARGETING_FLAGS_H
+#define GUARD_TARGETING_FLAGS_H
+
+#include "constants/move.h"
+#include "dungeon_entity.h"
+
+// 0x7CD64
+s16 GetMoveTargetingFlagsForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *move, u32 isAI);
+
+#endif