diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index e07497c5f..cbc48b759 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -1074,7 +1074,7 @@ AI_CheckViability: end AI_CV_Hazards: - if_ability AI_TARGET, ABILITY_MAGIC_BOUNCE, + if_ability AI_TARGET, ABILITY_MAGIC_BOUNCE, AI_CV_StealthRockEnd is_first_turn_for AI_USER if_equal 0, AI_CV_StealthRockEnd score +2 @@ -3248,7 +3248,7 @@ AI_TryToFaint_End: end AI_TryToFaint_IsInDanger: get_how_powerful_move_is - if not_equal MOVE_MOST_POWERFUL Score_Minus1 + if_not_equal MOVE_MOST_POWERFUL, Score_Minus1 score +1 goto AI_TryToFaint_End diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 81376ed3c..44ce1fdbf 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -354,6 +354,11 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectMagneticFlux .4byte BattleScript_EffectGearUp .4byte BattleScript_EffectIncinerate + .4byte BattleScript_EffectBugBite + +BattleScript_EffectBugBite: + setmoveeffect MOVE_EFFECT_BUG_BITE | MOVE_EFFECT_CERTAIN + goto BattleScript_EffectHit BattleScript_EffectIncinerate: setmoveeffect MOVE_EFFECT_INCINERATE | MOVE_EFFECT_CERTAIN @@ -363,6 +368,11 @@ BattleScript_MoveEffectIncinerate:: printstring STRINGID_INCINERATEBURN waitmessage 0x40 return + +BattleScript_MoveEffectBugBite:: + printstring STRINGID_BUGBITE + waitmessage 0x40 + return BattleScript_EffectCoreEnforcer: setmoveeffect MOVE_EFFECT_CORE_ENFORCER | MOVE_EFFECT_CERTAIN diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 8b5e3c18d..3e33c4ead 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -322,5 +322,6 @@ extern const u8 BattleScript_ItemHurtRet[]; extern const u8 BattleScript_ToxicOrb[]; extern const u8 BattleScript_FlameOrb[]; extern const u8 BattleScript_MoveEffectIncinerate[]; +extern const u8 BattleScript_MoveEffectBugBite[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle.h b/include/constants/battle.h index c36da4753..48dea68eb 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -331,6 +331,7 @@ #define MOVE_EFFECT_CORE_ENFORCER 0x42 #define MOVE_EFFECT_THROAT_CHOP 0x43 #define MOVE_EFFECT_INCINERATE 0x44 +#define MOVE_EFFECT_BUG_BITE 0x45 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 778b24b01..ea4a76591 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -342,5 +342,6 @@ #define EFFECT_MAGNETIC_FLUX 336 #define EFFECT_GEAR_UP 337 #define EFFECT_INCINERATE 338 +#define EFFECT_BUG_BITE 339 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 49cf4836d..d42237973 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -538,6 +538,7 @@ #define STRINGID_AIRBALLOONFLOAT 534 #define STRINGID_AIRBALLOONPOP 535 #define STRINGID_INCINERATEBURN 536 +#define STRINGID_BUGBITE 537 #define BATTLESTRINGS_COUNT 530 diff --git a/src/battle_message.c b/src/battle_message.c index 7a23c2ba3..ce1367265 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -663,9 +663,11 @@ static const u8 sText_TargetAteItem[] = _("{B_DEF_NAME_WITH_PREFIX} ate its {B_L static const u8 sText_AirBalloonFloat[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} floats in the air\nwith its {B_LAST_ITEM}!"); static const u8 sText_AirBalloonPop[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM} popped!"); static const u8 sText_IncinerateBurn[] = _("{B_EFF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nwas burnt up!"); +static const u8 sText_BugBite[] = _("{B_ATK_NAME_WITH_PREFIX} stole and ate\n{B_EFF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_BUGBITE - 12] = sText_BugBite, [STRINGID_INCINERATEBURN - 12] = sText_IncinerateBurn, [STRINGID_AIRBALLOONPOP - 12] = sText_AirBalloonPop, [STRINGID_AIRBALLOONFLOAT - 12] = sText_AirBalloonFloat, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 841997c97..12c207314 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2890,6 +2890,19 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr = BattleScript_MoveEffectIncinerate; } break; + case MOVE_EFFECT_BUG_BITE: + if ((gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX) + && GetBattlerAbility(gEffectBattler) != ABILITY_STICKY_HOLD) + { + gLastUsedItem = gBattleMons[gEffectBattler].item; + gBattleMons[gEffectBattler].item = 0; + gActiveBattler = gEffectBattler; + BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gEffectBattler].item); + MarkBattlerForControllerExec(gActiveBattler); + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite; + } + break; } } } diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index f51a1f36f..964f831dc 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -5117,7 +5117,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_PLUCK] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (Bug Bite and Pluck should have the same move effect) + .effect = EFFECT_BUG_BITE, .power = 60, .type = TYPE_FLYING, .accuracy = 100, @@ -6311,7 +6311,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BUG_BITE] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (Bug Bite and Pluck should have the same move effect) + .effect = EFFECT_BUG_BITE, .power = 60, .type = TYPE_BUG, .accuracy = 100,