Merge pull request #222 from DizzyEggg/decompile_battle_link_817C95C

Decompile battle_tv previously known as battle_link_817C95C
This commit is contained in:
Diegoisawesome 2018-02-28 18:18:51 -06:00 committed by GitHub
commit c0357cea46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 2352 additions and 5756 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3388,7 +3388,7 @@ _0813980C:
_0813981C:
ldrh r5, [r2]
adds r0, r5, 0
bl sub_80EF370
bl CountDigits
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
@ -3408,7 +3408,7 @@ _0813983C:
adds r4, 0x4
ldrh r5, [r2]
adds r0, r5, 0
bl sub_80EF370
bl CountDigits
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24

View File

@ -1,174 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 1
gUnknown_0860A4AC:: @ 860A4AC
.2byte 0x0044, 0x005a, 0x0075, 0x00f3, 0x0020, 0x00af, 0x00b3, 0x00ed, 0x0149, 0x0108, 0x011c, 0x0143, 0x008a, 0x0137, 0x00ad, 0x00dc
.2byte 0x000c, 0x00da, 0x00d8, 0x011b, 0x00d9, 0x0117, 0xffff, 0x00de, 0x0095, 0xffff
.align 1
gUnknown_0860A4E0:: @ 860A4E0
.2byte 0x0001, 0x0001, 0x0001, 0x0004, 0x0001, 0x0001, 0x0001, 0x0000, 0x0005, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001
.2byte 0x0001, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0005, 0x0005, 0x0004, 0x0005, 0x0001, 0x0003, 0x0001
.2byte 0x0003, 0x0005, 0x0001, 0x0007, 0x0001, 0x0007, 0x0007, 0x0001, 0x0005, 0x0002, 0x0004, 0x0001, 0x0001, 0x0001, 0x0005, 0x0001
.2byte 0x0002, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001
.2byte 0x0001, 0x0007, 0x0004, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0004, 0x0001, 0x0001, 0x0001, 0x0004
.2byte 0x0005, 0x0002, 0x0004, 0x0001, 0x0004, 0x0001, 0x0007, 0x0002, 0x0001, 0x0005, 0x0007, 0x0003, 0x0003, 0x0004, 0x0003, 0x0003
.2byte 0x0003, 0x0003, 0x0003, 0x0002, 0x0004, 0x0001, 0x0005, 0x0001, 0x0001, 0x0004, 0x0005, 0x0003, 0x0001, 0x0002, 0x0001, 0x0005
.2byte 0x0004, 0x0003, 0x0006, 0x0004, 0x0003, 0x0003, 0x0003, 0x0002, 0x0004, 0x0001, 0x0001, 0x0001, 0x0005, 0x0001, 0x0001, 0x0007
.2byte 0x0002, 0x0002, 0x0001, 0x0001, 0x0004, 0x0004, 0x0004, 0x0001, 0x0004, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, 0x0007, 0x0007
.2byte 0x0006, 0x0003, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0003, 0x0001, 0x0001, 0x0004, 0x0004
.2byte 0x0003, 0x0003, 0x0003, 0x0001, 0x0004, 0x0007, 0x0007, 0x0005, 0x0007, 0x0001, 0x0007, 0x0001, 0x0005, 0x0000, 0x0004, 0x0004
.2byte 0x0004, 0x0004, 0x0004, 0x0002, 0x0002, 0x0006, 0x0003, 0x0006, 0x0004, 0x0004, 0x0002, 0x0005, 0x0002, 0x0001, 0x0001, 0x0006
.2byte 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006, 0x0001, 0x0004, 0x0001, 0x0001, 0x0003, 0x0001, 0x0001, 0x0001
.2byte 0x0001, 0x0001, 0x0004, 0x0001, 0x0001, 0x0003
.align 1
gUnknown_0860A68C:: @ 860A68C
.2byte 0x0004, 0xfffd, 0xfffa
.align 1
gUnknown_0860A692:: @ 860A692
.2byte 0x0004, 0x0004, 0x0006, 0x0006, 0x0007, 0x0006, 0x0002
.align 1
gUnknown_0860A6A0:: @ 860A6A0
.2byte 0x0091, 0x0003, 0x00fa, 0x0003, 0x00be, 0x0003, 0x0080, 0x0003, 0x006e, 0x0003, 0x0098, 0x0003, 0x0143, 0x0003, 0x0123, 0x0003
.2byte 0x007f, 0x0003, 0x014a, 0x0003, 0x0039, 0x0003, 0x0134, 0x0003, 0x0038, 0x0003, 0x003d, 0x0003, 0x015a, 0x0000, 0x0037, 0x0003
.2byte 0x0160, 0x0003, 0x0137, 0x0003, 0x0057, 0x0003, 0x004c, 0xfffc, 0x013b, 0xfffc, 0x00ac, 0xfffc, 0x0035, 0xfffc, 0x00dd, 0xfffc
.2byte 0x007e, 0xfffc, 0x0101, 0xfffc, 0x0034, 0xfffc, 0x0133, 0xfffc, 0x012b, 0xfffc, 0x011c, 0xfffc, 0x0053, 0xfffc, 0x0007, 0xfffc
.2byte 0x004c, 0xfffc, 0xffff, 0x0000
.align 1
gUnknown_0860A728:: @ 860A728
.2byte 0x013b, 0x0003, 0x00ac, 0x0003, 0x0035, 0x0003, 0x00dd, 0x0003, 0x007e, 0x0003, 0x0101, 0x0003, 0x0034, 0x0003, 0x0133, 0x0003
.2byte 0x012b, 0x0003, 0x011c, 0x0003, 0x0053, 0x0003, 0x0007, 0x0003, 0x004c, 0x0005, 0x00eb, 0x0003, 0x00ea, 0x0003, 0x00ec, 0x0003
.2byte 0x0137, 0x0003, 0xffff, 0x0000
.align 1
gUnknown_0860A770:: @ 860A770
.2byte 0x0137, 0x0003, 0x004c, 0xfffd, 0xffff, 0x0000
.align 1
gUnknown_0860A77C:: @ 860A77C
.2byte 0x0137, 0x0003, 0x004c, 0xfffd, 0xffff, 0x0000
.align 1
gUnknown_0860A788:: @ 860A788
.2byte 0x0055, 0x0003, 0x0009, 0x0003, 0x00d1, 0x0003, 0x0054, 0x0003, 0x00c0, 0x0003, 0x015f, 0x0003, 0x0056, 0x0000, 0x0057, 0x0003
.2byte 0x0158, 0x0003, 0xffff, 0x0000
.align 1
gUnknown_0860A7B0:: @ 860A7B0
.2byte 0x0005, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003
.align 1
gUnknown_0860A7BE:: @ 860A7BE
.2byte 0x0005, 0x0005, 0x0005, 0x0005, 0x0005
.align 1
gUnknown_0860A7C8:: @ 860A7C8
.2byte 0x0004
.align 1
gUnknown_0860A7CA:: @ 860A7CA
.2byte 0x0005
.align 1
gUnknown_0860A7CC:: @ 860A7CC
.2byte 0x0005
.align 1
gUnknown_0860A7CE:: @ 860A7CE
.2byte 0x0003
.align 1
gUnknown_0860A7D0:: @ 860A7D0
.2byte 0x0003
.align 1
gUnknown_0860A7D2:: @ 860A7D2
.2byte 0x0004
.align 1
gUnknown_0860A7D4:: @ 860A7D4
.2byte 0x0003
.align 1
gUnknown_0860A7D6:: @ 860A7D6
.2byte 0x0006
.align 1
gUnknown_0860A7D8:: @ 860A7D8
.2byte 0x0006
.align 1
gUnknown_0860A7DA:: @ 860A7DA
.2byte 0x0006
.align 1
gUnknown_0860A7DC:: @ 860A7DC
.2byte 0x0004
.align 1
gUnknown_0860A7DE:: @ 860A7DE
.2byte 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002
.align 1
gUnknown_0860A7EC:: @ 860A7EC
.2byte 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004
.align 1
gUnknown_0860A7FA:: @ 860A7FA
.2byte 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
.align 1
gUnknown_0860A808:: @ 860A808
.2byte 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002
.align 1
gUnknown_0860A816:: @ 860A816
.2byte 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004
.align 1
gUnknown_0860A824:: @ 860A824
.2byte 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe
.align 2
gUnknown_0860A834:: @ 860A834
.4byte gUnknown_0860A4E0
.4byte gUnknown_0860A68C
.4byte gUnknown_0860A692
.4byte gUnknown_0860A6A0
.4byte gUnknown_0860A728
.4byte gUnknown_0860A770
.4byte gUnknown_0860A77C
.4byte gUnknown_0860A788
.4byte gUnknown_0860A7B0
.4byte gUnknown_0860A7BE
.4byte gUnknown_0860A7C8
.4byte gUnknown_0860A7CA
.4byte gUnknown_0860A7CC
.4byte gUnknown_0860A7CE
.4byte gUnknown_0860A7D0
.4byte gUnknown_0860A7D2
.4byte gUnknown_0860A7D4
.4byte gUnknown_0860A7D6
.4byte gUnknown_0860A7D8
.4byte gUnknown_0860A7DA
.4byte gUnknown_0860A7DA
.4byte gUnknown_0860A7DC
.4byte gUnknown_0860A7DE
.4byte gUnknown_0860A7EC
.4byte gUnknown_0860A7FA
.4byte gUnknown_0860A808
.4byte gUnknown_0860A816
.4byte gUnknown_0860A824
.align 1
gUnknown_0860A8A4:: @ 860A8A4
.2byte 0x0097, 0x00b2, 0x00bc, 0x008c, 0x00b4, 0x00b5, 0x0093, 0x006a, 0x0091, 0x005e, 0x0030, 0x002a, 0x0095, 0x001c, 0x001d, 0x0064
.2byte 0x0060, 0xffff

