add config option

This commit is contained in:
Evan 2021-01-15 18:28:10 -07:00
parent 0d8f804194
commit 449c2bcc34
2 changed files with 41 additions and 38 deletions

View file

@ -127,6 +127,7 @@
#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.
#define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1.
#define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable
// Flag settings
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.

View file

@ -5213,44 +5213,46 @@ static bool32 GetMentalHerbEffect(u8 battlerId)
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
ret = TRUE;
}
// check taunt
if (gDisableStructs[gBattlerTarget].tauntTimer != 0)
{
gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CURETAUNT;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT);
ret = TRUE;
}
// check encore
if (gDisableStructs[gBattlerTarget].encoreTimer != 0)
{
gDisableStructs[gActiveBattler].encoredMove = 0;
gDisableStructs[gBattlerTarget].encoreTimerStartValue = gDisableStructs[gBattlerTarget].encoreTimer = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREENCORE; //STRINGID_PKMNENCOREENDED
ret = TRUE;
}
// check torment
if (gBattleMons[battlerId].status2 & STATUS2_TORMENT)
{
gBattleMons[battlerId].status2 &= ~(STATUS2_TORMENT);
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CURETORMENT;
ret = TRUE;
}
// check heal block
if (gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)
{
gStatuses3[battlerId] & ~(STATUS3_HEAL_BLOCK);
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREHEALBLOCK;
ret = TRUE;
}
// disable
if (gDisableStructs[gBattlerTarget].disableTimer != 0)
{
gDisableStructs[gBattlerTarget].disableTimer = gDisableStructs[gBattlerTarget].disableTimerStartValue = 0;
gDisableStructs[gBattlerTarget].disabledMove = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREDISABLE;
ret = TRUE;
}
#if B_MENTAL_HERB >= GEN_5
// check taunt
if (gDisableStructs[gBattlerTarget].tauntTimer != 0)
{
gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CURETAUNT;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT);
ret = TRUE;
}
// check encore
if (gDisableStructs[gBattlerTarget].encoreTimer != 0)
{
gDisableStructs[gActiveBattler].encoredMove = 0;
gDisableStructs[gBattlerTarget].encoreTimerStartValue = gDisableStructs[gBattlerTarget].encoreTimer = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREENCORE; //STRINGID_PKMNENCOREENDED
ret = TRUE;
}
// check torment
if (gBattleMons[battlerId].status2 & STATUS2_TORMENT)
{
gBattleMons[battlerId].status2 &= ~(STATUS2_TORMENT);
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CURETORMENT;
ret = TRUE;
}
// check heal block
if (gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)
{
gStatuses3[battlerId] & ~(STATUS3_HEAL_BLOCK);
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREHEALBLOCK;
ret = TRUE;
}
// disable
if (gDisableStructs[gBattlerTarget].disableTimer != 0)
{
gDisableStructs[gBattlerTarget].disableTimer = gDisableStructs[gBattlerTarget].disableTimerStartValue = 0;
gDisableStructs[gBattlerTarget].disabledMove = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREDISABLE;
ret = TRUE;
}
#endif
return ret;
}