diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 31251d62f..018f94eb5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -415,6 +415,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectSleepHit @ EFFECT_SLEEP_HIT .4byte BattleScript_EffectDoubleShock @ EFFECT_DOUBLE_SHOCK .4byte BattleScript_EffectSpecialAttackUpHit @ EFFECT_SPECIAL_ATTACK_UP_HIT + .4byte BattleScript_EffectVictoryDance @ EFFECT_VICTORY_DANCE BattleScript_AffectionBasedEndurance:: playanimation BS_TARGET, B_ANIM_AFFECTION_HANGED_ON @@ -2346,6 +2347,38 @@ BattleScript_QuiverDanceTrySpeed:: BattleScript_QuiverDanceEnd:: goto BattleScript_MoveEnd +BattleScript_EffectVictoryDance: + attackcanceler + attackstring + ppreduce + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_VictoryDanceDoMoveAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_VictoryDanceDoMoveAnim + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MAX_STAT_STAGE, BattleScript_CantRaiseMultipleStats +BattleScript_VictoryDanceDoMoveAnim:: + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED, 0 + setstatchanger STAT_ATK, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_VictoryDanceTryDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_VictoryDanceTryDef + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_VictoryDanceTryDef:: + setstatchanger STAT_DEF, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_VictoryDanceTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_VictoryDanceTrySpeed + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_VictoryDanceTrySpeed:: + setstatchanger STAT_SPEED, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_VictoryDanceEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_VictoryDanceEnd + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_VictoryDanceEnd:: + goto BattleScript_MoveEnd + BattleScript_EffectSpeedUpHit: setmoveeffect MOVE_EFFECT_SPD_PLUS_1 | MOVE_EFFECT_AFFECTS_USER goto BattleScript_EffectHit diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index f6f109122..5af1017a9 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -396,7 +396,8 @@ #define EFFECT_SLEEP_HIT 390 #define EFFECT_DOUBLE_SHOCK 391 #define EFFECT_SPECIAL_ATTACK_UP_HIT 392 +#define EFFECT_VICTORY_DANCE 393 -#define NUM_BATTLE_MOVE_EFFECTS 393 +#define NUM_BATTLE_MOVE_EFFECTS 394 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 16a40de3d..384c50d88 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1082,6 +1082,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 6; break; + case EFFECT_VICTORY_DANCE: + if (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + score -= 10; + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) + score -= 8; + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) + score -= 6; + break; case EFFECT_SHIFT_GEAR: if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; @@ -4401,6 +4409,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPATK, &score); IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); break; + case EFFECT_VICTORY_DANCE: + IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPEED, &score); + IncreaseStatUpScore(battlerAtk, battlerDef, STAT_ATK, &score); + IncreaseStatUpScore(battlerAtk, battlerDef, STAT_DEF, &score); + break; case EFFECT_SHELL_SMASH: if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_RESTORE_STATS) score += 1; @@ -4886,6 +4899,7 @@ static s16 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SANDSTORM: case EFFECT_HAIL: case EFFECT_GEOMANCY: + case EFFECT_VICTORY_DANCE: score += 2; break; default: diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 113d5d3e0..83c933167 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2091,6 +2091,7 @@ bool32 IsStatRaisingEffect(u16 effect) case EFFECT_BULK_UP: case EFFECT_GEOMANCY: case EFFECT_STOCKPILE: + case EFFECT_VICTORY_DANCE: return TRUE; default: return FALSE; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 116c49294..5dd53a922 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -13454,7 +13454,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_VICTORY_DANCE] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_VICTORY_DANCE, + .effect = EFFECT_VICTORY_DANCE, .power = 0, .type = TYPE_FIGHTING, .accuracy = 0,