From 273474d57a39014654e60df151604ed5a28aeb57 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 2 Dec 2017 00:03:46 +0100 Subject: give names to some battlescripts --- src/battle_script_commands.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d9b35c053..c64fb99ef 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6383,7 +6383,7 @@ static void atk62(void) static void atk63_jumptorandomattack(void) { - if (gBattlescriptCurrInstr[1] != 0) + if (gBattlescriptCurrInstr[1]) gCurrentMove = gRandomMove; else gChosenMove = gCurrentMove = gRandomMove; @@ -7790,7 +7790,7 @@ static void atk8E_initmultihitstring(void) gBattlescriptCurrInstr++; } -static bool8 sub_8051064(void) +static bool8 TryDoForceSwitchOut(void) { if (gBattleMons[gBankAttacker].level >= gBattleMons[gBankTarget].level) { @@ -7807,7 +7807,7 @@ static bool8 sub_8051064(void) *(gBattleStruct->field_58 + gBankTarget) = gBattlePartyID[gBankTarget]; } - gBattlescriptCurrInstr = BattleScript_82DADD8; + gBattlescriptCurrInstr = BattleScript_SuccessForceOut; return TRUE; } @@ -7935,7 +7935,7 @@ static void atk8F_forcerandomswitch(void) } else { - if (sub_8051064()) + if (TryDoForceSwitchOut()) { do { @@ -7968,7 +7968,7 @@ static void atk8F_forcerandomswitch(void) } else { - sub_8051064(); + TryDoForceSwitchOut(); } } @@ -9306,7 +9306,7 @@ static void atkBA_jumpifnopursuitswitchdmg(void) gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON2); } - if (gActionForBanks[gBankTarget] == 0 + if (gActionForBanks[gBankTarget] == ACTION_USE_MOVE && gBankAttacker == *(gBattleStruct->moveTarget + gBankTarget) && !(gBattleMons[gBankTarget].status1 & (STATUS_SLEEP | STATUS_FREEZE)) && gBattleMons[gBankAttacker].hp -- cgit v1.2.3 From d75e7ace1dd034273ca47473a2f543904f823f53 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 2 Dec 2017 14:08:55 +0100 Subject: label battle stuff --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c64fb99ef..54811a90d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1053,7 +1053,7 @@ static void atk00_attackcanceler(void) if (!(gHitMarker & HITMARKER_OBEYS) && !(gBattleMons[gBankAttacker].status2 & STATUS2_MULTIPLETURNS)) { - i = IsPokeDisobedient(); // why use the 'i' variable...? + i = IsMonDisobedient(); // why use the 'i' variable...? switch (i) { case 0: -- cgit v1.2.3 From ce6e97fa0b24e69582615048dbbac17a55afe8ac Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 2 Dec 2017 21:44:50 +0100 Subject: sprite data fields to array --- src/battle_script_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d9b35c053..f91a52480 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6782,8 +6782,8 @@ static bool8 sub_804F344(void) return (gBattle_BG2_X != 0x1A0); } -#define sDestroy data0 -#define sSavedLvlUpBoxXPosition data1 +#define sDestroy data[0] +#define sSavedLvlUpBoxXPosition data[1] static void PutMonIconOnLvlUpBox(void) { -- cgit v1.2.3 From e10aea9a5196f916ca6d56617b2d74a00f0a68d4 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 2 Dec 2017 23:31:58 +0100 Subject: give some more labels to battle struct fields --- src/battle_script_commands.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 54811a90d..60b08d2c2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3040,7 +3040,7 @@ static void atk15_seteffectwithchance(void) } gBattleCommunication[MOVE_EFFECT_BYTE] = 0; - gBattleScripting.field_16 = 0; + gBattleScripting.multihitMoveEffect = 0; } static void atk16_seteffectprimary(void) @@ -3064,7 +3064,7 @@ static void atk18_clearstatusfromeffect(void) gBattleCommunication[MOVE_EFFECT_BYTE] = 0; gBattlescriptCurrInstr += 2; - gBattleScripting.field_16 = 0; + gBattleScripting.multihitMoveEffect = 0; } static void atk19_tryfaintmon(void) @@ -3221,7 +3221,7 @@ static void atk1E_jumpifability(void) gLastUsedAbility = ability; gBattlescriptCurrInstr = jumpPtr; RecordAbilityBattle(bank - 1, gLastUsedAbility); - gBattleScripting.field_15 = bank - 1; + gBattleScripting.bankWithAbility = bank - 1; } else gBattlescriptCurrInstr += 7; @@ -3234,7 +3234,7 @@ static void atk1E_jumpifability(void) gLastUsedAbility = ability; gBattlescriptCurrInstr = jumpPtr; RecordAbilityBattle(bank - 1, gLastUsedAbility); - gBattleScripting.field_15 = bank - 1; + gBattleScripting.bankWithAbility = bank - 1; } else gBattlescriptCurrInstr += 7; @@ -3247,7 +3247,7 @@ static void atk1E_jumpifability(void) gLastUsedAbility = ability; gBattlescriptCurrInstr = jumpPtr; RecordAbilityBattle(bank, gLastUsedAbility); - gBattleScripting.field_15 = bank; + gBattleScripting.bankWithAbility = bank; } else gBattlescriptCurrInstr += 7; -- cgit v1.2.3 From caa13f877797edbb7a1e13bf00b537bafbd4315a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 5 Dec 2017 11:55:48 -0600 Subject: convert some constants to C headers --- src/battle_script_commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d9b35c053..cf701ba18 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1,14 +1,14 @@ #include "global.h" #include "battle.h" -#include "battle_move_effects.h" +#include "constants/battle_move_effects.h" #include "battle_message.h" #include "battle_ai_script_commands.h" #include "battle_scripts.h" #include "moves.h" -#include "abilities.h" +#include "constants/abilities.h" #include "item.h" -#include "items.h" -#include "hold_effects.h" +#include "constants/items.h" +#include "constants/hold_effects.h" #include "util.h" #include "pokemon.h" #include "calculate_base_damage.h" -- cgit v1.2.3 From 00896cb3b5813cb843e5e1abd4cbc9ff0ad3a632 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 5 Dec 2017 12:27:33 -0600 Subject: rename rng.c to random.c and rom4.c to overworld.c --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ae4703512..a9578395d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12,7 +12,7 @@ #include "util.h" #include "pokemon.h" #include "calculate_base_damage.h" -#include "rng.h" +#include "random.h" #include "battle_controllers.h" #include "battle_interface.h" #include "species.h" -- cgit v1.2.3 From c681b482c2ab0a4281cb6ad5927ce8ca565a3692 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 11 Dec 2017 12:27:51 -0600 Subject: convert more constants --- src/battle_script_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/battle_script_commands.c') diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a7240783c..88d583c1f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4,7 +4,7 @@ #include "battle_message.h" #include "battle_ai_script_commands.h" #include "battle_scripts.h" -#include "moves.h" +#include "constants/moves.h" #include "constants/abilities.h" #include "item.h" #include "constants/items.h" @@ -15,8 +15,8 @@ #include "random.h" #include "battle_controllers.h" #include "battle_interface.h" -#include "species.h" -#include "songs.h" +#include "constants/species.h" +#include "constants/songs.h" #include "text.h" #include "sound.h" #include "pokedex.h" -- cgit v1.2.3