diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2022-02-27 08:43:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-27 08:43:59 -0800 |
commit | ea1aa9c0c5c3a4167912d1078fffdd5e69cbbe98 (patch) | |
tree | 1d3f29615f1683fae77ade7d8713e7bfe5a11c26 /src/dungeon_ai_items.c | |
parent | 0dd38993f6a4383d6d5743fd0ae0abc01210ae25 (diff) | |
parent | a5296a2f994a0f8e4421c4afd6bac1cedcfb72be (diff) |
Merge pull request #97 from AnonymousRandomPerson/master
More attack AI decomp
Diffstat (limited to 'src/dungeon_ai_items.c')
-rw-r--r-- | src/dungeon_ai_items.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index 183d143..31d57ff 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -6,10 +6,10 @@ #include "constants/status.h" #include "constants/targeting.h" #include "dungeon_action.h" -#include "dungeon_ai_1.h" -#include "dungeon_ai_attack_1.h" +#include "dungeon_ai_attack_2.h" #include "dungeon_ai_item_weight.h" #include "dungeon_ai_items.h" +#include "dungeon_ai_targeting_2.h" #include "dungeon_capabilities.h" #include "dungeon_capabilities_1.h" #include "dungeon_entity.h" @@ -39,7 +39,7 @@ enum ItemTargetFlag extern void sub_8077274(struct DungeonEntity *, struct DungeonEntity *); extern s32 gNumPotentialTargets; -extern u32 gPotentialTargetWeights[NUM_DIRECTIONS]; +extern u32 gPotentialItemTargetWeights[NUM_DIRECTIONS]; extern u32 gPotentialItemTargetDirections[NUM_DIRECTIONS]; extern bool8 gTargetAhead[NUM_DIRECTIONS]; extern struct TeamInventory *gTeamInventory_203B460; @@ -95,7 +95,7 @@ void DecideUseItem(struct DungeonEntity *pokemon) FindStraightThrowableTargets(pokemon, 2, item, 1); for (targetIndex = 0; targetIndex < gNumPotentialTargets; targetIndex++) { - if (RollPercentChance(gPotentialTargetWeights[targetIndex])) + if (RollPercentChance(gPotentialItemTargetWeights[targetIndex])) { SetAction(&pokemonData->action, DUNGEON_ACTION_THROW_ITEM_AI); pokemonData->action.actionUseIndex = selectedToolboxIndex; @@ -158,7 +158,7 @@ void DecideUseItem(struct DungeonEntity *pokemon) else if (toolboxIndex == 0) { // This seems unused. toolboxIndex can never be 0. - struct MapTile *mapTile = GetMapTileAtPosition(pokemon->posWorld.x, pokemon->posWorld.y); + struct MapTile *mapTile = GetMapTile_1(pokemon->posWorld.x, pokemon->posWorld.y); struct DungeonEntity *mapObject = mapTile->mapObject; if (mapObject != null) { @@ -229,7 +229,7 @@ void DecideUseItem(struct DungeonEntity *pokemon) s32 thrownAIFlag; for (thrownAIFlag = ITEM_AI_FLAG_TARGET_ALLY; thrownAIFlag <= ITEM_AI_FLAG_TARGET_ENEMY; thrownAIFlag++) { - potentialTargetWeights = gPotentialTargetWeights; + potentialTargetWeights = gPotentialItemTargetWeights; if (GetItemAIFlag(item->itemIndex, thrownAIFlag)) { u8 itemType = GetItemType(item->itemIndex); @@ -422,7 +422,7 @@ void TargetThrownItem(struct DungeonEntity *pokemon, struct DungeonEntity *targe u32 *targetWeight; gTargetAhead[targetDirection] = TRUE; gPotentialItemTargetDirections[gNumPotentialTargets] = targetDirection; - targetWeight = &gPotentialTargetWeights[gNumPotentialTargets]; + targetWeight = &gPotentialItemTargetWeights[gNumPotentialTargets]; itemWeight = !ignoreRollChance ? EvaluateItem(targetPokemon, item, targetingFlags) : 100; *targetWeight = itemWeight; gNumPotentialTargets++; |