Merge with master

This commit is contained in:
DizzyEggg 2018-09-22 00:22:13 +02:00
commit a69af8f2f5
33 changed files with 982 additions and 599 deletions

View File

@ -7327,8 +7327,8 @@ _081A36C2:
bx r1
thumb_func_end sub_81A3610
thumb_func_start sub_81A36D0
sub_81A36D0: @ 81A36D0
thumb_func_start CopyFrontierTrainerText
CopyFrontierTrainerText: @ 81A36D0
push {lr}
lsls r0, 24
lsrs r0, 24
@ -7561,7 +7561,7 @@ _081A38F8:
pop {r0}
bx r0
.pool
thumb_func_end sub_81A36D0
thumb_func_end CopyFrontierTrainerText
thumb_func_start sub_81A3908
sub_81A3908: @ 81A3908

View File

@ -28077,8 +28077,8 @@ sub_81D5520: @ 81D5520
.pool
thumb_func_end sub_81D5520
thumb_func_start sub_81D5530
sub_81D5530: @ 81D5530
thumb_func_start GetTrainerHillOpponentClass
GetTrainerHillOpponentClass: @ 81D5530
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@ -28094,10 +28094,10 @@ sub_81D5530: @ 81D5530
ldrb r0, [r0]
bx lr
.pool
thumb_func_end sub_81D5530
thumb_func_end GetTrainerHillOpponentClass
thumb_func_start sub_81D5554
sub_81D5554: @ 81D5554
thumb_func_start GetTrainerHillTrainerName
GetTrainerHillTrainerName: @ 81D5554
push {r4,lr}
adds r4, r0, 0
lsls r1, 24
@ -28123,10 +28123,10 @@ _081D556E:
pop {r0}
bx r0
.pool
thumb_func_end sub_81D5554
thumb_func_end GetTrainerHillTrainerName
thumb_func_start sub_81D5588
sub_81D5588: @ 81D5588
thumb_func_start GetTrainerHillTrainerFrontSpriteId
GetTrainerHillTrainerFrontSpriteId: @ 81D5588
push {r4,lr}
adds r4, r0, 0
lsls r4, 16
@ -28158,7 +28158,7 @@ sub_81D5588: @ 81D5588
pop {r1}
bx r1
.pool
thumb_func_end sub_81D5588
thumb_func_end GetTrainerHillTrainerFrontSpriteId
thumb_func_start sub_81D55D0
sub_81D55D0: @ 81D55D0
@ -28322,8 +28322,8 @@ _081D5722:
.pool
thumb_func_end sub_81D5710
thumb_func_start sub_81D572C
sub_81D572C: @ 81D572C
thumb_func_start CopyTrainerHillTrainerText
CopyTrainerHillTrainerText: @ 81D572C
push {r4-r6,lr}
adds r4, r1, 0
lsls r0, 24
@ -28439,7 +28439,7 @@ _081D580E:
pop {r0}
bx r0
.pool
thumb_func_end sub_81D572C
thumb_func_end CopyTrainerHillTrainerText
thumb_func_start sub_81D581C
sub_81D581C: @ 81D581C
@ -29702,7 +29702,7 @@ sub_81D62B4: @ 81D62B4
ldr r0, =gSpecialVar_LastTalked
ldrh r1, [r0]
movs r0, 0x5
bl sub_81D572C
bl CopyTrainerHillTrainerText
bl sub_80982B8
pop {r0}
bx r0

View File

@ -360,7 +360,7 @@ B_ATK_NAME_WITH_PREFIX_MON1 = FD 0D
B_ATK_PARTNER_NAME = FD 0E
B_ATK_NAME_WITH_PREFIX = FD 0F
B_DEF_NAME_WITH_PREFIX = FD 10
B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBank
B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBattler
B_ACTIVE_NAME_WITH_PREFIX = FD 12
B_SCR_ACTIVE_NAME_WITH_PREFIX = FD 13
B_CURRENT_MOVE = FD 14
@ -373,11 +373,11 @@ B_SCR_ACTIVE_ABILITY = FD 1A
B_EFF_ABILITY = FD 1B
B_TRAINER1_CLASS = FD 1C
B_TRAINER1_NAME = FD 1D
B_1E = FD 1E @ trainer name for a link player
B_1F = FD 1F @ trainer name for a link player
B_20 = FD 20 @ trainer name for a link player
B_21 = FD 21 @ trainer name for a link player
B_22 = FD 22 @ trainer name for a link player
B_LINK_PLAYER_NAME = FD 1E
B_LINK_PARTNER_NAME = FD 1F
B_LINK_OPPONENT1_NAME = FD 20
B_LINK_OPPONENT2_NAME = FD 21
B_LINK_SCR_TRAINER_NAME = FD 22
B_PLAYER_NAME = FD 23
B_TRAINER1_LOSE_TEXT = FD 24
B_TRAINER1_WIN_TEXT = FD 25

View File

@ -3679,7 +3679,7 @@ BattleScript_PayDayMoneyAndPickUpItems::
BattleScript_LocalBattleLost::
jumpifbattletype BATTLE_TYPE_DOME, BattleScript_CheckDomeDrew
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_LocalBattleLostPrintTrainersWinText
jumpifbattletype BATTLE_TYPE_x4000000, BattleScript_LocalBattleLostPrintTrainersWinText
jumpifbattletype BATTLE_TYPE_TRAINER_HILL, BattleScript_LocalBattleLostPrintTrainersWinText
jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_LocalBattleLostEnd
jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, 0x400, BattleScript_LocalBattleLostEnd
BattleScript_LocalBattleLostPrintWhiteOut::

View File

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

View File

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

View File

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

View File

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 296 B

View File

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 336 B

View File

@ -1,6 +1,11 @@
#ifndef GUARD_BATTLE_FRONTIER_2_H
#define GUARD_BATTLE_FRONTIER_2_H
#define FRONTIER_BEFORE_TEXT 0
#define FRONTIER_WIN_TEXT 1
#define FRONTIER_LOSE_TEXT 2
void CopyFrontierTrainerText(u8 whichText, u16 trainerId);
void sub_81A8934(u8);
void sub_81A895C(void);
u16 sub_81A89A0(u8);

View File

@ -34,11 +34,11 @@
#define B_TXT_EFF_ABILITY 0x1B
#define B_TXT_TRAINER1_CLASS 0x1C
#define B_TXT_TRAINER1_NAME 0x1D
#define B_TXT_1E 0x1E // trainer name for a link player
#define B_TXT_1F 0x1F // trainer name for a link player
#define B_TXT_20 0x20 // trainer name for a link player
#define B_TXT_21 0x21 // trainer name for a link player
#define B_TXT_22 0x22 // trainer name for a link player
#define B_TXT_LINK_PLAYER_NAME 0x1E
#define B_TXT_LINK_PARTNER_NAME 0x1F
#define B_TXT_LINK_OPPONENT1_NAME 0x20
#define B_TXT_LINK_OPPONENT2_NAME 0x21
#define B_TXT_LINK_SCR_TRAINER_NAME 0x22
#define B_TXT_PLAYER_NAME 0x23
#define B_TXT_TRAINER1_LOSE_TEXT 0x24
#define B_TXT_TRAINER1_WIN_TEXT 0x25

View File

