Tweaked the Oblivious immunities

Pokémon that are infatuated or taunted and obtain Oblivious through Skill Swap will now be healed of said conditions and a text string signaling it will be printed.
This commit is contained in:
LOuroboros 2021-06-03 07:55:44 -03:00
parent c21a00a5d1
commit b552db7193
5 changed files with 35 additions and 7 deletions

View File

@ -7412,6 +7412,18 @@ BattleScript_AbilityCuredStatus::
updatestatusicon BS_SCRIPTING updatestatusicon BS_SCRIPTING
return return
BattleScript_BattlerShookOffTaunt::
call BattleScript_AbilityPopUp
printstring STRINGID_PKMNSHOOKOFFTHETAUNT
waitmessage B_WAIT_TIME_LONG
return
BattleScript_BattlerGotOverItsInfatuation::
call BattleScript_AbilityPopUp
printstring STRINGID_PKMNGOTOVERITSINFATUATION
waitmessage B_WAIT_TIME_LONG
return
BattleScript_IgnoresWhileAsleep:: BattleScript_IgnoresWhileAsleep::
printstring STRINGID_PKMNIGNORESASLEEP printstring STRINGID_PKMNIGNORESASLEEP
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG

View File

@ -368,5 +368,7 @@ extern const u8 BattleScript_MicleBerryActivateEnd2[];
extern const u8 BattleScript_MicleBerryActivateRet[]; extern const u8 BattleScript_MicleBerryActivateRet[];
extern const u8 BattleScript_JabocaRowapBerryActivates[]; extern const u8 BattleScript_JabocaRowapBerryActivates[];
extern const u8 BattleScript_NotAffectedAbilityPopUp[]; extern const u8 BattleScript_NotAffectedAbilityPopUp[];
extern const u8 BattleScript_BattlerShookOffTaunt[];
extern const u8 BattleScript_BattlerGotOverItsInfatuation[];
#endif // GUARD_BATTLE_SCRIPTS_H #endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -568,8 +568,10 @@
#define STRINGID_CURIOUSMEDICINEENTERS 564 #define STRINGID_CURIOUSMEDICINEENTERS 564
#define STRINGID_CANACTFASTERTHANKSTO 565 #define STRINGID_CANACTFASTERTHANKSTO 565
#define STRINGID_MICLEBERRYACTIVATES 566 #define STRINGID_MICLEBERRYACTIVATES 566
#define STRINGID_PKMNSHOOKOFFTHETAUNT 567
#define BATTLESTRINGS_COUNT 567 #define STRINGID_PKMNGOTOVERITSINFATUATION 568
#define BATTLESTRINGS_COUNT 569
// The below IDs are all indexes into battle message tables, // The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print. // used to determine which of a set of messages to print.

View File

@ -694,9 +694,13 @@ static const u8 sText_AsOneEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} has two
static const u8 sText_CuriousMedicineEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s\nstat changes were reset!"); static const u8 sText_CuriousMedicineEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s\nstat changes were reset!");
static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faster,\nthanks to {B_LAST_ITEM}!"); static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faster,\nthanks to {B_LAST_ITEM}!");
static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!"); static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!");
static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!");
static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{ {
[STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation,
[STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt,
[STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates, [STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates,
[STRINGID_CANACTFASTERTHANKSTO - 12] = sText_CanActFaster, [STRINGID_CANACTFASTERTHANKSTO - 12] = sText_CanActFaster,
[STRINGID_CURIOUSMEDICINEENTERS - 12] = sText_CuriousMedicineEnters, [STRINGID_CURIOUSMEDICINEENTERS - 12] = sText_CuriousMedicineEnters,

View File

@ -5100,10 +5100,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
break; break;
case ABILITY_OBLIVIOUS: case ABILITY_OBLIVIOUS:
if (gBattleMons[battler].status2 & STATUS2_INFATUATION) if (gBattleMons[battler].status2 & STATUS2_INFATUATION)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
effect = 3; effect = 3;
} else if (gDisableStructs[battler].tauntTimer != 0)
effect = 4;
break; break;
} }
if (effect) if (effect)
@ -5112,17 +5111,26 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
{ {
case 1: // status cleared case 1: // status cleared
gBattleMons[battler].status1 = 0; gBattleMons[battler].status1 = 0;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
break; break;
case 2: // get rid of confusion case 2: // get rid of confusion
gBattleMons[battler].status2 &= ~(STATUS2_CONFUSION); gBattleMons[battler].status2 &= ~(STATUS2_CONFUSION);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
break; break;
case 3: // get rid of infatuation case 3: // get rid of infatuation
gBattleMons[battler].status2 &= ~(STATUS2_INFATUATION); gBattleMons[battler].status2 &= ~(STATUS2_INFATUATION);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BattlerGotOverItsInfatuation;
break;
case 4: // get rid of taunt
gDisableStructs[battler].tauntTimer = 0;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BattlerShookOffTaunt;
break; break;
} }
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
gBattleScripting.battler = gActiveBattler = gBattlerAbility = battler; gBattleScripting.battler = gActiveBattler = gBattlerAbility = battler;
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);