Skip to content

Commit

Permalink
Cured its problem
Browse files Browse the repository at this point in the history
  • Loading branch information
kittenchilly committed Jan 1, 2025
1 parent eb2d3c8 commit dbcc8c8
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 9 deletions.
4 changes: 3 additions & 1 deletion include/battle_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ extern const u8 gStatusConditionString_BurnJpn[8];
extern const u8 gStatusConditionString_IceJpn[8];
extern const u8 gStatusConditionString_ConfusionJpn[8];
extern const u8 gStatusConditionString_LoveJpn[8];
extern const u8 gStatusConditionString_FrostbiteJpn[8];
extern const u8 gStatusConditionString_DrowsinessJpn[8];

extern const u8 *const gStatusConditionStringsTable[7][2];
extern const u8 *const gStatusConditionStringsTable[9][2];

#endif // GUARD_BATTLE_MAIN_H
2 changes: 2 additions & 0 deletions include/battle_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ extern const u8 gText_Paralysis[];
extern const u8 gText_Ice[];
extern const u8 gText_Confusion[];
extern const u8 gText_Love[];
extern const u8 gText_Frostbite[];
extern const u8 gText_Drowsiness[];
extern const u8 gText_SpaceAndSpace[];
extern const u8 gText_CommaSpace[];
extern const u8 gText_Space2[];
Expand Down
2 changes: 2 additions & 0 deletions include/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,8 @@ extern const u8 gText_Burn[];
extern const u8 gText_Ice[];
extern const u8 gText_Confusion[];
extern const u8 gText_Love[];
extern const u8 gText_Frostbite[];
extern const u8 gText_Drowsiness[];

// battle message
extern const u8 gText_PkmnTransferredSomeonesPCBoxFull[];
Expand Down
6 changes: 5 additions & 1 deletion src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ const u8 gStatusConditionString_BurnJpn[] = _("やけど$$$$");
const u8 gStatusConditionString_IceJpn[] = _("こおり$$$$");
const u8 gStatusConditionString_ConfusionJpn[] = _("こんらん$$$");
const u8 gStatusConditionString_LoveJpn[] = _("メロメロ$$$");
const u8 gStatusConditionString_FrostbiteJpn[] = _("しもやけ$$$");
const u8 gStatusConditionString_DrowsinessJpn[] = _("ねむけ$$$$");

const u8 *const gStatusConditionStringsTable[][2] =
{
Expand All @@ -423,7 +425,9 @@ const u8 *const gStatusConditionStringsTable[][2] =
{gStatusConditionString_BurnJpn, gText_Burn},
{gStatusConditionString_IceJpn, gText_Ice},
{gStatusConditionString_ConfusionJpn, gText_Confusion},
{gStatusConditionString_LoveJpn, gText_Love}
{gStatusConditionString_LoveJpn, gText_Love},
{gStatusConditionString_FrostbiteJpn, gText_Frostbite},
{gStatusConditionString_DrowsinessJpn, gText_Drowsiness}
};

void CB2_InitBattle(void)
Expand Down
2 changes: 2 additions & 0 deletions src/battle_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,8 @@ const u8 gText_Paralysis[] = _("paralysis");
const u8 gText_Ice[] = _("ice");
const u8 gText_Confusion[] = _("confusion");
const u8 gText_Love[] = _("love");
const u8 gText_Frostbite[] = _("frostbite");
const u8 gText_Drowsiness[] = _("drowsiness");
const u8 gText_SpaceAndSpace[] = _(" and ");
const u8 gText_CommaSpace[] = _(", ");
const u8 gText_Space2[] = _(" ");
Expand Down
55 changes: 48 additions & 7 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5345,18 +5345,25 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
ABILITY_HEAL_MON_STATUS:
if (gBattleMons[battler].status1 & (STATUS1_POISON | STATUS1_TOXIC_POISON))
StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn);
if (gBattleMons[battler].status1 & (STATUS1_SLEEP | STATUS1_DROWSY))
if (gBattleMons[battler].status1 & STATUS1_SLEEP)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn);
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
}
if (gBattleMons[battler].status1 & STATUS1_DROWSY)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_DrowsinessJpn);
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
}

