diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/charge_move.c | 15 | ||||
-rw-r--r-- | src/data/adjacent_tile_offsets.h | 17 | ||||
-rw-r--r-- | src/dungeon_ai_1.c | 33 | ||||
-rw-r--r-- | src/dungeon_ai_attack.c | 3 | ||||
-rw-r--r-- | src/dungeon_pokemon_attributes_1.c | 5 |
5 files changed, 66 insertions, 7 deletions
diff --git a/src/charge_move.c b/src/charge_move.c index c17db2b..7fe358c 100644 --- a/src/charge_move.c +++ b/src/charge_move.c @@ -4,7 +4,20 @@ #include "constants/status.h" #include "dungeon_util.h" -extern u32 gMultiTurnChargingStatuses[]; +const u32 gMultiTurnChargingStatuses[10] = { + CHARGING_STATUS_SOLARBEAM, + CHARGING_STATUS_SKY_ATTACK, + CHARGING_STATUS_RAZOR_WIND, + CHARGING_STATUS_FOCUS_PUNCH, + CHARGING_STATUS_SKULL_BASH, + CHARGING_STATUS_FLY, + CHARGING_STATUS_BOUNCE, + CHARGING_STATUS_DIVE, + CHARGING_STATUS_DIG, + CHARGING_STATUS_NONE +}; + +ALIGNED(4) const char chargingStatusFill[] = "pksdir0"; bool8 IsCharging(struct DungeonEntity *pokemon, bool8 checkCharge) { diff --git a/src/data/adjacent_tile_offsets.h b/src/data/adjacent_tile_offsets.h new file mode 100644 index 0000000..e96b771 --- /dev/null +++ b/src/data/adjacent_tile_offsets.h @@ -0,0 +1,17 @@ +#ifndef GUARD_CONSTANTS_ADJACENT_TILE_OFFSETS_H +#define GUARD_CONSTANTS_ADJACENT_TILE_OFFSETS_H + +#include "position.h" + +const struct Position gAdjacentTileOffsets[8] = { + {0, 1}, + {1, 1}, + {1, 0}, + {1, -1}, + {0, -1}, + {-1, -1}, + {-1, 0}, + {-1, 1} +}; + +#endif
\ No newline at end of file diff --git a/src/dungeon_ai_1.c b/src/dungeon_ai_1.c index 1d177c7..4550c83 100644 --- a/src/dungeon_ai_1.c +++ b/src/dungeon_ai_1.c @@ -5,7 +5,38 @@ #include "constants/targeting.h" #include "dungeon_pokemon_attributes_1.h" -extern bool8 gTargetingData[3][2][2][2]; +const u8 gTargetingData[3][2][2][2] = { + { + { + {TARGET_CAPABILITY_CANNOT_ATTACK, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET}, + {TARGET_CAPABILITY_CAN_TARGET, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET} + }, + { + {TARGET_CAPABILITY_CAN_TARGET, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET}, + {TARGET_CAPABILITY_CANNOT_ATTACK, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET} + } + }, + { + { + {TARGET_CAPABILITY_CANNOT_ATTACK, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET}, + {TARGET_CAPABILITY_CAN_TARGET, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET} + }, + { + {TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET, TARGET_CAPABILITY_CAN_TARGET}, + {TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET, TARGET_CAPABILITY_CAN_TARGET} + } + }, + { + { + {TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET, TARGET_CAPABILITY_CAN_TARGET}, + {TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET, TARGET_CAPABILITY_CAN_TARGET} + }, + { + {TARGET_CAPABILITY_CAN_TARGET, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET}, + {TARGET_CAPABILITY_CANNOT_ATTACK, TARGET_CAPABILITY_CAN_ATTACK_NOT_TARGET} + } + } +}; u8 CanTarget(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified) { diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 48ccdfe..eaefbd9 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -2,12 +2,11 @@ #include "dungeon_ai_attack.h" #include "constants/iq_skill.h" +#include "data/adjacent_tile_offsets.h" #include "dungeon_global_data.h" #include "dungeon_map_access.h" #include "dungeon_pokemon_attributes_1.h" -extern struct Position gAdjacentTileOffsets[8]; - bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange) { s32 posDiffX = pokemon->posWorld.x - targetPokemon->posWorld.x; diff --git a/src/dungeon_pokemon_attributes_1.c b/src/dungeon_pokemon_attributes_1.c index f3829b2..93d8d4a 100644 --- a/src/dungeon_pokemon_attributes_1.c +++ b/src/dungeon_pokemon_attributes_1.c @@ -12,8 +12,7 @@ #include "pokemon.h" #include "pokemon_3.h" -extern s16 gItemMasterMinWildLevel; - +const s16 gItemMasterMinWildLevel[] = {16}; extern bool8 IsIQSkillSet(u8 *, u32); extern void SetIQSkill(u8 *param_1, u32 skillIndex); @@ -73,7 +72,7 @@ void LoadIQSkills(struct DungeonEntity *pokemon) SetIQSkill(iVar2, IQ_SKILL_ITEM_CATCHER); if (pokemonData->isBoss) SetIQSkill(iVar2, IQ_SKILL_SELF_CURER); - if (pokemonData->level >= gItemMasterMinWildLevel) + if (pokemonData->level >= *gItemMasterMinWildLevel) SetIQSkill(iVar2, IQ_SKILL_ITEM_MASTER); pokemonData->tactic = TACTIC_GO_AFTER_FOES; } |