@ -46,7 +46,7 @@
// Battle Type Flags
#define BATTLE_TYPE_DOUBLE 0x0001
#define BATTLE_TYPE_LINK 0x0002
#define BATTLE_TYPE_WILD 0x0004
#define BATTLE_TYPE_IS_MASTER 0x0004 // In not-link battles, it's always set.
#define BATTLE_TYPE_TRAINER 0x0008
#define BATTLE_TYPE_FIRST_BATTLE 0x0010
#define BATTLE_TYPE_20 0x0020
@ -70,7 +70,7 @@
#define BATTLE_TYPE_x800000 0x800000
#define BATTLE_TYPE_RECORDED 0x1000000
#define BATTLE_TYPE_x2000000 0x2000000
#define BATTLE_TYPE_x4000000 0x4000000
#define BATTLE_TYPE_TRAINER_HILL 0x4000000
#define BATTLE_TYPE_SECRET_BASE 0x8000000
#define BATTLE_TYPE_GROUDON 0x10000000
#define BATTLE_TYPE_KYOGRE 0x20000000

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,18 +1,393 @@
KeySplitTable_86B4698:: @ 86B4698
@ This is weird. There are instruments at the beginning of the keysplit table.
voice_square_1 0, 2, 0, 0, 15, 0 @ 86B4698
voice_directsound_no_resample 64, 104, DirectSoundWaveData_86DD11C, 255, 0, 255, 0 @ 86B46A4
voice_directsound 63, 64, DirectSoundWaveData_86DE6C0, 255, 0, 255, 0 @ 86B46B0
.incbin "sound/key_split_tables/86B46BC.bin"
@ Due to the way mks4agb (Nintendo's tool) works, key split table labels can
@ appear before the actual start of the key split table data. If you look at
@ the first keysplit table (KeySplitTable1), you'll notice it's offset backwards
@ by 36 bytes. This is because the key split tables don't map instruments
@ for the entire note range (0-127)--they only map subsets, and the upper
@ and lower ranges aren't necessarily 0 or 127.
@
@ For example if a key split table maps an note range of 10-20, then the key
@ split table label will be offset 10 bytes before the actual key split data
@ begins. Therefore, the notes naturally map to the key split table without
@ any extra offset calculation.
KeySplitTable_86B46E0:: @ 86B46E0
.incbin "sound/key_split_tables/86B46E0.bin"
.set KeySplitTable1, . - 36
.byte 0 @ 36
.byte 0 @ 37
.byte 0 @ 38
.byte 0 @ 39
.byte 0 @ 40
.byte 0 @ 41
.byte 0 @ 42
.byte 0 @ 43
.byte 0 @ 44
.byte 0 @ 45
.byte 0 @ 46
.byte 0 @ 47
.byte 0 @ 48
.byte 0 @ 49
.byte 0 @ 50
.byte 0 @ 51
.byte 0 @ 52
.byte 0 @ 53
.byte 0 @ 54
.byte 1 @ 55
.byte 1 @ 56
.byte 1 @ 57
.byte 1 @ 58
.byte 1 @ 59
.byte 1 @ 60
.byte 1 @ 61
.byte 1 @ 62
.byte 1 @ 63
.byte 1 @ 64
.byte 1 @ 65
.byte 1 @ 66
.byte 1 @ 67
.byte 1 @ 68
.byte 1 @ 69
.byte 2 @ 70
.byte 2 @ 71
.byte 2 @ 72
.byte 2 @ 73
.byte 2 @ 74
.byte 2 @ 75
.byte 2 @ 76
.byte 2 @ 77
.byte 2 @ 78
.byte 2 @ 79
.byte 2 @ 80
.byte 2 @ 81
.byte 2 @ 82
.byte 2 @ 83
.byte 2 @ 84
.byte 2 @ 85
.byte 2 @ 86
.byte 2 @ 87
.byte 2 @ 88
.byte 2 @ 89
.byte 2 @ 90
.byte 3 @ 91
.byte 3 @ 92
.byte 3 @ 93
.byte 3 @ 94
.byte 3 @ 95
.byte 3 @ 96
.byte 3 @ 97
.byte 3 @ 98
.byte 3 @ 99
.byte 3 @ 100
.byte 3 @ 101
.byte 3 @ 102
.byte 3 @ 103
.byte 3 @ 104
.byte 3 @ 105
.byte 3 @ 106
.byte 3 @ 107
KeySplitTable_86B4728:: @ 86B4728
.incbin "sound/key_split_tables/86B4728.bin"
.set KeySplitTable2, . - 36
.byte 0 @ 36
.byte 0 @ 37
.byte 0 @ 38
.byte 0 @ 39
.byte 0 @ 40
.byte 0 @ 41
.byte 0 @ 42
.byte 0 @ 43
.byte 0 @ 44
.byte 0 @ 45
.byte 0 @ 46
.byte 0 @ 47
.byte 0 @ 48
.byte 0 @ 49
.byte 0 @ 50
.byte 0 @ 51
.byte 0 @ 52
.byte 0 @ 53
.byte 0 @ 54
.byte 0 @ 55
.byte 0 @ 56
.byte 0 @ 57
.byte 0 @ 58
.byte 0 @ 59
.byte 0 @ 60
.byte 0 @ 61
.byte 0 @ 62
.byte 0 @ 63
.byte 0 @ 64
.byte 0 @ 65
.byte 0 @ 66
.byte 0 @ 67
.byte 0 @ 68
.byte 1 @ 69
.byte 1 @ 70
.byte 1 @ 71
.byte 1 @ 72
.byte 1 @ 73
.byte 1 @ 74
.byte 1 @ 75
.byte 1 @ 76
.byte 1 @ 77
.byte 1 @ 78
.byte 1 @ 79
.byte 1 @ 80
.byte 2 @ 81
.byte 2 @ 82
.byte 2 @ 83
.byte 2 @ 84
.byte 2 @ 85
.byte 2 @ 86
.byte 2 @ 87
.byte 2 @ 88
.byte 2 @ 89
.byte 2 @ 90
.byte 2 @ 91
.byte 2 @ 92
.byte 2 @ 93
.byte 2 @ 94
.byte 2 @ 95
.byte 2 @ 96
.byte 2 @ 97
.byte 2 @ 98
.byte 2 @ 99
.byte 2 @ 100
.byte 2 @ 101
.byte 2 @ 102
.byte 2 @ 103
.byte 2 @ 104
.byte 2 @ 105
.byte 2 @ 106
.byte 2 @ 107
KeySplitTable_86B477C:: @ 86B477C
.incbin "sound/key_split_tables/86B477C.bin"
.set KeySplitTable3, . - 36
.byte 0 @ 36
.byte 0 @ 37
.byte 0 @ 38
.byte 0 @ 39
.byte 0 @ 40
.byte 0 @ 41
.byte 0 @ 42
.byte 0 @ 43
.byte 0 @ 44
.byte 0 @ 45
.byte 0 @ 46
.byte 0 @ 47
.byte 0 @ 48
.byte 0 @ 49
.byte 0 @ 50
.byte 0 @ 51
.byte 0 @ 52
.byte 0 @ 53
.byte 0 @ 54
.byte 0 @ 55
.byte 0 @ 56
.byte 0 @ 57
.byte 0 @ 58
.byte 0 @ 59
.byte 0 @ 60
.byte 0 @ 61
.byte 0 @ 62
.byte 0 @ 63
.byte 0 @ 64
.byte 0 @ 65
.byte 1 @ 66
.byte 1 @ 67
.byte 1 @ 68
.byte 1 @ 69
.byte 1 @ 70
.byte 1 @ 71
.byte 1 @ 72
.byte 1 @ 73
.byte 1 @ 74
.byte 1 @ 75
.byte 1 @ 76
.byte 1 @ 77
.byte 1 @ 78
.byte 1 @ 79
.byte 1 @ 80
.byte 1 @ 81
.byte 1 @ 82
.byte 1 @ 83
.byte 2 @ 84
.byte 2 @ 85
.byte 2 @ 86
.byte 2 @ 87
.byte 2 @ 88
.byte 2 @ 89
.byte 2 @ 90
.byte 2 @ 91
.byte 2 @ 92
.byte 2 @ 93
.byte 2 @ 94
.byte 2 @ 95
.byte 2 @ 96
.byte 2 @ 97
.byte 2 @ 98
.byte 2 @ 99
.byte 2 @ 100
.byte 2 @ 101
.byte 2 @ 102
.byte 2 @ 103
.byte 2 @ 104
.byte 2 @ 105
.byte 2 @ 106
.byte 2 @ 107
KeySplitTable_86B47C4:: @ 86B47C4
.incbin "sound/key_split_tables/86B47C4.bin"
.set KeySplitTable4, . - 24
.byte 0 @ 24
.byte 0 @ 25
.byte 0 @ 26
.byte 0 @ 27
.byte 0 @ 28
.byte 0 @ 29
.byte 0 @ 30
.byte 0 @ 31
.byte 0 @ 32
.byte 0 @ 33
.byte 0 @ 34
.byte 0 @ 35
.byte 0 @ 36
.byte 0 @ 37
.byte 0 @ 38
.byte 0 @ 39
.byte 0 @ 40
.byte 0 @ 41
.byte 1 @ 42
.byte 1 @ 43
.byte 1 @ 44
.byte 1 @ 45
.byte 1 @ 46
.byte 1 @ 47
.byte 1 @ 48
.byte 1 @ 49
.byte 1 @ 50
.byte 1 @ 51
.byte 1 @ 52
.byte 1 @ 53
.byte 1 @ 54
.byte 1 @ 55
.byte 1 @ 56
.byte 1 @ 57
.byte 1 @ 58
.byte 1 @ 59
.byte 1 @ 60
.byte 1 @ 61
.byte 1 @ 62
.byte 1 @ 63
.byte 1 @ 64
.byte 1 @ 65
.byte 1 @ 66
.byte 1 @ 67
.byte 1 @ 68
.byte 1 @ 69
.byte 1 @ 70
.byte 1 @ 71
.byte 1 @ 72
.byte 1 @ 73
.byte 1 @ 74
.byte 1 @ 75
.byte 1 @ 76
.byte 1 @ 77
.byte 1 @ 78
.byte 1 @ 79
.byte 1 @ 80
.byte 1 @ 81
.byte 1 @ 82
.byte 1 @ 83
.byte 1 @ 84
.byte 1 @ 85
.byte 1 @ 86
.byte 1 @ 87
.byte 1 @ 88
.byte 1 @ 89
.byte 1 @ 90
.byte 1 @ 91
.byte 1 @ 92
.byte 1 @ 93
.byte 1 @ 94
.byte 1 @ 95
.byte 1 @ 96
.byte 1 @ 97
.byte 1 @ 98
.byte 1 @ 99
.byte 1 @ 100
.byte 1 @ 101
.byte 1 @ 102
.byte 1 @ 103
.byte 1 @ 104
.byte 1 @ 105
.byte 1 @ 106
.byte 1 @ 107
.set KeySplitTable5, . - 36
.byte 0 @ 36
.byte 0 @ 37
.byte 0 @ 38
.byte 0 @ 39
.byte 0 @ 40
.byte 0 @ 41
.byte 0 @ 42
.byte 0 @ 43
.byte 0 @ 44
.byte 0 @ 45
.byte 0 @ 46
.byte 0 @ 47
.byte 0 @ 48
.byte 0 @ 49
.byte 0 @ 50
.byte 0 @ 51
.byte 0 @ 52
.byte 0 @ 53
.byte 0 @ 54
.byte 0 @ 55
.byte 0 @ 56
.byte 0 @ 57
.byte 0 @ 58
.byte 0 @ 59
.byte 0 @ 60
.byte 0 @ 61
.byte 0 @ 62
.byte 0 @ 63
.byte 0 @ 64
.byte 0 @ 65
.byte 1 @ 66
.byte 1 @ 67
.byte 1 @ 68
.byte 1 @ 69
.byte 1 @ 70
.byte 1 @ 71
.byte 1 @ 72
.byte 1 @ 73
.byte 1 @ 74
.byte 1 @ 75
.byte 1 @ 76
.byte 1 @ 77
.byte 1 @ 78
.byte 1 @ 79
.byte 1 @ 80
.byte 1 @ 81
.byte 1 @ 82
.byte 1 @ 83
.byte 1 @ 84
.byte 1 @ 85
.byte 1 @ 86
.byte 1 @ 87
.byte 1 @ 88
.byte 1 @ 89
.byte 1 @ 90
.byte 1 @ 91
.byte 1 @ 92
.byte 1 @ 93
.byte 1 @ 94
.byte 1 @ 95
.byte 1 @ 96
.byte 1 @ 97
.byte 1 @ 98
.byte 1 @ 99
.byte 1 @ 100
.byte 1 @ 101
.byte 1 @ 102
.byte 1 @ 103
.byte 1 @ 104
.byte 1 @ 105
.byte 1 @ 106
.byte 1 @ 107

File diff suppressed because it is too large Load Diff

View File

@ -380,7 +380,7 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves)
AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_FIRST_BATTLE;
else if (gBattleTypeFlags & BATTLE_TYPE_FACTORY)
AI_THINKING_STRUCT->aiFlags = GetAiScriptsInBattleFactory();
else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_x4000000 | BATTLE_TYPE_SECRET_BASE))
else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_SECRET_BASE))
AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_TRY_TO_FAINT;
else if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags | gTrainers[gTrainerBattleOpponent_B].aiFlags;