View File

@ -353,6 +353,91 @@ struct BattleResults
u8 catchAttempts[11]; // 0x36
};
struct BattleTv_Side
{
u32 spikesMonId:3;
u32 reflectMonId:3;
u32 lightScreenMonId:3;
u32 safeguardMonId:3;
u32 mistMonId:3;
u32 futureSightMonId:3;
u32 doomDesireMonId:3;
u32 perishSongMonId:3;
u32 wishMonId:3;
u32 grudgeMonId:3;
u32 usedMoveSlot:2;
u32 spikesMoveSlot:2;
u32 reflectMoveSlot:2;
u32 lightScreenMoveSlot:2;
u32 safeguardMoveSlot:2;
u32 mistMoveSlot:2;
u32 futureSightMoveSlot:2;
u32 doomDesireMoveSlot:2;
u32 perishSongMoveSlot:2;
u32 wishMoveSlot:2;
u32 grudgeMoveSlot:2;
u32 destinyBondMonId:3;
u32 destinyBondMoveSlot:2;
u32 faintCause:4;
u32 faintCauseMonId:3;
u32 explosion:1;
u32 explosionMoveSlot:2;
u32 explosionMonId:3;
u32 perishSong:1;
};
struct BattleTv_Position
{
u32 curseMonId:3;
u32 leechSeedMonId:3;
u32 nightmareMonId:3;
u32 wrapMonId:3;
u32 attractMonId:3;
u32 confusionMonId:3;
u32 curseMoveSlot:2;
u32 leechSeedMoveSlot:2;
u32 nightmareMoveSlot:2;
u32 wrapMoveSlot:2;
u32 attractMoveSlot:2;
u32 confusionMoveSlot:2;
u32 waterSportMoveSlot:2;
u32 waterSportMonId:3;
u32 mudSportMonId:3;
u32 mudSportMoveSlot:2;
u32 ingrainMonId:3;
u32 ingrainMoveSlot:2;
u32 attackedByMonId:3;
u32 attackedByMoveSlot:2;
};
struct BattleTv_Mon
{
u32 psnMonId:3;
u32 badPsnMonId:3;
u32 brnMonId:3;
u32 prlzMonId:3;
u32 slpMonId:3;
u32 frzMonId:3;
u32 psnMoveSlot:2;
u32 badPsnMoveSlot:2;
u32 brnMoveSlot:2;
u32 prlzMoveSlot:2;
u32 slpMoveSlot:2;
u32 frzMoveSlot:2;
};
struct BattleTv
{
struct BattleTv_Mon mon[2][6]; // [side][partyId]
struct BattleTv_Position pos[2][2]; // [side][flank]
struct BattleTv_Side side[2]; // [side]
};
struct BattleTvMovePoints
{
s16 points[2][PARTY_SIZE * 4];
};
struct BattleStruct
{
u8 turnEffectsTracker;
@ -432,7 +517,7 @@ struct BattleStruct
u8 field_B0;
u8 hpScale;
u8 synchronizeMoveEffect;
u8 field_B3;
bool8 anyMonHasTransformed;
void (*savedCallback)(void);
u16 usedHeldItems[MAX_BATTLERS_COUNT];
u8 chosenItem[4]; // why is this an u8?
@ -457,9 +542,9 @@ struct BattleStruct
u8 wishPerishSongBattlerId;
bool8 overworldWeatherDone;
u8 atkCancellerTracker;
u8 field_1A4[96];
u8 field_204[104];
u8 field_26C[40];
struct BattleTvMovePoints tvMovePoints;
struct BattleTv tv;
u8 notSureWhatFieldLol[0x28];
u8 AI_monToSwitchIntoId[MAX_BATTLERS_COUNT];
u8 field_298[8];
u8 field_2A0;
@ -478,6 +563,7 @@ struct BattleStruct
#define IS_MOVE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY)
#define IS_MOVE_SPECIAL(moveType)(moveType > TYPE_MYSTERY)
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit

View File

@ -1,11 +0,0 @@
#ifndef GUARD_BATTLE_LINK_817C95C_H
#define GUARD_BATTLE_LINK_817C95C_H
void sub_817C95C(u16 stringId);
void sub_817E0FC(u16 move, u16 weatherFlags, struct DisableStruct *disableStructPtr);
void sub_817E32C(u8 animationId);
void sub_817E3F4(void);
void sub_817F2A8(void);
u8 GetBattlerMoveSlotId(u8 bank, u16 move);
#endif // GUARD_BATTLE_LINK_817C95C_H

View File

@ -4,16 +4,16 @@
#define WINDOW_CLEAR 0x1
#define WINDOW_x80 0x80
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
void AI_CalcDmg(u8 battlerIdAtk, u8 battlerIdDef);
u8 TypeCalc(u16 move, u8 battlerIdAtk, u8 battlerIdDef);
u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility);
u8 GetBattlerTurnOrderNum(u8 bank);
u8 GetBattlerTurnOrderNum(u8 battlerId);
void SetMoveEffect(bool8 primary, u8 certain);
void BattleDestroyYesNoCursorAt(u8 cursorPosition);
void BattleCreateYesNoCursorAt(u8 cursorPosition);
void BufferMoveToLearnIntoBattleTextBuff2(void);
void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
bool8 UproarWakeUpCheck(u8 bank);
bool8 UproarWakeUpCheck(u8 battlerId);
extern void (* const gBattleScriptingCommandsTable[])(void);
extern const u8 gUnknown_0831C494[][4];

