merge with master, fix conflicts
This commit is contained in:
@@ -204,9 +204,6 @@ extern const u8 BattleScript_ActionSwitch[];
|
||||
extern const u8 BattleScript_PrintFailedToRunString[];
|
||||
|
||||
// functions
|
||||
extern void HandleLinkBattleSetup(void); // rom_3
|
||||
extern void SetUpBattleVarsAndBirchZigzagoon(void); // rom_3
|
||||
extern void sub_8032768(void); // rom_3
|
||||
extern void dp12_8087EA4(void);
|
||||
extern void sub_80356D0(void);
|
||||
extern void GetFrontierTrainerName(u8* dst, u16 trainerId); // battle tower
|
||||
@@ -4083,7 +4080,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
if (gBattleMons[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)].status2 & STATUS2_MULTIPLETURNS
|
||||
|| gBattleMons[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)].status2 & STATUS2_RECHARGE)
|
||||
{
|
||||
Emit_x32(0);
|
||||
EmitCmd50(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
return;
|
||||
}
|
||||
@@ -4111,7 +4108,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
{
|
||||
RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON), 3);
|
||||
}
|
||||
Emit_x32(0);
|
||||
EmitCmd50(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ static bool8 ShouldSwitchIfPerishSong(void)
|
||||
&& gDisableStructs[gActiveBank].perishSong1 == 0)
|
||||
{
|
||||
*(gBattleStruct->field_294 + gActiveBank) = 6;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
|
||||
{
|
||||
// we found a mon
|
||||
*(gBattleStruct->field_294 + gActiveBank) = i;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
|
||||
{
|
||||
// we found a mon
|
||||
*(gBattleStruct->field_294 + gActiveBank) = i;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -241,13 +241,13 @@ static bool8 ShouldSwitchIfNaturalCure(void)
|
||||
if ((gUnknown_02024250[gActiveBank] == 0 || gUnknown_02024250[gActiveBank] == 0xFFFF) && Random() & 1)
|
||||
{
|
||||
*(gBattleStruct->field_294 + gActiveBank) = 6;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
else if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0 && Random() & 1)
|
||||
{
|
||||
*(gBattleStruct->field_294 + gActiveBank) = 6;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ static bool8 ShouldSwitchIfNaturalCure(void)
|
||||
if (Random() & 1)
|
||||
{
|
||||
*(gBattleStruct->field_294 + gActiveBank) = 6;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
|
||||
if (moveFlags & MOVESTATUS_SUPEREFFECTIVE && Random() % moduloPercent == 0)
|
||||
{
|
||||
*(gBattleStruct->field_294 + gActiveBank) = i;
|
||||
EmitCmd_x21(1, 2, 0);
|
||||
EmitCmd33(1, 2, 0);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -611,7 +611,7 @@ void AI_TrySwitchOrUseItem(void)
|
||||
}
|
||||
}
|
||||
|
||||
EmitCmd_x21(1, 0, (gActiveBank ^ BIT_SIDE) << 8);
|
||||
EmitCmd33(1, 0, (gActiveBank ^ BIT_SIDE) << 8);
|
||||
}
|
||||
|
||||
#define TYPE_FORESIGHT 0xFE
|
||||
@@ -940,7 +940,7 @@ static bool8 ShouldUseItem(void)
|
||||
|
||||
if (shouldUse)
|
||||
{
|
||||
EmitCmd_x21(1, 1, 0);
|
||||
EmitCmd33(1, 1, 0);
|
||||
*(gBattleStruct->field_C0 + (gActiveBank / 2) * 2) = item;
|
||||
gBattleResources->battleHistory->trainerItems[i] = 0;
|
||||
return shouldUse;
|
||||
|
||||
1850
src/battle_anim.c
Normal file
1850
src/battle_anim.c
Normal file
File diff suppressed because it is too large
Load Diff
1551
src/battle_controllers.c
Normal file
1551
src/battle_controllers.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -349,7 +349,7 @@ static void atk51_switch_handle_order(void);
|
||||
static void atk52_switch_in_effects(void);
|
||||
static void atk53_trainer_slide(void);
|
||||
static void atk54_effectiveness_sound(void);
|
||||
static void atk55_play_sound(void);
|
||||
static void atk55_play_fanfare(void);
|
||||
static void atk56_fainting_cry(void);
|
||||
static void atk57(void);
|
||||
static void atk58_return_to_ball(void);
|
||||
@@ -601,7 +601,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
atk52_switch_in_effects,
|
||||
atk53_trainer_slide,
|
||||
atk54_effectiveness_sound,
|
||||
atk55_play_sound,
|
||||
atk55_play_fanfare,
|
||||
atk56_fainting_cry,
|
||||
atk57,
|
||||
atk58_return_to_ball,
|
||||
@@ -5308,7 +5308,7 @@ static void atk4B_return_atk_to_ball(void)
|
||||
gActiveBank = gBankAttacker;
|
||||
if (!(gHitMarker & HITMARKER_FAINTED(gActiveBank)))
|
||||
{
|
||||
EmitReturnPokeToBall(0, 0);
|
||||
EmitReturnMonToBall(0, 0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
gBattlescriptCurrInstr++;
|
||||
@@ -5627,7 +5627,7 @@ static void atk50_openpartyscreen(void)
|
||||
{
|
||||
gAbsentBankFlags |= gBitTable[gActiveBank];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBank));
|
||||
Emit_x2A(0);
|
||||
EmitCmd42(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
else if (!gSpecialStatuses[gActiveBank].flag40)
|
||||
@@ -5649,7 +5649,7 @@ static void atk50_openpartyscreen(void)
|
||||
{
|
||||
gAbsentBankFlags |= gBitTable[gActiveBank];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBank));
|
||||
Emit_x2A(0);
|
||||
EmitCmd42(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
else if (!gSpecialStatuses[gActiveBank].flag40)
|
||||
@@ -5670,7 +5670,7 @@ static void atk50_openpartyscreen(void)
|
||||
{
|
||||
gAbsentBankFlags |= gBitTable[gActiveBank];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBank));
|
||||
Emit_x2A(0);
|
||||
EmitCmd42(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
else if (!gSpecialStatuses[gActiveBank].flag40)
|
||||
@@ -5692,7 +5692,7 @@ static void atk50_openpartyscreen(void)
|
||||
{
|
||||
gAbsentBankFlags |= gBitTable[gActiveBank];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBank));
|
||||
Emit_x2A(0);
|
||||
EmitCmd42(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
else if (!gSpecialStatuses[gActiveBank].flag40)
|
||||
@@ -5755,7 +5755,7 @@ static void atk50_openpartyscreen(void)
|
||||
{
|
||||
gAbsentBankFlags |= gBitTable[gActiveBank];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBank));
|
||||
Emit_x2A(0);
|
||||
EmitCmd42(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
else if (!gSpecialStatuses[gActiveBank].flag40)
|
||||
@@ -5771,7 +5771,7 @@ static void atk50_openpartyscreen(void)
|
||||
{
|
||||
gAbsentBankFlags |= gBitTable[gActiveBank];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBank));
|
||||
Emit_x2A(0);
|
||||
EmitCmd42(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
else if (!gSpecialStatuses[gActiveBank].flag40)
|
||||
@@ -6031,10 +6031,10 @@ static void atk54_effectiveness_sound(void)
|
||||
gBattlescriptCurrInstr += 3;
|
||||
}
|
||||
|
||||
static void atk55_play_sound(void)
|
||||
static void atk55_play_fanfare(void)
|
||||
{
|
||||
gActiveBank = gBankAttacker;
|
||||
EmitPlaySound(0, BS2ScriptRead16(gBattlescriptCurrInstr + 1), 0);
|
||||
EmitPlayFanfareOrBGM(0, BS2ScriptRead16(gBattlescriptCurrInstr + 1), FALSE);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
@@ -6052,7 +6052,7 @@ static void atk56_fainting_cry(void)
|
||||
static void atk57(void)
|
||||
{
|
||||
gActiveBank = GetBankByIdentity(0);
|
||||
Emit_x37(0, gBattleOutcome);
|
||||
EmitCmd55(0, gBattleOutcome);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
|
||||
gBattlescriptCurrInstr += 1;
|
||||
@@ -6061,7 +6061,7 @@ static void atk57(void)
|
||||
static void atk58_return_to_ball(void)
|
||||
{
|
||||
gActiveBank = GetBattleBank(gBattlescriptCurrInstr[1]);
|
||||
EmitReturnPokeToBall(0, 1);
|
||||
EmitReturnMonToBall(0, 1);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
|
||||
gBattlescriptCurrInstr += 2;
|
||||
@@ -7137,7 +7137,7 @@ static void atk76_various(void)
|
||||
gDisableStructs[1].truantUnknownBit = 1;
|
||||
break;
|
||||
case 13:
|
||||
EmitCmd13(0);
|
||||
EmitCmd19(0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
break;
|
||||
case 14:
|
||||
@@ -7162,7 +7162,7 @@ static void atk76_various(void)
|
||||
gActiveBank = 1;
|
||||
if (gBattleMons[gActiveBank].hp != 0)
|
||||
{
|
||||
EmitReturnPokeToBall(0, 0);
|
||||
EmitReturnMonToBall(0, 0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
break;
|
||||
@@ -7172,7 +7172,7 @@ static void atk76_various(void)
|
||||
gActiveBank = 3;
|
||||
if (gBattleMons[gActiveBank].hp != 0)
|
||||
{
|
||||
EmitReturnPokeToBall(0, 0);
|
||||
EmitReturnMonToBall(0, 0);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
}
|
||||
}
|
||||
@@ -7197,7 +7197,7 @@ static void atk76_various(void)
|
||||
gBattleOutcome = BATTLE_OPPONENT_TELEPORTED;
|
||||
break;
|
||||
case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC:
|
||||
EmitPlaySound(0, BGM_KACHI1, 1);
|
||||
EmitPlayFanfareOrBGM(0, BGM_KACHI1, TRUE);
|
||||
MarkBufferBankForExecution(gActiveBank);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ u32 sub_8034974(void* ptr)
|
||||
return (ptr_[3] << 16) | (ptr_[2] << 8) | (ptr_[1]);
|
||||
}
|
||||
|
||||
bool8 LoadCompressedObjectPicUsingHeap(struct CompressedSpriteSheet* src)
|
||||
bool8 LoadCompressedObjectPicUsingHeap(const struct CompressedSpriteSheet* src)
|
||||
{
|
||||
struct SpriteSheet dest;
|
||||
void* buffer;
|
||||
|
||||
@@ -462,7 +462,7 @@ static void VBlankCB_EggHatch(void)
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
static void EggHatch(void)
|
||||
void EggHatch(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
CreateTask(Task_EggHatch, 10);
|
||||
|
||||
@@ -139,7 +139,7 @@ static void ClearAllPokeblockFeeders(void)
|
||||
memset(sPokeblockFeeders, 0, sizeof(sPokeblockFeeders));
|
||||
}
|
||||
|
||||
static void GetPokeblockFeederInFront(void)
|
||||
void GetPokeblockFeederInFront(void)
|
||||
{
|
||||
s16 x, y;
|
||||
u16 i;
|
||||
|
||||
@@ -594,7 +594,7 @@ u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y,
|
||||
return index;
|
||||
}
|
||||
|
||||
u8 CreateSpriteAndAnimate(struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority)
|
||||
u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user