add curious medicine

This commit is contained in:
Evan 2021-01-05 20:02:11 -07:00
parent 0a3908ee92
commit 4c1e8f2f2e
5 changed files with 30 additions and 7 deletions

View file

@ -26,6 +26,7 @@ u32 IsFlowerVeilProtected(u32 battler);
u32 IsLeafGuardProtected(u32 battler);
bool32 IsShieldsDownProtected(u32 battler);
u32 IsAbilityStatusProtected(u32 battler);
void ResetBattlerStatChanges(u8 battler);
extern void (* const gBattleScriptingCommandsTable[])(void);
extern const u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4];

View file

@ -559,8 +559,9 @@
#define STRINGID_COMATOSEENTERS 555
#define STRINGID_SCREENCLEANERENTERS 556
#define STRINGID_ASONEENTERS 557
#define STRINGID_CURIOUSMEDICINEENTERS 558
#define BATTLESTRINGS_COUNT 558
#define BATTLESTRINGS_COUNT 559
//// multichoice message IDs
// switch in ability message
@ -578,5 +579,6 @@
#define MULTI_SWITCHIN_COMATOSE 11
#define MULTI_SWITCHIN_SCREENCLEANER 12
#define MULTI_SWITCHIN_ASONE 13
#define MULTI_SWITCHIN_CURIOUS_MEDICINE 14
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H

View file

@ -686,9 +686,11 @@ static const u8 sText_AuraBreakActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}
static const u8 sText_ComatoseActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is drowsing!");
static const u8 sText_ScreenCleanerActivates[] = _("All screens on the field were\ncleansed!");
static const u8 sText_AsOneEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} has two Abilities!");
static const u8 sText_CuriousMedicineEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s\nstat changes were reset!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_CURIOUSMEDICINEENTERS - 12] = sText_CuriousMedicineEnters,
[STRINGID_ASONEENTERS - 12] = sText_AsOneEnters,
[STRINGID_STATWASNOTLOWERED - 12] = sText_StatWasNotLowered,
[STRINGID_CLOAKEDINAFREEZINGLIGHT - 12] = sText_CloakedInAFreezingLight,

View file

@ -9074,17 +9074,22 @@ static void Cmd_statbuffchange(void)
gBattlescriptCurrInstr = jumpPtr;
}
void ResetBattlerStatChanges(u8 battler)
{
u32 j;
gDisableStructs[battler].stockpileDef = 0;
gDisableStructs[battler].stockpileSpDef = 0;
for (j = 0; j < NUM_BATTLE_STATS; j++)
gBattleMons[battler].statStages[j] = DEFAULT_STAT_STAGE;
}
static void Cmd_normalisebuffs(void) // haze
{
s32 i, j;
for (i = 0; i < gBattlersCount; i++)
{
gDisableStructs[i].stockpileDef = 0;
gDisableStructs[i].stockpileSpDef = 0;
for (j = 0; j < NUM_BATTLE_STATS; j++)
gBattleMons[i].statStages[j] = DEFAULT_STAT_STAGE;
}
ResetBattlerStatChanges(i);
gBattlescriptCurrInstr++;
}

View file

@ -3712,6 +3712,18 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect++;
}
break;
case ABILITY_CURIOUS_MEDICINE:
if (!gSpecialStatuses[battler].switchInAbilityDone && IsDoubleBattle() && IsBattlerAlive(BATTLE_PARTNER(battler)))
{
u32 i;
gEffectBattler = BATTLE_PARTNER(battler);
ResetBattlerStatChanges(gEffectBattler);
gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_CURIOUS_MEDICINE;
gSpecialStatuses[battler].switchInAbilityDone = 1;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++;
}
break;
case ABILITY_ANTICIPATION:
if (!gSpecialStatuses[battler].switchInAbilityDone)
{
@ -7891,3 +7903,4 @@ static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId)
return TRUE;
return FALSE;
}