11
include/battle_tv.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_BATTLE_TV_H
#define GUARD_BATTLE_TV_H
void BattleTv_SetDataBasedOnString(u16 stringId);
void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruct *disableStructPtr);
void BattleTv_SetDataBasedOnAnimation(u8 animationId);
void TryPutLinkBattleTvShowOnAir(void);
void BattleTv_ClearExplosionFaintCause(void);
u8 GetBattlerMoveSlotId(u8 battlerId, u16 moveId);
#endif // GUARD_BATTLE_TV_H

View File

@ -188,11 +188,11 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 species;
/*0x02*/ u16 speciesOpponent;
/*0x04*/ u8 playerName[8];
/*0x0C*/ u8 linkOpponentName[8];
/*0x14*/ u16 move;
/*0x16*/ u16 species2;
/*0x16*/ u16 speciesPlayer;
/*0x18*/ u8 battleType;
/*0x19*/ u8 language;
/*0x1A*/ u8 linkOpponentLanguage;

View File

@ -4,17 +4,46 @@
extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void);
void PutPokemonTodayCaughtOnAir(void);
void sub_80EE184(void);
void sub_80EE35C(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove);
void sub_80EE8C8(u16 winStreak, u8 facility);
void DoTVShow(void);
void DoTVShowInSearchOfTrainers(void);
void sub_80EDCE8(void);
void sub_80EE2CC(void);
void sub_80EE72C(void);
void sub_80EED10(void);
void sub_80EED34(void);
void sub_80EED60(u16 delta);
void sub_80F01B8(void);
void sub_80F01E8(void *src, u32 size, u8 masterIdx);
void sub_80EE4DC(struct Pokemon *pokemon, u8 ribbonMonDataIdx);
u32 GetPlayerIDAsU32(void);
bool8 GetPriceReduction(u8 newsKind);
u8 GetRibbonCount(struct Pokemon *pokemon);
void TV_PutSecretBaseVisitOnTheAir(void);
void sub_80EE184(void);
void sub_80EEA70(void);
void sub_80F14F8(TVShow *shows);
size_t sub_80EF370(int value);
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language);
size_t CountDigits(int value);
u8 GetRibbonCount(struct Pokemon *pokemon);
void sub_80EDE70(u16 nCoinsSpent);
void sub_80EDE84(u16 nCoinsSpent);
void sub_80EDD78(u16 nCoinsPaidOut);
void sub_80EEA70(void);
void sub_80EDB44(void);
void sub_80EDC60(const u16 *words);
void sub_80EDA80(void);
void sub_80F0C7C(void *src, u32 size, u8 masterIdx);
void sub_80F0BB8(void);
void sub_80ED950(bool8 flag);
void sub_80EEC80(void);
void sub_80EECA4(void);
void sub_80EECC8(void);
void sub_80EECEC(void);
void sub_80F1208(TVShow *shows);
void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed);
void SetPokemonAnglerSpecies(u16 species);
void UpdateTVShowsPerDay(u16 days);
void PutPokemonTodayCaughtOnAir(void);
void TV_PutSecretBaseVisitOnTheAir(void);
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language);
void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlayer, u16 speciesOpponent);
#endif //GUARD_TV_H

View File

@ -236,7 +236,7 @@ SECTIONS {
src/evolution_graphics.o(.text);
src/bard_music.o(.text);
src/fldeff_teleport.o(.text);
asm/battle_link_817C95C.o(.text);
src/battle_tv.o(.text);
src/pokemon_animation.o(.text);
src/recorded_battle.o(.text);
src/battle_controller_recorded_opponent.o(.text);
@ -510,7 +510,7 @@ SECTIONS {
src/intro_credits_graphics.o(.rodata);
src/evolution_graphics.o(.rodata);
src/bard_music.o(.rodata);
data/battle_link_817C95C.o(.rodata);
src/battle_tv.o(.rodata);
src/pokemon_animation.o(.rodata);
src/battle_controller_recorded_opponent.o(.rodata);
src/battle_controller_recorded_player.o(.rodata);

View File

@ -6,7 +6,7 @@
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
@ -1413,7 +1413,7 @@ static void LinkOpponentHandleMoveAnimation(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDoMoveAnimation;
sub_817E0FC(move, gWeatherMoveAnim, gAnimDisableStructPtr);
BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr);
}
}
}
@ -1477,7 +1477,7 @@ static void LinkOpponentHandlePrintString(void)
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
sub_817C95C(*stringId);
BattleTv_SetDataBasedOnString(*stringId);
}
static void LinkOpponentHandlePrintSelectionString(void)
@ -1830,7 +1830,7 @@ static void LinkOpponentHandleBattleAnimation(void)
else
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedBattleAnimation;
sub_817E32C(animationId);
BattleTv_SetDataBasedOnAnimation(animationId);
}
}

View File

@ -6,7 +6,7 @@
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
@ -1237,7 +1237,7 @@ static void LinkPartnerHandleMoveAnimation(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
gBattlerControllerFuncs[gActiveBattler] = LinkPartnerDoMoveAnimation;
sub_817E0FC(move, gWeatherMoveAnim, gAnimDisableStructPtr);
BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr);
}
}
}
@ -1301,7 +1301,7 @@ static void LinkPartnerHandlePrintString(void)
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
sub_817C95C(*stringId);
BattleTv_SetDataBasedOnString(*stringId);
}
static void LinkPartnerHandlePrintSelectionString(void)
@ -1665,7 +1665,7 @@ static void LinkPartnerHandleBattleAnimation(void)
else
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedBattleAnimation;
sub_817E32C(animationId);
BattleTv_SetDataBasedOnAnimation(animationId);
}
}

View File

@ -5,7 +5,7 @@
#include "battle_interface.h"
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "battle_ai_script_commands.h"
#include "pokemon.h"
#include "link.h"

View File

