diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index e879dfd056..ac1f3b5f02 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -702,7 +702,7 @@ .4byte \param0 .endm - .macro negativedamage + .macro setdrainedhp .byte 0x88 .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c4befebb8f..cf6e8ef8a3 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -744,7 +744,7 @@ BattleScript_EffectAbsorb:: waitmessage 0x40 resultmessage waitmessage 0x40 - negativedamage + setdrainedhp orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze setbyte cMULTISTRING_CHOOSER, 0x0 @@ -854,7 +854,7 @@ BattleScript_82D8C18:: waitmessage 0x40 resultmessage waitmessage 0x40 - negativedamage + setdrainedhp orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER diff --git a/include/data/battle_moves.h b/include/data/battle_moves.h index 70a815b7e7..c127bc1e14 100644 --- a/include/data/battle_moves.h +++ b/include/data/battle_moves.h @@ -6928,7 +6928,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_STATUS, }, { // MOVE_DRAINING_KISS - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (restores 75% HP instead of 50% HP) + .effect = EFFECT_ABSORB, .power = 50, .type = TYPE_FAIRY, .accuracy = 100, @@ -6937,7 +6937,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, + .split = SPLIT_SPECIAL, // restores 75% HP instead of 50% HP + .argument = 75, }, { // MOVE_CRAFTY_SHIELD .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect diff --git a/include/pokemon.h b/include/pokemon.h index 5d34106c1f..d979d9b5e4 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -365,6 +365,7 @@ struct BattleMove s8 priority; u32 flags; u8 split; + u8 argument; }; struct SpindaSpot diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 187fca7d6a..e5f351f36b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -227,7 +227,7 @@ static void atk84_jumpifcantmakeasleep(void); static void atk85_stockpile(void); static void atk86_stockpiletobasedamage(void); static void atk87_stockpiletohpheal(void); -static void atk88_negativedamage(void); +static void atk88_setdrainedhp(void); static void atk89_statbuffchange(void); static void atk8A_normalisebuffs(void); static void atk8B_setbide(void); @@ -485,7 +485,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = atk85_stockpile, atk86_stockpiletobasedamage, atk87_stockpiletohpheal, - atk88_negativedamage, + atk88_setdrainedhp, atk89_statbuffchange, atk8A_normalisebuffs, atk8B_setbide, @@ -6739,9 +6739,13 @@ static void atk87_stockpiletohpheal(void) } } -static void atk88_negativedamage(void) +static void atk88_setdrainedhp(void) { - gBattleMoveDamage = -(gHpDealt / 2); + if (gBattleMoves[gCurrentMove].argument != 0) + gBattleMoveDamage = -(gHpDealt * gBattleMoves[gCurrentMove].argument / 100); + else + gBattleMoveDamage = -(gHpDealt / 2); + if (gBattleMoveDamage == 0) gBattleMoveDamage = -1;