View File

@ -40,7 +40,7 @@ extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon);
extern void sub_81A57E4(u8 battlerId, u16 stringId);
extern u8 GetFrontierBrainTrainerPicIndex(void);
extern u8 sub_81D5588(u16 trainerId);
extern u8 GetTrainerHillTrainerFrontSpriteId(u16 trainerId);
extern u8 GetFrontierTrainerFrontSpriteId(u16 trainerId);
extern u8 GetEreaderTrainerFrontSpriteId(void);
@ -1238,18 +1238,18 @@ static void OpponentHandleDrawTrainerPic(void)
{
trainerPicId = GetFrontierBrainTrainerPicIndex();
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
{
if (gActiveBattler == 1)
trainerPicId = sub_81D5588(gTrainerBattleOpponent_A);
trainerPicId = GetTrainerHillTrainerFrontSpriteId(gTrainerBattleOpponent_A);
else
trainerPicId = sub_81D5588(gTrainerBattleOpponent_B);
trainerPicId = GetTrainerHillTrainerFrontSpriteId(gTrainerBattleOpponent_B);
}
else
{
trainerPicId = sub_81D5588(gTrainerBattleOpponent_A);
trainerPicId = GetTrainerHillTrainerFrontSpriteId(gTrainerBattleOpponent_A);
}
}
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
@ -1322,18 +1322,18 @@ static void OpponentHandleTrainerSlide(void)
{
trainerPicId = GetFrontierBrainTrainerPicIndex();
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
{
if (gActiveBattler == 1)
trainerPicId = sub_81D5588(gTrainerBattleOpponent_A);
trainerPicId = GetTrainerHillTrainerFrontSpriteId(gTrainerBattleOpponent_A);
else
trainerPicId = sub_81D5588(gTrainerBattleOpponent_B);
trainerPicId = GetTrainerHillTrainerFrontSpriteId(gTrainerBattleOpponent_B);
}
else
{
trainerPicId = sub_81D5588(gTrainerBattleOpponent_A);
trainerPicId = GetTrainerHillTrainerFrontSpriteId(gTrainerBattleOpponent_A);
}
}
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
@ -2002,7 +2002,7 @@ static void OpponentHandleResetActionMoveSelection(void)
static void OpponentHandleCmd55(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_WILD))
if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
{
gMain.inBattle = 0;
gMain.callback1 = gPreBattleCallback1;

View File

@ -689,7 +689,7 @@ static void SafariHandleCmd55(void)
FadeOutMapMusic(5);
BeginFastPaletteFade(3);
SafariBufferExecCompleted();
if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && !(gBattleTypeFlags & BATTLE_TYPE_WILD))
if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
gBattlerControllerFuncs[gActiveBattler] = sub_81595E4;
}