@ -5,7 +5,7 @@
#include "battle_interface.h"
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
@ -879,7 +879,7 @@ static void sub_80586F8(void)
gMain.callback1 = gPreBattleCallback1;
SetMainCallback2(sub_8038D64);
if (gBattleOutcome == B_OUTCOME_WON)
sub_817E3F4();
TryPutLinkBattleTvShowOnAir();
FreeAllWindowBuffers();
}
}
@ -892,7 +892,7 @@ static void sub_80586F8(void)
gMain.callback1 = gPreBattleCallback1;
SetMainCallback2(sub_8038D64);
if (gBattleOutcome == B_OUTCOME_WON)
sub_817E3F4();
TryPutLinkBattleTvShowOnAir();
FreeAllWindowBuffers();
}
}
@ -2482,7 +2482,7 @@ static void PlayerHandleMoveAnimation(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
gBattlerControllerFuncs[gActiveBattler] = PlayerDoMoveAnimation;
sub_817E0FC(move, gWeatherMoveAnim, gAnimDisableStructPtr);
BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr);
}
}
}
@ -2546,7 +2546,7 @@ static void PlayerHandlePrintString(void)
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
sub_817C95C(*stringId);
BattleTv_SetDataBasedOnString(*stringId);
sub_81A57E4(gActiveBattler, *stringId);
}
@ -2573,7 +2573,7 @@ static void PlayerHandleChooseAction(void)
s32 i;
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
sub_817F2A8();
BattleTv_ClearExplosionFaintCause();
BattleHandleAddTextPrinter(gText_BattleMenu, 2);
for (i = 0; i < 4; i++)
@ -3067,7 +3067,7 @@ static void PlayerHandleBattleAnimation(void)
else
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedBattleAnimation;
sub_817E32C(animationId);
BattleTv_SetDataBasedOnAnimation(animationId);
}
}

View File

@ -6,7 +6,7 @@
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "recorded_battle.h"
#include "pokemon.h"
#include "link.h"

View File

@ -5,7 +5,7 @@
#include "battle_interface.h"
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"

View File

@ -96,7 +96,6 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
void sub_8032768(void)
{
s32 i;
u8 *data;
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
sub_8184DA4(1);
@ -119,11 +118,11 @@ void sub_8032768(void)
sub_81B8D64(i, 0);
}
for (i = 0; i < sizeof(gBattleStruct->field_1A4); i++)
*(gBattleStruct->field_1A4 + i) = 0;
for (i = 0; i < sizeof(gBattleStruct->tvMovePoints); i++)
*((u8*)(&gBattleStruct->tvMovePoints) + i) = 0;
for (i = 0; i < sizeof(gBattleStruct->field_204); i++)
*(gBattleStruct->field_204 + i) = 0;
for (i = 0; i < sizeof(gBattleStruct->tv); i++)
*((u8*)(&gBattleStruct->tv) + i) = 0;
}
static void InitSinglePlayerBtlControllers(void)

View File

