mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Applied remaining instances of BATTLE_OPPOSITE and BATTLE_PARTNER
This commit is contained in:
parent
5403cd036e
commit
03498d7240
@ -5,7 +5,7 @@
|
|||||||
#define AI_IS_FASTER 0
|
#define AI_IS_FASTER 0
|
||||||
#define AI_IS_SLOWER 1
|
#define AI_IS_SLOWER 1
|
||||||
|
|
||||||
#define FOE(battler) ((battler ^ BIT_SIDE) & BIT_SIDE)
|
#define FOE(battler) ((BATTLE_OPPOSITE(battler)) & BIT_SIDE)
|
||||||
|
|
||||||
bool32 AI_RandLessThan(u8 val);
|
bool32 AI_RandLessThan(u8 val);
|
||||||
void RecordLastUsedMoveByTarget(void);
|
void RecordLastUsedMoveByTarget(void);
|
||||||
|
@ -486,7 +486,7 @@ static u8 ChooseMoveOrAction_Doubles(void)
|
|||||||
bestMovePointsForTarget[i] = mostViableMovesScores[0];
|
bestMovePointsForTarget[i] = mostViableMovesScores[0];
|
||||||
|
|
||||||
// Don't use a move against ally if it has less than 100 points.
|
// Don't use a move against ally if it has less than 100 points.
|
||||||
if (i == (sBattler_AI ^ BIT_FLANK) && bestMovePointsForTarget[i] < 100)
|
if (i == BATTLE_PARTNER(sBattler_AI) && bestMovePointsForTarget[i] < 100)
|
||||||
{
|
{
|
||||||
bestMovePointsForTarget[i] = -1;
|
bestMovePointsForTarget[i] = -1;
|
||||||
mostViableMovesScores[0] = mostViableMovesScores[0]; // Needed to match.
|
mostViableMovesScores[0] = mostViableMovesScores[0]; // Needed to match.
|
||||||
|
@ -3248,7 +3248,7 @@ s32 CountUsablePartyMons(u8 battlerId)
|
|||||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||||
{
|
{
|
||||||
battlerOnField1 = gBattlerPartyIndexes[battlerId];
|
battlerOnField1 = gBattlerPartyIndexes[battlerId];
|
||||||
battlerOnField2 = gBattlerPartyIndexes[GetBattlerAtPosition(GetBattlerPosition(battlerId) ^ BIT_FLANK)];
|
battlerOnField2 = gBattlerPartyIndexes[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(battlerId)))];
|
||||||
}
|
}
|
||||||
else // In singles there's only one battlerId by side.
|
else // In singles there's only one battlerId by side.
|
||||||
{
|
{
|
||||||
|
@ -6523,7 +6523,7 @@ const struct SpriteTemplate gSoulStealZStarSpriteTemplate =
|
|||||||
//general
|
//general
|
||||||
void AnimTask_IsTargetPartner(u8 taskId)
|
void AnimTask_IsTargetPartner(u8 taskId)
|
||||||
{
|
{
|
||||||
if (gBattleAnimTarget == (gBattleAnimAttacker ^ BIT_FLANK))
|
if (gBattleAnimTarget == BATTLE_PARTNER(gBattleAnimAttacker))
|
||||||
gBattleAnimArgs[0] = 1;
|
gBattleAnimArgs[0] = 1;
|
||||||
else
|
else
|
||||||
gBattleAnimArgs[0] = 0;
|
gBattleAnimArgs[0] = 0;
|
||||||
|
@ -226,7 +226,7 @@ static void Intro_DelayAndEnd(void)
|
|||||||
|
|
||||||
static bool32 TwoIntroMons(u32 battlerId) // Double battle with both player pokemon active.
|
static bool32 TwoIntroMons(u32 battlerId) // Double battle with both player pokemon active.
|
||||||
{
|
{
|
||||||
return (IsDoubleBattle() && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[battlerId ^ BIT_FLANK]]));
|
return (IsDoubleBattle() && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]]));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Intro_WaitForShinyAnimAndHealthbox(void)
|
static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||||
|
@ -2703,7 +2703,7 @@ void BufferStringBattle(u16 stringID)
|
|||||||
{
|
{
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_LEGENDARY)
|
if (gBattleTypeFlags & BATTLE_TYPE_LEGENDARY)
|
||||||
stringPtr = sText_LegendaryPkmnAppeared;
|
stringPtr = sText_LegendaryPkmnAppeared;
|
||||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]])) // interesting, looks like they had something planned for wild double battles
|
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]])) // interesting, looks like they had something planned for wild double battles
|
||||||
stringPtr = sText_TwoWildPkmnAppeared;
|
stringPtr = sText_TwoWildPkmnAppeared;
|
||||||
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
|
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
|
||||||
stringPtr = sText_WildPkmnAppearedPause;
|
stringPtr = sText_WildPkmnAppearedPause;
|
||||||
@ -2714,7 +2714,7 @@ void BufferStringBattle(u16 stringID)
|
|||||||
case STRINGID_INTROSENDOUT: // poke first send-out
|
case STRINGID_INTROSENDOUT: // poke first send-out
|
||||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||||
{
|
{
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsValidForBattle(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]))
|
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsValidForBattle(&gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]))
|
||||||
{
|
{
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
|
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
|
||||||
stringPtr = sText_InGamePartnerSentOutZGoN;
|
stringPtr = sText_InGamePartnerSentOutZGoN;
|
||||||
@ -2732,7 +2732,7 @@ void BufferStringBattle(u16 stringID)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]))
|
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]))
|
||||||
{
|
{
|
||||||
if (BATTLE_TWO_VS_ONE_OPPONENT)
|
if (BATTLE_TWO_VS_ONE_OPPONENT)
|
||||||
stringPtr = sText_Trainer1SentOutTwoPkmn;
|
stringPtr = sText_Trainer1SentOutTwoPkmn;
|
||||||
|
@ -10730,7 +10730,7 @@ static void Cmd_forcerandomswitch(void)
|
|||||||
monsCount = 6;
|
monsCount = 6;
|
||||||
minNeeded = 2;
|
minNeeded = 2;
|
||||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||||
battler1PartyId = gBattlerPartyIndexes[gBattlerTarget ^ BIT_FLANK];
|
battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)];
|
||||||
}
|
}
|
||||||
else if ((gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_LINK)
|
else if ((gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||||
|| (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
|
|| (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
|
||||||
|
@ -5817,7 +5817,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||||||
{
|
{
|
||||||
if (gBattleMons[i].ability == ABILITY_TRACE && (gBattleResources->flags->flags[i] & RESOURCE_FLAG_TRACED))
|
if (gBattleMons[i].ability == ABILITY_TRACE && (gBattleResources->flags->flags[i] & RESOURCE_FLAG_TRACED))
|
||||||
{
|
{
|
||||||
u8 side = (GetBattlerPosition(i) ^ BIT_SIDE) & BIT_SIDE; // side of the opposing pokemon
|
u8 side = (BATTLE_OPPOSITE(GetBattlerPosition(i))) & BIT_SIDE; // side of the opposing pokemon
|
||||||
u8 target1 = GetBattlerAtPosition(side);
|
u8 target1 = GetBattlerAtPosition(side);
|
||||||
u8 target2 = GetBattlerAtPosition(side + BIT_FLANK);
|
u8 target2 = GetBattlerAtPosition(side + BIT_FLANK);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user