if (gBattleMons[battler].status1 & STATUS1_PARALYSIS)
StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn);
if (gBattleMons[battler].status1 & STATUS1_BURN)
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);
if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE))
if (gBattleMons[battler].status1 & STATUS1_FREEZE)
StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn);
if (gBattleMons[battler].status1 & STATUS1_FROSTBITE)
StringCopy(gBattleTextBuff1, gStatusConditionString_FrostbiteJpn);

gBattleMons[battler].status1 = 0;
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE;
Expand Down Expand Up @@ -6389,13 +6396,20 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
break;
case ABILITY_INSOMNIA:
case ABILITY_VITAL_SPIRIT:
if (gBattleMons[battler].status1 & (STATUS1_SLEEP | STATUS1_DROWSY))
if (gBattleMons[battler].status1 & STATUS1_SLEEP)
{
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE;
StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn);
effect = 1;
}
if (gBattleMons[battler].status1 & STATUS1_DROWSY)
{
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE;
StringCopy(gBattleTextBuff1, gStatusConditionString_DrowsinessJpn);
effect = 1;
}
break;
case ABILITY_WATER_VEIL:
case ABILITY_WATER_BUBBLE:
Expand All @@ -6406,11 +6420,16 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
}
break;
case ABILITY_MAGMA_ARMOR:
if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE))
if (gBattleMons[battler].status1 & STATUS1_FREEZE)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn);
effect = 1;
}
if (gBattleMons[battler].status1 & STATUS1_FROSTBITE)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_FrostbiteJpn);
effect = 1;
}
break;
case ABILITY_OBLIVIOUS:
if (gBattleMons[battler].status2 & STATUS2_INFATUATION)
Expand Down Expand Up @@ -7533,21 +7552,31 @@ static u8 ItemEffectMoveEnd(u32 battler, u16 holdEffect)
if (gBattleMons[battler].status1 & STATUS1_PSN_ANY)
StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn);

if (gBattleMons[battler].status1 & STATUS1_SLEEP || gBattleMons[battler].status1 & STATUS1_DROWSY)
if (gBattleMons[battler].status1 & STATUS1_SLEEP)
{
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE;
StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn);
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
}

if (gBattleMons[battler].status1 & STATUS1_DROWSY)
{
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE;
StringCopy(gBattleTextBuff1, gStatusConditionString_DrowsinessJpn);
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
}

if (gBattleMons[battler].status1 & STATUS1_PARALYSIS)
StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn);

if (gBattleMons[battler].status1 & STATUS1_BURN)
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);

if (gBattleMons[battler].status1 & STATUS1_FREEZE || gBattleMons[battler].status1 & STATUS1_FROSTBITE)
if (gBattleMons[battler].status1 & STATUS1_FREEZE)
StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn);

if (gBattleMons[battler].status1 & STATUS1_FROSTBITE)
StringCopy(gBattleTextBuff1, gStatusConditionString_FrostbiteJpn);

if (gBattleMons[battler].status2 & STATUS2_CONFUSION)
StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn);
Expand Down Expand Up @@ -7615,6 +7644,13 @@ static inline bool32 TryCureStatus(u32 battler, enum ItemEffect caseId)
string++;
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
}
if (gBattleMons[battler].status1 & STATUS1_DROWSY)
{
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE;
StringCopy(gBattleTextBuff1, gStatusConditionString_DrowsinessJpn);
string++;
TryDeactivateSleepClause(GetBattlerSide(battler), gBattlerPartyIndexes[battler]);
}
if (gBattleMons[battler].status1 & STATUS1_PARALYSIS)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn);
Expand All @@ -7625,11 +7661,16 @@ static inline bool32 TryCureStatus(u32 battler, enum ItemEffect caseId)
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);
string++;
}
if (gBattleMons[battler].status1 & STATUS1_FREEZE || gBattleMons[battler].status1 & STATUS1_FROSTBITE)
if (gBattleMons[battler].status1 & STATUS1_FREEZE)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn);
string++;
}
if (gBattleMons[battler].status1 & STATUS1_FROSTBITE)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_FrostbiteJpn);
string++;
}
if (gBattleMons[battler].status2 & STATUS2_CONFUSION)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn);
Expand Down

0 comments on commit dbcc8c8

Please sign in to comment.