@ -514,375 +514,375 @@ const u8 gText_Trainer2LoseText[];
const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
gText_Trainer1LoseText,
gText_PkmnGainedEXP,
gText_PkmnGrewToLv,
gText_PkmnLearnedMove,
gText_TryToLearnMove1,
gText_TryToLearnMove2,
gText_TryToLearnMove3,
gText_PkmnForgotMove,
gText_StopLearningMove,
gText_DidNotLearnMove,
gText_PkmnLearnedMove2,
gText_AttackMissed,
gText_PkmnProtectedItself,
gText_StatsWontIncrease2,
gText_AvoidedDamage,
gText_ItDoesntAffect,
gText_AttackerFainted,
gText_TargetFainted,
gText_PlayerGotMoney,
gText_PlayerWhiteout,
gText_PlayerWhiteout2,
gText_PreventsEscape,
gText_HitXTimes,
gText_PkmnFellAsleep,
gText_PkmnMadeSleep,
gText_PkmnAlreadyAsleep,
gText_PkmnAlreadyAsleep2,
gText_PkmnWasntAffected,
gText_PkmnWasPoisoned,
gText_PkmnPoisonedBy,
gText_PkmnHurtByPoison,
gText_PkmnAlreadyPoisoned,
gText_PkmnBadlyPoisoned,
gText_PkmnEnergyDrained,
gText_PkmnWasBurned,
gText_PkmnBurnedBy,
gText_PkmnHurtByBurn,
gText_PkmnWasFrozen,
gText_PkmnFrozenBy,
gText_PkmnIsFrozen,
gText_PkmnWasDefrosted,
gText_PkmnWasDefrosted2,
gText_PkmnWasDefrostedBy,
gText_PkmnWasParalyzed,
gText_PkmnWasParalyzedBy,
gText_PkmnIsParalyzed,
gText_PkmnIsAlreadyParalyzed,
gText_PkmnHealedParalysis,
gText_PkmnDreamEaten,
gText_StatsWontIncrease,
gText_StatsWontDecrease,
gText_TeamStoppedWorking,
gText_FoeStoppedWorking,
gText_PkmnIsConfused,
gText_PkmnHealedConfusion,
gText_PkmnWasConfused,
gText_PkmnAlreadyConfused,
gText_PkmnFellInLove,
gText_PkmnInLove,
gText_PkmnImmobilizedByLove,
gText_PkmnBlownAway,
gText_PkmnChangedType,
gText_PkmnFlinched,
gText_PkmnRegainedHealth,
gText_PkmnHPFull,
gText_PkmnRaisedSpDef,
gText_PkmnRaisedDef,
gText_PkmnCoveredByVeil,
gText_PkmnUsedSafeguard,
gText_PkmnSafeguardExpired,
gText_PkmnWentToSleep,
gText_PkmnSleptHealthy,
gText_PkmnWhippedWhirlwind,
gText_PkmnTookSunlight,
gText_PkmnLoweredHead,
gText_PkmnIsGlowing,
gText_PkmnFlewHigh,
gText_PkmnDugHole,
gText_PkmnSqueezedByBind,
gText_PkmnTrappedInVortex,
gText_PkmnWrappedBy,
gText_PkmnClamped,
gText_PkmnHurtBy,
gText_PkmnFreedFrom,
gText_PkmnCrashed,
gText_PkmnShroudedInMist,
gText_PkmnProtectedByMist,
gText_PkmnGettingPumped,
gText_PkmnHitWithRecoil,
gText_PkmnProtectedItself2,
gText_PkmnBuffetedBySandstorm,
gText_PkmnPeltedByHail,
gText_PkmnSeeded,
gText_PkmnEvadedAttack,
gText_PkmnSappedByLeechSeed,
gText_PkmnFastAsleep,
gText_PkmnWokeUp,
gText_PkmnUproarKeptAwake,
gText_PkmnWokeUpInUproar,
gText_PkmnCausedUproar,
gText_PkmnMakingUproar,
gText_PkmnCalmedDown,
gText_PkmnCantSleepInUproar,
gText_PkmnStockpiled,
gText_PkmnCantStockpile,
gText_PkmnCantSleepInUproar2,
gText_UproarKeptPkmnAwake,
gText_PkmnStayedAwakeUsing,
gText_PkmnStoringEnergy,
gText_PkmnUnleashedEnergy,
gText_PkmnFatigueConfusion,
gText_PkmnPickedUpItem,
gText_PkmnUnaffected,
gText_PkmnTransformedInto,
gText_PkmnMadeSubstitute,
gText_PkmnHasSubstitute,
gText_SubstituteDamaged,
gText_PkmnSubstituteFaded,
gText_PkmnMustRecharge,
gText_PkmnRageBuilding,
gText_PkmnMoveWasDisabled,
gText_PkmnMoveIsDisabled,
gText_PkmnMoveDisabledNoMore,
gText_PkmnGotEncore,
gText_PkmnEncoreEnded,
gText_PkmnTookAim,
gText_PkmnSketchedMove,
gText_PkmnTryingToTakeFoe,
gText_PkmnTookFoe,
gText_PkmnReducedPP,
gText_PkmnStoleItem,
gText_TargetCantEscapeNow,
gText_PkmnFellIntoNightmare,
gText_PkmnLockedInNightmare,
gText_PkmnLaidCurse,
gText_PkmnAfflictedByCurse,
gText_SpikesScattered,
gText_PkmnHurtBySpikes,
gText_PkmnIdentified,
gText_PkmnPerishCountFell,
gText_PkmnBracedItself,
gText_PkmnEnduredHit,
gText_MagnitudeStrength,
gText_PkmnCutHPMaxedAttack,
gText_PkmnCopiedStatChanges,
gText_PkmnGotFree,
gText_PkmnShedLeechSeed,
gText_PkmnBlewAwaySpikes,
gText_PkmnFledFromBattle,
gText_PkmnForesawAttack,
gText_PkmnTookAttack,
gText_PkmnAttack,
gText_PkmnCenterAttention,
gText_PkmnChargingPower,
gText_NaturePowerTurnedInto,
gText_PkmnStatusNormal,
gText_PkmnHasNoMovesLeft,
gText_PkmnSubjectedToTorment,
gText_PkmnCantUseMoveTorment,
gText_PkmnTighteningFocus,
gText_PkmnFellForTaunt,
gText_PkmnCantUseMoveTaunt,
gText_PkmnReadyToHelp,
gText_PkmnSwitchedItems,
gText_PkmnCopiedFoe,
gText_PkmnMadeWish,
gText_PkmnWishCameTrue,
gText_PkmnPlantedRoots,
gText_PkmnAbsorbedNutrients,
gText_PkmnAnchoredItself,
gText_PkmnWasMadeDrowsy,
gText_PkmnKnockedOff,
gText_PkmnSwappedAbilities,
gText_PkmnSealedOpponentMove,
gText_PkmnCantUseMoveSealed,
gText_PkmnWantsGrudge,
gText_PkmnLostPPGrudge,
gText_PkmnShroudedItself,
gText_PkmnMoveBounced,
gText_PkmnWaitsForTarget,
gText_PkmnSnatchedMove,
gText_PkmnMadeItRain,
gText_PkmnRaisedSpeed,
gText_PkmnProtectedBy,
gText_PkmnPreventsUsage,
gText_PkmnRestoredHPUsing,
gText_PkmnChangedTypeWith,
gText_PkmnPreventsParalysisWith,
gText_PkmnPreventsRomanceWith,
gText_PkmnPreventsPoisoningWith,
gText_PkmnPreventsConfusionWith,
gText_PkmnRaisedFirePowerWith,
gText_PkmnAnchorsItselfWith,
gText_PkmnCutsAttackWith,
gText_PkmnPreventsStatLossWith,
gText_PkmnHurtsWith,
gText_PkmnTraced,
gText_StatSharply,
gText_StatRose,
gText_StatHarshly,
gText_StatFell,
gText_PkmnsStatChanged,
gText_PkmnsStatChanged2,
gText_PkmnsStatChanged3,
gText_PkmnsStatChanged4,
gText_CriticalHit,
gText_OneHitKO,
gText_123Poof,
gText_AndEllipsis,
gText_NotVeryEffective,
gText_SuperEffective,
gText_GotAwaySafely,
gText_WildPkmnFled,
gText_NoRunningFromTrainers,
gText_CantEscape,
gText_DontLeaveBirch,
gText_ButNothingHappened,
gText_ButItFailed,
gText_ItHurtConfusion,
gText_MirrorMoveFailed,
gText_StartedToRain,
gText_DownpourStarted,
gText_RainContinues,
gText_DownpourContinues,
gText_RainStopped,
gText_SandstormBrewed,
gText_SandstormRages,
gText_SandstormSubsided,
gText_SunlightGotBright,
gText_SunlightStrong,
gText_SunlightFaded,
gText_StartedHail,
gText_HailContinues,
gText_HailStopped,
gText_FailedToSpitUp,
gText_FailedToSwallow,
gText_WindBecameHeatWave,
gText_StatChangesGone,
gText_CoinsScattered,
gText_TooWeakForSubstitute,
gText_SharedPain,
gText_BellChimed,
gText_FaintInThree,
gText_NoPPLeft,
gText_ButNoPPLeft,
gText_PlayerUsedItem,
gText_WallyUsedItem,
gText_TrainerBlockedBall,
gText_DontBeAThief,
gText_ItDodgedBall,
gText_YouMissedPkmn,
gText_PkmnBrokeFree,
gText_ItAppearedCaught,
gText_AarghAlmostHadIt,
gText_ShootSoClose,
gText_GotchaPkmnCaught,
gText_GotchaPkmnCaught2,
gText_GiveNicknameCaptured,
gText_PkmnSentToPC,
gText_PkmnDataAddedToDex,
gText_ItIsRaining,
gText_SandstormIsRaging,
gText_CantEscape2,
gText_PkmnIgnoresAsleep,
gText_PkmnIgnoredOrders,
gText_PkmnBeganToNap,
gText_PkmnLoafing,
gText_PkmnWontObey,
gText_PkmnTurnedAway,
gText_PkmnPretendNotNotice,
gText_EnemyAboutToSwitchPkmn,
gText_CreptCloser,
gText_CantGetCloser,
gText_PkmnWatchingCarefully,
gText_PkmnCuriousAboutX,
gText_PkmnEnthralledByX,
gText_PkmnIgnoredX,
gText_ThrewPokeblockAtPkmn,
gText_OutOfSafariBalls,
gText_PkmnsItemCuredParalysis,
gText_PkmnsItemCuredPoison,
gText_PkmnsItemHealedBurn,
gText_PkmnsItemDefrostedIt,
gText_PkmnsItemWokeIt,
gText_PkmnsItemSnappedOut,
gText_PkmnsItemCuredProblem,
gText_PkmnsItemRestoredHealth,
gText_PkmnsItemRestoredPP,
gText_PkmnsItemRestoredStatus,
gText_PkmnsItemRestoredHPALittle,
gText_ItemAllowsOnlyYMove,
gText_PkmnHungOnWithX,
gText_EmptyString3,
gText_PkmnsXPreventsBurns,
gText_PkmnsXBlocksY,
gText_PkmnsXRestoredHPALittle2,
gText_PkmnsXWhippedUpSandstorm,
gText_PkmnsXPreventsYLoss,
gText_PkmnsXInfatuatedY,
gText_PkmnsXMadeYIneffective,
gText_PkmnsXCuredYProblem,
gText_ItSuckedLiquidOoze,
gText_PkmnTransformed,
gText_ElectricityWeakened,
gText_FireWeakened,
gText_PkmnHidUnderwater,
gText_PkmnSprangUp,
gText_HMMovesCantBeForgotten,
gText_XFoundOneY,
gText_PlayerDefeatedLinkTrainerTrainer1,
gText_SoothingAroma,
gText_ItemsCantBeUsedNow,
gText_ForXCommaYZ,
gText_UsingXTheYOfZN,
gText_PkmnUsedXToGetPumped,
gText_PkmnsXMadeYUseless,
gText_PkmnTrappedBySandTomb,
gText_EmptyString4,
gText_ABoosted,
gText_PkmnsXIntensifiedSun,
gText_PkmnMakesGroundMiss,
gText_YouThrowABallNowRight,
gText_PkmnsXTookAttack,
gText_PkmnChoseXAsDestiny,
gText_PkmnLostFocus,
gText_UseNextPkmn,
gText_PkmnFledUsingIts,
gText_PkmnFledUsing,
gText_PkmnWasDraggedOut,
gText_PreventedFromWorking,
gText_PkmnsItemNormalizedStatus,
gText_Trainer1UsedItem,
gText_BoxIsFull,
gText_PkmnAvoidedAttack,
gText_PkmnsXMadeItIneffective,
gText_PkmnsXPreventsFlinching,
gText_PkmnAlreadyHasBurn,
gText_StatsWontDecrease2,
gText_PkmnsXBlocksY2,
gText_PkmnsXWoreOff,
gText_PkmnRaisedDefALittle,
gText_PkmnRaisedSpDefALittle,
gText_TheWallShattered,
gText_PkmnsXPreventsYsZ,
gText_PkmnsXCuredItsYProblem,
gText_AttackerCantEscape,
gText_PkmnObtainedX,
gText_PkmnObtainedX2,
gText_PkmnObtainedXYObtainedZ,
gText_ButNoEffect,
gText_PkmnsXHadNoEffectOnY,
gText_TwoInGameTrainersDefeated,
gText_Trainer2LoseText,
gText_PkmnIncapableOfPower,
gText_GlintAppearsInEye,
gText_PkmnGettingIntoPosition,
gText_PkmnBeganGrowlingDeeply,
gText_PkmnEagerForMore,
gText_DefeatedOpponentByReferee,
gText_LostToOpponentByReferee,
gText_TiedOpponentByReferee,
gText_QuestionForfeitMatch,
gText_ForfeitedMatch,
gText_PkmnTransferredSomeonesPC,
gText_PkmnTransferredLanettesPC,
gText_PkmnBoxSomeonesPCFull,
gText_PkmnBoxLanettesPCFull,
gText_Trainer1WinText,
gText_Trainer2WinText,
gText_Trainer1LoseText, // 12
gText_PkmnGainedEXP, // 13
gText_PkmnGrewToLv, // 14
gText_PkmnLearnedMove, // 15
gText_TryToLearnMove1, // 16
gText_TryToLearnMove2, // 17
gText_TryToLearnMove3, // 18
gText_PkmnForgotMove, // 19
gText_StopLearningMove, // 20
gText_DidNotLearnMove, // 21
gText_PkmnLearnedMove2, // 22
gText_AttackMissed, // 23
gText_PkmnProtectedItself, // 24
gText_StatsWontIncrease2, // 25
gText_AvoidedDamage, // 26
gText_ItDoesntAffect, // 27
gText_AttackerFainted, // 28
gText_TargetFainted, // 29
gText_PlayerGotMoney, // 30
gText_PlayerWhiteout, // 31
gText_PlayerWhiteout2, // 32
gText_PreventsEscape, // 33
gText_HitXTimes, // 34
gText_PkmnFellAsleep, // 35
gText_PkmnMadeSleep, // 36
gText_PkmnAlreadyAsleep, // 37
gText_PkmnAlreadyAsleep2, // 38
gText_PkmnWasntAffected, // 39
gText_PkmnWasPoisoned, // 40
gText_PkmnPoisonedBy, // 41
gText_PkmnHurtByPoison, // 42
gText_PkmnAlreadyPoisoned, // 43
gText_PkmnBadlyPoisoned, // 44
gText_PkmnEnergyDrained, // 45
gText_PkmnWasBurned, // 46
gText_PkmnBurnedBy, // 47
gText_PkmnHurtByBurn, // 48
gText_PkmnWasFrozen, // 49
gText_PkmnFrozenBy, // 50
gText_PkmnIsFrozen, // 51
gText_PkmnWasDefrosted, // 52
gText_PkmnWasDefrosted2, // 53
gText_PkmnWasDefrostedBy, // 54
gText_PkmnWasParalyzed, // 55
gText_PkmnWasParalyzedBy, // 56
gText_PkmnIsParalyzed, // 57
gText_PkmnIsAlreadyParalyzed, // 58
gText_PkmnHealedParalysis, // 59
gText_PkmnDreamEaten, // 60
gText_StatsWontIncrease, // 61
gText_StatsWontDecrease, // 62
gText_TeamStoppedWorking, // 63
gText_FoeStoppedWorking, // 64
gText_PkmnIsConfused, // 65
gText_PkmnHealedConfusion, // 66
gText_PkmnWasConfused, // 67
gText_PkmnAlreadyConfused, // 68
gText_PkmnFellInLove, // 69
gText_PkmnInLove, // 70
gText_PkmnImmobilizedByLove, // 71
gText_PkmnBlownAway, // 72
gText_PkmnChangedType, // 73
gText_PkmnFlinched, // 74
gText_PkmnRegainedHealth, // 75
gText_PkmnHPFull, // 76
gText_PkmnRaisedSpDef, // 77
gText_PkmnRaisedDef, // 78
gText_PkmnCoveredByVeil, // 79
gText_PkmnUsedSafeguard, // 80
gText_PkmnSafeguardExpired, // 81
gText_PkmnWentToSleep, // 82
gText_PkmnSleptHealthy, // 83
gText_PkmnWhippedWhirlwind, // 84
gText_PkmnTookSunlight, // 85
gText_PkmnLoweredHead, // 86
gText_PkmnIsGlowing, // 87
gText_PkmnFlewHigh, // 88
gText_PkmnDugHole, // 89
gText_PkmnSqueezedByBind, // 90
gText_PkmnTrappedInVortex, // 91
gText_PkmnWrappedBy, // 92
gText_PkmnClamped, // 93
gText_PkmnHurtBy, // 94
gText_PkmnFreedFrom, // 95
gText_PkmnCrashed, // 96
gText_PkmnShroudedInMist, // 97
gText_PkmnProtectedByMist, // 98
gText_PkmnGettingPumped, // 99
gText_PkmnHitWithRecoil, // 100
gText_PkmnProtectedItself2, // 101
gText_PkmnBuffetedBySandstorm, // 102
gText_PkmnPeltedByHail, // 103
gText_PkmnSeeded, // 104
gText_PkmnEvadedAttack, // 105
gText_PkmnSappedByLeechSeed, // 106
gText_PkmnFastAsleep, // 107
gText_PkmnWokeUp, // 108
gText_PkmnUproarKeptAwake, // 109
gText_PkmnWokeUpInUproar, // 110
gText_PkmnCausedUproar, // 111
gText_PkmnMakingUproar, // 112
gText_PkmnCalmedDown, // 113
gText_PkmnCantSleepInUproar, // 114
gText_PkmnStockpiled, // 115
gText_PkmnCantStockpile, // 116
gText_PkmnCantSleepInUproar2, // 117
gText_UproarKeptPkmnAwake, // 118
gText_PkmnStayedAwakeUsing, // 119
gText_PkmnStoringEnergy, // 120
gText_PkmnUnleashedEnergy, // 121
gText_PkmnFatigueConfusion, // 122
gText_PkmnPickedUpItem, // 123
gText_PkmnUnaffected, // 124
gText_PkmnTransformedInto, // 125
gText_PkmnMadeSubstitute, // 126
gText_PkmnHasSubstitute, // 127
gText_SubstituteDamaged, // 128
gText_PkmnSubstituteFaded, // 129
gText_PkmnMustRecharge, // 130
gText_PkmnRageBuilding, // 131
gText_PkmnMoveWasDisabled, // 132
gText_PkmnMoveIsDisabled, // 133
gText_PkmnMoveDisabledNoMore, // 134
gText_PkmnGotEncore, // 135
gText_PkmnEncoreEnded, // 136
gText_PkmnTookAim, // 137
gText_PkmnSketchedMove, // 138
gText_PkmnTryingToTakeFoe, // 139
gText_PkmnTookFoe, // 140
gText_PkmnReducedPP, // 141
gText_PkmnStoleItem, // 142
gText_TargetCantEscapeNow, // 143
gText_PkmnFellIntoNightmare, // 144
gText_PkmnLockedInNightmare, // 145
gText_PkmnLaidCurse, // 146
gText_PkmnAfflictedByCurse, // 147
gText_SpikesScattered, // 148
gText_PkmnHurtBySpikes, // 149
gText_PkmnIdentified, // 150
gText_PkmnPerishCountFell, // 151
gText_PkmnBracedItself, // 152
gText_PkmnEnduredHit, // 153
gText_MagnitudeStrength, // 154
gText_PkmnCutHPMaxedAttack, // 155
gText_PkmnCopiedStatChanges, // 156
gText_PkmnGotFree, // 157
gText_PkmnShedLeechSeed, // 158
gText_PkmnBlewAwaySpikes, // 159
gText_PkmnFledFromBattle, // 160
gText_PkmnForesawAttack, // 161
gText_PkmnTookAttack, // 162
gText_PkmnAttack, // 163
gText_PkmnCenterAttention, // 164
gText_PkmnChargingPower, // 165
gText_NaturePowerTurnedInto, // 166
gText_PkmnStatusNormal, // 167
gText_PkmnHasNoMovesLeft, // 168
gText_PkmnSubjectedToTorment, // 169
gText_PkmnCantUseMoveTorment, // 170
gText_PkmnTighteningFocus, // 171
gText_PkmnFellForTaunt, // 172
gText_PkmnCantUseMoveTaunt, // 173
gText_PkmnReadyToHelp, // 174
gText_PkmnSwitchedItems, // 175
gText_PkmnCopiedFoe, // 176
gText_PkmnMadeWish, // 177
gText_PkmnWishCameTrue, // 178
gText_PkmnPlantedRoots, // 179
gText_PkmnAbsorbedNutrients, // 180
gText_PkmnAnchoredItself, // 181
gText_PkmnWasMadeDrowsy, // 182
gText_PkmnKnockedOff, // 183
gText_PkmnSwappedAbilities, // 184
gText_PkmnSealedOpponentMove, // 185
gText_PkmnCantUseMoveSealed, // 186
gText_PkmnWantsGrudge, // 187
gText_PkmnLostPPGrudge, // 188
gText_PkmnShroudedItself, // 189
gText_PkmnMoveBounced, // 190
gText_PkmnWaitsForTarget, // 191
gText_PkmnSnatchedMove, // 192
gText_PkmnMadeItRain, // 193
gText_PkmnRaisedSpeed, // 194
gText_PkmnProtectedBy, // 195
gText_PkmnPreventsUsage, // 196
gText_PkmnRestoredHPUsing, // 197
gText_PkmnChangedTypeWith, // 198
gText_PkmnPreventsParalysisWith, // 199
gText_PkmnPreventsRomanceWith, // 200
gText_PkmnPreventsPoisoningWith, // 201
gText_PkmnPreventsConfusionWith, // 202
gText_PkmnRaisedFirePowerWith, // 203
gText_PkmnAnchorsItselfWith, // 204
gText_PkmnCutsAttackWith, // 205
gText_PkmnPreventsStatLossWith, // 206
gText_PkmnHurtsWith, // 207
gText_PkmnTraced, // 208
gText_StatSharply, // 209
gText_StatRose, // 210
gText_StatHarshly, // 211
gText_StatFell, // 212
gText_PkmnsStatChanged, // 213
gText_PkmnsStatChanged2, // 214
gText_PkmnsStatChanged3, // 215
gText_PkmnsStatChanged4, // 216
gText_CriticalHit, // 217
gText_OneHitKO, // 218
gText_123Poof, // 219
gText_AndEllipsis, // 220
gText_NotVeryEffective, // 221
gText_SuperEffective, // 222
gText_GotAwaySafely, // 223
gText_WildPkmnFled, // 224
gText_NoRunningFromTrainers, // 225
gText_CantEscape, // 226
gText_DontLeaveBirch, // 227
gText_ButNothingHappened, // 228
gText_ButItFailed, // 229
gText_ItHurtConfusion, // 230
gText_MirrorMoveFailed, // 231
gText_StartedToRain, // 232
gText_DownpourStarted, // 233
gText_RainContinues, // 234
gText_DownpourContinues, // 235
gText_RainStopped, // 236
gText_SandstormBrewed, // 237
gText_SandstormRages, // 238
gText_SandstormSubsided, // 239
gText_SunlightGotBright, // 240
gText_SunlightStrong, // 241
gText_SunlightFaded, // 242
gText_StartedHail, // 243
gText_HailContinues, // 244
gText_HailStopped, // 245
gText_FailedToSpitUp, // 246
gText_FailedToSwallow, // 247
gText_WindBecameHeatWave, // 248
gText_StatChangesGone, // 249
gText_CoinsScattered, // 250
gText_TooWeakForSubstitute, // 251
gText_SharedPain, // 252
gText_BellChimed, // 253
gText_FaintInThree, // 254
gText_NoPPLeft, // 255
gText_ButNoPPLeft, // 256
gText_PlayerUsedItem, // 257
gText_WallyUsedItem, // 258
gText_TrainerBlockedBall, // 259
gText_DontBeAThief, // 260
gText_ItDodgedBall, // 261
gText_YouMissedPkmn, // 262
gText_PkmnBrokeFree, // 263
gText_ItAppearedCaught, // 264
gText_AarghAlmostHadIt, // 265
gText_ShootSoClose, // 266
gText_GotchaPkmnCaught, // 267
gText_GotchaPkmnCaught2, // 268
gText_GiveNicknameCaptured, // 269
gText_PkmnSentToPC, // 270
gText_PkmnDataAddedToDex, // 271
gText_ItIsRaining, // 272
gText_SandstormIsRaging, // 273
gText_CantEscape2, // 274
gText_PkmnIgnoresAsleep, // 275
gText_PkmnIgnoredOrders, // 276
gText_PkmnBeganToNap, // 277
gText_PkmnLoafing, // 278
gText_PkmnWontObey, // 279
gText_PkmnTurnedAway, // 280
gText_PkmnPretendNotNotice, // 281
gText_EnemyAboutToSwitchPkmn, // 282
gText_CreptCloser, // 283
gText_CantGetCloser, // 284
gText_PkmnWatchingCarefully, // 285
gText_PkmnCuriousAboutX, // 286
gText_PkmnEnthralledByX, // 287
gText_PkmnIgnoredX, // 288
gText_ThrewPokeblockAtPkmn, // 289
gText_OutOfSafariBalls, // 290
gText_PkmnsItemCuredParalysis, // 291
gText_PkmnsItemCuredPoison, // 292
gText_PkmnsItemHealedBurn, // 293
gText_PkmnsItemDefrostedIt, // 294
gText_PkmnsItemWokeIt, // 295
gText_PkmnsItemSnappedOut, // 296
gText_PkmnsItemCuredProblem, // 297
gText_PkmnsItemRestoredHealth, // 298
gText_PkmnsItemRestoredPP, // 299
gText_PkmnsItemRestoredStatus, // 300
gText_PkmnsItemRestoredHPALittle, // 301
gText_ItemAllowsOnlyYMove, // 302
gText_PkmnHungOnWithX, // 303
gText_EmptyString3, // 304
gText_PkmnsXPreventsBurns, // 305
gText_PkmnsXBlocksY, // 306
gText_PkmnsXRestoredHPALittle2, // 307
gText_PkmnsXWhippedUpSandstorm, // 308
gText_PkmnsXPreventsYLoss, // 309
gText_PkmnsXInfatuatedY, // 310
gText_PkmnsXMadeYIneffective, // 311
gText_PkmnsXCuredYProblem, // 312
gText_ItSuckedLiquidOoze, // 313
gText_PkmnTransformed, // 314
gText_ElectricityWeakened, // 315
gText_FireWeakened, // 316
gText_PkmnHidUnderwater, // 317
gText_PkmnSprangUp, // 318
gText_HMMovesCantBeForgotten, // 319
gText_XFoundOneY, // 320
gText_PlayerDefeatedLinkTrainerTrainer1, // 321
gText_SoothingAroma, // 322
gText_ItemsCantBeUsedNow, // 323
gText_ForXCommaYZ, // 324
gText_UsingXTheYOfZN, // 325
gText_PkmnUsedXToGetPumped, // 326
gText_PkmnsXMadeYUseless, // 327
gText_PkmnTrappedBySandTomb, // 328
gText_EmptyString4, // 329
gText_ABoosted, // 330
gText_PkmnsXIntensifiedSun, // 331
gText_PkmnMakesGroundMiss, // 332
gText_YouThrowABallNowRight, // 333
gText_PkmnsXTookAttack, // 334
gText_PkmnChoseXAsDestiny, // 335
gText_PkmnLostFocus, // 336
gText_UseNextPkmn, // 337
gText_PkmnFledUsingIts, // 338
gText_PkmnFledUsing, // 339
gText_PkmnWasDraggedOut, // 340
gText_PreventedFromWorking, // 341
gText_PkmnsItemNormalizedStatus, // 342
gText_Trainer1UsedItem, // 343
gText_BoxIsFull, // 344
gText_PkmnAvoidedAttack, // 345
gText_PkmnsXMadeItIneffective, // 346
gText_PkmnsXPreventsFlinching, // 347
gText_PkmnAlreadyHasBurn, // 348
gText_StatsWontDecrease2, // 349
gText_PkmnsXBlocksY2, // 350
gText_PkmnsXWoreOff, // 351
gText_PkmnRaisedDefALittle, // 352
gText_PkmnRaisedSpDefALittle, // 353
gText_TheWallShattered, // 354
gText_PkmnsXPreventsYsZ, // 355
gText_PkmnsXCuredItsYProblem, // 356
gText_AttackerCantEscape, // 357
gText_PkmnObtainedX, // 358
gText_PkmnObtainedX2, // 359
gText_PkmnObtainedXYObtainedZ, // 360
gText_ButNoEffect, // 361
gText_PkmnsXHadNoEffectOnY, // 362
gText_TwoInGameTrainersDefeated, // 363
gText_Trainer2LoseText, // 364
gText_PkmnIncapableOfPower, // 365
gText_GlintAppearsInEye, // 366
gText_PkmnGettingIntoPosition, // 367
gText_PkmnBeganGrowlingDeeply, // 368
gText_PkmnEagerForMore, // 369
gText_DefeatedOpponentByReferee, // 370
gText_LostToOpponentByReferee, // 371
gText_TiedOpponentByReferee, // 372
gText_QuestionForfeitMatch, // 373
gText_ForfeitedMatch, // 374
gText_PkmnTransferredSomeonesPC, // 375
gText_PkmnTransferredLanettesPC, // 376
gText_PkmnBoxSomeonesPCFull, // 377
gText_PkmnBoxLanettesPCFull, // 378
gText_Trainer1WinText, // 379
gText_Trainer2WinText, // 380
};
const u16 gMissStringIds[] =

