From 8a2921ef718b5086ed29a11c2570d43a47795afa Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 24 Sep 2021 06:34:25 -0300 Subject: [PATCH] Completed Black Sludge's effect --- src/battle_util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index e6137b0f2..e669bfa03 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6120,7 +6120,20 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) break; case HOLD_EFFECT_BLACK_SLUDGE: if (IS_BATTLER_OF_TYPE(battlerId, TYPE_POISON)) + { goto LEFTOVERS; + } + else if (GetBattlerAbility(battlerId) != ABILITY_MAGIC_GUARD && !moveTurn) + { + gBattleMoveDamage = gBattleMons[battlerId].maxHP / 8; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + BattleScriptExecute(BattleScript_ItemHurtEnd2); + effect = ITEM_HP_CHANGE; + RecordItemEffectBattle(battlerId, battlerHoldEffect); + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + } + break; case HOLD_EFFECT_LEFTOVERS: LEFTOVERS: if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn)