update mental herb to gen 5
This commit is contained in:
parent
bd8950e8a0
commit
0d8f804194
8 changed files with 114 additions and 15 deletions
|
@ -7508,6 +7508,19 @@ BattleScript_BerryCureChosenStatusRet::
|
|||
removeitem BS_SCRIPTING
|
||||
return
|
||||
|
||||
BattleScript_MentalHerbCureRet::
|
||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||
printfromtable gMentalHerbCureStringIds
|
||||
waitmessage 0x40
|
||||
updatestatusicon BS_SCRIPTING
|
||||
removeitem BS_SCRIPTING
|
||||
copybyte gBattlerAttacker, sSAVED_BATTLER @ restore the original attacker just to be safe
|
||||
return
|
||||
|
||||
BattleScript_MentalHerbCureEnd2::
|
||||
call BattleScript_MentalHerbCureRet
|
||||
end2
|
||||
|
||||
BattleScript_WhiteHerbEnd2::
|
||||
call BattleScript_WhiteHerbRet
|
||||
end2
|
||||
|
|
|
@ -357,5 +357,7 @@ extern const u8 BattleScript_CottonDownActivates[];
|
|||
extern const u8 BattleScript_BallFetch[];
|
||||
extern const u8 BattleScript_SandSpitActivates[];
|
||||
extern const u8 BattleScript_PerishBodyActivates[];
|
||||
extern const u8 BattleScript_MentalHerbCureRet[];
|
||||
extern const u8 BattleScript_MentalHerbCureEnd2[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
|
|
@ -564,8 +564,11 @@
|
|||
#define STRINGID_PKMNSWILLPERISHIN3TURNS 560
|
||||
#define STRINGID_ABILITYRAISEDSTATDRASTICALLY 561
|
||||
#define STRINGID_AURAFLAREDTOLIFE 562
|
||||
#define STRINGID_ATKGOTOVERINFATUATION 563
|
||||
#define STRINGID_TORMENTEDNOMORE 564
|
||||
#define STRINGID_HEALBLOCKEDNOMORE 565
|
||||
|
||||
#define BATTLESTRINGS_COUNT 563
|
||||
#define BATTLESTRINGS_COUNT 566
|
||||
|
||||
//// multichoice message IDs
|
||||
// switch in ability message
|
||||
|
@ -583,4 +586,12 @@
|
|||
#define MULTI_SWITCHIN_COMATOSE 11
|
||||
#define MULTI_SWITCHIN_SCREENCLEANER 12
|
||||
|
||||
// mental herb
|
||||
#define MULTI_CUREINFATUATION 0
|
||||
#define MULTI_CURETAUNT 1
|
||||
#define MULTI_CUREENCORE 2
|
||||
#define MULTI_CURETORMENT 3
|
||||
#define MULTI_CUREHEALBLOCK 4
|
||||
#define MULTI_CUREDISABLE 5
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define HOLD_EFFECT_EXP_SHARE 25
|
||||
#define HOLD_EFFECT_QUICK_CLAW 26
|
||||
#define HOLD_EFFECT_HAPPINESS_UP 27
|
||||
#define HOLD_EFFECT_CURE_ATTRACT 28
|
||||
#define HOLD_EFFECT_MENTAL_HERB 28
|
||||
#define HOLD_EFFECT_CHOICE_BAND 29
|
||||
#define HOLD_EFFECT_FLINCH 30
|
||||
#define HOLD_EFFECT_BUG_POWER 31
|
||||
|
|
|
@ -691,9 +691,15 @@ static const u8 sText_BattlerAbilityRaisedStat[] = _("{B_SCR_ACTIVE_NAME_WITH_PR
|
|||
static const u8 sText_ASandstormKickedUp[] = _("A sandstorm kicked up!");
|
||||
static const u8 sText_PkmnsWillPerishIn3Turns[] = _("Both Pokémon will perish\nin three turns!");
|
||||
static const u8 sText_AbilityRaisedStatDrastically[] = _("{B_DEF_ABILITY} raised {B_DEF_NAME_WITH_PREFIX}'s\n{B_BUFF1} drastically!");
|
||||
static const u8 sText_AttackerGotOverInfatuation[] =_("{B_ATK_NAME_WITH_PREFIX} got over\nits infatuation!");
|
||||
static const u8 sText_TormentedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is\ntormented no more!");
|
||||
static const u8 sText_HealBlockedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is cured of\nits heal block!");
|
||||
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
{
|
||||
[STRINGID_HEALBLOCKEDNOMORE - 12] = sText_HealBlockedNoMore,
|
||||
[STRINGID_TORMENTEDNOMORE - 12] = sText_TormentedNoMore,
|
||||
[STRINGID_ATKGOTOVERINFATUATION - 12] = sText_AttackerGotOverInfatuation,
|
||||
[STRINGID_ABILITYRAISEDSTATDRASTICALLY - 12] = sText_AbilityRaisedStatDrastically,
|
||||
[STRINGID_PKMNSWILLPERISHIN3TURNS - 12] = sText_PkmnsWillPerishIn3Turns,
|
||||
[STRINGID_ASANDSTORMKICKEDUP - 12] = sText_ASandstormKickedUp,
|
||||
|
@ -1247,6 +1253,16 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
|||
[STRINGID_SCREENCLEANERENTERS - 12] = sText_ScreenCleanerActivates,
|
||||
};
|
||||
|
||||
const u16 gMentalHerbCureStringIds[] =
|
||||
{
|
||||
[MULTI_CUREINFATUATION] = STRINGID_ATKGOTOVERINFATUATION,
|
||||
[MULTI_CURETAUNT] = STRINGID_BUFFERENDS,
|
||||
[MULTI_CUREENCORE] = STRINGID_PKMNENCOREENDED,
|
||||
[MULTI_CURETORMENT] = STRINGID_TORMENTEDNOMORE,
|
||||
[MULTI_CUREHEALBLOCK] = STRINGID_HEALBLOCKEDNOMORE,
|
||||
[MULTI_CUREDISABLE] = STRINGID_PKMNMOVEDISABLEDNOMORE,
|
||||
};
|
||||
|
||||
const u16 gTerrainStringIds[] =
|
||||
{
|
||||
STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC
|
||||
|
|
|
@ -5202,6 +5202,58 @@ static bool32 UnnerveOn(u32 battlerId, u32 itemId)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 GetMentalHerbEffect(u8 battlerId)
|
||||
{
|
||||
bool32 ret = FALSE;
|
||||
// check infatuation
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION)
|
||||
{
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREINFATUATION; //STRINGID_TARGETGOTOVERINFATUATION
|
||||
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;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
{
|
||||
int i = 0, moveType;
|
||||
|
@ -5658,13 +5710,12 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||
effect = ITEM_STATUS_CHANGE;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_ATTRACT:
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION)
|
||||
case HOLD_EFFECT_MENTAL_HERB:
|
||||
if (GetMentalHerbEffect(battlerId))
|
||||
{
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
|
||||
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
gBattleScripting.savedBattler = gBattlerAttacker;
|
||||
gBattlerAttacker = battlerId;
|
||||
BattleScriptExecute(BattleScript_MentalHerbCureEnd2);
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
|
@ -5757,14 +5808,13 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_ATTRACT:
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION)
|
||||
case HOLD_EFFECT_MENTAL_HERB:
|
||||
if (GetMentalHerbEffect(battlerId))
|
||||
{
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
|
||||
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
|
||||
gBattleScripting.savedBattler = gBattlerAttacker;
|
||||
gBattlerAttacker = battlerId;
|
||||
BattleScriptPushCursor();
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
|
||||
gBattlescriptCurrInstr = BattleScript_MentalHerbCureRet;
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -2423,7 +2423,7 @@ const struct Item gItems[] =
|
|||
.name = _("MENTAL HERB"),
|
||||
.itemId = ITEM_MENTAL_HERB,
|
||||
.price = 100,
|
||||
.holdEffect = HOLD_EFFECT_CURE_ATTRACT,
|
||||
.holdEffect = HOLD_EFFECT_MENTAL_HERB,
|
||||
.description = sMentalHerbDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = 4,
|
||||
|
|
|
@ -743,10 +743,17 @@ static const u8 sSootheBellDesc[] = _(
|
|||
"calms spirits and\n"
|
||||
"fosters friendship.");
|
||||
|
||||
#if B_MENTAL_HERB < GEN_5
|
||||
static const u8 sMentalHerbDesc[] = _(
|
||||
"A hold item that\n"
|
||||
"snaps POKéMON out\n"
|
||||
"of infatuation.");
|
||||
#else
|
||||
static const u8 sMentalHerbDesc[] = _(
|
||||
"Snaps Pokémon out\n"
|
||||
"of move-binding\n"
|
||||
"effects.");
|
||||
#endif
|
||||
|
||||
static const u8 sChoiceBandDesc[] = _(
|
||||
"Raises a move's\n"
|
||||
|
|
Loading…
Reference in a new issue