1576
src/battle_tv.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2198,7 +2198,7 @@ void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
(var) /= (gStatStageRatios)[(mon)->statStages[(statIndex)]][1]; \
}
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef)
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef)
{
u32 i;
s32 damage = 0;
@ -2228,8 +2228,8 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attacker->item == ITEM_ENIGMA_BERRY)
{
attackerHoldEffect = gEnigmaBerries[bankAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[bankAtk].holdEffectParam;
attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam;
}
else
{
@ -2239,8 +2239,8 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (defender->item == ITEM_ENIGMA_BERRY)
{
defenderHoldEffect = gEnigmaBerries[bankDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[bankDef].holdEffectParam;
defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam;
}
else
{
@ -2251,13 +2251,13 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attacker->ability == ABILITY_HUGE_POWER || attacker->ability == ABILITY_PURE_POWER)
attack *= 2;
if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, bankAtk))
if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerIdAtk))
attack = (110 * attack) / 100;
if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, bankDef))
if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerIdDef))
defense = (110 * defense) / 100;
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, bankAtk))
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdAtk))
spAttack = (110 * spAttack) / 100;
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, bankDef))
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdDef))
spDefense = (110 * spDefense) / 100;
for (i = 0; i < ARRAY_COUNT(sHoldEffectToType); i++)
@ -2442,7 +2442,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
}
// flash fire triggered
if ((gBattleResources->flags->flags[bankAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE)
if ((gBattleResources->flags->flags[battlerIdAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE)
damage = (15 * damage) / 10;
}

View File

@ -1612,7 +1612,7 @@ bool8 ScrCmd_buffernumberstring(struct ScriptContext *ctx)
{
u8 stringVarIndex = ScriptReadByte(ctx);
u16 v1 = VarGet(ScriptReadHalfword(ctx));
u8 v2 = sub_80EF370(v1);
u8 v2 = CountDigits(v1);
ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], v1, 0, v2);
return FALSE;

483
src/tv.c

File diff suppressed because it is too large Load Diff