diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index aa97ae324..3b3d59c82 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13995,7 +13995,7 @@ Move_SKITTER_SMACK:: end @to do: Move_BURNING_JEALOUSY:: - end @to do: + goto Move_OVERHEAT Move_LASH_OUT:: end @to do: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9860fb38d..39a000cbd 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -367,6 +367,36 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectSleepHit .4byte BattleScript_EffectEerieSpell .4byte BattleScript_EffectJungleHealing + .4byte BattleScript_EffectCoaching + .4byte BattleScript_EffectLashOut + +BattleScript_EffectCoaching: + attackcanceler + attackstring + ppreduce + jumpifnoally BS_ATTACKER, BattleScript_ButItFailed + copybyte gBattlerTarget, gBattlerAttacker + setallytonexttarget EffectCoaching_CheckAllyStats + goto BattleScript_ButItFailed +EffectCoaching_CheckAllyStats: + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_CoachingWorks + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 12, BattleScript_CoachingWorks + goto BattleScript_ButItFailed @ ally at max atk, def +BattleScript_CoachingWorks: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, 0x0 + setstatchanger STAT_ATK, 1, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_CoachingBoostDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CoachingBoostDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_CoachingBoostDef: + setstatchanger STAT_DEF, 1, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd + printfromtable gStatUpStringIds + waitmessage 0x40 + goto BattleScript_MoveEnd BattleScript_EffectJungleHealing: attackcanceler @@ -2082,6 +2112,7 @@ BattleScript_EffectChangeTypeOnItem: BattleScript_EffectFusionCombo: BattleScript_EffectRevelationDance: BattleScript_EffectBelch: +BattleScript_EffectLashOut: BattleScript_HitFromAtkCanceler:: attackcanceler diff --git a/include/battle.h b/include/battle.h index 5917a4ab3..632d7e7fa 100644 --- a/include/battle.h +++ b/include/battle.h @@ -144,6 +144,8 @@ struct ProtectStruct u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; + u8 statFell:1; // placed here since cleared at end of round + u8 statRaised:1; }; struct SpecialStatus diff --git a/include/constants/battle.h b/include/constants/battle.h index 40c604c9e..a0c29d3cd 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -342,7 +342,8 @@ #define MOVE_EFFECT_THROAT_CHOP 0x43 #define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_BUG_BITE 0x45 -#define NUM_MOVE_EFFECTS 0x46 +#define MOVE_EFFECT_BURNING_JEALOUSY 0x46 +#define NUM_MOVE_EFFECTS 0x47 #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 2376336d8..a15cb0c6b 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -353,5 +353,7 @@ #define EFFECT_SLEEP_HIT 347 // Relic Song #define EFFECT_EERIE_SPELL 348 #define EFFECT_JUNGLE_HEALING 349 +#define EFFECT_COACHING 350 +#define EFFECT_LASH_OUT 351 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b053eef54..7ce9692d2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1252,7 +1252,7 @@ static bool32 TryAegiFormChange(void) static void Cmd_attackcanceler(void) { s32 i, moveType; - + if (gBattleOutcome != 0) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -2506,6 +2506,9 @@ void SetMoveEffect(bool32 primary, u32 certain) statusChanged = TRUE; break; case STATUS1_BURN: + if (gCurrentMove == MOVE_BURNING_JEALOUSY && gProtectStructs[gEffectBattler].statRaised == 0) + break; + if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) { @@ -9090,11 +9093,16 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattleTextBuff2[index] = STRINGID_STATFELL >> 8; index++; gBattleTextBuff2[index] = B_BUFF_EOS; - + if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE) + { gBattleCommunication[MULTISTRING_CHOOSER] = 2; + } else + { gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); + gProtectStructs[gActiveBattler].statFell = 1; + } } } else // stat increase @@ -9129,9 +9137,14 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattleTextBuff2[index] = B_BUFF_EOS; if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE) + { gBattleCommunication[MULTISTRING_CHOOSER] = 2; + } else + { gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); + gProtectStructs[gActiveBattler].statRaised = 1; + } } gBattleMons[gActiveBattler].statStages[statId] += statValue; diff --git a/src/battle_util.c b/src/battle_util.c index 58219080e..69c7706b1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6686,6 +6686,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; + case EFFECT_LASH_OUT: + if (gProtectStructs[battlerAtk].statFell == 1) + basePower *= 2; + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 5ce967ecd..9ba9c20bc 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11222,12 +11222,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BURNING_JEALOUSY] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_BURN_HIT, .power = 70, .type = TYPE_FIRE, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, @@ -11236,7 +11236,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_LASH_OUT] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_LASH_OUT, .power = 75, .type = TYPE_DARK, .accuracy = 100, @@ -11278,7 +11278,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_COACHING] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_COACHING, .power = 0, .type = TYPE_FIGHTING, .accuracy = 0,