From 3c30e6bdc360e9949bfbeb2e7e938deb1bbf3e3f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 6 Dec 2022 01:41:06 -0300 Subject: [PATCH] Implemented Sharpness' effect --- include/constants/pokemon.h | 1 + src/battle_util.c | 4 ++++ src/data/battle_moves.h | 36 ++++++++++++++++++------------------ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 8d637af30..35eca5bbc 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -236,6 +236,7 @@ #define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury #define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit #define FLAG_WIND_MOVE (1 << 28) +#define FLAG_SLICING_MOVE (1 << 29) // Split defines. #define SPLIT_PHYSICAL 0x0 diff --git a/src/battle_util.c b/src/battle_util.c index 7fdd63eb4..2362a3fff 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8862,6 +8862,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) MulModifier(&modifier, UQ_4_12(1.3)); break; + case ABILITY_SHARPNESS: + if (gBattleMoves[move].flags & FLAG_SLICING_MOVE) + MulModifier(&modifier, UQ_4_12(1.5)); + break; } // field abilities diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 37ba7aaff..b9603b882 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -256,7 +256,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -1354,7 +1354,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -2922,7 +2922,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, @@ -3805,7 +3805,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -5656,7 +5656,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_WIND_MOVE, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SLICING_MOVE | FLAG_WIND_MOVE, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5989,7 +5989,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, @@ -6286,7 +6286,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7217,7 +7217,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, @@ -7259,7 +7259,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .pp = 15, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE, #elif B_UPDATED_MOVE_DATA == GEN_5 .pp = 20, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, @@ -7289,7 +7289,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, @@ -7699,7 +7699,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, @@ -7921,7 +7921,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, @@ -9537,7 +9537,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, @@ -9553,7 +9553,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 50, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, @@ -11182,7 +11182,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, @@ -12509,7 +12509,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, @@ -13292,7 +13292,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, @@ -13532,7 +13532,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE, .split = SPLIT_PHYSICAL, .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE,