From c026f705b37009aa4db723114e63beedb690691d Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 17 Nov 2020 19:45:27 -0700 Subject: [PATCH 01/35] permanent terrain move bgs --- data/battle_anim_scripts.s | 14 ++++++++++++++ data/battle_scripts_1.s | 4 ++++ include/battle_anim.h | 1 + include/battle_bg.h | 1 + include/constants/battle.h | 2 ++ include/constants/battle_anim.h | 1 + src/battle_anim.c | 5 +++-- src/battle_bg.c | 25 +++++++++++++++++++++++++ src/battle_script_commands.c | 2 +- 9 files changed, 52 insertions(+), 3 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 70ed22c9e..4042dcd0e 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -815,6 +815,7 @@ gBattleAnims_General:: .4byte General_IllusionOff .4byte General_FormChange .4byte General_SlideOffScreen + .4byte General_RestoreBg .align 2 gBattleAnims_Special:: @@ -8453,6 +8454,8 @@ Move_GRASSY_TERRAIN:: delay 4 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(31, 24, 31) waitforvisualfinish + restorebg + waitbgfadein end Move_MISTY_TERRAIN:: @@ -8491,6 +8494,8 @@ Move_MISTY_TERRAIN:: delay 4 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 7, 0, RGB(31, 24, 31) waitforvisualfinish + restorebg + waitbgfadein end Move_ELECTRIFY:: @@ -9374,6 +9379,8 @@ Move_ELECTRIC_TERRAIN:: delay 2 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(28, 28, 0) waitforvisualfinish + restorebg + waitbgfadein end Move_DAZZLING_GLEAM:: @@ -11027,6 +11034,8 @@ Move_PSYCHIC_TERRAIN:: delay 4 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(27, 0, 13) waitforvisualfinish + restorebg + waitbgfadein end Move_LUNGE:: @@ -24320,6 +24329,11 @@ General_TerrainElectric: General_TerrainPsychic: end +General_RestoreBg: + restorebg + waitbgfadein + end + SnatchMoveTrySwapFromSubstitute: createvisualtask AnimTask_IsAttackerBehindSubstitute, 2 jumprettrue SnatchMoveSwapSubstituteForMon diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 504896d63..f8efc7e7d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5426,21 +5426,25 @@ BattleScript_MagicRoomEnds:: BattleScript_ElectricTerrainEnds:: printstring STRINGID_ELECTRICTERRAINENDS waitmessage 0x40 + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL end2 BattleScript_MistyTerrainEnds:: printstring STRINGID_MISTYTERRAINENDS waitmessage 0x40 + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL end2 BattleScript_GrassyTerrainEnds:: printstring STRINGID_GRASSYTERRAINENDS waitmessage 0x40 + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL end2 BattleScript_PsychicTerrainEnds:: printstring STRINGID_PSYCHICTERRAINENDS waitmessage 0x40 + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL end2 BattleScript_MudSportEnds:: diff --git a/include/battle_anim.h b/include/battle_anim.h index 2f481c5f2..2b28e92fb 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -68,6 +68,7 @@ s16 KeepPanInRange(s16 a, int oldPan); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); void sub_80A4720(u16 a, u16 *b, u32 c, u8 d); void sub_80A477C(bool8); +void LoadMoveBg(u16 bgId); // battle_intro.c void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); diff --git a/include/battle_bg.h b/include/battle_bg.h index 167ea5cf7..43295476f 100644 --- a/include/battle_bg.h +++ b/include/battle_bg.h @@ -9,5 +9,6 @@ void LoadBattleTextboxAndBackground(void); void InitLinkBattleVsScreen(u8 taskId); void DrawBattleEntryBackground(void); bool8 LoadChosenBattleElement(u8 caseId); +void DrawTerrainTypeBattleBackground(void); #endif // GUARD_BATTLE_BG_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 2c573dcbe..40c604c9e 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -234,6 +234,8 @@ #define STATUS_FIELD_ION_DELUGE 0x400 #define STATUS_FIELD_FAIRY_LOCK 0x800 +#define STATUS_TERRAIN_ANY (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN) + // Flags describing move's result #define MOVE_RESULT_MISSED (1 << 0) #define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1) diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 871aa1e35..406606050 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -525,6 +525,7 @@ #define B_ANIM_ILLUSION_OFF 0x1C #define B_ANIM_FORM_CHANGE 0x1D #define B_ANIM_SLIDE_OFFSCREEN 0x1E // for Emergency Exit +#define B_ANIM_RESTORE_BG 0x1F // for Terrain Endings // special animations table #define B_ANIM_LVL_UP 0x0 diff --git a/src/battle_anim.c b/src/battle_anim.c index 6482ccc6b..9f914f1e8 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -88,7 +88,6 @@ static void Task_PanFromInitialToTarget(u8 taskId); static void Task_LoopAndPlaySE(u8 taskId); static void Task_WaitAndPlaySE(u8 taskId); static void LoadDefaultBg(void); -static void LoadMoveBg(u16 bgId); // ewram EWRAM_DATA static const u8 *sBattleAnimScriptPtr = NULL; @@ -3177,7 +3176,7 @@ static void Task_FadeToBg(u8 taskId) } } -static void LoadMoveBg(u16 bgId) +void LoadMoveBg(u16 bgId) { if (IsContest()) { @@ -3205,6 +3204,8 @@ static void LoadDefaultBg(void) { if (IsContest()) LoadContestBgAfterMoveAnim(); + else if (gFieldStatuses & STATUS_TERRAIN_ANY) + DrawTerrainTypeBattleBackground(); else DrawMainBattleBackground(); } diff --git a/src/battle_bg.c b/src/battle_bg.c index d9d6bf87c..7ae123c12 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "battle_anim.h" #include "battle_bg.h" #include "battle_main.h" #include "battle_message.h" @@ -23,6 +24,7 @@ #include "constants/map_types.h" #include "constants/songs.h" #include "constants/trainers.h" +#include "constants/battle_anim.h" struct BattleBackground { @@ -1413,3 +1415,26 @@ bool8 LoadChosenBattleElement(u8 caseId) return ret; } + +void DrawTerrainTypeBattleBackground(void) +{ + switch (gFieldStatuses & STATUS_TERRAIN_ANY) + { + case STATUS_FIELD_GRASSY_TERRAIN: + LoadMoveBg(BG_GRASSY_TERRAIN); + break; + case STATUS_FIELD_MISTY_TERRAIN: + LoadMoveBg(BG_MISTY_TERRAIN); + break; + case STATUS_FIELD_ELECTRIC_TERRAIN: + LoadMoveBg(BG_ELECTRIC_TERRAIN); + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + LoadMoveBg(BG_PSYCHIC_TERRAIN); + break; + default: + DrawMainBattleBackground(); + break; + } +} + diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d0811e77d..d59d579d3 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6952,7 +6952,7 @@ static void HandleTerrainMove(u32 moveEffect) } else { - gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN); + gFieldStatuses &= ~STATUS_TERRAIN_ANY; gFieldStatuses |= statusFlag; if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_TERRAIN_EXTENDER) *timer = 8; From 5c658c695007a6ebb913bfb970e55a0ee2ee33aa Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 17 Nov 2020 20:26:09 -0700 Subject: [PATCH 02/35] config option for terrain bg change --- include/constants/battle_config.h | 1 + src/battle_anim.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index d7f178570..fc1e0d54e 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -164,5 +164,6 @@ #define B_NEW_SURF_PARTICLE_PALETTE TRUE // If set to TRUE, it updates Surf's wave palette. #define HIDE_HEALTHBOXES_DURING_ANIMS TRUE //if TRUE, hides healthboxes during move animations +#define B_TERRAIN_BG_CHANGE TRUE //if TRUE, terrain moves permanently change the default battle bg until the effect fades #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/src/battle_anim.c b/src/battle_anim.c index 9f914f1e8..cb7ea5bea 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -3204,8 +3204,10 @@ static void LoadDefaultBg(void) { if (IsContest()) LoadContestBgAfterMoveAnim(); + #if B_TERRAIN_BG_CHANGE == TRUE else if (gFieldStatuses & STATUS_TERRAIN_ANY) DrawTerrainTypeBattleBackground(); + #endif else DrawMainBattleBackground(); } From ef43596a7915e34d1339c289ca67af06c35e7588 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 19 Nov 2020 15:16:27 -0700 Subject: [PATCH 03/35] toggleable manual ability popup destruction --- asm/macros/battle_script.inc | 4 ++++ include/battle.h | 2 ++ include/battle_interface.h | 1 + include/constants/battle_script_commands.h | 2 ++ src/battle_interface.c | 13 ++++++++++++- src/battle_script_commands.c | 3 +++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 41a51efeb..1f0b6c807 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1755,6 +1755,10 @@ various \battler, VARIOUS_JUMP_IF_ABSENT .4byte \ptr .endm + + .macro destroyabilitypopup + various BS_ABILITY_BATTLER, VARIOUS_DESTROY_ABILITY_POPUP + .endm @ helpful macros .macro setstatchanger stat:req, stages:req, down:req diff --git a/include/battle.h b/include/battle.h index 13fe13171..1084d2bb9 100644 --- a/include/battle.h +++ b/include/battle.h @@ -520,6 +520,7 @@ struct BattleStruct u8 savedBattlerTarget; bool8 ateBoost[MAX_BATTLERS_COUNT]; u8 activeAbilityPopUps; // as bits for each battler + u8 abilityPopUpSpriteIds[MAX_BATTLERS_COUNT][2]; //two per battler bool8 throwingPokeBall; struct MegaEvolutionData mega; const u8 *trainerSlideMsg; @@ -611,6 +612,7 @@ struct BattleScripting u16 moveEffect; u16 multihitMoveEffect; u8 illusionNickHack; // To properly display nick in STRINGID_ENEMYABOUTTOSWITCHPKMN. + bool8 fixedPopup; // force ability popup to stick until manually called back }; // rom_80A5C6C diff --git a/include/battle_interface.h b/include/battle_interface.h index 32c679285..d06c44e88 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -92,5 +92,6 @@ s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3); u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u8 GetHPBarLevel(s16 hp, s16 maxhp); void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle); +void DestroyAbilityPopUp(u8 battlerId); #endif // GUARD_BATTLE_INTERFACE_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index b081907ec..36165558b 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -35,6 +35,7 @@ #define sMOVE_EFFECT gBattleScripting + 0x2E #define sMULTIHIT_EFFECT gBattleScripting + 0x30 #define sILLUSION_NICK_HACK gBattleScripting + 0x32 +#define sFIXED_ABILITY_POPUP gBattleScripting + 0x33 #define cMULTISTRING_CHOOSER gBattleCommunication + 5 @@ -165,6 +166,7 @@ #define VARIOUS_SET_LAST_USED_ITEM 99 #define VARIOUS_PARALYZE_TYPE_IMMUNITY 100 #define VARIOUS_JUMP_IF_ABSENT 101 +#define VARIOUS_DESTROY_ABILITY_POPUP 102 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_interface.c b/src/battle_interface.c index d302cd646..c97705edf 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3062,6 +3062,9 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) gSprites[spriteId1].tRightToLeft = FALSE; gSprites[spriteId2].tRightToLeft = FALSE; } + + gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][0] = spriteId1; + gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][1] = spriteId2; taskId = CreateTask(Task_FreeAbilityPopUpGfx, 5); gTasks[taskId].tSpriteId1 = spriteId1; @@ -3110,11 +3113,19 @@ static void SpriteCb_AbilityPopUp(struct Sprite *sprite) } else { - sprite->tFrames--; + if (!gBattleScripting.fixedPopup) + sprite->tFrames--; } } } +void DestroyAbilityPopUp(u8 battlerId) +{ + gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][0]].tFrames = 0; + gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][1]].tFrames = 0; + gBattleScripting.fixedPopup = FALSE; +} + static void Task_FreeAbilityPopUpGfx(u8 taskId) { if (!gSprites[gTasks[taskId].tSpriteId1].inUse diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d0811e77d..ad3629cd6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8300,6 +8300,9 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; } return; + case VARIOUS_DESTROY_ABILITY_POPUP: + DestroyAbilityPopUp(gActiveBattler); + break; } gBattlescriptCurrInstr += 3; From 9472bc894f00768aa5a0ad78da12be57f595594a Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 20 Nov 2020 08:26:50 -0700 Subject: [PATCH 04/35] formatting --- src/battle_interface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index c97705edf..267b06ece 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3063,8 +3063,8 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) gSprites[spriteId2].tRightToLeft = FALSE; } - gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][0] = spriteId1; - gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][1] = spriteId2; + gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][0] = spriteId1; + gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][1] = spriteId2; taskId = CreateTask(Task_FreeAbilityPopUpGfx, 5); gTasks[taskId].tSpriteId1 = spriteId1; @@ -3121,8 +3121,8 @@ static void SpriteCb_AbilityPopUp(struct Sprite *sprite) void DestroyAbilityPopUp(u8 battlerId) { - gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][0]].tFrames = 0; - gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][1]].tFrames = 0; + gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][0]].tFrames = 0; + gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][1]].tFrames = 0; gBattleScripting.fixedPopup = FALSE; } From 9ec67db8fa3ed8e200c506d5948b56012c328181 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 24 Nov 2020 17:03:40 -0500 Subject: [PATCH 05/35] keep permanent terrain bg from party menu, bag --- src/battle_bg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/battle_bg.c b/src/battle_bg.c index 7ae123c12..ca1893d65 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -865,7 +865,11 @@ void LoadBattleTextboxAndBackground(void) CopyBgTilemapBufferToVram(0); LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40); LoadBattleMenuWindowGfx(); - DrawMainBattleBackground(); + #if B_TERRAIN_BG_CHANGE == TRUE + DrawTerrainTypeBattleBackground(); + #else + DrawMainBattleBackground(); + #endif } static void DrawLinkBattleParticipantPokeballs(u8 taskId, u8 multiplayerId, u8 bgId, u8 destX, u8 destY) From 6c0878b5fe5f7bc6430d3660528460f286d27ab7 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 24 Nov 2020 17:21:59 -0500 Subject: [PATCH 06/35] infestation between turn anim --- data/battle_anim_scripts.s | 20 ++++++++++++++++++++ include/constants/battle_anim.h | 1 + src/battle_anim_throw.c | 2 ++ 3 files changed, 23 insertions(+) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 70ed22c9e..431ca8e2e 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -23929,6 +23929,7 @@ General_TurnTrap: jumpargeq 0, TRAP_ANIM_WHIRLPOOL, Status_Whirlpool jumpargeq 0, TRAP_ANIM_CLAMP, Status_Clamp jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb + jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation goto Status_BindWrap Status_BindWrap: loadspritegfx ANIM_TAG_TENDRILS @@ -24002,6 +24003,25 @@ Status_SandTomb: stopsound end +Status_Infestation: + loadspritegfx ANIM_TAG_HANDS_AND_FEET @black color + loadspritegfx ANIM_TAG_SMALL_BUBBLES @circle particles + monbg ANIM_DEF_PARTNER + monbgprio_28 ANIM_TARGET + createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_DEF, 0x2, 0x0, 0x9, 0x7320 + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0x4f 0x1 + loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0x0, 0x4F + call InfestationVortex + call InfestationVortex + call InfestationVortex + call InfestationVortex + call InfestationVortex + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xA 0x5 ANIM_PAL_DEF 0x2 0x9 0x0 0x7320 + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + end + General_HeldItemEffect: loadspritegfx ANIM_TAG_THIN_RING loadspritegfx ANIM_TAG_SPARKLE_2 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 871aa1e35..633f0ae8a 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -558,6 +558,7 @@ #define TRAP_ANIM_WHIRLPOOL 2 #define TRAP_ANIM_CLAMP 3 #define TRAP_ANIM_SAND_TOMB 4 +#define TRAP_ANIM_INFESTATION 5 // Weather defines for battle animation scripts. #define ANIM_WEATHER_NONE 0 diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index ad3270235..c8c2b9e6a 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -2494,6 +2494,8 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId) gBattleAnimArgs[0] = TRAP_ANIM_CLAMP; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SAND_TOMB) gBattleAnimArgs[0] = TRAP_ANIM_SAND_TOMB; + else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION) + gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION; else gBattleAnimArgs[0] = TRAP_ANIM_BIND; From 7c6e74ab69ca4800b61d5f9006060ec3cb87e59e Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 24 Nov 2020 21:17:31 -0500 Subject: [PATCH 07/35] update terrain bg config option comment --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index fc1e0d54e..55c62af98 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -164,6 +164,6 @@ #define B_NEW_SURF_PARTICLE_PALETTE TRUE // If set to TRUE, it updates Surf's wave palette. #define HIDE_HEALTHBOXES_DURING_ANIMS TRUE //if TRUE, hides healthboxes during move animations -#define B_TERRAIN_BG_CHANGE TRUE //if TRUE, terrain moves permanently change the default battle bg until the effect fades +#define B_TERRAIN_BG_CHANGE TRUE // If TRUE, terrain moves permanently change the default battle background until the effect fades. #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H From 58a79a4f37e7c14380744bbbc1de58f2e68abf7c Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 1 Dec 2020 17:52:44 -0500 Subject: [PATCH 08/35] shorten between-turn infestation anim length --- data/battle_anim_scripts.s | 3 --- 1 file changed, 3 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 431ca8e2e..a8af18686 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24013,9 +24013,6 @@ Status_Infestation: loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0x0, 0x4F call InfestationVortex call InfestationVortex - call InfestationVortex - call InfestationVortex - call InfestationVortex waitforvisualfinish launchtask AnimTask_BlendBattleAnimPal 0xA 0x5 ANIM_PAL_DEF 0x2 0x9 0x0 0x7320 waitforvisualfinish From 3102e499da6af188fff123edce7e36427112f2f2 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 2 Dec 2020 14:23:03 -0500 Subject: [PATCH 09/35] fix babydoll eyes anim priority --- data/battle_anim_scripts.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 70ed22c9e..69c2fe6cf 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -9451,6 +9451,7 @@ Move_BABY_DOLL_EYES:: loadspritegfx ANIM_TAG_PINK_CLOUD loadspritegfx ANIM_TAG_OPENING_EYE @eye setalpha 8, 8 + monbg ANIM_DEF_PARTNER launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0xA 0x7FFF waitforvisualfinish launchtemplate gOpeningEyeSpriteTemplate 0x5 0x4 0x0 0x0 0x1 0x0 @@ -9463,6 +9464,7 @@ Move_BABY_DOLL_EYES:: launchtask AnimTask_ShakeMon2 0x2 0x5 0x3 0x1 0x0 0x9 0x1 launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0xA 0x0 0x7FFF waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER blendoff end From 5c72a89105c11918656f1b60004e7fcfc8739c21 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 2 Dec 2020 15:03:49 -0500 Subject: [PATCH 10/35] fix B_BUFF_ABILITY --- src/battle_message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_message.c b/src/battle_message.c index 22561dd07..35ccc6e26 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3432,7 +3432,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) srcID += 2; break; case B_BUFF_ABILITY: // ability names - StringAppend(dst, gAbilityNames[src[srcID + 1]]); + StringAppend(dst, gAbilityNames[T1_READ_16(&src[srcID + 1])]); srcID += 3; break; case B_BUFF_ITEM: // item name From 49ca76f880db267f9812e1b7720dd2acb65e0d2e Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 5 Dec 2020 20:39:05 -0300 Subject: [PATCH 11/35] Made Techno Blast's animation change depending on the Drive held --- src/battle_anim_new.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 0b54b4c40..f36eac6ae 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -5001,8 +5001,9 @@ void AnimTask_PurpleFlamesOnTarget(u8 taskId) void AnimTask_TechnoBlast(u8 taskId) { - //gBattleAnimArgs[0] = gItems[GetBattlerPartyData(gBattleAnimAttacker).item].holdEffectParam; - gBattleAnimArgs[0] = ItemId_GetHoldEffectParam(gBattleMons[gBattleAnimAttacker].item); + if (ItemId_GetHoldEffect(gBattleMons[gBattleAnimAttacker].item) == HOLD_EFFECT_DRIVE) + gBattleAnimArgs[0] = ItemId_GetSecondaryId(gBattleMons[gBattleAnimAttacker].item); + else + gBattleAnimArgs[0] = 0; DestroyAnimVisualTask(taskId); } - From b6d06817795caa72c6afcd3fb49c46f5d193679a Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 5 Dec 2020 20:50:33 -0300 Subject: [PATCH 12/35] Included hold_effects.h in battle_anim_new.c Otherwise the file won't recognize HOLD_EFFECT_PLATE and will refuse to build a ROM. --- src/battle_anim_new.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index f36eac6ae..9574f974b 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -14,6 +14,7 @@ #include "battle_scripts.h" #include "battle_controllers.h" #include "constants/moves.h" +#include "constants/hold_effects.h" //// function declarations static void SpriteCB_SpriteToCentreOfSide(struct Sprite* sprite); From 42a06c6003e31aedbe3fa52e597891d811189d1c Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 5 Dec 2020 21:23:59 -0300 Subject: [PATCH 13/35] Fixed softlock caused by the majority of Techno Blast's animations And made the checks that sets its animation use the Type constants instead of their internal IDs. --- data/battle_anim_scripts.s | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index cf11f4d6a..0e3862250 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -6,6 +6,7 @@ .include "asm/macros.inc" .include "asm/macros/battle_anim_script.inc" .include "constants/constants.inc" +#include "constants/pokemon.h" .section script_data, "aw", %progbits @@ -6745,10 +6746,10 @@ Move_SEARING_SHOT: Move_TECHNO_BLAST: launchtask AnimTask_TechnoBlast 0x5 0x0 - jumpargeq 0x0, 10, TechnoBlastFire - jumpargeq 0x0, 11, TechnoBlastWater - jumpargeq 0x0, 13, TechnoBlastElectric - jumpargeq 0x0, 15, TechnoBlastIce + jumpargeq 0x0, TYPE_FIRE, TechnoBlastFire + jumpargeq 0x0, TYPE_WATER, TechnoBlastWater + jumpargeq 0x0, TYPE_ELECTRIC, TechnoBlastElectric + jumpargeq 0x0, TYPE_ICE, TechnoBlastIce TechnoBlastNormal: loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge animation loadspritegfx ANIM_TAG_ORBS @circles @@ -6884,7 +6885,7 @@ TechnoBlastElectric: launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0 launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1 launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0 - launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2 + launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2 launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0 launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1 launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0 @@ -6893,20 +6894,20 @@ TechnoBlastElectric: playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x5 0x1 launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0x8 0x8 0x1 0x0 - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x5 0x0 0x5 0x0, ANIM_TARGET - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfffb 0xa 0x5 0x1, ANIM_TARGET + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x5 0x0 0x5 0x0 + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfffb 0xa 0x5 0x1 delay 0x2 launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0xfff8 0xfff8 0x1 0x0 - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xf 0x14 0x5 0x2, ANIM_TARGET - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff1 0xfff6 0x5 0x0, ANIM_TARGET + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xf 0x14 0x5 0x2 + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff1 0xfff6 0x5 0x0 delay 0x2 launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0x8 0xfff8 0x1 0x0 - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x19 0x0 0x5 0x1, ANIM_TARGET - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff8 0x8 0x5 0x2, ANIM_TARGET + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x19 0x0 0x5 0x1 + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff8 0x8 0x5 0x2 delay 0x2 launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0xfff8 0x8 0x1 0x0 - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x2 0xfff8 0x5 0x0, ANIM_TARGET - launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xffec 0xf 0x5 0x1, ANIM_TARGET + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x2 0xfff8 0x5 0x0 + launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xffec 0xf 0x5 0x1 waitforvisualfinish launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xC 0x0 0x0 waitforvisualfinish @@ -7018,7 +7019,7 @@ TechnoBlastWater: launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0 launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1 launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0 - launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2 + launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2 launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0 launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1 launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0 @@ -7071,7 +7072,7 @@ TechnoBlastFire: launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0 launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1 launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0 - launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2 + launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2 launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0 launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1 launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0 @@ -7080,13 +7081,13 @@ TechnoBlastFire: playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x5 0x1 launchtemplate gTechnoBlastRedSmokeTemplate 0x82, 0x4, 0x8 0x8 0x1 0x0 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa SOUND_PAN_ATTACKER 0xb0 0x28 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xff40 0xf0 0x28 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa SOUND_PAN_ATTACKER 0xff60 0x28 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xff40 0xff90 0x28 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xa0 0x30 0x28 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xff20 0xffe0 0x28 - launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0x70 0xff80 0x28 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 192, 176, 40 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -192, 240, 40 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 192, -160, 40 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -192, -112, 40 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 160, 48, 40 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -224, -32, 40 + createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 112, -128, 40 delay 0x2 launchtemplate gTechnoBlastRedSmokeTemplate 0x82, 0x4, 0xfff8 0xfff8 0x1 0x0 delay 0x2 @@ -7155,7 +7156,7 @@ TechnoBlastIce: launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0 launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1 launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0 - launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2 + launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2 launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0 launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1 launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0 @@ -24428,4 +24429,3 @@ Special_CriticalCaptureBallThrow: createvisualtask AnimTask_IsBallBlockedByTrainer, 2 jumpreteq -1, BallThrowTrainerBlock goto BallThrowEnd - From ef41a4c14d8008b41dd468f9f1a124f1b5a8c017 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 6 Dec 2020 16:14:02 +1300 Subject: [PATCH 14/35] Fix Jump Kick * Now inflicts recoil damage on the user if the target was immune to the attack * Gen V+ recoil damage is now half of the user's HP instead of half of the target's HP. --- data/battle_scripts_1.s | 7 ++++--- src/battle_script_commands.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0ccaa7ef6..63ae752ec 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2806,6 +2806,8 @@ BattleScript_EffectDoubleHit:: BattleScript_EffectRecoilIfMiss:: attackcanceler accuracycheck BattleScript_MoveMissedDoDamage, ACC_CURR_MOVE + typecalc + jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage goto BattleScript_HitFromAtkString BattleScript_MoveMissedDoDamage:: jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_PrintMoveMissed @@ -2814,19 +2816,18 @@ BattleScript_MoveMissedDoDamage:: pause 0x40 resultmessage waitmessage 0x40 - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd printstring STRINGID_PKMNCRASHED waitmessage 0x40 damagecalc typecalc adjustdamage manipulatedamage DMG_RECOIL_FROM_MISS - bichalfword gMoveResultFlags, MOVE_RESULT_MISSED + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL - orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd BattleScript_EffectMist:: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 16e2989f8..ab3b70e69 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8584,7 +8584,7 @@ static void Cmd_manipulatedamage(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; if (B_RECOIL_IF_MISS_DMG >= GEN_5 || ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage)) - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; break; case DMG_DOUBLED: gBattleMoveDamage *= 2; From 37aeeae27780e68c9de1bea467e80b7b730a0e65 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 5 Dec 2020 20:25:03 -0700 Subject: [PATCH 15/35] fix terrain bg on subsequent battle start --- src/battle_util2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_util2.c b/src/battle_util2.c index 081b73621..55f710a77 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -45,7 +45,8 @@ void FreeBattleResources(void) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL) FreeTrainerHillBattleStruct(); - + + gFieldStatuses = 0; if (gBattleResources != NULL) { FREE_AND_SET_NULL(gBattleStruct); From 426ea191ad06b91604441c015fac671f6bc678cb Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 5 Dec 2020 21:04:12 -0700 Subject: [PATCH 16/35] style fix --- include/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/battle.h b/include/battle.h index 4b7ad8d1d..488e0fc51 100644 --- a/include/battle.h +++ b/include/battle.h @@ -520,7 +520,7 @@ struct BattleStruct u8 savedBattlerTarget; bool8 ateBoost[MAX_BATTLERS_COUNT]; u8 activeAbilityPopUps; // as bits for each battler - u8 abilityPopUpSpriteIds[MAX_BATTLERS_COUNT][2]; //two per battler + u8 abilityPopUpSpriteIds[MAX_BATTLERS_COUNT][2]; // two per battler bool8 throwingPokeBall; struct MegaEvolutionData mega; const u8 *trainerSlideMsg; From 72b769ec7518e1d8dbdd57b94e721f6107c6f83c Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 7 Dec 2020 19:30:31 +1300 Subject: [PATCH 17/35] Add config options for Jump Kick Added options for: - Gen 4 style recoil when target is immune (user takes 50% of target's max HP) - Gen 3 style recoil when target is immune (i.e no recoil) - Gen 5+ recoil was already implemented but was bugged --- data/battle_scripts_1.s | 17 +++++++++++++++++ include/constants/battle_config.h | 1 + include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 3 +++ 4 files changed, 22 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 63ae752ec..d72346b12 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2806,8 +2806,10 @@ BattleScript_EffectDoubleHit:: BattleScript_EffectRecoilIfMiss:: attackcanceler accuracycheck BattleScript_MoveMissedDoDamage, ACC_CURR_MOVE +.if B_CRASH_IF_TARGET_IMMUNE >= GEN_4 typecalc jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage +.endif goto BattleScript_HitFromAtkString BattleScript_MoveMissedDoDamage:: jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_PrintMoveMissed @@ -2816,18 +2818,33 @@ BattleScript_MoveMissedDoDamage:: pause 0x40 resultmessage waitmessage 0x40 +.if B_CRASH_IF_TARGET_IMMUNE < GEN_4 + jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd +.endif printstring STRINGID_PKMNCRASHED waitmessage 0x40 damagecalc typecalc adjustdamage +.if B_CRASH_IF_TARGET_IMMUNE == GEN_4 + manipulatedamage DMG_RECOIL_FROM_IMMUNE +.else manipulatedamage DMG_RECOIL_FROM_MISS +.endif +.if B_CRASH_IF_TARGET_IMMUNE >= GEN_4 bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE +.else + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED +.endif orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL +.if B_CRASH_IF_TARGET_IMMUNE >= GEN_4 orhalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE +.else + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED +.endif goto BattleScript_MoveEnd BattleScript_EffectMist:: diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 55c62af98..7acfaf026 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -109,6 +109,7 @@ #define B_DISABLE_TURNS GEN_6 // Disable's turns. See Cmd_disablelastusedattack. #define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems. #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. +#define B_CRASH_IF_TARGET_IMMUNE GEN_6 // In Gen4+, The user of Jump Kick or Hi Jump Kick will "keep going and crash" if it attacks a target that is immune to the move. // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index b081907ec..38f9254cb 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -175,6 +175,7 @@ #define DMG_CURR_ATTACKER_HP 5 #define DMG_BIG_ROOT 6 #define DMG_1_2_ATTACKER_HP 7 +#define DMG_RECOIL_FROM_IMMUNE 8 // Used to calculate recoil for the Gen 4 version of Jump Kick // Cmd_jumpifcantswitch #define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ab3b70e69..58e4cf60d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8606,6 +8606,9 @@ static void Cmd_manipulatedamage(void) case DMG_1_2_ATTACKER_HP: gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; break; + case DMG_RECOIL_FROM_IMMUNE: + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; + break; } gBattlescriptCurrInstr += 2; From a3b891bd653434fa6587275724e334650b502ec3 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 7 Dec 2020 19:41:49 +1300 Subject: [PATCH 18/35] Cap recoil for Gen 4 Jump Kick Jump Kick's recoil in Gen 4 cannot exceed half of the target's maximum HP. --- src/battle_script_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 58e4cf60d..2de22dd98 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8583,8 +8583,10 @@ static void Cmd_manipulatedamage(void) gBattleMoveDamage /= 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - if (B_RECOIL_IF_MISS_DMG >= GEN_5 || ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage)) + if (B_RECOIL_IF_MISS_DMG >= GEN_5) gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + if ((B_RECOIL_IF_MISS_DMG <= GEN_4) && ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage)) + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; break; case DMG_DOUBLED: gBattleMoveDamage *= 2; From 964ec53a65815aa28f3e63e42fa219b96ae10943 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 8 Dec 2020 11:36:19 -0700 Subject: [PATCH 19/35] port cfru shadow sneak anim --- data/battle_anim_scripts.s | 52 ++++++++++++++++++++++++-------------- src/battle_anim_new.c | 12 +++++++++ 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index cf11f4d6a..df87c770e 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -2799,28 +2799,42 @@ Move_FIRE_FANG: end Move_SHADOW_SNEAK: - loadspritegfx ANIM_TAG_LICK - setalpha 0, 16 - delay 1 - createvisualtask AnimTask_InitMementoShadow, 2 - delay 1 - createvisualtask AnimTask_MoveAttackerMementoShadow, 5 - playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER - delay 48 - playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_WHITE_SHADOW @Destiny Bond + loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @Black Colour + loadspritegfx ANIM_TAG_POISON_BUBBLE @Poison + loadspritegfx ANIM_TAG_HANDS_AND_FEET + monbg ANIM_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x7 0x0000 waitforvisualfinish - createvisualtask sub_8114470, 2 - setalpha 0, 16 - delay 1 - playsewithpan SE_M_LICK, SOUND_PAN_TARGET - createsprite gLickSpriteTemplate, ANIM_TARGET, 2, 0, 0 - createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 16, 1 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + launchtask AnimTask_TranslateMonEllipticalRespectSide 0x2 0x5 0x0 0x12 0x6 0x1 0x3 + launchtask AnimTask_AttackerFadeToInvisible 0x2 0x1 0x1 + waitforvisualfinish + clearmonbg ANIM_ATTACKER + invisible ANIM_ATTACKER + delay 0x1 + launchtask AnimTask_DestinyBondWhiteShadow 0x5 0x2 0x0 0x30 + delay 0x30 + launchtask AnimTask_BlendColorCycle 0x2 0x6 ANIM_PAL_DEF 0x2 0x2 0x0 0xF 0x0 + createsprite gShadowSneakImpactSpriteTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff6, 0x0 + call ShadowSneakMovement + createsprite gShadowSneakImpactSpriteTemplate, ANIM_TARGET, 2, 0xa, 0x14, 0x0 + call ShadowSneakMovement + createsprite gShadowSneakImpactSpriteTemplate, ANIM_TARGET, 2, 0xfffb, 0xa, 0x0 + call ShadowSneakMovement + createsprite gShadowSneakImpactSpriteTemplate, ANIM_TARGET, 2, 0x11, 0xfff4, 0x0 + call ShadowSneakMovement + waitforvisualfinish + visible ANIM_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x7 0x0 0x0000 waitforvisualfinish - clearmonbg_23 ANIM_TARGET - delay 1 - blendoff - delay 1 end +ShadowSneakMovement: + playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0x6 0x1 + delay 0x4 + return Move_MUD_BOMB: loadspritegfx ANIM_TAG_MUD_SAND diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 0b54b4c40..e7bb23d90 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -66,6 +66,18 @@ static const union AffineAnimCmd sSquishTargetAffineAnimCmds[] = }; //// GEN 4 +// shadow sneak +const struct SpriteTemplate gShadowSneakImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_IceCrystalHit, + .callback = AnimIceEffectParticle +}; + // power trick const struct SpriteTemplate gPowerTrickSpriteTemplate = { From ee59fab143ee4ff79227c9848bfea3acc48cfdc5 Mon Sep 17 00:00:00 2001 From: NamNguyenUTSA <47985283+NamNguyenUTSA@users.noreply.github.com> Date: Fri, 11 Dec 2020 08:31:00 -0600 Subject: [PATCH 20/35] Allow player partner NPC's to mega evolve (i.e., Steven at Mossdeep) --- src/battle_controller_player_partner.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 9743e92e0..06a73beab 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1526,7 +1526,10 @@ static void PlayerPartnerHandleChooseMove(void) gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); } - BtlController_EmitTwoReturnValues(1, 10, chosenMoveId | (gBattlerTarget << 8)); + if (CanMegaEvolve(gActiveBattler)) // If partner can mega evolve, do it. + BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); + else + BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gBattlerTarget << 8)); PlayerPartnerBufferExecCompleted(); } From 0ac026e6ca0075ecbcfdfe855998c3c4371e2ac9 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 11 Dec 2020 20:21:40 -0300 Subject: [PATCH 21/35] Added the data of SwSh's Crown Tundra's moves And Dragon Energy's effect. Eerie Spell's is the only one missing out of this bunch. --- data/battle_scripts_1.s | 2 + include/constants/battle_move_effects.h | 1 + include/constants/moves.h | 11 ++- src/battle_util.c | 3 + src/data/battle_moves.h | 112 ++++++++++++++++++++++++ src/data/text/move_descriptions.h | 41 ++++++++- src/data/text/move_names.h | 8 ++ 7 files changed, 176 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0ccaa7ef6..982507ac8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -365,6 +365,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFairyLock .4byte BattleScript_EffectAllySwitch .4byte BattleScript_EffectSleepHit + .4byte BattleScript_EffectDragonEnergy BattleScript_EffectSleepHit: setmoveeffect MOVE_EFFECT_SLEEP @@ -2007,6 +2008,7 @@ BattleScript_EffectPlaceholder: printstring STRINGID_NOTDONEYET goto BattleScript_MoveEnd +BattleScript_EffectDragonEnergy: BattleScript_EffectStompingTantrum: BattleScript_EffectEvasionDownHit: BattleScript_EffectVitalThrow: diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index b018429de..5bd0c6a46 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -351,5 +351,6 @@ #define EFFECT_FAIRY_LOCK 345 #define EFFECT_ALLY_SWITCH 346 #define EFFECT_SLEEP_HIT 347 // Relic Song +#define EFFECT_DRAGON_ENERGY 348 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/moves.h b/include/constants/moves.h index 711aa3023..1c38d54e9 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -772,8 +772,17 @@ #define MOVE_JUNGLE_HEALING 744 #define MOVE_WICKED_BLOW 745 #define MOVE_SURGING_STRIKES 746 +// Crown Tundra Moves +#define MOVE_THUNDER_CAGE 747 +#define MOVE_DRAGON_ENERGY 748 +#define MOVE_FREEZING_GLARE 749 +#define MOVE_FIERY_WRATH 750 +#define MOVE_THUNDEROUS_KICK 751 +#define MOVE_GLACIAL_LANCE 752 +#define MOVE_ASTRAL_BARRAGE 753 +#define MOVE_EERIE_SPELL 754 -#define MOVES_COUNT_GEN8 747 +#define MOVES_COUNT_GEN8 755 #define MOVES_COUNT MOVES_COUNT_GEN8 diff --git a/src/battle_util.c b/src/battle_util.c index b929b7499..14f7a6e93 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6581,6 +6581,9 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; + case EFFECT_DRAGON_ENERGY: + basePower = 150 * gBattleMons[battlerAtk].hp / gBattleMons[battlerAtk].maxHP; + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 0b0c0b553..175c623f3 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11386,4 +11386,116 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, }, + + [MOVE_THUNDER_CAGE] = + { + .effect = EFFECT_TRAP, + .power = 80, + .type = TYPE_ELECTRIC, + .accuracy = 90, + .pp = 15, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_DRAGON_ENERGY] = + { + .effect = EFFECT_DRAGON_ENERGY, + .power = 150, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_FREEZING_GLARE] = + { + .power = 90, + .effect = EFFECT_FREEZE_HIT, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_FIERY_WRATH] = + { + .effect = EFFECT_FLINCH_HIT, + .power = 90, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_THUNDEROUS_KICK] = + { + .effect = EFFECT_DEFENSE_DOWN_HIT, + .power = 90, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_GLACIAL_LANCE] = + { + .effect = EFFECT_HIT, + .power = 130, + .type = TYPE_ICE, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_ASTRAL_BARRAGE] = + { + .effect = EFFECT_HIT, + .power = 120, + .type = TYPE_GHOST, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_EERIE_SPELL] = + { + .effect = EFFECT_HIT, // To do. It's a copy of Spite that inflicts damage and reduced the target's last move's PP by 3 instead of 4. + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .split = SPLIT_SPECIAL, + }, }; diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index 96b04d342..2792f33ce 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -2910,6 +2910,38 @@ static const u8 sSURGING_STRIKESDescription[] = _( "Mastering the Water style,\n" "strikes with 3 critical hits."); +static const u8 sTHUNDER_CAGEDescription[] = _( + "Traps the foe in a cage of\n" + "electricity for 2 to 5 turns."); + +static const u8 sDRAGON_ENERGYDescription[] = _( + "The higher the user's HP\n" + "the more damage caused."); + +static const u8 sFREEZING_GLAREDescription[] = _( + "Shoots psychic power from\n" + "the eyes. May freeze the foe."); + +static const u8 sFIERY_WRATHDescription[] = _( + "An attack fueled by your\n" + "wrath. May cause flinching."); + +static const u8 sTHUNDEROUS_KICKDescription[] = _( + "Uses a lightning-like kick\n" + "to hit. Lowers foe's DEFENSE."); + +static const u8 sGLACIAL_LANCEDescription[] = _( + "Strikes by hurling a blizzard-\n" + "cloaked icicle lance at a foe."); + +static const u8 sASTRAL_BARRAGEDescription[] = _( + "Strikes by sending a frightful\n" + "amount of ghosts at a foe."); + +static const u8 sEERIE_SPELLDescription[] = _( + "Eeriely inflicts damage and\n" + "cuts a foe's las move's PP."); + static const u8 sNotDoneYetDescription[] = _( "Not done yet."); @@ -3664,5 +3696,12 @@ const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] = [MOVE_JUNGLE_HEALING - 1] = sJUNGLE_HEALINGDescription, [MOVE_WICKED_BLOW - 1] = sWICKED_BLOWDescription, [MOVE_SURGING_STRIKES - 1] = sSURGING_STRIKESDescription, - + [MOVE_THUNDER_CAGE - 1] = sTHUNDER_CAGEDescription, + [MOVE_DRAGON_ENERGY - 1] = sDRAGON_ENERGYDescription, + [MOVE_FREEZING_GLARE - 1] = sFREEZING_GLAREDescription, + [MOVE_FIERY_WRATH - 1] = sFIERY_WRATHDescription, + [MOVE_THUNDEROUS_KICK - 1] = sTHUNDEROUS_KICKDescription, + [MOVE_GLACIAL_LANCE - 1] = sGLACIAL_LANCEDescription, + [MOVE_ASTRAL_BARRAGE - 1] = sASTRAL_BARRAGEDescription, + [MOVE_EERIE_SPELL - 1] = sEERIE_SPELLDescription, }; diff --git a/src/data/text/move_names.h b/src/data/text/move_names.h index 1eaf3137d..8df3a514d 100644 --- a/src/data/text/move_names.h +++ b/src/data/text/move_names.h @@ -748,4 +748,12 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] = [MOVE_JUNGLE_HEALING] = _("Jungle Heal"), [MOVE_WICKED_BLOW] = _("Wicked Blow"), [MOVE_SURGING_STRIKES] = _("SurgeStrikes"), + [MOVE_THUNDER_CAGE] = _("Thunder Cage"), + [MOVE_DRAGON_ENERGY] = _("DragonEnergy"), + [MOVE_FREEZING_GLARE] = _("FreezngGlare"), + [MOVE_FIERY_WRATH] = _("Fiery Wrath"), + [MOVE_THUNDEROUS_KICK] = _("ThnderusKick"), + [MOVE_GLACIAL_LANCE] = _("GlacialLance"), + [MOVE_ASTRAL_BARRAGE] = _("AstrlBarrage"), + [MOVE_EERIE_SPELL] = _("Eerie Spell"), }; From 9ec2e44f4cebd66845247b2f2f1188a1442e7ded Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 11 Dec 2020 21:36:59 -0300 Subject: [PATCH 22/35] Updated Spite --- include/constants/battle_config.h | 2 ++ src/battle_script_commands.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 55c62af98..8771ac73b 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -109,6 +109,8 @@ #define B_DISABLE_TURNS GEN_6 // Disable's turns. See Cmd_disablelastusedattack. #define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems. #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. +#define B_PP_REDUCED_BY_SPITE GEN_6 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. +#define B_SPITE_CAN_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 16e2989f8..4e9537e49 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10192,9 +10192,18 @@ static void Cmd_tryspiteppreduce(void) break; } + #if B_CAN_SPITE_FAIL <= GEN_3 if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] > 1) + #else + if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) + #endif { + #if B_PP_REDUCED_BY_SPITE <= GEN_3 s32 ppToDeduct = (Random() & 3) + 2; + #else + s32 ppToDeduct = 4; + #endif + if (gBattleMons[gBattlerTarget].pp[i] < ppToDeduct) ppToDeduct = gBattleMons[gBattlerTarget].pp[i]; From 17a9555715ba06acd6cea56f4b4dd7ce7dd5ddc9 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 11 Dec 2020 21:43:18 -0300 Subject: [PATCH 23/35] Oopsie. --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 8771ac73b..ab03e1bde 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -110,7 +110,7 @@ #define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems. #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. #define B_PP_REDUCED_BY_SPITE GEN_6 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. -#define B_SPITE_CAN_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. +#define B_CAN_SPITE_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. From 33d7f224947ddb3c47e1ebe42260ea38cc9682b5 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 11 Dec 2020 21:49:03 -0300 Subject: [PATCH 24/35] Improved the comment of B_STANCE_CHANGE_FAIL --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 55c62af98..9b017833d 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -113,7 +113,7 @@ // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. #define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger. -#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Aegislash's form change does not happen, if the Pokémon cannot use a move, because of confusion, paralysis, etc. In gen6, the form change occurs despite not being able to move. +#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Stance Change fails if the Pokémon is unable to use a move because of confusion, paralysis, etc. In Gen6, it doesn't. #define B_GHOSTS_ESCAPE GEN_6 // In Gen6+, ghosts can escape even when blocked by abilities such as Shadow Tag. #define B_MOODY_ACC_EVASION GEN_6 // In Gen8+, Moody CANNOT raise Accuray and Evasion any more. #define B_FLASH_FIRE_FROZEN GEN_6 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. From c5e04cf2437623acafdcf3904a2839ef98bb3cc7 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 12 Dec 2020 01:19:15 -0300 Subject: [PATCH 25/35] Removed the unnecessary Dragon Energy effect The move is an Eruption clone, whose effect was already done. Thanks to BuffelSaft for the heads up. I took the chance and fixed its target too. --- data/battle_scripts_1.s | 2 -- include/constants/battle_move_effects.h | 1 - src/battle_util.c | 3 --- src/data/battle_moves.h | 4 ++-- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 982507ac8..0ccaa7ef6 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -365,7 +365,6 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFairyLock .4byte BattleScript_EffectAllySwitch .4byte BattleScript_EffectSleepHit - .4byte BattleScript_EffectDragonEnergy BattleScript_EffectSleepHit: setmoveeffect MOVE_EFFECT_SLEEP @@ -2008,7 +2007,6 @@ BattleScript_EffectPlaceholder: printstring STRINGID_NOTDONEYET goto BattleScript_MoveEnd -BattleScript_EffectDragonEnergy: BattleScript_EffectStompingTantrum: BattleScript_EffectEvasionDownHit: BattleScript_EffectVitalThrow: diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 5bd0c6a46..b018429de 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -351,6 +351,5 @@ #define EFFECT_FAIRY_LOCK 345 #define EFFECT_ALLY_SWITCH 346 #define EFFECT_SLEEP_HIT 347 // Relic Song -#define EFFECT_DRAGON_ENERGY 348 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_util.c b/src/battle_util.c index 14f7a6e93..b929b7499 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6581,9 +6581,6 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; - case EFFECT_DRAGON_ENERGY: - basePower = 150 * gBattleMons[battlerAtk].hp / gBattleMons[battlerAtk].maxHP; - break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 175c623f3..7031fdc22 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11403,13 +11403,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DRAGON_ENERGY] = { - .effect = EFFECT_DRAGON_ENERGY, + .effect = EFFECT_ERUPTION, .power = 150, .type = TYPE_DRAGON, .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, From 31d483ef44bb39536b20f5b8677eca7c72a5d425 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 12 Dec 2020 11:26:27 -0300 Subject: [PATCH 26/35] Some more battle_config.h tweaks --- include/constants/battle_config.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 55c62af98..4cf246418 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -111,7 +111,7 @@ #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. // Ability settings -#define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. +#define B_ABILITY_WEATHER GEN_6 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move. #define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger. #define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Aegislash's form change does not happen, if the Pokémon cannot use a move, because of confusion, paralysis, etc. In gen6, the form change occurs despite not being able to move. #define B_GHOSTS_ESCAPE GEN_6 // In Gen6+, ghosts can escape even when blocked by abilities such as Shadow Tag. @@ -124,8 +124,9 @@ #define B_HP_BERRIES GEN_6 // In Gen4+, berries which restore hp activate immediately after hp drops to half. In gen3, the effect occurs at the end of the turn. #define B_BERRIES_INSTANT GEN_6 // In Gen4+, most berries activate on battle start/switch-in if applicable. In gen3, they only activate either at the move end or turn end. -// Flag settings. -// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag for toggling the feature. +// Flag settings +// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. +// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature. #define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water. #define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles. From e9c6c96b9d087103b88e84e891186336e3d9359a Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 12 Dec 2020 11:54:41 -0300 Subject: [PATCH 27/35] Corrected Final Gambit's move data It didn't have its own working effect assigned, and it wasn't being affected by King's Rock even though it should. --- src/data/battle_moves.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 0b0c0b553..bce0c60e5 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -7986,7 +7986,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_FINAL_GAMBIT] = { - .effect = EFFECT_HIT_SWITCH_TARGET, + .effect = EFFECT_FINAL_GAMBIT, .power = 1, .type = TYPE_FIGHTING, .accuracy = 100, @@ -7994,7 +7994,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, }, From 305bea32df6c40fea32d72bec732207e1d46dee9 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 12 Dec 2020 20:32:52 -0300 Subject: [PATCH 28/35] Added missing check to Flower Gift (offensive) --- src/battle_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index b929b7499..aeeefa734 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6960,7 +6960,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b } break; case ABILITY_FLOWER_GIFT: - if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_HUSTLE: @@ -6996,7 +6996,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) { case ABILITY_FLOWER_GIFT: - if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM) + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); break; } From 36b0e6dedce4002385e162ac1efce4086a4f9e9a Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 13 Dec 2020 17:08:35 -0700 Subject: [PATCH 29/35] fix shake duration --- data/battle_anim_scripts.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index a8af18686..facd8e0d2 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24009,8 +24009,8 @@ Status_Infestation: monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_DEF, 0x2, 0x0, 0x9, 0x7320 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0x4f 0x1 - loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0x0, 0x4F + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 30 0x1 + loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0x0, 30 call InfestationVortex call InfestationVortex waitforvisualfinish From 785e23222bd3a8ae7b94fa635d846906fc2a4b2d Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 13 Dec 2020 21:20:23 -0300 Subject: [PATCH 30/35] Review correction --- data/battle_anim_scripts.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 0e3862250..85e69da39 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -3,10 +3,10 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/moves.h" +#include "constants/pokemon.h" .include "asm/macros.inc" .include "asm/macros/battle_anim_script.inc" .include "constants/constants.inc" -#include "constants/pokemon.h" .section script_data, "aw", %progbits From ffa35a33c169780a6154eb4976218b499e63d3c7 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 19 Dec 2020 07:44:34 -0300 Subject: [PATCH 31/35] Review corrections --- src/data/battle_moves.h | 10 +++++----- src/data/text/move_descriptions.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 7031fdc22..138f4f86c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11425,7 +11425,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -11437,9 +11437,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 10, .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, }, @@ -11465,7 +11465,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, @@ -11479,7 +11479,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index 2792f33ce..354094ad0 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -2928,7 +2928,7 @@ static const u8 sFIERY_WRATHDescription[] = _( static const u8 sTHUNDEROUS_KICKDescription[] = _( "Uses a lightning-like kick\n" - "to hit. Lowers foe's DEFENSE."); + "to hit. Lowers foe's Defense."); static const u8 sGLACIAL_LANCEDescription[] = _( "Strikes by hurling a blizzard-\n" @@ -2939,8 +2939,8 @@ static const u8 sASTRAL_BARRAGEDescription[] = _( "amount of ghosts at a foe."); static const u8 sEERIE_SPELLDescription[] = _( - "Eeriely inflicts damage and\n" - "cuts a foe's las move's PP."); + "Attacks with psychic power.\n" + "Foe's last move has 3 PP cut."); static const u8 sNotDoneYetDescription[] = _( "Not done yet."); From 89989943b37b6ce91e2eea7b803bd7f8957c1851 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 19 Dec 2020 19:11:17 -0300 Subject: [PATCH 32/35] Added placeholders for the anims of CT's moves --- data/battle_anim_scripts.s | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index cf11f4d6a..9fb69e1e4 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -767,7 +767,15 @@ gBattleAnims_Moves:: .4byte Move_JUNGLE_HEALING .4byte Move_WICKED_BLOW .4byte Move_SURGING_STRIKES - .4byte Move_COUNT @ cannot be reached, because last move is Surging Strikes + .4byte Move_THUNDER_CAGE + .4byte Move_DRAGON_ENERGY + .4byte Move_FREEZING_GLARE + .4byte Move_FIERY_WRATH + .4byte Move_THUNDEROUS_KICK + .4byte Move_GLACIAL_LANCE + .4byte Move_ASTRAL_BARRAGE + .4byte Move_EERIE_SPELL + .4byte Move_COUNT @ cannot be reached, because last move is Eerie Spell .align 2 gBattleAnims_StatusConditions:: @@ -14006,6 +14014,30 @@ Move_WICKED_BLOW:: Move_SURGING_STRIKES:: end @to do: +Move_THUNDER_CAGE:: + end @to do: + +Move_DRAGON_ENERGY:: + end @to do: + +Move_FREEZING_GLARE:: + end @to do: + +Move_FIERY_WRATH:: + end @to do: + +Move_THUNDEROUS_KICK:: + end @to do: + +Move_GLACIAL_LANCE:: + end @to do: + +Move_ASTRAL_BARRAGE:: + end @to do: + +Move_EERIE_SPELL:: + end @to do: + @@@@@@@@@@@@@@@@@@@@@@@ GEN 1-3 @@@@@@@@@@@@@@@@@@@@@@@ Move_NONE: Move_MIRROR_MOVE: From 0aae069db88550f703856f9833e0b6ae68622c46 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 19 Dec 2020 21:11:17 -0300 Subject: [PATCH 33/35] Made Fiery Wrath unaffected by King's Rock --- src/data/battle_moves.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 138f4f86c..13cef869b 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11439,7 +11439,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 20, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, }, From 9f2dc914ba1064bf9085a52c6daf3b77885db61f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 19 Dec 2020 21:57:47 -0300 Subject: [PATCH 34/35] Tweaked Final Gambit's effect -Made the user faint before the foe like in the official games -Removed calls to resultmessage and critmessage as those were never needed by this move's effect --- data/battle_scripts_1.s | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0ccaa7ef6..8065073fc 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1082,16 +1082,12 @@ BattleScript_EffectFinalGambit: waitstate healthbarupdate BS_TARGET datahpupdate BS_TARGET - critmessage - waitmessage 0x40 - resultmessage - waitmessage 0x40 - seteffectwithchance - tryfaintmon BS_TARGET, FALSE, NULL - jumpifmovehadnoeffect BattleScript_MoveEnd healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER + seteffectwithchance tryfaintmon BS_ATTACKER, FALSE, NULL + tryfaintmon BS_TARGET, FALSE, NULL + jumpifmovehadnoeffect BattleScript_MoveEnd goto BattleScript_MoveEnd BattleScript_EffectHitSwitchTarget: From 3918542b3e10a441344fb70ac7411b3dbcc55ce3 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 20 Dec 2020 21:31:36 -0300 Subject: [PATCH 35/35] Corrections to Final Gambit's effect's battle script -Restored the call to resultmessage -Corrected its behavior against Endured, Focus Banded/Sashed and Sturdy foes --- data/battle_scripts_1.s | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8065073fc..0856324e2 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1082,6 +1082,9 @@ BattleScript_EffectFinalGambit: waitstate healthbarupdate BS_TARGET datahpupdate BS_TARGET + resultmessage + waitmessage 0x40 + dmgtocurrattackerhp healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER seteffectwithchance