View File

@ -1562,7 +1562,7 @@ static void WallyHandleCmd55(void)
BeginFastPaletteFade(3);
WallyBufferExecCompleted();
if (!(gBattleTypeFlags & BATTLE_TYPE_WILD) && gBattleTypeFlags & BATTLE_TYPE_LINK)
if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) && gBattleTypeFlags & BATTLE_TYPE_LINK)
gBattlerControllerFuncs[gActiveBattler] = sub_80587B0;
}

View File

@ -330,7 +330,7 @@ static void InitSinglePlayerBtlControllers(void)
}
}
}
else if (gBattleTypeFlags & BATTLE_TYPE_WILD)
else if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)
{
gBattlerControllerFuncs[0] = SetControllerToRecordedPlayer;
gBattlerPositions[0] = B_POSITION_PLAYER_LEFT;
@ -391,7 +391,7 @@ static void InitLinkBtlControllers(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
{
if (gBattleTypeFlags & BATTLE_TYPE_WILD)
if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)
{
gBattleMainFunc = BeginBattleIntro;
@ -416,7 +416,7 @@ static void InitLinkBtlControllers(void)
}
else if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
{
if (gBattleTypeFlags & BATTLE_TYPE_WILD)
if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)
{
gBattleMainFunc = BeginBattleIntro;
@ -453,7 +453,7 @@ static void InitLinkBtlControllers(void)
}
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
{
if (gBattleTypeFlags & BATTLE_TYPE_WILD)
if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)
{
gBattleMainFunc = BeginBattleIntro;
@ -501,7 +501,7 @@ static void InitLinkBtlControllers(void)
{
multiplayerId = GetMultiplayerId();
if (gBattleTypeFlags & BATTLE_TYPE_WILD)
if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)
gBattleMainFunc = BeginBattleIntro;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
@ -700,14 +700,14 @@ static void CreateTasksForSendRecvLinkBuffers(void)
enum
{
LINK_BUFF_BUFFER_ID,
LINK_BUFF_ACTIVE_BANK,
LINK_BUFF_ACTIVE_BATTLER,
LINK_BUFF_ATTACKER,
LINK_BUFF_TARGET,
LINK_BUFF_SIZE_LO,
LINK_BUFF_SIZE_HI,
LINK_BUFF_ABSENT_BANK_FLAGS,
LINK_BUFF_EFFECT_BANK,
LINK_BUFF_DATA
LINK_BUFF_ABSENT_BATTLER_FLAGS,
LINK_BUFF_EFFECT_BATTLER,
LINK_BUFF_DATA,
};
void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data)
@ -722,13 +722,13 @@ void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data)
gTasks[gUnknown_02022D08].data[14] = 0;
}
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_BUFFER_ID] = bufferId;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ACTIVE_BANK] = gActiveBattler;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ACTIVE_BATTLER] = gActiveBattler;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ATTACKER] = gBattlerAttacker;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_TARGET] = gBattlerTarget;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_SIZE_LO] = alignedSize;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_SIZE_HI] = (alignedSize & 0x0000FF00) >> 8;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ABSENT_BANK_FLAGS] = gAbsentBattlerFlags;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_EFFECT_BANK] = gEffectBattler;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ABSENT_BATTLER_FLAGS] = gAbsentBattlerFlags;
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_EFFECT_BATTLER] = gEffectBattler;
for (i = 0; i < size; i++)
gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_DATA + i] = data[i];
@ -877,7 +877,7 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
gTasks[taskId].data[12] = 0;
gTasks[taskId].data[15] = 0;
}
battlerId = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ACTIVE_BANK];
battlerId = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ACTIVE_BATTLER];
blockSize = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_SIZE_LO] | (gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_SIZE_HI] << 8);
switch (gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 0])
@ -886,19 +886,19 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
if (gBattleControllerExecFlags & gBitTable[battlerId])
return;
memcpy(gBattleBufferA[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 8], blockSize);
memcpy(gBattleBufferA[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA], blockSize);
sub_803F850(battlerId);
if (!(gBattleTypeFlags & BATTLE_TYPE_WILD))
if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
{
gBattlerAttacker = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 2];
gBattlerTarget = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 3];
gAbsentBattlerFlags = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 6];
gEffectBattler = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 7];
gBattlerAttacker = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ATTACKER];
gBattlerTarget = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_TARGET];
gAbsentBattlerFlags = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ABSENT_BATTLER_FLAGS];
gEffectBattler = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_EFFECT_BATTLER];
}
break;
case 1:
memcpy(gBattleBufferB[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 8], blockSize);
memcpy(gBattleBufferB[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA], blockSize);
break;
case 2:
var = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA];

View File

