From c4efe06f3831a344f19b4c56f87acff7d0c19f88 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 12 Nov 2021 17:55:05 -0500 Subject: [PATCH 1/3] wish update --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 8e72b2c99d..b7071221eb 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -153,6 +153,7 @@ #define B_GLARE_GHOST GEN_7 // In Gen4+, Glare can hit Ghost-type Pokémon normally. #define B_SKILL_SWAP GEN_7 // In Gen4+, Skill Swap triggers switch-in abilities after use. #define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune. +#define B_WISH GEN_7 // In Gen5+, it heals half of the user's max HP instead of the target // Ability settings #define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3f9ba388f7..36e438ae1e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12347,12 +12347,13 @@ static void Cmd_trywish(void) break; case 1: // heal effect PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerTarget, gWishFutureKnock.wishMonId[gBattlerTarget]) - - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; + #if B_WISH >= GEN_5 + gBattleMoveDamage = max(1, gBattleMons[gWishFutureKnock.wishMonId[gBattlerTarget]].maxHP / 2); + #else + gBattleMoveDamage = max(1, gBattleMons[gBattlerTarget].maxHP / 2); + #endif + gBattleMoveDamage *= -1; - if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); else From a4204e5491e30ec2b1cc8fd113cd4ad2d284cd66 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Sat, 13 Nov 2021 08:50:24 -0500 Subject: [PATCH 2/3] Update include/constants/battle_config.h Co-authored-by: Eduardo Quezada D'Ottone --- 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 b7071221eb..0b80c9bc66 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -153,7 +153,7 @@ #define B_GLARE_GHOST GEN_7 // In Gen4+, Glare can hit Ghost-type Pokémon normally. #define B_SKILL_SWAP GEN_7 // In Gen4+, Skill Swap triggers switch-in abilities after use. #define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune. -#define B_WISH GEN_7 // In Gen5+, it heals half of the user's max HP instead of the target +#define B_WISH_HP_SOURCE GEN_7 // In Gen5+, Wish heals half of the user's max HP instead of the target's. // Ability settings #define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability. From b68c596ce5c3029179dcfb53930c1351ffd67f97 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Sat, 13 Nov 2021 08:50:30 -0500 Subject: [PATCH 3/3] Update src/battle_script_commands.c Co-authored-by: Eduardo Quezada D'Ottone --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 36e438ae1e..a5cce7c45d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12347,7 +12347,7 @@ static void Cmd_trywish(void) break; case 1: // heal effect PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerTarget, gWishFutureKnock.wishMonId[gBattlerTarget]) - #if B_WISH >= GEN_5 + #if B_WISH_HP_SOURCE >= GEN_5 gBattleMoveDamage = max(1, gBattleMons[gWishFutureKnock.wishMonId[gBattlerTarget]].maxHP / 2); #else gBattleMoveDamage = max(1, gBattleMons[gBattlerTarget].maxHP / 2);