From 62fd90caa00fb9dabd19f541a92ee14b0c8d25ee Mon Sep 17 00:00:00 2001 From: Papa Cancer Date: Tue, 5 Feb 2019 21:47:50 +0000 Subject: [PATCH 1/3] Parting Shot Effect plus animation (looks like Snarl) --- data/battle_anim_scripts.s | 15 +++++++++ data/battle_scripts_1.s | 41 +++++++++++++++++++++++++ include/constants/battle_move_effects.h | 1 + src/data/battle_moves.h | 2 +- 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index ce79175a4..fb3d0389e 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -2378,6 +2378,21 @@ Move_DISARMING_VOICE: end Move_PARTING_SHOT: + loadspritegfx ANIM_TAG_NOISE_LINE + fadetobg BG_DARK + waitbgfadein + delay 0 + createvisualtask sub_8158E9C, 2, 0, 255 + call RoarEffect + delay 10 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 9, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 9, 1 + waitforvisualfinish + createvisualtask sub_8159078, 5 + waitforvisualfinish + delay 1 + restorebg + waitbgfadein end Move_TOPSY_TURVY: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a0ff489b2..7d2814306 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -342,6 +342,47 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectPowder .4byte BattleScript_EffectSpAtkUpHit .4byte BattleScript_EffectBelch + .4byte BattleScript_EffectPartingShot + +BattleScript_EffectPartingShot:: + attackcanceler + attackstring + ppreduce + jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_ATK, 0x0, BattleScript_EffectPartingShotTryAtk + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPATK, 0x0, BattleScript_CantLowerMultipleStats +BattleScript_EffectPartingShotTryAtk: + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE + playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE + setstatchanger STAT_ATK, 1, TRUE + statbuffchange 0x1, BattleScript_EffectPartingShotTrySpAtk + printfromtable gStatDownStringIds + waitmessage 0x40 +BattleScript_EffectPartingShotTrySpAtk: + playstatchangeanimation BS_TARGET, BIT_SPATK, ATK48_STAT_NEGATIVE + setstatchanger STAT_SPATK, 1, TRUE + statbuffchange 0x1, BattleScript_MoveEnd + printfromtable gStatDownStringIds + waitmessage 0x40 + jumpifcantswitch ATK4F_DONT_CHECK_STATUSES | BS_ATTACKER, BattleScript_MoveEnd + openpartyscreen BS_ATTACKER, BattleScript_ButItFailed + printstring STRINGID_PKMNWENTBACK + switchoutabilities BS_ATTACKER + waitstate + switchhandleorder BS_ATTACKER, 0x2 + returnatktoball + waitstate + getswitchedmondata BS_ATTACKER + switchindataupdate BS_ATTACKER + hpthresholds BS_ATTACKER + printstring STRINGID_SWITCHINMON + switchinanim BS_ATTACKER, TRUE + waitstate + switchineffects BS_ATTACKER + goto BattleScript_MoveEnd BattleScript_EffectSpAtkUpHit: setmoveeffect MOVE_EFFECT_SP_ATK_PLUS_1 | MOVE_EFFECT_AFFECTS_USER diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 7d1f1399a..d6171a8e0 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -330,5 +330,6 @@ #define EFFECT_POWDER 324 #define EFFECT_SP_ATTACK_UP_HIT 325 #define EFFECT_BELCH 326 +#define EFFECT_PARTING_SHOT 327 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index a45a31dda..195cb27ac 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -8069,7 +8069,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_PARTING_SHOT] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_PARTING_SHOT, .power = 0, .type = TYPE_DARK, .accuracy = 100, From a1be618c47831afe71a9a02478b65d5da354b8b5 Mon Sep 17 00:00:00 2001 From: Papa Cancer Date: Sat, 9 Feb 2019 16:05:59 +0000 Subject: [PATCH 2/3] Parting Shot v2 With DizzyEgg's amendment --- data/battle_scripts_1.s | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7d2814306..4dd61cb71 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -367,14 +367,14 @@ BattleScript_EffectPartingShotTrySpAtk: statbuffchange 0x1, BattleScript_MoveEnd printfromtable gStatDownStringIds waitmessage 0x40 - jumpifcantswitch ATK4F_DONT_CHECK_STATUSES | BS_ATTACKER, BattleScript_MoveEnd - openpartyscreen BS_ATTACKER, BattleScript_ButItFailed - printstring STRINGID_PKMNWENTBACK + setbyte sMOVEEND_STATE, 0x0 + moveend 0x0, 0x0 + jumpifcantswitch ATK4F_DONT_CHECK_STATUSES | BS_ATTACKER, BattleScript_PartingShotEnd + openpartyscreen 0x1, BattleScript_PartingShotEnd switchoutabilities BS_ATTACKER waitstate switchhandleorder BS_ATTACKER, 0x2 - returnatktoball - waitstate + returntoball BS_ATTACKER getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER @@ -382,7 +382,8 @@ BattleScript_EffectPartingShotTrySpAtk: switchinanim BS_ATTACKER, TRUE waitstate switchineffects BS_ATTACKER - goto BattleScript_MoveEnd +BattleScript_PartingShotEnd: + end BattleScript_EffectSpAtkUpHit: setmoveeffect MOVE_EFFECT_SP_ATK_PLUS_1 | MOVE_EFFECT_AFFECTS_USER From dd342726209f3d76e442ee30a98c07b7358c648c Mon Sep 17 00:00:00 2001 From: Papa Cancer Date: Sat, 9 Feb 2019 17:40:04 +0000 Subject: [PATCH 3/3] Parting Shot v3 --- data/battle_scripts_1.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 4dd61cb71..f7a60b76f 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -364,9 +364,10 @@ BattleScript_EffectPartingShotTryAtk: BattleScript_EffectPartingShotTrySpAtk: playstatchangeanimation BS_TARGET, BIT_SPATK, ATK48_STAT_NEGATIVE setstatchanger STAT_SPATK, 1, TRUE - statbuffchange 0x1, BattleScript_MoveEnd + statbuffchange 0x1, BattleScript_EffectPartingShotSwitch printfromtable gStatDownStringIds waitmessage 0x40 +BattleScript_EffectPartingShotSwitch: setbyte sMOVEEND_STATE, 0x0 moveend 0x0, 0x0 jumpifcantswitch ATK4F_DONT_CHECK_STATUSES | BS_ATTACKER, BattleScript_PartingShotEnd