mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-21 19:54:14 +01:00
Add missing Heal Block functionalities
This commit is contained in:
parent
f0d74b60ff
commit
be6148d876
@ -7872,7 +7872,7 @@ static void Cmd_various(void)
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
return;
|
||||
case VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS:
|
||||
if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE))
|
||||
if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE | STATUS3_HEAL_BLOCK))
|
||||
|| BATTLER_MAX_HP(gActiveBattler)
|
||||
|| !gBattleMons[gActiveBattler].hp
|
||||
|| !(IsBattlerGrounded(gActiveBattler)))
|
||||
|
@ -1689,6 +1689,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move)
|
||||
case EFFECT_HEALING_WISH:
|
||||
case EFFECT_WISH:
|
||||
case EFFECT_DREAM_EATER:
|
||||
case EFFECT_STRENGTH_SAP:
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
@ -6082,7 +6083,7 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId)
|
||||
|
||||
static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2)
|
||||
{
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId))
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK))
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId);
|
||||
|
||||
@ -6268,7 +6269,7 @@ u8 TryHandleSeed(u8 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 exec
|
||||
|
||||
static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal)
|
||||
{
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId)
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)
|
||||
&& !(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP))
|
||||
{
|
||||
if (percentHeal)
|
||||
@ -6707,7 +6708,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
break;
|
||||
case HOLD_EFFECT_LEFTOVERS:
|
||||
LEFTOVERS:
|
||||
if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn)
|
||||
if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn
|
||||
&& !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK))
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[battlerId].maxHP / 16;
|
||||
if (gBattleMoveDamage == 0)
|
||||
@ -7137,7 +7139,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
if (gSpecialStatuses[gBattlerAttacker].damagedMons // Need to have done damage
|
||||
&& gBattlerAttacker != gBattlerTarget
|
||||
&& gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP
|
||||
&& gBattleMons[gBattlerAttacker].hp != 0)
|
||||
&& gBattleMons[gBattlerAttacker].hp != 0
|
||||
&& !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK))
|
||||
{
|
||||
gLastUsedItem = atkItem;
|
||||
gPotentialItemEffectBattler = gBattlerAttacker;
|
||||
|
Loading…
x
Reference in New Issue
Block a user