mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Sync src/battle_controllers.c with pokefirered
This commit is contained in:
parent
59f89bde9e
commit
3bc2cf921c
@ -368,7 +368,7 @@ struct BattleStruct
|
||||
u8 faintedActionsState;
|
||||
u8 faintedActionsBattlerId;
|
||||
u16 expValue;
|
||||
u8 field_52;
|
||||
u8 scriptPartyIdx; // for printing the nickname
|
||||
u8 sentInPokes;
|
||||
bool8 selectionScriptFinished[MAX_BATTLERS_COUNT];
|
||||
u8 battlerPartyIndexes[MAX_BATTLERS_COUNT];
|
||||
|
@ -202,9 +202,7 @@ void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data);
|
||||
|
||||
// emitters
|
||||
void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck);
|
||||
void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes); // unused
|
||||
void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 bytes, void *data);
|
||||
void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data); // unused
|
||||
void BtlController_EmitLoadMonSprite(u8 bufferId);
|
||||
void BtlController_EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
|
||||
void BtlController_EmitReturnMonToBall(u8 bufferId, bool8 skipAnim);
|
||||
@ -212,10 +210,7 @@ void BtlController_EmitDrawTrainerPic(u8 bufferId);
|
||||
void BtlController_EmitTrainerSlide(u8 bufferId);
|
||||
void BtlController_EmitTrainerSlideBack(u8 bufferId);
|
||||
void BtlController_EmitFaintAnimation(u8 bufferId);
|
||||
void BtlController_EmitPaletteFade(u8 bufferId); // unused
|
||||
void BtlController_EmitSuccessBallThrowAnim(u8 bufferId); // unused
|
||||
void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId);
|
||||
void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data); // unused
|
||||
void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit);
|
||||
void BtlController_EmitPrintString(u8 bufferId, u16 stringId);
|
||||
void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
|
||||
@ -224,24 +219,15 @@ void BtlController_EmitYesNoBox(u8 bufferId);
|
||||
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
|
||||
void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder);
|
||||
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8 *data);
|
||||
void BtlController_EmitCmd23(u8 bufferId); // unused
|
||||
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
|
||||
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
|
||||
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
|
||||
void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
|
||||
void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused
|
||||
void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data);
|
||||
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
|
||||
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused
|
||||
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data); // unused
|
||||
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u16 ret16);
|
||||
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder);
|
||||
void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret);
|
||||
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret);
|
||||
void BtlController_EmitClearUnkVar(u8 bufferId); // unused
|
||||
void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
|
||||
void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
|
||||
void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused
|
||||
void BtlController_EmitHitAnimation(u8 bufferId);
|
||||
void BtlController_EmitCantSwitch(u8 bufferId);
|
||||
void BtlController_EmitPlaySE(u8 bufferId, u16 songId);
|
||||
|
@ -202,7 +202,7 @@ struct BattleMsgData
|
||||
u16 lastItem;
|
||||
u8 lastAbility;
|
||||
u8 scrActive;
|
||||
u8 unk1605E;
|
||||
u8 bakScriptPartyIdx;
|
||||
u8 hpScale;
|
||||
u8 itemEffectBattler;
|
||||
u8 moveType;
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "recorded_battle.h"
|
||||
#include "task.h"
|
||||
#include "util.h"
|
||||
@ -595,7 +594,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG) == 0)
|
||||
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG))
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
break;
|
||||
@ -606,7 +605,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG) == 0)
|
||||
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG))
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
break;
|
||||
@ -620,7 +619,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES) != SPECIES_NONE // Probably a typo by Game Freak. The rest use SPECIES2.
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG) == 0
|
||||
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG)
|
||||
&& gBattlerPartyIndexes[i - 2] != j)
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
@ -632,7 +631,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG) == 0
|
||||
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG)
|
||||
&& gBattlerPartyIndexes[i - 2] != j)
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
@ -913,7 +912,8 @@ void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
|
||||
// Unused
|
||||
static void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA;
|
||||
sBattleBuffersTransferData[1] = monId;
|
||||
@ -934,7 +934,8 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
|
||||
}
|
||||
|
||||
void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1007,7 +1008,8 @@ void BtlController_EmitFaintAnimation(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE;
|
||||
@ -1016,7 +1018,8 @@ void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
|
||||
@ -1032,7 +1035,8 @@ void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1089,7 +1093,7 @@ void BtlController_EmitPrintString(u8 bufferId, u16 stringID)
|
||||
stringInfo->lastItem = gLastUsedItem;
|
||||
stringInfo->lastAbility = gLastUsedAbility;
|
||||
stringInfo->scrActive = gBattleScripting.battler;
|
||||
stringInfo->unk1605E = gBattleStruct->field_52;
|
||||
stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx;
|
||||
stringInfo->hpScale = gBattleStruct->hpScale;
|
||||
stringInfo->itemEffectBattler = gPotentialItemEffectBattler;
|
||||
stringInfo->moveType = gBattleMoves[gCurrentMove].type;
|
||||
@ -1121,7 +1125,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringID)
|
||||
stringInfo->lastItem = gLastUsedItem;
|
||||
stringInfo->lastAbility = gLastUsedAbility;
|
||||
stringInfo->scrActive = gBattleScripting.battler;
|
||||
stringInfo->unk1605E = gBattleStruct->field_52;
|
||||
stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx;
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
stringInfo->abilities[i] = gBattleMons[i].ability;
|
||||
@ -1191,7 +1195,8 @@ void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abili
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written.
|
||||
}
|
||||
|
||||
void BtlController_EmitCmd23(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitCmd23(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_23;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_23;
|
||||
@ -1245,7 +1250,8 @@ void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6);
|
||||
}
|
||||
|
||||
void BtlController_EmitStatusXor(u8 bufferId, u8 b)
|
||||
// Unused
|
||||
static void BtlController_EmitStatusXor(u8 bufferId, u8 b)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_STATUSXOR;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
@ -1265,7 +1271,8 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1282,7 +1289,7 @@ void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data
|
||||
}
|
||||
|
||||
// Unused
|
||||
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1297,7 +1304,8 @@ void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
|
||||
}
|
||||
|
||||
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -1347,7 +1355,8 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR;
|
||||
@ -1356,14 +1365,16 @@ void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
|
||||
// Unused
|
||||
static void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG;
|
||||
@ -1372,7 +1383,8 @@ void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitToggleUnkFlag(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitToggleUnkFlag(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG;
|
||||
|
@ -2063,7 +2063,7 @@ void BufferStringBattle(u16 stringID)
|
||||
gLastUsedItem = gBattleMsgDataPtr->lastItem;
|
||||
gLastUsedAbility = gBattleMsgDataPtr->lastAbility;
|
||||
gBattleScripting.battler = gBattleMsgDataPtr->scrActive;
|
||||
*(&gBattleStruct->field_52) = gBattleMsgDataPtr->unk1605E;
|
||||
*(&gBattleStruct->scriptPartyIdx) = gBattleMsgDataPtr->bakScriptPartyIdx;
|
||||
*(&gBattleStruct->hpScale) = gBattleMsgDataPtr->hpScale;
|
||||
gPotentialItemEffectBattler = gBattleMsgDataPtr->itemEffectBattler;
|
||||
*(&gBattleStruct->stringMoveType) = gBattleMsgDataPtr->moveType;
|
||||
@ -2713,7 +2713,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
}
|
||||
break;
|
||||
case B_TXT_26: // ?
|
||||
HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->field_52))
|
||||
HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->scriptPartyIdx))
|
||||
break;
|
||||
case B_TXT_PC_CREATOR_NAME: // lanette pc
|
||||
if (FlagGet(FLAG_SYS_PC_LANETTE))
|
||||
|
Loading…
Reference in New Issue
Block a user