-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
battle_input.c #347
base: main
Are you sure you want to change the base?
battle_input.c #347
Changes from 2 commits
28e8e81
c93a3db
0ee0e35
459f3a8
d297701
b756262
667b1b8
4df8633
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef POKEPLATINUM_OV16_0226871C_H | ||
#define POKEPLATINUM_OV16_0226871C_H | ||
|
||
#include "struct_decls/battle_system.h" | ||
|
||
#include "battle/move_display_info.h" | ||
#include "battle/struct_ov16_02268A14_decl.h" | ||
|
||
#include "bg_window.h" | ||
#include "narc.h" | ||
|
||
void ov16_02268744(BgConfig *bgConfig); | ||
void ov16_022687A0(BgConfig *bgConfig); | ||
void *BattleInput_NewInit(NARC *param0, NARC *param1, BattleSystem *param2, int param3, u8 *param4); | ||
void BattleInput_Free(BattleInput *input); | ||
void ov16_02268A88(BattleInput *input); | ||
void ov16_02268B8C(BattleInput *input); | ||
void ov16_02268C04(NARC *param0, NARC *param1, BattleInput *param2, int param3, int param4, void *param5); | ||
void ov16_02268D40(NARC *param0, BattleInput *param1); | ||
void ov16_0226914C(BattleInput *input, const u8 *param1); | ||
void ov16_02269168(BattleInput *input, u8 param1[], u8 param2[]); | ||
void ov16_022691BC(BattleInput *input); | ||
void ov16_02269218(BattleInput *input); | ||
int BattleInput_CheckTouch(BattleInput *input); | ||
BOOL ov16_02269348(BattleInput *input); | ||
int ov16_02269368(int param0, int param1); | ||
void ov16_0226940C(BattleInput *input); | ||
void ov16_0226947C(BattleInput *input, int param1, int param2); | ||
void ov16_0226AC98(BattleInput *input, int param1, const MoveDisplayInfo *param2); | ||
void ov16_0226BCCC(BattleInput *input, int param1); | ||
BOOL ov16_0226BCD0(BattleInput *input); | ||
int ov16_0226CD08(BattleInput *input); | ||
void ov16_0226CD10(BattleInput *input, int param1); | ||
void BattleInput_PrintRecordingStopMessage(BattleInput *input, int param1); | ||
u8 ov16_0226D088(BattleInput *input); | ||
|
||
#endif // POKEPLATINUM_OV16_0226871C_H |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef POKEPLATINUM_STRUCT_OV16_02268A14_DECL_H | ||
#define POKEPLATINUM_STRUCT_OV16_02268A14_DECL_H | ||
|
||
typedef struct UnkStruct_ov16_02268A14_t UnkStruct_ov16_02268A14; | ||
typedef struct BattleInput_t BattleInput; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. polish: Pull this (and other such structs named in this PR) out into the corresponding header, if possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one specifically is defined in the c file, I can default to just putting it in battle_input.h for now |
||
|
||
#endif // POKEPLATINUM_STRUCT_OV16_02268A14_DECL_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef POKEPLATINUM_STRUCT_OV16_0226DC24_DECL_H | ||
#define POKEPLATINUM_STRUCT_OV16_0226DC24_DECL_H | ||
|
||
typedef struct UnkStruct_ov16_0226DC24_t UnkStruct_ov16_0226DC24; | ||
typedef struct UnkStruct_ov16_0226DC24_t BattleCursor; | ||
|
||
#endif // POKEPLATINUM_STRUCT_OV16_0226DC24_DECL_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef POKEPLATINUM_STRUCT_OV16_0226DEEC_DECL_H | ||
#define POKEPLATINUM_STRUCT_OV16_0226DEEC_DECL_H | ||
|
||
typedef struct UnkStruct_ov16_0226DEEC_t UnkStruct_ov16_0226DEEC; | ||
typedef struct CatchingTutorialFinger_t CatchingTutorialFinger; | ||
|
||
#endif // POKEPLATINUM_STRUCT_OV16_0226DEEC_DECL_H |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,10 +8,10 @@ | |||||
|
||||||
UnkStruct_ov13_02228A50 *ov13_02228A38(u32 param0); | ||||||
void ov13_02228A50(UnkStruct_ov13_02228A50 *param0); | ||||||
UnkStruct_ov16_0226DC24 *ov13_02228A58(UnkStruct_ov13_02228A50 *param0); | ||||||
BattleCursor *ov13_02228A58(UnkStruct_ov13_02228A50 *param0); | ||||||
u8 ov13_02228A5C(UnkStruct_ov13_02228A50 *param0); | ||||||
void ov13_02228A60(UnkStruct_ov13_02228A50 *param0, u8 param1); | ||||||
void ov13_02228A64(UnkStruct_ov13_02228A50 *param0, UnkStruct_ov16_0226DC24 *param1); | ||||||
void ov13_02228A64(UnkStruct_ov13_02228A50 *param0, BattleCursor *param1); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
void ov13_02228A68(UnkStruct_ov13_02228A50 *param0, u8 param1); | ||||||
void ov13_02228A90(UnkStruct_ov13_02228A50 *param0); | ||||||
void ov13_02228A9C(UnkStruct_ov13_02228A50 *param0, const ByteFlagSet *param1); | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,7 +312,7 @@ static inline BOOL SingleControllerForSide(BattleContext *battleCtx, int battler | |
static void BattleController_CommandSelectionInput(BattleSystem *battleSys, BattleContext *battleCtx) | ||
{ | ||
int maxBattlers = BattleSystem_MaxBattlers(battleSys); | ||
int battleType = BattleSystem_BattleType(battleSys); | ||
int battleType = BattleSystem_GetBattleType(battleSys); | ||
int battlersDone = 0; | ||
BattleMessage msg; | ||
|
||
|
@@ -460,7 +460,7 @@ static void BattleController_CommandSelectionInput(BattleSystem *battleSys, Batt | |
break; | ||
|
||
case PLAYER_INPUT_ITEM: | ||
if (BattleSystem_BattleType(battleSys) & BATTLE_TYPE_NO_ITEMS) { | ||
if (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_NO_ITEMS) { | ||
msg.id = 593; // "Items can’t be used here." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. polish: GMM constant |
||
msg.tags = TAG_NONE; | ||
BattleIO_SetAlertMessage(battleSys, i, msg); | ||
|
@@ -709,7 +709,7 @@ static void BattleController_CalcTurnOrder(BattleSystem *battleSys, BattleContex | |
int battler, i, j; // Must declare these here to match. | ||
|
||
int maxBattlers = BattleSystem_MaxBattlers(battleSys); | ||
u32 battleType = BattleSystem_BattleType(battleSys); | ||
u32 battleType = BattleSystem_GetBattleType(battleSys); | ||
int order = 0; | ||
|
||
if (battleType & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_PAL_PARK)) { | ||
|
@@ -1955,8 +1955,8 @@ static void BattleController_ItemCommand(BattleSystem *battleSys, BattleContext | |
|
||
case BATTLE_ITEM_CATEGORY_POKE_BALLS: | ||
nextSeq = subscript_throw_pokeball; | ||
if ((BattleSystem_BattleType(battleSys) & BATTLE_TYPE_TRAINER) == FALSE | ||
&& (BattleSystem_BattleType(battleSys) & BATTLE_TYPE_CATCH_TUTORIAL) == FALSE) { | ||
if ((BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_TRAINER) == FALSE | ||
&& (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_CATCH_TUTORIAL) == FALSE) { | ||
Bag_TryRemoveItem(BattleSystem_Bag(battleSys), used->item, 1, HEAP_ID_BATTLE); | ||
Bag_SetLastBattleItemUsed(BattleSystem_BagCursor(battleSys), used->item, used->category); | ||
} | ||
|
@@ -1990,7 +1990,7 @@ static void BattleController_FleeCommand(BattleSystem *battleSys, BattleContext | |
battleCtx->attacker = battleCtx->battlerActionOrder[battleCtx->turnOrderCounter]; | ||
|
||
if (Battler_Side(battleSys, battleCtx->attacker) | ||
&& (BattleSystem_BattleType(battleSys) & BATTLE_TYPE_LINK) == FALSE) { | ||
&& (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_LINK) == FALSE) { | ||
if (ATTACKING_MON.statusVolatile & (VOLATILE_CONDITION_BIND | VOLATILE_CONDITION_MEAN_LOOK)) { | ||
LOAD_SUBSEQ(subscript_enemy_escape_failed); | ||
battleCtx->scriptCursor = 0; | ||
|
@@ -2110,7 +2110,7 @@ static int BattleController_CheckObedience(BattleSystem *battleSys, BattleContex | |
{ | ||
int rand1, rand2; // must be defined up here to match | ||
u8 maxLevel = 0; | ||
u32 battleType = BattleSystem_BattleType(battleSys); | ||
u32 battleType = BattleSystem_GetBattleType(battleSys); | ||
TrainerInfo *trInfo = BattleSystem_TrainerInfo(battleSys, 0); | ||
|
||
// These separate sentinels do not match if chained into a single sentinel | ||
|
@@ -2864,7 +2864,7 @@ static inline int CalcMoveType(BattleContext *battleCtx, int attacker, int move) | |
*/ | ||
static int BattleController_CheckMoveHitAccuracy(BattleSystem *battleSys, BattleContext *battleCtx, int attacker, int defender, int move) | ||
{ | ||
if (BattleSystem_BattleType(battleSys) & BATTLE_TYPE_CATCH_TUTORIAL) { | ||
if (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_CATCH_TUTORIAL) { | ||
return 0; | ||
} | ||
|
||
|
@@ -3961,7 +3961,7 @@ static void BattleController_UpdateMoveBuffers(BattleSystem *battleSys, BattleCo | |
|
||
static void BattleController_MoveEnd(BattleSystem *battleSys, BattleContext *battleCtx) | ||
{ | ||
if ((BattleSystem_BattleType(battleSys) & BATTLE_TYPE_NO_MOVES) == FALSE) { | ||
if ((BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_NO_MOVES) == FALSE) { | ||
if (BattleSystem_RecoverStatusByAbility(battleSys, battleCtx, battleCtx->attacker, FALSE) == TRUE | ||
|| (battleCtx->defender != BATTLER_NONE | ||
&& BattleSystem_RecoverStatusByAbility(battleSys, battleCtx, battleCtx->defender, FALSE) == TRUE) | ||
|
@@ -4040,7 +4040,7 @@ static void BattleController_ScreenWipe(BattleSystem *battleSys, BattleContext * | |
|
||
static void BattleController_EndFight(BattleSystem *battleSys, BattleContext *battleCtx) | ||
{ | ||
u32 battleType = BattleSystem_BattleType(battleSys); | ||
u32 battleType = BattleSystem_GetBattleType(battleSys); | ||
|
||
if ((battleType & BATTLE_TYPE_LINK) == FALSE) { | ||
Party *playerParty = BattleSystem_Party(battleSys, BATTLER_US); | ||
|
@@ -4072,7 +4072,7 @@ static BOOL BattleController_ReplaceFainted(BattleSystem *battleSys, BattleConte | |
BOOL result = FALSE; | ||
int i; // must be declared here to match | ||
int maxBattlers = BattleSystem_MaxBattlers(battleSys); | ||
u32 battleType = BattleSystem_BattleType(battleSys); | ||
u32 battleType = BattleSystem_GetBattleType(battleSys); | ||
int retCommand = battleCtx->command; | ||
|
||
for (i = 0; i < maxBattlers; i++) { | ||
|
@@ -4182,7 +4182,7 @@ static BOOL BattleController_CheckBattleOver(BattleSystem *battleSys, BattleCont | |
{ | ||
int i; | ||
int maxBattlers = BattleSystem_MaxBattlers(battleSys); | ||
u32 battleType = BattleSystem_BattleType(battleSys); | ||
u32 battleType = BattleSystem_GetBattleType(battleSys); | ||
u8 battleResult = BATTLE_IN_PROGRESS; | ||
|
||
for (i = 0; i < maxBattlers; i++) { | ||
|
@@ -4795,7 +4795,7 @@ static BOOL BattleController_TriggerAfterMoveHitEffects(BattleSystem *battleSys, | |
*/ | ||
static void BattleController_InitAI(BattleSystem *battleSys, BattleContext *battleCtx) | ||
{ | ||
u32 battleType = BattleSystem_BattleType(battleSys); | ||
u32 battleType = BattleSystem_GetBattleType(battleSys); | ||
MI_CpuClear32(&battleCtx->aiContext, sizeof(AIContext)); | ||
|
||
if ((battleType & BATTLE_TYPE_TRAINER) && (battleType & BATTLE_TYPE_NO_AI_ITEMS) == FALSE) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etc.