From 8ae57dc912cc96c08a37c630ec5b1283d134f9b7 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 14 Dec 2022 11:13:52 -0300 Subject: [PATCH] Implemented Take Heart's effect --- data/battle_scripts_1.s | 19 +++++++++++++++++++ include/constants/battle_move_effects.h | 3 ++- src/data/battle_moves.h | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index f1f312e6a..9c1cb1587 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -425,6 +425,25 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectBarbBarrage @ EFFECT_BARB_BARRAGE .4byte BattleScript_EffectTripleArrows @ EFFECT_TRIPLE_ARROWS .4byte BattleScript_EffectInfernalParade @ EFFECT_INFERNAL_PARADE + .4byte BattleScript_EffectTakeHeart @ EFFECT_TAKE_HEART + +BattleScript_EffectTakeHeart:: +@ TO DO: Use modifybattlerstatstage here once PR #2470 is merged. + printstring STRINGID_EMPTYSTRING3 + playstatchangeanimation BS_ATTACKER, BIT_SPATK, 0 + setstatchanger STAT_SPATK, 1, FALSE + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_TakeHeartTrySpDef + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_TakeHeartTrySpDef: + printstring STRINGID_EMPTYSTRING3 + playstatchangeanimation BS_ATTACKER, BIT_SPDEF, 0 + setstatchanger STAT_SPDEF, 1, FALSE + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_TakeHeart_MoveEnd + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_TakeHeart_MoveEnd: + goto BattleScript_MoveEnd BattleScript_EffectInfernalParade:: setmoveeffect MOVE_EFFECT_BURN diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index a60d8ee03..4188c341b 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -406,7 +406,8 @@ #define EFFECT_BARB_BARRAGE 400 #define EFFECT_TRIPLE_ARROWS 401 #define EFFECT_INFERNAL_PARADE 402 +#define EFFECT_TAKE_HEART 403 -#define NUM_BATTLE_MOVE_EFFECTS 403 +#define NUM_BATTLE_MOVE_EFFECTS 404 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 685742e08..66b9c0dc5 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -12850,7 +12850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TAKE_HEART] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_TAKE_HEART, + .effect = EFFECT_TAKE_HEART, .power = 0, .type = TYPE_PSYCHIC, .accuracy = 0,