From c930a63c84d5c66deda4299765af53da99244a14 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 11 Dec 2020 19:46:33 -0300 Subject: [PATCH] Implemented Punk Rock --- include/constants/pokemon.h | 1 + src/battle_util.c | 8 ++++++++ src/data/battle_moves.h | 26 +++++++++++++------------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 334122385..0edb1608e 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -264,6 +264,7 @@ #define FLAG_DANCE (1 << 21) #define FLAG_DMG_IN_AIR (1 << 22) // X2 dmg on air, always hits target on air #define FLAG_HIT_IN_AIR (1 << 23) // dmg is normal, always hits target on air +#define FLAG_PUNK_ROCK_AFFECTED (1 << 24) // To do: Add it to Eerie Spell's move data. // Split defines. #define SPLIT_PHYSICAL 0x0 diff --git a/src/battle_util.c b/src/battle_util.c index 65f55001b..87ce6bce7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6777,6 +6777,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe if (moveType == TYPE_NORMAL && gBattleStruct->ateBoost[battlerAtk]) MulModifier(&modifier, UQ_4_12(1.2)); break; + case ABILITY_PUNK_ROCK: + if (gBattleMoves[move].flags & FLAG_PUNK_ROCK_AFFECTED) + MulModifier(&modifier, UQ_4_12(1.3)); + break; } // field abilities @@ -7222,6 +7226,10 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && !usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); break; + case ABILITY_PUNK_ROCK: + if (gBattleMoves[move].flags & FLAG_PUNK_ROCK_AFFECTED) + MulModifier(&modifier, UQ_4_12(1.3)); + break; } // ally's abilities diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 0b0c0b553..046d11035 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -2720,7 +2720,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -3993,7 +3993,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -4764,7 +4764,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -6354,7 +6354,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -7715,7 +7715,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -7729,7 +7729,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -8479,7 +8479,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 10, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -8593,7 +8593,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 100, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -8876,7 +8876,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -9050,7 +9050,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -9637,7 +9637,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, .argument = STATUS1_BURN, }, @@ -10016,7 +10016,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -10936,7 +10936,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_PUNK_ROCK_AFFECTED, .split = SPLIT_SPECIAL, },