@ -47,11 +47,11 @@ extern const u32 gUnknown_08C093F0[];
extern const u32 gSubstituteDollTilemap[];
extern const u32 gSubstituteDollGfx[];
extern const u16 gSubstituteDollPal[];
extern const u8 gUnknown_08C1F1C8[];
extern const u8 gUnknown_08C1F46C[];
extern const u8 gUnknown_08C1F5E8[];
extern const u8 gUnknown_08C1F76C[];
extern const u8 gUnknown_08C1F8E8[];
extern const u8 gHealthboxSinglesPlayerGfx[];
extern const u8 gHealthboxSinglesOpponentGfx[];
extern const u8 gHealthboxDoublesPlayerGfx[];
extern const u8 gHealthboxDoublesOpponentGfx[];
extern const u8 gHealthboxSafariGfx[];
extern const u8 gBlankGfxCompressed[];
extern const u16 gBattleInterface_BallStatusBarPal[];
extern const u16 gBattleInterface_BallDisplayPal[];
@ -72,29 +72,29 @@ static void ClearSpritesBattlerHealthboxAnimData(void);
// const rom data
static const struct CompressedSpriteSheet sSpriteSheet_SinglesPlayerHealthbox =
{
gUnknown_08C1F1C8, 0x1000, TAG_HEALTHBOX_PLAYER1_TILE
gHealthboxSinglesPlayerGfx, 0x1000, TAG_HEALTHBOX_PLAYER1_TILE
};
static const struct CompressedSpriteSheet sSpriteSheet_SinglesOpponentHealthbox =
{
gUnknown_08C1F46C, 0x1000, TAG_HEALTHBOX_OPPONENT1_TILE
gHealthboxSinglesOpponentGfx, 0x1000, TAG_HEALTHBOX_OPPONENT1_TILE
};
static const struct CompressedSpriteSheet sSpriteSheets_DoublesPlayerHealthbox[2] =
{
{gUnknown_08C1F5E8, 0x800, TAG_HEALTHBOX_PLAYER1_TILE},
{gUnknown_08C1F5E8, 0x800, TAG_HEALTHBOX_PLAYER2_TILE}
{gHealthboxDoublesPlayerGfx, 0x800, TAG_HEALTHBOX_PLAYER1_TILE},
{gHealthboxDoublesPlayerGfx, 0x800, TAG_HEALTHBOX_PLAYER2_TILE}
};
static const struct CompressedSpriteSheet sSpriteSheets_DoublesOpponentHealthbox[2] =
{
{gUnknown_08C1F76C, 0x800, TAG_HEALTHBOX_OPPONENT1_TILE},
{gUnknown_08C1F76C, 0x800, TAG_HEALTHBOX_OPPONENT2_TILE}
{gHealthboxDoublesOpponentGfx, 0x800, TAG_HEALTHBOX_OPPONENT1_TILE},
{gHealthboxDoublesOpponentGfx, 0x800, TAG_HEALTHBOX_OPPONENT2_TILE}
};
static const struct CompressedSpriteSheet sSpriteSheet_SafariHealthbox =
{
gUnknown_08C1F8E8, 0x1000, TAG_HEALTHBOX_SAFARI_TILE
gHealthboxSafariGfx, 0x1000, TAG_HEALTHBOX_SAFARI_TILE
};
static const struct CompressedSpriteSheet sSpriteSheets_HealthBar[MAX_BATTLERS_COUNT] =

View File

@ -881,7 +881,7 @@ static void sub_8036EB8(u8 arg0, u8 arg1)
if (gBlockRecvBuffer[0][0] == 256)
{
if (arg1 == 0)
gBattleTypeFlags |= BATTLE_TYPE_WILD | BATTLE_TYPE_TRAINER;
gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER | BATTLE_TYPE_TRAINER;
else
gBattleTypeFlags |= BATTLE_TYPE_TRAINER;
var++;
@ -900,7 +900,7 @@ static void sub_8036EB8(u8 arg0, u8 arg1)
if (i == arg0)
{
if (arg1 == 0)
gBattleTypeFlags |= BATTLE_TYPE_WILD | BATTLE_TYPE_TRAINER;
gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER | BATTLE_TYPE_TRAINER;
else
gBattleTypeFlags |= BATTLE_TYPE_TRAINER;
var++;
@ -920,7 +920,7 @@ static void sub_8036EB8(u8 arg0, u8 arg1)
}
if (i == arg0)
gBattleTypeFlags |= BATTLE_TYPE_WILD | BATTLE_TYPE_TRAINER;
gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER | BATTLE_TYPE_TRAINER;
else
gBattleTypeFlags |= BATTLE_TYPE_TRAINER;
}
@ -983,7 +983,7 @@ static void CB2_HandleStartBattle(void)
else
{
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
gBattleTypeFlags |= BATTLE_TYPE_WILD;
gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER;
gBattleCommunication[MULTIUSE_STATE] = 15;
SetAllPlayersBerryData();
}
@ -1091,7 +1091,7 @@ static void CB2_HandleStartBattle(void)
if ((GetBlockReceivedStatus() & 3) == 3)
{
ResetBlockReceivedFlags();
if (!(gBattleTypeFlags & BATTLE_TYPE_WILD))
if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
memcpy(&gRecordedBattleRngSeed, gBlockRecvBuffer[enemyMultiplayerId], sizeof(gRecordedBattleRngSeed));
gBattleCommunication[MULTIUSE_STATE]++;
}
@ -1185,7 +1185,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
else
{
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
gBattleTypeFlags |= BATTLE_TYPE_WILD;
gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER;
gBattleCommunication[MULTIUSE_STATE] = 13;
SetAllPlayersBerryData();
}
@ -1344,7 +1344,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
if ((GetBlockReceivedStatus() & 3) == 3)
{
ResetBlockReceivedFlags();
if (!(gBattleTypeFlags & BATTLE_TYPE_WILD))
if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
memcpy(&gRecordedBattleRngSeed, gBlockRecvBuffer[enemyMultiplayerId], sizeof(gRecordedBattleRngSeed));
gBattleCommunication[MULTIUSE_STATE]++;
}
@ -1572,7 +1572,7 @@ static void CB2_HandleStartMultiBattle(void)
else
{
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
gBattleTypeFlags |= BATTLE_TYPE_WILD;
gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER;
gBattleCommunication[MULTIUSE_STATE] = 7;
SetAllPlayersBerryData();
}
@ -1924,7 +1924,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_x4000000)))
| BATTLE_TYPE_TRAINER_HILL)))
{
if (firstTrainer == TRUE)
ZeroEnemyPartyMons();
@ -3320,7 +3320,7 @@ static void BattleIntroGetMonsData(void)
{
case 0:
gActiveBattler = gBattleCommunication[1];
BtlController_EmitGetMonData(0, 0, 0);
BtlController_EmitGetMonData(0, REQUEST_ALL_BATTLE, 0);
MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[MULTIUSE_STATE]++;
break;
@ -3403,7 +3403,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
| BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000
| BATTLE_TYPE_x4000000)))
| BATTLE_TYPE_TRAINER_HILL)))
{
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
}
@ -3416,7 +3416,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
| BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000
| BATTLE_TYPE_x4000000)))
| BATTLE_TYPE_TRAINER_HILL)))
{
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
}
@ -3727,7 +3727,7 @@ static void BattleIntroRecordMonsToDex(void)
| BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000
| BATTLE_TYPE_x4000000)))
| BATTLE_TYPE_TRAINER_HILL)))
{
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
}
@ -4351,7 +4351,7 @@ static void HandleTurnActionSelectionState(void)
}
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000)
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL)
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
{
gSelectionBattleScripts[gActiveBattler] = BattleScript_AskIfWantsToForfeitMatch;
@ -5044,7 +5044,7 @@ static void HandleEndTurn_BattleWon(void)
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000 | BATTLE_TYPE_EREADER_TRAINER))
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_EREADER_TRAINER))
{
BattleStopLowHpSound();
gBattlescriptCurrInstr = BattleScript_FrontierTrainerBattleWon;
@ -5135,7 +5135,7 @@ static void HandleEndTurn_RanFromBattle(void)
gBattleOutcome = B_OUTCOME_FORFEITED;
gSaveBlock2Ptr->frontier.field_CA9_b = 1;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeited;
gBattleOutcome = B_OUTCOME_FORFEITED;
@ -5772,7 +5772,7 @@ bool8 TryRunFromBattle(u8 battler)
effect++;
}
}
else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000) && gBattleTypeFlags & BATTLE_TYPE_TRAINER)
else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL) && gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{
effect++;
}

View File

