Anticipation clean-up

This commit is contained in:
DizzyEggg 2020-04-11 12:34:53 +02:00
parent 6078cd3e15
commit d28992d2ed
3 changed files with 26 additions and 39 deletions

View File

@ -587,7 +587,7 @@ static const u8 sText_SlowStartEnters[] = _("{B_ATK_NAME_WITH_PREFIX} can't get
static const u8 sText_SlowStartEnd[] = _("{B_ATK_NAME_WITH_PREFIX} finally got its act together!");
static const u8 sText_SolarPowerHpDrop[] = _("The {B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\ntakes its toll!");
static const u8 sText_AftermathDmg[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt!");
static const u8 sText_AnticipationActivates[] = _("The {B_ATK_NAME_WITH_PREFIX} shuddered\nin anticipation!");
static const u8 sText_AnticipationActivates[] = _("{B_ATK_NAME_WITH_PREFIX} shuddered\nin anticipation!");
static const u8 sText_ForewarnActivates[] = _("{B_ATK_ABILITY} alerted the {B_ATK_NAME_WITH_PREFIX} to the\n{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}!");
static const u8 sText_IceBodyHpGain[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nhealed it a little bit!");
static const u8 sText_SnowWarningHail[] = _("It started to hail!");

View File

@ -2734,7 +2734,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
u32 speciesAtk, speciesDef;
u32 pidAtk, pidDef;
u32 moveType, move;
u32 i;
u32 i, j;
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
return 0;
@ -2864,45 +2864,32 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
}
break;
case ABILITY_ANTICIPATION:
if (!gSpecialStatuses[battler].switchInAbilityDone)
{
bool16 shudders = FALSE;
u8 side = (GetBattlerPosition(battler) ^ BIT_SIDE) & BIT_SIDE; // side of the opposing pokemon
u8 target1 = GetBattlerAtPosition(side);
u8 target2 = GetBattlerAtPosition(side + BIT_FLANK);
if (IsBattlerAlive(target1))
u32 side = GetBattlerSide(battler);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
for(i = 0; i < MAX_MON_MOVES; i++)
if (IsBattlerAlive(i) && side != GetBattlerSide(i))
{
move = gBattleMons[target1].moves[i];
GET_MOVE_TYPE(move, moveType);
if(CalcTypeEffectivenessMultiplier(move, moveType, target1, battler, FALSE) >= UQ_4_12(2.0))
for (j = 0; j < MAX_MON_MOVES; j++)
{
shudders = TRUE;
break;
move = gBattleMons[i].moves[j];
GET_MOVE_TYPE(move, moveType);
if (CalcTypeEffectivenessMultiplier(move, moveType, i, battler, FALSE) >= UQ_4_12(2.0))
{
effect++;
break;
}
}
}
}
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsBattlerAlive(target2))
{
for(i = 0; i < MAX_MON_MOVES; i++)
{
move = gBattleMons[target2].moves[i];
GET_MOVE_TYPE(move, moveType);
if(CalcTypeEffectivenessMultiplier(move, moveType, target2, battler, FALSE) >= UQ_4_12(2.0))
{
shudders = TRUE;
break;
}
}
}
if (!gSpecialStatuses[battler].switchInAbilityDone && shudders)
if (effect)
{
gBattleCommunication[MULTISTRING_CHOOSER] = 5;
gSpecialStatuses[battler].switchInAbilityDone = 1;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++;
}
}
break;

View File

@ -1898,22 +1898,22 @@ static const u8 sDeoxysBaseStats[] =
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
{
// Male classes
FACILITY_CLASS_COOLTRAINER_M,
FACILITY_CLASS_BLACK_BELT,
FACILITY_CLASS_COOLTRAINER_M,
FACILITY_CLASS_BLACK_BELT,
FACILITY_CLASS_CAMPER,
FACILITY_CLASS_YOUNGSTER,
FACILITY_CLASS_PSYCHIC_M,
FACILITY_CLASS_YOUNGSTER,
FACILITY_CLASS_PSYCHIC_M,
FACILITY_CLASS_BUG_CATCHER,
FACILITY_CLASS_PKMN_BREEDER_M,
FACILITY_CLASS_PKMN_BREEDER_M,
FACILITY_CLASS_GUITARIST,
// Female Classes
FACILITY_CLASS_COOLTRAINER_F,
FACILITY_CLASS_HEX_MANIAC,
FACILITY_CLASS_COOLTRAINER_F,
FACILITY_CLASS_HEX_MANIAC,
FACILITY_CLASS_PICNICKER,
FACILITY_CLASS_LASS,
FACILITY_CLASS_PSYCHIC_F,
FACILITY_CLASS_LASS,
FACILITY_CLASS_PSYCHIC_F,
FACILITY_CLASS_BATTLE_GIRL,
FACILITY_CLASS_PKMN_BREEDER_F,
FACILITY_CLASS_PKMN_BREEDER_F,
FACILITY_CLASS_BEAUTY
};