diff --git a/include/moves_3.h b/include/moves_3.h index 2238f36c..1aa30b97 100644 --- a/include/moves_3.h +++ b/include/moves_3.h @@ -9,6 +9,10 @@ bool8 IsThawingMove(struct move *move); bool8 IsUsableWhileTaunted(struct move *move); u16 GetMoveRangeId(struct move *move); +s32 GetMoveActualAccuracy(s32 move_id); +s16 GetMoveBasePowerFromId(s32 move_id); +bool32 IsMoveRangeStringUser(struct move *move); + #endif //PMDSKY_MOVES_3_H diff --git a/main.lsf b/main.lsf index b7917195..5f2a408f 100644 --- a/main.lsf +++ b/main.lsf @@ -56,8 +56,6 @@ Static main Object src/moves_4.o Object src/moves.o Object src/moves_3.o - Object asm/main_02013B70.o - Object src/main_02013C04.o Object asm/main_02013C30.o Object src/main_02014CEC.o Object asm/main_02014D18.o diff --git a/src/main_02013C04.c b/src/main_02013C04.c deleted file mode 100644 index af255652..00000000 --- a/src/main_02013C04.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "main_02013C04.h" -#include "move_data.h" - -extern struct move_data_table_outer DUNGEON_MOVE_TABLES; - -s16 GetMoveBasePowerFromId(s32 move_id) -{ - struct move_data *move; - move = &DUNGEON_MOVE_TABLES.moves->moves[move_id]; - return move->base_power; -} - -bool32 IsMoveRangeStringUser(struct move *move) -{ - return DUNGEON_MOVE_TABLES.moves->moves[move->id].range_string_idx == MOVE_RANGE_STRING_USER; -} diff --git a/src/moves_3.c b/src/moves_3.c index f8b41695..d032bffd 100644 --- a/src/moves_3.c +++ b/src/moves_3.c @@ -18,3 +18,36 @@ u16 GetMoveRangeId(struct move *move) return DUNGEON_MOVE_TABLES.moves->moves[move->id].range_string_idx; } +s32 GetMoveActualAccuracy(s32 move_id) +{ + struct move_data *move; + u8 max_ginseng_boost; + u8 global_acc; + + move = &DUNGEON_MOVE_TABLES.moves->moves[move_id]; + max_ginseng_boost = move->max_ginseng_boost; + if (max_ginseng_boost == 0) { + return move->accuracy[ACCURACY_1]; + } + if (max_ginseng_boost == 0x63) { + global_acc = move->accuracy[ACCURACY_1]; + if (global_acc == 0x7D) { + return move->accuracy[ACCURACY_2]; + } + return ((global_acc * move->accuracy[ACCURACY_2]) / 100); + } + return 0; +} + +s16 GetMoveBasePowerFromId(s32 move_id) +{ + struct move_data *move; + move = &DUNGEON_MOVE_TABLES.moves->moves[move_id]; + return move->base_power; +} + +bool32 IsMoveRangeStringUser(struct move *move) +{ + return DUNGEON_MOVE_TABLES.moves->moves[move->id].range_string_idx == MOVE_RANGE_STRING_USER; +} +