@ -17,6 +17,7 @@
#include "menu.h"
#include "recorded_battle.h"
#include "international_string_util.h"
#include "battle_frontier_2.h"
struct BattleWindowText
{
@ -46,13 +47,12 @@ extern const u8 gText_PkmnTransferredLanettesPC[];
extern u8 GetFrontierBrainTrainerClass(void); // battle_frontier_2
extern u8 GetFrontierOpponentClass(u16 trainerId); // battle_tower
extern u8 sub_81D5530(u16 trainerId); // pokenav
extern u8 GetTrainerHillOpponentClass(u16 trainerId); // pokenav
extern u8 GetEreaderTrainerClassId(void); // battle_tower
extern void CopyFrontierBrainTrainerName(u8 *txtPtr); // battle_frontier_2
extern void sub_81D5554(u8 *txtPtr, u16 trainerId); // pokenav
extern void GetTrainerHillTrainerName(u8 *txtPtr, u16 trainerId); // pokenav
extern void GetEreaderTrainerName(u8 *txtPtr);
extern void sub_81A36D0(u8 arg0, u16 trainerId); // battle_frontier_2
extern void sub_81D572C(u8 arg0, u16 trainerId); // pokenav
extern void CopyTrainerHillTrainerText(u8 arg0, u16 trainerId); // pokenav
extern void GetFrontierTrainerName(u8 *dst, u16 trainerId);
// this files functions
@ -334,14 +334,14 @@ static const u8 sText_GotAwaySafely[] = _("{PLAY_SE 0x0011}Got away safely!\p");
static const u8 sText_PkmnFledUsingIts[] = _("{PLAY_SE 0x0011}{B_ATK_NAME_WITH_PREFIX} fled\nusing its {B_LAST_ITEM}!\p");
static const u8 sText_PkmnFledUsing[] = _("{PLAY_SE 0x0011}{B_ATK_NAME_WITH_PREFIX} fled\nusing {B_ATK_ABILITY}!\p");
static const u8 sText_WildPkmnFled[] = _("{PLAY_SE 0x0011}Wild {B_BUFF1} fled!");
static const u8 sText_PlayerDefeatedLinkTrainer[] = _("Player defeated\n{B_20}!");
static const u8 sText_TwoLinkTrainersDefeated[] = _("Player beat {B_20}\nand {B_21}!");
static const u8 sText_PlayerLostAgainstLinkTrainer[] = _("Player lost against\n{B_20}!");
static const u8 sText_PlayerLostToTwo[] = _("Player lost to {B_20}\nand {B_21}!");
static const u8 sText_PlayerBattledToDrawLinkTrainer[] = _("Player battled to a draw against\n{B_20}!");
static const u8 sText_PlayerBattledToDrawVsTwo[] = _("Player battled to a draw against\n{B_20} and {B_21}!");
static const u8 sText_WildFled[] = _("{PLAY_SE 0x0011}{B_20} fled!");
static const u8 sText_TwoWildFled[] = _("{PLAY_SE 0x0011}{B_20} and\n{B_21} fled!");
static const u8 sText_PlayerDefeatedLinkTrainer[] = _("Player defeated\n{B_LINK_OPPONENT1_NAME}!");
static const u8 sText_TwoLinkTrainersDefeated[] = _("Player beat {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!");
static const u8 sText_PlayerLostAgainstLinkTrainer[] = _("Player lost against\n{B_LINK_OPPONENT1_NAME}!");
static const u8 sText_PlayerLostToTwo[] = _("Player lost to {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!");
static const u8 sText_PlayerBattledToDrawLinkTrainer[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME}!");
static const u8 sText_PlayerBattledToDrawVsTwo[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}!");
static const u8 sText_WildFled[] = _("{PLAY_SE 0x0011}{B_LINK_OPPONENT1_NAME} fled!");
static const u8 sText_TwoWildFled[] = _("{PLAY_SE 0x0011}{B_LINK_OPPONENT1_NAME} and\n{B_LINK_OPPONENT2_NAME} fled!");
static const u8 sText_NoRunningFromTrainers[] = _("No! Theres no running\nfrom a TRAINER battle!\p");
static const u8 sText_CantEscape[] = _("Cant escape!\p");
static const u8 sText_DontLeaveBirch[] = _("PROF. BIRCH: Dont leave me like this!\p");
@ -398,33 +398,33 @@ static const u8 sText_WildPkmnAppeared2[] = _("Wild {B_OPPONENT_MON1_NAME} appea
static const u8 sText_WildPkmnAppearedPause[] = _("Wild {B_OPPONENT_MON1_NAME} appeared!{PAUSE 127}");
static const u8 sText_TwoWildPkmnAppeared[] = _("Wild {B_OPPONENT_MON1_NAME} and\n{B_OPPONENT_MON2_NAME} appeared!\p");
static const u8 sText_Trainer1WantsToBattle[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME}\nwould like to battle!\p");
static const u8 sText_LinkTrainerWantsToBattle[] = _("{B_20}\nwants to battle!");
static const u8 sText_TwoLinkTrainersWantToBattle[] = _("{B_20} and {B_21}\nwant to battle!");
static const u8 sText_LinkTrainerWantsToBattle[] = _("{B_LINK_OPPONENT1_NAME}\nwants to battle!");
static const u8 sText_TwoLinkTrainersWantToBattle[] = _("{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}\nwant to battle!");
static const u8 sText_Trainer1SentOutPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_OPPONENT_MON1_NAME}!");
static const u8 sText_Trainer1SentOutTwoPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_OPPONENT_MON1_NAME} and {B_OPPONENT_MON2_NAME}!");
static const u8 sText_Trainer1SentOutPkmn2[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_BUFF1}!");
static const u8 sText_LinkTrainerSentOutPkmn[] = _("{B_20} sent out\n{B_OPPONENT_MON1_NAME}!");
static const u8 sText_LinkTrainerSentOutTwoPkmn[] = _("{B_20} sent out\n{B_OPPONENT_MON1_NAME} and {B_OPPONENT_MON2_NAME}!");
static const u8 sText_TwoLinkTrainersSentOutPkmn[] = _("{B_20} sent out {B_LINK_OPPONENT_MON1_NAME}!\n{B_21} sent out {B_LINK_OPPONENT_MON2_NAME}!");
static const u8 sText_LinkTrainerSentOutPkmn2[] = _("{B_20} sent out\n{B_BUFF1}!");
static const u8 sText_LinkTrainerMultiSentOutPkmn[] = _("{B_22} sent out\n{B_BUFF1}!");
static const u8 sText_LinkTrainerSentOutPkmn[] = _("{B_LINK_OPPONENT1_NAME} sent out\n{B_OPPONENT_MON1_NAME}!");
static const u8 sText_LinkTrainerSentOutTwoPkmn[] = _("{B_LINK_OPPONENT1_NAME} sent out\n{B_OPPONENT_MON1_NAME} and {B_OPPONENT_MON2_NAME}!");
static const u8 sText_TwoLinkTrainersSentOutPkmn[] = _("{B_LINK_OPPONENT1_NAME} sent out {B_LINK_OPPONENT_MON1_NAME}!\n{B_LINK_OPPONENT2_NAME} sent out {B_LINK_OPPONENT_MON2_NAME}!");
static const u8 sText_LinkTrainerSentOutPkmn2[] = _("{B_LINK_OPPONENT1_NAME} sent out\n{B_BUFF1}!");
static const u8 sText_LinkTrainerMultiSentOutPkmn[] = _("{B_LINK_SCR_TRAINER_NAME} sent out\n{B_BUFF1}!");
static const u8 sText_GoPkmn[] = _("Go! {B_PLAYER_MON1_NAME}!");
static const u8 sText_GoTwoPkmn[] = _("Go! {B_PLAYER_MON1_NAME} and\n{B_PLAYER_MON2_NAME}!");
static const u8 sText_GoPkmn2[] = _("Go! {B_BUFF1}!");
static const u8 sText_DoItPkmn[] = _("Do it! {B_BUFF1}!");
static const u8 sText_GoForItPkmn[] = _("Go for it, {B_BUFF1}!");
static const u8 sText_YourFoesWeakGetEmPkmn[] = _("Your foes weak!\nGet em, {B_BUFF1}!");
static const u8 sText_LinkPartnerSentOutPkmnGoPkmn[] = _("{B_1F} sent out {B_LINK_PLAYER_MON2_NAME}!\nGo! {B_LINK_PLAYER_MON1_NAME}!");
static const u8 sText_LinkPartnerSentOutPkmnGoPkmn[] = _("{B_LINK_PARTNER_NAME} sent out {B_LINK_PLAYER_MON2_NAME}!\nGo! {B_LINK_PLAYER_MON1_NAME}!");
static const u8 sText_PkmnThatsEnough[] = _("{B_BUFF1}, thats enough!\nCome back!");
static const u8 sText_PkmnComeBack[] = _("{B_BUFF1}, come back!");
static const u8 sText_PkmnOkComeBack[] = _("{B_BUFF1}, OK!\nCome back!");
static const u8 sText_PkmnGoodComeBack[] = _("{B_BUFF1}, good!\nCome back!");
static const u8 sText_Trainer1WithdrewPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME}\nwithdrew {B_BUFF1}!");
static const u8 sText_LinkTrainer1WithdrewPkmn[] = _("{B_20} withdrew\n{B_BUFF1}!");
static const u8 sText_LinkTrainer2WithdrewPkmn[] = _("{B_22} withdrew\n{B_BUFF1}!");
static const u8 sText_LinkTrainer1WithdrewPkmn[] = _("{B_LINK_OPPONENT1_NAME} withdrew\n{B_BUFF1}!");
static const u8 sText_LinkTrainer2WithdrewPkmn[] = _("{B_LINK_SCR_TRAINER_NAME} withdrew\n{B_BUFF1}!");
static const u8 sText_WildPkmnPrefix[] = _("Wild ");
static const u8 sText_FoePkmnPrefix[] = _("Foe ");
static const u8 sText_EmptyString8[] = _( "");
static const u8 sText_EmptyString8[] = _("");
static const u8 sText_FoePkmnPrefix2[] = _("Foe");
static const u8 sText_AllyPkmnPrefix[] = _("Ally");
static const u8 sText_FoePkmnPrefix3[] = _("Foe");
@ -1603,8 +1603,8 @@ static const u8 sText_PlayerLostAgainstTrainer1[] = _("Player lost against\n{B_T
static const u8 sText_PlayerBattledToDrawTrainer1[] = _("Player battled to a draw against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!");
const u8 gText_RecordBattleToPass[] = _("Would you like to record your battle\non your FRONTIER PASS?");
const u8 gText_BattleRecordedOnPass[] = _("{B_PLAYER_NAME}s battle result was recorded\non the FRONTIER PASS.");
static const u8 sText_LinkTrainerWantsToBattlePause[] = _("{B_20}\nwants to battle!{PAUSE 49}");
static const u8 sText_TwoLinkTrainersWantToBattlePause[] = _("{B_20} and {B_21}\nwant to battle!{PAUSE 49}");
static const u8 sText_LinkTrainerWantsToBattlePause[] = _("{B_LINK_OPPONENT1_NAME}\nwants to battle!{PAUSE 49}");
static const u8 sText_TwoLinkTrainersWantToBattlePause[] = _("{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}\nwant to battle!{PAUSE 49}");
static const u8 sText_YourTeam[] = _("Your team");
static const u8 sText_OpposingTeam[] = _("The opposing team");
@ -2613,9 +2613,9 @@ static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text,
GetFrontierTrainerName(text, trainerId);
toCpy = text;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
sub_81D5554(text, trainerId);
GetTrainerHillTrainerName(text, trainerId);
toCpy = text;
}
else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER)
@ -2703,8 +2703,8 @@ static const u8 *BattleStringGetOpponentClassByTrainerId(u16 trainerId)
toCpy = gTrainerClassNames[GetFrontierBrainTrainerClass()];
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
toCpy = gTrainerClassNames[GetFrontierOpponentClass(trainerId)];
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
toCpy = gTrainerClassNames[sub_81D5530(trainerId)];
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
toCpy = gTrainerClassNames[GetTrainerHillOpponentClass(trainerId)];
else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER)
toCpy = gTrainerClassNames[GetEreaderTrainerClassId()];
else
@ -2926,19 +2926,19 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_TRAINER1_NAME: // trainer1 name
toCpy = BattleStringGetOpponentNameByTrainerId(gTrainerBattleOpponent_A, text, multiplayerId, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT));
break;
case B_TXT_1E: // link player name?
case B_TXT_LINK_PLAYER_NAME: // link player name
toCpy = gLinkPlayers[multiplayerId].name;
break;
case B_TXT_1F: // link partner name?
toCpy = gLinkPlayers[GetBattlerMultiplayerId(2 ^ gLinkPlayers[multiplayerId].id)].name;
case B_TXT_LINK_PARTNER_NAME: // link partner name
toCpy = gLinkPlayers[GetBattlerMultiplayerId(BATTLE_PARTNER(gLinkPlayers[multiplayerId].id))].name;
break;
case B_TXT_20: // link opponent 1 name?
toCpy = gLinkPlayers[GetBattlerMultiplayerId(1 ^ gLinkPlayers[multiplayerId].id)].name;
case B_TXT_LINK_OPPONENT1_NAME: // link opponent 1 name
toCpy = gLinkPlayers[GetBattlerMultiplayerId(BATTLE_OPPOSITE(gLinkPlayers[multiplayerId].id))].name;
break;
case B_TXT_21: // link opponent 2 name?
toCpy = gLinkPlayers[GetBattlerMultiplayerId(3 ^ gLinkPlayers[multiplayerId].id)].name;
case B_TXT_LINK_OPPONENT2_NAME: // link opponent 2 name
toCpy = gLinkPlayers[GetBattlerMultiplayerId(BATTLE_PARTNER(BATTLE_OPPOSITE(gLinkPlayers[multiplayerId].id)))].name;
break;
case B_TXT_22: // link scripting active name
case B_TXT_LINK_SCR_TRAINER_NAME: // link scripting active name
toCpy = gLinkPlayers[GetBattlerMultiplayerId(gBattleScripting.battler)].name;
break;
case B_TXT_PLAYER_NAME: // player name
@ -2947,12 +2947,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_TRAINER1_LOSE_TEXT: // trainerA lose text
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
sub_81A36D0(2, gTrainerBattleOpponent_A);
CopyFrontierTrainerText(FRONTIER_LOSE_TEXT, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
sub_81D572C(4, gTrainerBattleOpponent_A);
CopyTrainerHillTrainerText(4, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
}
else
@ -2963,12 +2963,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_TRAINER1_WIN_TEXT: // trainerA win text
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
sub_81A36D0(1, gTrainerBattleOpponent_A);
CopyFrontierTrainerText(FRONTIER_WIN_TEXT, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
sub_81D572C(3, gTrainerBattleOpponent_A);
CopyTrainerHillTrainerText(3, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
}
break;
@ -3026,12 +3026,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_TRAINER2_LOSE_TEXT:
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
sub_81A36D0(2, gTrainerBattleOpponent_B);
CopyFrontierTrainerText(FRONTIER_LOSE_TEXT, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
sub_81D572C(4, gTrainerBattleOpponent_B);
CopyTrainerHillTrainerText(4, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
}
else
@ -3042,12 +3042,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_TRAINER2_WIN_TEXT:
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
sub_81A36D0(1, gTrainerBattleOpponent_B);
CopyFrontierTrainerText(FRONTIER_WIN_TEXT, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
}
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
sub_81D572C(3, gTrainerBattleOpponent_B);
CopyTrainerHillTrainerText(3, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
}
break;

View File

@ -2490,7 +2490,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
break;
case MOVE_EFFECT_STEAL_ITEM:
{
if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
gBattlescriptCurrInstr++;
break;
@ -3019,7 +3019,7 @@ static void atk23_getexp(void)
if (GetBattlerSide(gBattlerFainted) != B_SIDE_OPPONENT || (gBattleTypeFlags &
(BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000
| BATTLE_TYPE_x4000000
| BATTLE_TYPE_TRAINER_HILL
| BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_SAFARI
| BATTLE_TYPE_BATTLE_TOWER
@ -4407,7 +4407,7 @@ static void atk4E_switchinanim(void)
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_x2000000
| BATTLE_TYPE_x4000000
| BATTLE_TYPE_TRAINER_HILL
| BATTLE_TYPE_FRONTIER)))
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
@ -9262,7 +9262,7 @@ static void atkD1_trysethelpinghand(void)
static void atkD2_tryswapitems(void) // trick
{
// opponent can't swap items with player in regular battles
if (gBattleTypeFlags & BATTLE_TYPE_x4000000
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL
|| (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_EREADER_TRAINER

View File

@ -75,7 +75,7 @@ extern void sub_81D6384(void);
extern void sub_81D61E8(void);
extern void sub_80982B8(void);
extern void sub_81A9EDC(u16 a0);
extern void sub_81D572C(u8 a0, u16 arg1);
extern void CopyTrainerHillTrainerText(u8 a0, u16 arg1);
// this file's functions
static void DoBattlePikeWildBattle(void);
@ -1281,7 +1281,7 @@ void BattleSetup_StartTrainerBattle(void)
}
else if (sub_81D5C18())
{
gBattleTypeFlags |= BATTLE_TYPE_x4000000;
gBattleTypeFlags |= BATTLE_TYPE_TRAINER_HILL;
if (gNoOfApproachingTrainers == 2)
sub_81D639C();
@ -1370,9 +1370,9 @@ void ShowTrainerIntroSpeech(void)
else if (sub_81D5C18())
{
if (gNoOfApproachingTrainers == 0 || gNoOfApproachingTrainers == 1)
sub_81D572C(2, sub_81D6180(gSpecialVar_LastTalked));
CopyTrainerHillTrainerText(2, sub_81D6180(gSpecialVar_LastTalked));
else
sub_81D572C(2, sub_81D6180(gEventObjects[gApproachingTrainers[gApproachingTrainerId].eventObjectId].localId));
CopyTrainerHillTrainerText(2, sub_81D6180(gEventObjects[gApproachingTrainers[gApproachingTrainerId].eventObjectId].localId));
sub_80982B8();
}

View File

@ -17,7 +17,7 @@ extern void sub_81B8FB0(u8, u8);
void AllocateBattleResources(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
sub_81D55D0();
gBattleStruct = AllocZeroed(sizeof(*gBattleStruct));
@ -47,7 +47,7 @@ void AllocateBattleResources(void)
void FreeBattleResources(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
sub_81D5694();
if (gBattleResources != NULL)

View File

@ -643,11 +643,11 @@ const u8 gBattleAnimSpritePalette_187[] = INCBIN_U8("graphics/battle_anims/sprit
const u8 gBattleAnimSpriteSheet_186[] = INCBIN_U8("graphics/battle_anims/sprites/186.4bpp.lz");
const u8 gBattleAnimSpritePalette_186[] = INCBIN_U8("graphics/battle_anims/sprites/186.gbapal.lz");
const u8 gUnknown_08C1F1C8[] = INCBIN_U8("graphics/battle_interface/window.4bpp.lz");
const u8 gUnknown_08C1F46C[] = INCBIN_U8("graphics/battle_interface/window2.4bpp.lz");
const u8 gUnknown_08C1F5E8[] = INCBIN_U8( "graphics/battle_interface/window3.4bpp.lz");
const u8 gUnknown_08C1F76C[] = INCBIN_U8("graphics/battle_interface/window4.4bpp.lz");
const u8 gUnknown_08C1F8E8[] = INCBIN_U8("graphics/battle_interface/window5.4bpp.lz");
const u8 gHealthboxSinglesPlayerGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_singles_player.4bpp.lz");
const u8 gHealthboxSinglesOpponentGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_singles_opponent.4bpp.lz");
const u8 gHealthboxDoublesPlayerGfx[] = INCBIN_U8( "graphics/battle_interface/healthbox_doubles_player.4bpp.lz");
const u8 gHealthboxDoublesOpponentGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_doubles_opponent.4bpp.lz");
const u8 gHealthboxSafariGfx[] = INCBIN_U8("graphics/battle_interface/healthbox_safari.4bpp.lz");
const u8 gUnusedGfx_Shadow[] = INCBIN_U8("graphics/unused/shadow.4bpp.lz");
const u8 gUnusedPal_Shadow[] = INCBIN_U8("graphics/unused/shadow.gbapal.lz");

View File

@ -5031,7 +5031,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
// I have to re-use this variable to match.
r5 = gActiveBattler;
gActiveBattler = battlerId;
BtlController_EmitGetMonData(0, 0, 0);
BtlController_EmitGetMonData(0, REQUEST_ALL_BATTLE, 0);
MarkBattlerForControllerExec(gActiveBattler);
gActiveBattler = r5;
}
@ -6345,7 +6345,7 @@ u16 GetBattleBGM(void)
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
trainerClass = GetFrontierOpponentClass(gTrainerBattleOpponent_A);
else if (gBattleTypeFlags & BATTLE_TYPE_x4000000)
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
trainerClass = TRAINER_CLASS_EXPERT;
else
trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;

View File

@ -19,7 +19,7 @@
#define ILLEGAL_BATTLE_TYPES ((BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_FIRST_BATTLE \
| BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_ROAMER | BATTLE_TYPE_EREADER_TRAINER \
| BATTLE_TYPE_KYOGRE_GROUDON | BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_REGI \
| BATTLE_TYPE_RECORDED | BATTLE_TYPE_x4000000 | BATTLE_TYPE_SECRET_BASE \
| BATTLE_TYPE_RECORDED | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_SECRET_BASE \
| BATTLE_TYPE_GROUDON | BATTLE_TYPE_KYOGRE | BATTLE_TYPE_RAYQUAZA))
extern u8 gUnknown_03001278;
@ -273,7 +273,7 @@ void sub_81851A8(u8 *arg0)
return;
}
if (!(gBattleTypeFlags & BATTLE_TYPE_WILD))
if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER))
{
for (var2 = *arg0; var2 != 0;)
{
@ -360,7 +360,7 @@ u32 MoveRecordedBattleToSaveData(void)
battleSave->battleFlags = (sBattleFlags & ~(BATTLE_TYPE_LINK | BATTLE_TYPE_20));
battleSave->battleFlags |= BATTLE_TYPE_x2000000;
if (sBattleFlags & BATTLE_TYPE_WILD)
if (sBattleFlags & BATTLE_TYPE_IS_MASTER)
{
battleSave->battleFlags |= BATTLE_TYPE_x80000000;
}