summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h146
-rw-r--r--include/battle_script_commands.h65
-rw-r--r--include/battle_string_ids.h387
-rw-r--r--include/battle_util.h4
-rw-r--r--include/ewram.h2
5 files changed, 587 insertions, 17 deletions
diff --git a/include/battle.h b/include/battle.h
index c94325cd5..d3cbd24f5 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -4,6 +4,30 @@
#include "sprite.h"
#include "constants/battle_constants.h"
+/*
+ Banks are a name given to what could be called a 'battlerId' or 'monControllerId'.
+ Each bank has a value consisting of two bits.
+ 0x1 bit is responsible for the side, 0 = player's side, 1 = opponent's side.
+ 0x2 bit is responsible for the id of sent out pokemon. 0 means it's the first sent out pokemon, 1 it's the second one. (Triple battle didn't exist at the time yet.)
+*/
+
+#define BATTLE_BANKS_COUNT 4
+
+#define IDENTITY_PLAYER_MON1 0
+#define IDENTITY_OPPONENT_MON1 1
+#define IDENTITY_PLAYER_MON2 2
+#define IDENTITY_OPPONENT_MON2 3
+
+#define SIDE_PLAYER 0x0
+#define SIDE_OPPONENT 0x1
+
+#define BIT_SIDE 0x1
+#define BIT_MON 0x2
+
+#define GET_BANK_IDENTITY(bank)((gBanksByIdentity[bank]))
+#define GET_BANK_SIDE(bank)((GetBankIdentity(bank) & BIT_SIDE))
+#define GET_BANK_SIDE2(bank)((GET_BANK_IDENTITY(bank) & BIT_SIDE))
+
enum
{
BATTLE_TERRAIN_GRASS,
@@ -49,16 +73,16 @@ struct AI_Stack
struct AI_ThinkingStruct /* 0x2016800 */
{
-/* 0x00 */ u8 aiState;
-/* 0x01 */ u8 movesetIndex;
-/* 0x02 */ u16 moveConsidered;
-/* 0x04 */ s8 score[4]; // score?
-/* 0x08 */ u32 funcResult;
-/* 0x0C */ u32 aiFlags;
-/* 0x10 */ u8 aiAction;
-/* 0x11 */ u8 aiLogicId;
-/* 0x12 */ u8 filler12[6];
-/* 0x18 */ u8 simulatedRNG[4];
+ /*0x00*/ u8 aiState;
+ /*0x01*/ u8 movesetIndex;
+ /*0x02*/ u16 moveConsidered;
+ /*0x04*/ s8 score[4]; // score?
+ /*0x08*/ u32 funcResult;
+ /*0x0C*/ u32 aiFlags;
+ /*0x10*/ u8 aiAction;
+ /*0x11*/ u8 aiLogicId;
+ /*0x12*/ u8 filler12[6];
+ /*0x18*/ u8 simulatedRNG[4];
};
struct BattleStruct /* 0x2000000 */
@@ -302,6 +326,18 @@ struct BattleStruct /* 0x2000000 */
/* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2;
};
+struct StatsArray
+{
+ u16 hp;
+ u16 atk;
+ u16 def;
+ u16 spd;
+ u16 spAtk;
+ u16 spDef;
+};
+
+#define gBattleResources_statsBeforeLvlUp ((struct StatsArray *)(gSharedMem + 0x17180))
+
struct DisableStruct
{
/*0x00*/ u32 transformedMonPersonality;
@@ -491,7 +527,7 @@ struct WishFutureKnock
u8 wishCounter[MAX_BANKS_BATTLE];
u8 wishUserID[MAX_BANKS_BATTLE];
u8 weatherDuration;
- u16 knockedOffPokes;
+ u8 knockedOffPokes[2];
};
extern struct UnkBattleStruct1 unk_2016A00;
@@ -504,6 +540,88 @@ extern struct WishFutureKnock gWishFutureKnock;
extern struct AI_ThinkingStruct gAIThinkingSpace;
extern struct Struct20238C8 gUnknown_020238C8;
+#define GET_MOVE_TYPE(move, typeArg) \
+{ \
+ if (gBattleStruct->dynamicMoveType) \
+ typeArg = gBattleStruct->dynamicMoveType & 0x3F; \
+ else \
+ typeArg = gBattleMoves[move].type; \
+}
+
+#define MOVE_EFFECT_SLEEP 0x1
+#define MOVE_EFFECT_POISON 0x2
+#define MOVE_EFFECT_BURN 0x3
+#define MOVE_EFFECT_FREEZE 0x4
+#define MOVE_EFFECT_PARALYSIS 0x5
+#define MOVE_EFFECT_TOXIC 0x6
+#define MOVE_EFFECT_CONFUSION 0x7
+#define MOVE_EFFECT_FLINCH 0x8
+#define MOVE_EFFECT_TRI_ATTACK 0x9
+#define MOVE_EFFECT_UPROAR 0xA
+#define MOVE_EFFECT_PAYDAY 0xB
+#define MOVE_EFFECT_CHARGING 0xC
+#define MOVE_EFFECT_WRAP 0xD
+#define MOVE_EFFECT_RECOIL_25 0xE
+#define MOVE_EFFECT_ATK_PLUS_1 0xF
+#define MOVE_EFFECT_DEF_PLUS_1 0x10
+#define MOVE_EFFECT_SPD_PLUS_1 0x11
+#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12
+#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13
+#define MOVE_EFFECT_ACC_PLUS_1 0x14
+#define MOVE_EFFECT_EVS_PLUS_1 0x15
+#define MOVE_EFFECT_ATK_MINUS_1 0x16
+#define MOVE_EFFECT_DEF_MINUS_1 0x17
+#define MOVE_EFFECT_SPD_MINUS_1 0x18
+#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19
+#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A
+#define MOVE_EFFECT_ACC_MINUS_1 0x1B
+#define MOVE_EFFECT_EVS_MINUS_1 0x1C
+#define MOVE_EFFECT_RECHARGE 0x1D
+#define MOVE_EFFECT_RAGE 0x1E
+#define MOVE_EFFECT_STEAL_ITEM 0x1F
+#define MOVE_EFFECT_PREVENT_ESCAPE 0x20
+#define MOVE_EFFECT_NIGHTMARE 0x21
+#define MOVE_EFFECT_ALL_STATS_UP 0x22
+#define MOVE_EFFECT_RAPIDSPIN 0x23
+#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24
+#define MOVE_EFFECT_ATK_DEF_DOWN 0x25
+#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26
+#define MOVE_EFFECT_ATK_PLUS_2 0x27
+#define MOVE_EFFECT_DEF_PLUS_2 0x28
+#define MOVE_EFFECT_SPD_PLUS_2 0x29
+#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A
+#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B
+#define MOVE_EFFECT_ACC_PLUS_2 0x2C
+#define MOVE_EFFECT_EVS_PLUS_2 0x2D
+#define MOVE_EFFECT_ATK_MINUS_2 0x2E
+#define MOVE_EFFECT_DEF_MINUS_2 0x2F
+#define MOVE_EFFECT_SPD_MINUS_2 0x30
+#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31
+#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32
+#define MOVE_EFFECT_ACC_MINUS_2 0x33
+#define MOVE_EFFECT_EVS_MINUS_2 0x34
+#define MOVE_EFFECT_THRASH 0x35
+#define MOVE_EFFECT_KNOCK_OFF 0x36
+#define MOVE_EFFECT_NOTHING_37 0x37
+#define MOVE_EFFECT_NOTHING_38 0x38
+#define MOVE_EFFECT_NOTHING_39 0x39
+#define MOVE_EFFECT_NOTHING_3A 0x3A
+#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
+#define MOVE_EFFECT_NOTHING_3C 0x3C
+#define MOVE_EFFECT_NOTHING_3D 0x3D
+#define MOVE_EFFECT_NOTHING_3E 0x3E
+#define MOVE_EFFECT_NOTHING_3F 0x3F
+#define MOVE_EFFECT_AFFECTS_USER 0x40
+#define MOVE_EFFECT_CERTAIN 0x80
+
+#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
+
+#define SET_STAT_BUFF_VALUE(n)(((s8)(((s8)(n) << 4)) & 0xF0))
+
+#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
+
// used in many battle files, it seems as though Hisashi Sogabe wrote
// some sort of macro to replace the use of actually calling memset.
// Perhaps it was thought calling memset was much slower?
@@ -540,7 +658,7 @@ struct funcStack
struct scriptsStack
{
- u8* ptr[8];
+ const u8 *ptr[8];
u8 size;
};
@@ -676,11 +794,11 @@ void nullsub_10(int);
void load_gfxc_health_bar();
u8 battle_load_something();
void sub_8031F88(u8);
-void sub_80324F8(struct Pokemon *, u8);
+void HandleLowHpMusicChange(struct Pokemon *, u8);
void sub_8032638();
void sub_8032AA8(u8, u8);
void SetBankFuncToOpponentBufferRunCommand(void);
-void BattleMusicStop(void);
+void BattleStopLowHpSound(void);
// asm/battle_9.o
void SetBankFuncToLinkOpponentBufferRunCommand(void);
diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h
new file mode 100644
index 000000000..030844ec3
--- /dev/null
+++ b/include/battle_script_commands.h
@@ -0,0 +1,65 @@
+#ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H
+#define GUARD_BATTLE_SCRIPT_COMMANDS_H
+
+#define NO_ACC_CALC 0xFFFE
+#define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF
+#define ACC_CURR_MOVE 0
+
+#define CMP_EQUAL 0x0
+#define CMP_NOT_EQUAL 0x1
+#define CMP_GREATER_THAN 0x2
+#define CMP_LESS_THAN 0x3
+#define CMP_COMMON_BITS 0x4
+#define CMP_NO_COMMON_BITS 0x5
+
+#define BS_ATTACKER_WITH_PARTNER 4 // for atk98_status_icon_update
+#define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability
+#define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability
+
+#define ATK48_STAT_NEGATIVE 0x1
+#define ATK48_STAT_BY_TWO 0x2
+#define ATK48_BIT_x4 0x4
+#define ATK48_LOWER_FAIL_CHECK 0x8
+
+#define ATK4F_DONT_CHECK_STATUSES 0x80
+
+#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
+#define VARIOUS_SET_MAGIC_COAT_TARGET 1
+#define VARIOUS_IS_RUNNING_IMPOSSIBLE 2
+#define VARIOUS_GET_MOVE_TARGET 3
+#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
+#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
+#define VARIOUS_EMIT_YESNOBOX 13
+#define VARIOUS_WAIT_CRY 18
+#define VARIOUS_RETURN_OPPONENT_MON1 19
+#define VARIOUS_RETURN_OPPONENT_MON2 20
+#define VARIOUS_SET_TELEPORT_OUTCOME 25
+#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
+
+#define ATK80_DMG_CHANGE_SIGN 0
+#define ATK80_DMG_HALF_BY_TWO_NOT_MORE_THAN_HALF_MAX_HP 1
+#define ATK80_DMG_DOUBLED 2
+
+#define STAT_CHANGE_BS_PTR 0x1
+#define STAT_CHANGE_NOT_PROTECT_AFFECTED 0x20
+
+#define STAT_CHANGE_WORKED 0
+#define STAT_CHANGE_DIDNT_WORK 1
+
+#define WINDOW_CLEAR 0x1
+#define WINDOW_x80 0x80
+
+void AI_CalcDmg(u8 bankAtk, u8 bankDef);
+u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
+u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility);
+u8 BankGetTurnOrder(u8 bank);
+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);
+
+extern void (* const gBattleScriptingCommandsTable[])(void);
+
+#endif // GUARD_BATTLE_SCRIPT_COMMANDS_H
diff --git a/include/battle_string_ids.h b/include/battle_string_ids.h
new file mode 100644
index 000000000..f242284b0
--- /dev/null
+++ b/include/battle_string_ids.h
@@ -0,0 +1,387 @@
+#ifndef GUARD_BATTLE_STRING_IDS_H
+#define GUARD_BATTLE_STRING_IDS_H
+
+#define BATTLESTRINGS_COUNT 369
+
+#define BATTLESTRINGS_ID_ADDER 12 // all battlestrings have its ID + 12, because first 5 are reserved
+
+#define STRINGID_INTROMSG 0
+#define STRINGID_INTROSENDOUT 1
+#define STRINGID_RETURNMON 2
+#define STRINGID_SWITCHINMON 3
+#define STRINGID_USEDMOVE 4
+#define STRINGID_BATTLEEND 5
+
+
+// todo: make some of those names less vague: attacker/target vs pkmn, etc.
+#define STRINGID_TRAINER1LOSETEXT 12
+#define STRINGID_PKMNGAINEDEXP 13
+#define STRINGID_PKMNGREWTOLV 14
+#define STRINGID_PKMNLEARNEDMOVE 15
+#define STRINGID_TRYTOLEARNMOVE1 16
+#define STRINGID_TRYTOLEARNMOVE2 17
+#define STRINGID_TRYTOLEARNMOVE3 18
+#define STRINGID_PKMNFORGOTMOVE 19
+#define STRINGID_STOPLEARNINGMOVE 20
+#define STRINGID_DIDNOTLEARNMOVE 21
+#define STRINGID_PKMNLEARNEDMOVE2 22
+#define STRINGID_ATTACKMISSED 23
+#define STRINGID_PKMNPROTECTEDITSELF 24
+#define STRINGID_STATSWONTINCREASE2 25
+#define STRINGID_AVOIDEDDAMAGE 26
+#define STRINGID_ITDOESNTAFFECT 27
+#define STRINGID_ATTACKERFAINTED 28
+#define STRINGID_TARGETFAINTED 29
+#define STRINGID_PLAYERGOTMONEY 30
+#define STRINGID_PLAYERWHITEOUT 31
+#define STRINGID_PLAYERWHITEOUT2 32
+#define STRINGID_PREVENTSESCAPE 33
+#define STRINGID_HITXTIMES 34
+#define STRINGID_PKMNFELLASLEEP 35
+#define STRINGID_PKMNMADESLEEP 36
+#define STRINGID_PKMNALREADYASLEEP 37
+#define STRINGID_PKMNALREADYASLEEP2 38
+#define STRINGID_PKMNWASNTAFFECTED 39
+#define STRINGID_PKMNWASPOISONED 40
+#define STRINGID_PKMNPOISONEDBY 41
+#define STRINGID_PKMNHURTBYPOISON 42
+#define STRINGID_PKMNALREADYPOISONED 43
+#define STRINGID_PKMNBADLYPOISONED 44
+#define STRINGID_PKMNENERGYDRAINED 45
+#define STRINGID_PKMNWASBURNED 46
+#define STRINGID_PKMNBURNEDBY 47
+#define STRINGID_PKMNHURTBYBURN 48
+#define STRINGID_PKMNWASFROZEN 49
+#define STRINGID_PKMNFROZENBY 50
+#define STRINGID_PKMNISFROZEN 51
+#define STRINGID_PKMNWASDEFROSTED 52
+#define STRINGID_PKMNWASDEFROSTED2 53
+#define STRINGID_PKMNWASDEFROSTEDBY 54
+#define STRINGID_PKMNWASPARALYZED 55
+#define STRINGID_PKMNWASPARALYZEDBY 56
+#define STRINGID_PKMNISPARALYZED 57
+#define STRINGID_PKMNISALREADYPARALYZED 58
+#define STRINGID_PKMNHEALEDPARALYSIS 59
+#define STRINGID_PKMNDREAMEATEN 60
+#define STRINGID_STATSWONTINCREASE 61
+#define STRINGID_STATSWONTDECREASE 62
+#define STRINGID_TEAMSTOPPEDWORKING 63
+#define STRINGID_FOESTOPPEDWORKING 64
+#define STRINGID_PKMNISCONFUSED 65
+#define STRINGID_PKMNHEALEDCONFUSION 66
+#define STRINGID_PKMNWASCONFUSED 67
+#define STRINGID_PKMNALREADYCONFUSED 68
+#define STRINGID_PKMNFELLINLOVE 69
+#define STRINGID_PKMNINLOVE 70
+#define STRINGID_PKMNIMMOBILIZEDBYLOVE 71
+#define STRINGID_PKMNBLOWNAWAY 72
+#define STRINGID_PKMNCHANGEDTYPE 73
+#define STRINGID_PKMNFLINCHED 74
+#define STRINGID_PKMNREGAINEDHEALTH 75
+#define STRINGID_PKMNHPFULL 76
+#define STRINGID_PKMNRAISEDSPDEF 77
+#define STRINGID_PKMNRAISEDDEF 78
+#define STRINGID_PKMNCOVEREDBYVEIL 79
+#define STRINGID_PKMNUSEDSAFEGUARD 80
+#define STRINGID_PKMNSAFEGUARDEXPIRED 81
+#define STRINGID_PKMNWENTTOSLEEP 82
+#define STRINGID_PKMNSLEPTHEALTHY 83
+#define STRINGID_PKMNWHIPPEDWHIRLWIND 84
+#define STRINGID_PKMNTOOKSUNLIGHT 85
+#define STRINGID_PKMNLOWEREDHEAD 86
+#define STRINGID_PKMNISGLOWING 87
+#define STRINGID_PKMNFLEWHIGH 88
+#define STRINGID_PKMNDUGHOLE 89
+#define STRINGID_PKMNSQUEEZEDBYBIND 90
+#define STRINGID_PKMNTRAPPEDINVORTEX 91
+#define STRINGID_PKMNWRAPPEDBY 92
+#define STRINGID_PKMNCLAMPED 93
+#define STRINGID_PKMNHURTBY 94
+#define STRINGID_PKMNFREEDFROM 95
+#define STRINGID_PKMNCRASHED 96
+#define STRINGID_PKMNSHROUDEDINMIST 97
+#define STRINGID_PKMNPROTECTEDBYMIST 98
+#define STRINGID_PKMNGETTINGPUMPED 99
+#define STRINGID_PKMNHITWITHRECOIL 100
+#define STRINGID_PKMNPROTECTEDITSELF2 101
+#define STRINGID_PKMNBUFFETEDBYSANDSTORM 102
+#define STRINGID_PKMNPELTEDBYHAIL 103
+#define STRINGID_PKMNSEEDED 104
+#define STRINGID_PKMNEVADEDATTACK 105
+#define STRINGID_PKMNSAPPEDBYLEECHSEED 106
+#define STRINGID_PKMNFASTASLEEP 107
+#define STRINGID_PKMNWOKEUP 108
+#define STRINGID_PKMNUPROARKEPTAWAKE 109
+#define STRINGID_PKMNWOKEUPINUPROAR 110
+#define STRINGID_PKMNCAUSEDUPROAR 111
+#define STRINGID_PKMNMAKINGUPROAR 112
+#define STRINGID_PKMNCALMEDDOWN 113
+#define STRINGID_PKMNCANTSLEEPINUPROAR 114
+#define STRINGID_PKMNSTOCKPILED 115
+#define STRINGID_PKMNCANTSTOCKPILE 116
+#define STRINGID_PKMNCANTSLEEPINUPROAR2 117
+#define STRINGID_UPROARKEPTPKMNAWAKE 118
+#define STRINGID_PKMNSTAYEDAWAKEUSING 119
+#define STRINGID_PKMNSTORINGENERGY 120
+#define STRINGID_PKMNUNLEASHEDENERGY 121
+#define STRINGID_PKMNFATIGUECONFUSION 122
+#define STRINGID_PKMNPICKEDUPITEM 123
+#define STRINGID_PKMNUNAFFECTED 124
+#define STRINGID_PKMNTRANSFORMEDINTO 125
+#define STRINGID_PKMNMADESUBSTITUTE 126
+#define STRINGID_PKMNHASSUBSTITUTE 127
+#define STRINGID_SUBSTITUTEDAMAGED 128
+#define STRINGID_PKMNSUBSTITUTEFADED 129
+#define STRINGID_PKMNMUSTRECHARGE 130
+#define STRINGID_PKMNRAGEBUILDING 131
+#define STRINGID_PKMNMOVEWASDISABLED 132
+#define STRINGID_PKMNMOVEISDISABLED 133
+#define STRINGID_PKMNMOVEDISABLEDNOMORE 134
+#define STRINGID_PKMNGOTENCORE 135
+#define STRINGID_PKMNENCOREENDED 136
+#define STRINGID_PKMNTOOKAIM 137
+#define STRINGID_PKMNSKETCHEDMOVE 138
+#define STRINGID_PKMNTRYINGTOTAKEFOE 139
+#define STRINGID_PKMNTOOKFOE 140
+#define STRINGID_PKMNREDUCEDPP 141
+#define STRINGID_PKMNSTOLEITEM 142
+#define STRINGID_TARGETCANTESCAPENOW 143
+#define STRINGID_PKMNFELLINTONIGHTMARE 144
+#define STRINGID_PKMNLOCKEDINNIGHTMARE 145
+#define STRINGID_PKMNLAIDCURSE 146
+#define STRINGID_PKMNAFFLICTEDBYCURSE 147
+#define STRINGID_SPIKESSCATTERED 148
+#define STRINGID_PKMNHURTBYSPIKES 149
+#define STRINGID_PKMNIDENTIFIED 150
+#define STRINGID_PKMNPERISHCOUNTFELL 151
+#define STRINGID_PKMNBRACEDITSELF 152
+#define STRINGID_PKMNENDUREDHIT 153
+#define STRINGID_MAGNITUDESTRENGTH 154
+#define STRINGID_PKMNCUTHPMAXEDATTACK 155
+#define STRINGID_PKMNCOPIEDSTATCHANGES 156
+#define STRINGID_PKMNGOTFREE 157
+#define STRINGID_PKMNSHEDLEECHSEED 158
+#define STRINGID_PKMNBLEWAWAYSPIKES 159
+#define STRINGID_PKMNFLEDFROMBATTLE 160
+#define STRINGID_PKMNFORESAWATTACK 161
+#define STRINGID_PKMNTOOKATTACK 162
+#define STRINGID_PKMNATTACK 163
+#define STRINGID_PKMNCENTERATTENTION 164
+#define STRINGID_PKMNCHARGINGPOWER 165
+#define STRINGID_NATUREPOWERTURNEDINTO 166
+#define STRINGID_PKMNSTATUSNORMAL 167
+#define STRINGID_PKMNHASNOMOVESLEFT 168
+#define STRINGID_PKMNSUBJECTEDTOTORMENT 169
+#define STRINGID_PKMNCANTUSEMOVETORMENT 170
+#define STRINGID_PKMNTIGHTENINGFOCUS 171
+#define STRINGID_PKMNFELLFORTAUNT 172
+#define STRINGID_PKMNCANTUSEMOVETAUNT 173
+#define STRINGID_PKMNREADYTOHELP 174
+#define STRINGID_PKMNSWITCHEDITEMS 175
+#define STRINGID_PKMNCOPIEDFOE 176
+#define STRINGID_PKMNMADEWISH 177
+#define STRINGID_PKMNWISHCAMETRUE 178
+#define STRINGID_PKMNPLANTEDROOTS 179
+#define STRINGID_PKMNABSORBEDNUTRIENTS 180
+#define STRINGID_PKMNANCHOREDITSELF 181
+#define STRINGID_PKMNWASMADEDROWSY 182
+#define STRINGID_PKMNKNOCKEDOFF 183
+#define STRINGID_PKMNSWAPPEDABILITIES 184
+#define STRINGID_PKMNSEALEDOPPONENTMOVE 185
+#define STRINGID_PKMNCANTUSEMOVESEALED 186
+#define STRINGID_PKMNWANTSGRUDGE 187
+#define STRINGID_PKMNLOSTPPGRUDGE 188
+#define STRINGID_PKMNSHROUDEDITSELF 189
+#define STRINGID_PKMNMOVEBOUNCED 190
+#define STRINGID_PKMNWAITSFORTARGET 191
+#define STRINGID_PKMNSNATCHEDMOVE 192
+#define STRINGID_PKMNMADEITRAIN 193
+#define STRINGID_PKMNRAISEDSPEED 194
+#define STRINGID_PKMNPROTECTEDBY 195
+#define STRINGID_PKMNPREVENTSUSAGE 196
+#define STRINGID_PKMNRESTOREDHPUSING 197
+#define STRINGID_PKMNCHANGEDTYPEWITH 198
+#define STRINGID_PKMNPREVENTSPARALYSISWITH 199
+#define STRINGID_PKMNPREVENTSROMANCEWITH 200
+#define STRINGID_PKMNPREVENTSPOISONINGWITH 201
+#define STRINGID_PKMNPREVENTSCONFUSIONWITH 202
+#define STRINGID_PKMNRAISEDFIREPOWERWITH 203
+#define STRINGID_PKMNANCHORSITSELFWITH 204
+#define STRINGID_PKMNCUTSATTACKWITH 205
+#define STRINGID_PKMNPREVENTSSTATLOSSWITH 206
+#define STRINGID_PKMNHURTSWITH 207
+#define STRINGID_PKMNTRACED 208
+#define STRINGID_STATSHARPLY 209
+#define STRINGID_STATROSE 210
+#define STRINGID_STATHARSHLY 211
+#define STRINGID_STATFELL 212
+#define STRINGID_PKMNSSTATCHANGED 213
+#define STRINGID_PKMNSSTATCHANGED2 214
+#define STRINGID_PKMNSSTATCHANGED3 215
+#define STRINGID_PKMNSSTATCHANGED4 216
+#define STRINGID_CRITICALHIT 217
+#define STRINGID_ONEHITKO 218
+#define STRINGID_123POOF 219
+#define STRINGID_ANDELLIPSIS 220
+#define STRINGID_NOTVERYEFFECTIVE 221
+#define STRINGID_SUPEREFFECTIVE 222
+#define STRINGID_GOTAWAYSAFELY 223
+#define STRINGID_WILDPKMNFLED 224
+#define STRINGID_NORUNNINGFROMTRAINERS 225
+#define STRINGID_CANTESCAPE 226
+#define STRINGID_DONTLEAVEBIRCH 227
+#define STRINGID_BUTNOTHINGHAPPENED 228
+#define STRINGID_BUTITFAILED 229
+#define STRINGID_ITHURTCONFUSION 230
+#define STRINGID_MIRRORMOVEFAILED 231
+#define STRINGID_STARTEDTORAIN 232
+#define STRINGID_DOWNPOURSTARTED 233
+#define STRINGID_RAINCONTINUES 234
+#define STRINGID_DOWNPOURCONTINUES 235
+#define STRINGID_RAINSTOPPED 236
+#define STRINGID_SANDSTORMBREWED 237
+#define STRINGID_SANDSTORMRAGES 238
+#define STRINGID_SANDSTORMSUBSIDED 239
+#define STRINGID_SUNLIGHTGOTBRIGHT 240
+#define STRINGID_SUNLIGHTSTRONG 241
+#define STRINGID_SUNLIGHTFADED 242
+#define STRINGID_STARTEDHAIL 243
+#define STRINGID_HAILCONTINUES 244
+#define STRINGID_HAILSTOPPED 245
+#define STRINGID_FAILEDTOSPITUP 246
+#define STRINGID_FAILEDTOSWALLOW 247
+#define STRINGID_WINDBECAMEHEATWAVE 248
+#define STRINGID_STATCHANGESGONE 249
+#define STRINGID_COINSSCATTERED 250
+#define STRINGID_TOOWEAKFORSUBSTITUTE 251
+#define STRINGID_SHAREDPAIN 252
+#define STRINGID_BELLCHIMED 253
+#define STRINGID_FAINTINTHREE 254
+#define STRINGID_NOPPLEFT 255
+#define STRINGID_BUTNOPPLEFT 256
+#define STRINGID_PLAYERUSEDITEM 257
+#define STRINGID_WALLYUSEDITEM 258
+#define STRINGID_TRAINERBLOCKEDBALL 259
+#define STRINGID_DONTBEATHIEF 260
+#define STRINGID_ITDODGEDBALL 261
+#define STRINGID_YOUMISSEDPKMN 262
+#define STRINGID_PKMNBROKEFREE 263
+#define STRINGID_ITAPPEAREDCAUGHT 264
+#define STRINGID_AARGHALMOSTHADIT 265
+#define STRINGID_SHOOTSOCLOSE 266
+#define STRINGID_GOTCHAPKMNCAUGHT 267
+#define STRINGID_GOTCHAPKMNCAUGHT2 268
+#define STRINGID_GIVENICKNAMECAPTURED 269
+#define STRINGID_PKMNSENTTOPC 270
+#define STRINGID_PKMNDATAADDEDTODEX 271
+#define STRINGID_ITISRAINING 272
+#define STRINGID_SANDSTORMISRAGING 273
+#define STRINGID_CANTESCAPE2 274
+#define STRINGID_PKMNIGNORESASLEEP 275
+#define STRINGID_PKMNIGNOREDORDERS 276
+#define STRINGID_PKMNBEGANTONAP 277
+#define STRINGID_PKMNLOAFING 278
+#define STRINGID_PKMNWONTOBEY 279
+#define STRINGID_PKMNTURNEDAWAY 280
+#define STRINGID_PKMNPRETENDNOTNOTICE 281
+#define STRINGID_ENEMYABOUTTOSWITCHPKMN 282
+#define STRINGID_CREPTCLOSER 283
+#define STRINGID_CANTGETCLOSER 284
+#define STRINGID_PKMNWATCHINGCAREFULLY 285
+#define STRINGID_PKMNCURIOUSABOUTX 286
+#define STRINGID_PKMNENTHRALLEDBYX 287
+#define STRINGID_PKMNIGNOREDX 288
+#define STRINGID_THREWPOKEBLOCKATPKMN 289
+#define STRINGID_OUTOFSAFARIBALLS 290
+#define STRINGID_PKMNSITEMCUREDPARALYSIS 291
+#define STRINGID_PKMNSITEMCUREDPOISON 292
+#define STRINGID_PKMNSITEMHEALEDBURN 293
+#define STRINGID_PKMNSITEMDEFROSTEDIT 294
+#define STRINGID_PKMNSITEMWOKEIT 295
+#define STRINGID_PKMNSITEMSNAPPEDOUT 296
+#define STRINGID_PKMNSITEMCUREDPROBLEM 297
+#define STRINGID_PKMNSITEMRESTOREDHEALTH 298
+#define STRINGID_PKMNSITEMRESTOREDPP 299
+#define STRINGID_PKMNSITEMRESTOREDSTATUS 300
+#define STRINGID_PKMNSITEMRESTOREDHPALITTLE 301
+#define STRINGID_ITEMALLOWSONLYYMOVE 302
+#define STRINGID_PKMNHUNGONWITHX 303
+#define STRINGID_EMPTYSTRING3 304
+#define STRINGID_PKMNSXPREVENTSBURNS 305
+#define STRINGID_PKMNSXBLOCKSY 306
+#define STRINGID_PKMNSXRESTOREDHPALITTLE2 307
+#define STRINGID_PKMNSXWHIPPEDUPSANDSTORM 308
+#define STRINGID_PKMNSXPREVENTSYLOSS 309
+#define STRINGID_PKMNSXINFATUATEDY 310
+#define STRINGID_PKMNSXMADEYINEFFECTIVE 311
+#define STRINGID_PKMNSXCUREDYPROBLEM 312
+#define STRINGID_ITSUCKEDLIQUIDOOZE 313
+#define STRINGID_PKMNTRANSFORMED 314
+#define STRINGID_ELECTRICITYWEAKENED 315
+#define STRINGID_FIREWEAKENED 316
+#define STRINGID_PKMNHIDUNDERWATER 317
+#define STRINGID_PKMNSPRANGUP 318
+#define STRINGID_HMMOVESCANTBEFORGOTTEN 319
+#define STRINGID_XFOUNDONEY 320
+#define STRINGID_PLAYERDEFEATEDTRAINER1 321
+#define STRINGID_SOOTHINGAROMA 322
+#define STRINGID_ITEMSCANTBEUSEDNOW 323
+#define STRINGID_FORXCOMMAYZ 324
+#define STRINGID_USINGXTHEYOFZN 325
+#define STRINGID_PKMNUSEDXTOGETPUMPED 326
+#define STRINGID_PKMNSXMADEYUSELESS 327
+#define STRINGID_PKMNTRAPPEDBYSANDTOMB 328
+#define STRINGID_EMPTYSTRING4 329
+#define STRINGID_ABOOSTED 330
+#define STRINGID_PKMNSXINTENSIFIEDSUN 331
+#define STRINGID_PKMNMAKESGROUNDMISS 332
+#define STRINGID_YOUTHROWABALLNOWRIGHT 333
+#define STRINGID_PKMNSXTOOKATTACK 334
+#define STRINGID_PKMNCHOSEXASDESTINY 335
+#define STRINGID_PKMNLOSTFOCUS 336
+#define STRINGID_USENEXTPKMN 337
+#define STRINGID_PKMNFLEDUSINGITS 338
+#define STRINGID_PKMNFLEDUSING 339
+#define STRINGID_PKMNWASDRAGGEDOUT 340
+#define STRINGID_PREVENTEDFROMWORKING 341
+#define STRINGID_PKMNSITEMNORMALIZEDSTATUS 342
+#define STRINGID_TRAINER1USEDITEM 343
+#define STRINGID_BOXISFULL 344
+#define STRINGID_PKMNAVOIDEDATTACK 345
+#define STRINGID_PKMNSXMADEITINEFFECTIVE 346
+#define STRINGID_PKMNSXPREVENTSFLINCHING 347
+#define STRINGID_PKMNALREADYHASBURN 348
+#define STRINGID_STATSWONTDECREASE2 349
+#define STRINGID_PKMNSXBLOCKSY2 350
+#define STRINGID_PKMNSXWOREOFF 351
+#define STRINGID_PKMNRAISEDDEFALITTLE 352
+#define STRINGID_PKMNRAISEDSPDEFALITTLE 353
+#define STRINGID_THEWALLSHATTERED 354
+#define STRINGID_PKMNSXPREVENTSYSZ 355
+#define STRINGID_PKMNSXCUREDITSYPROBLEM 356
+#define STRINGID_ATTACKERCANTESCAPE 357
+#define STRINGID_PKMNOBTAINEDX 358
+#define STRINGID_PKMNOBTAINEDX2 359
+#define STRINGID_PKMNOBTAINEDXYOBTAINEDZ 360
+#define STRINGID_BUTNOEFFECT 361
+#define STRINGID_PKMNSXHADNOEFFECTONY 362
+#define STRINGID_TWOENEMIESDEFEATED 363
+#define STRINGID_TRAINER2LOSETEXT 364
+#define STRINGID_PKMNINCAPABLEOFPOWER 365
+#define STRINGID_GLINTAPPEARSINEYE 366
+#define STRINGID_PKMNGETTINGINTOPOSITION 367
+#define STRINGID_PKMNBEGANGROWLINGDEEPLY 368
+#define STRINGID_PKMNEAGERFORMORE 369
+#define STRINGID_DEFEATEDOPPONENTBYREFEREE 370
+#define STRINGID_LOSTTOOPPONENTBYREFEREE 371
+#define STRINGID_TIEDOPPONENTBYREFEREE 372
+#define STRINGID_QUESTIONFORFEITMATCH 373
+#define STRINGID_FORFEITEDMATCH 374
+#define STRINGID_PKMNTRANSFERREDSOMEONESPC 375
+#define STRINGID_PKMNTRANSFERREDLANETTESPC 376
+#define STRINGID_PKMNBOXSOMEONESPCFULL 377
+#define STRINGID_PKMNBOXLANETTESPCFULL 378
+#define STRINGID_TRAINER1WINTEXT 379
+#define STRINGID_TRAINER2WINTEXT 380
+
+#endif // GUARD_BATTLE_STRING_IDS_H
diff --git a/include/battle_util.h b/include/battle_util.h
index f47b00b2c..15fa39d1a 100644
--- a/include/battle_util.h
+++ b/include/battle_util.h
@@ -11,7 +11,7 @@
#define BS_GET_OPPONENT2 14
void TryClearRageStatuses(void);
-void BattleScriptPush(u8* BS_ptr);
+void BattleScriptPush(const u8* BS_ptr);
void PressurePPLoseOnUsingImprision(u8 bankAtk);
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
void sub_80155A4(u8);
@@ -22,7 +22,7 @@ void ResetSentPokesToOpponentValue(void);
void sub_8015740(u8 bank);
void sub_80157C4(u8 bank);
bool8 HandleWishPerishSongOnTurnEnd(void);
-void BattleScriptExecute(u8* BS_ptr);
+void BattleScriptExecute(const u8* BS_ptr);
void BattleScriptPushCursorAndCallback(u8* BS_ptr);
u8 IsMonDisobedient(void);
diff --git a/include/ewram.h b/include/ewram.h
index 36081dd2a..6f42925c1 100644
--- a/include/ewram.h
+++ b/include/ewram.h
@@ -9,7 +9,7 @@ extern u8 gSharedMem[];
// dupes can be determined to be the same, they will be deliberate
// seperated.
#define eWeatherPaletteData (*(struct WeatherPaletteData *)gSharedMem)
-#define BATTLE_STRUCT ((struct BattleStruct *) (gSharedMem + 0x0))
+#define gBattleStruct ((struct BattleStruct *) (gSharedMem + 0x0))
#define ewram0_2 (*(struct Struct2000000 *)(gSharedMem + 0x0))
#define namingScreenData (*(struct NamingScreenData *)(gSharedMem + 0x0))
#define ewramBerryPic (gSharedMem + 0x0)