-
Notifications
You must be signed in to change notification settings - Fork 80
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
Renaming variables and functions related to overworld poison damage and FieldOverworldState #307
Changes from 5 commits
a942454
9da11d6
00890c6
0dea833
37ba739
e7e7f44
da15089
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 |
---|---|---|
|
@@ -18,10 +18,10 @@ void FieldOverworldState_Init(FieldOverworldState *param0); | |
Location *FieldOverworldState_GetPlayerLocation(FieldOverworldState *param0); | ||
Location *FieldOverworldState_GetEntranceLocation(FieldOverworldState *param0); | ||
Location *FieldOverworldState_GetPrevLocation(FieldOverworldState *param0); | ||
Location *sub_0203A72C(FieldOverworldState *param0); | ||
Location *FieldOverworldState_GetExitLocation(FieldOverworldState *param0); | ||
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: The declarations' parameter names should match the definitions' ones. (same with the one in |
||
Location *FieldOverworldState_GetSpecialLocation(FieldOverworldState *param0); | ||
void FieldOverworldState_SetSpecialLocation(FieldOverworldState *param0, Location *param1); | ||
u16 *sub_0203A748(FieldOverworldState *param0); | ||
u16 *FieldOverworldState_GetSpecialBGM(FieldOverworldState *param0); | ||
u16 FieldOverworldState_GetWeather(const FieldOverworldState *param0); | ||
void FieldOverworldState_SetWeather(FieldOverworldState *param0, u16 param1); | ||
u16 FieldOverworldState_GetWarpId(const FieldOverworldState *param0); | ||
|
@@ -30,9 +30,9 @@ UnkStruct_020556C4 *sub_0203A76C(FieldOverworldState *param0); | |
int FieldOverworldState_GetCameraType(const FieldOverworldState *param0); | ||
void FieldOverworldState_SetCameraType(FieldOverworldState *param0, int param1); | ||
PlayerData *FieldOverworldState_GetPlayerData(FieldOverworldState *param0); | ||
u16 *sub_0203A784(FieldOverworldState *param0); | ||
u16 *sub_0203A788(FieldOverworldState *param0); | ||
u16 *sub_0203A78C(FieldOverworldState *param0); | ||
u16 *FieldOverworldState_GetSafariBallCount(FieldOverworldState *param0); | ||
u16 *FieldOverworldState_GetSafariStepCount(FieldOverworldState *param0); | ||
u16 *FieldOverworldState_GetPoisonStepCount(FieldOverworldState *param0); | ||
FieldOverworldState *SaveData_GetFieldOverworldState(SaveData *param0); | ||
FieldOverworldSave *SaveData_GetFieldOverworldSave(SaveData *param0); | ||
void FieldSystem_SaveObjects(FieldSystem *fieldSystem); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef POKEPLATINUM_STRUCT_0203A790_DECL_H | ||
#define POKEPLATINUM_STRUCT_0203A790_DECL_H | ||
|
||
typedef struct UnkStruct_0203A790_t FieldOverworldState; | ||
typedef struct FieldOverworldState FieldOverworldState; | ||
|
||
#endif // POKEPLATINUM_STRUCT_0203A790_DECL_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -896,7 +896,7 @@ static void Field_CalculateFriendship(FieldSystem *fieldSystem) | |
static BOOL Field_UpdatePoison(FieldSystem *fieldSystem) | ||
{ | ||
Party *party = Party_GetFromSavedata(fieldSystem->saveData); | ||
u16 *poisonSteps = sub_0203A78C(SaveData_GetFieldOverworldState(fieldSystem->saveData)); | ||
u16 *poisonSteps = FieldOverworldState_GetPoisonStepCount(SaveData_GetFieldOverworldState(fieldSystem->saveData)); | ||
|
||
(*poisonSteps)++; | ||
(*poisonSteps) %= 4; | ||
|
@@ -905,14 +905,14 @@ static BOOL Field_UpdatePoison(FieldSystem *fieldSystem) | |
return FALSE; | ||
} | ||
|
||
switch (sub_02054B04(party, MapHeader_GetMapLabelTextID(fieldSystem->location->mapId))) { | ||
switch (Pokemon_DoPoisonDamage(party, MapHeader_GetMapLabelTextID(fieldSystem->location->mapId))) { | ||
case 0: | ||
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. suggestion: It would be good to add descriptive constants for these cases (and the corresponding return values in |
||
return FALSE; | ||
case 1: | ||
ov5_021EF518(fieldSystem->unk_04->unk_20); | ||
Field_DoPoisonEffect(fieldSystem->unk_04->unk_20); | ||
return FALSE; | ||
case 2: | ||
ov5_021EF518(fieldSystem->unk_04->unk_20); | ||
Field_DoPoisonEffect(fieldSystem->unk_04->unk_20); | ||
ScriptManager_Set(fieldSystem, 2003, NULL); | ||
return TRUE; | ||
} | ||
|
@@ -926,14 +926,14 @@ static BOOL Field_UpdateSafari(FieldSystem *fieldSystem) | |
return FALSE; | ||
} | ||
|
||
u16 *balls = sub_0203A784(SaveData_GetFieldOverworldState(fieldSystem->saveData)); | ||
u16 *balls = FieldOverworldState_GetSafariBallCount(SaveData_GetFieldOverworldState(fieldSystem->saveData)); | ||
|
||
if (*balls == 0) { | ||
ScriptManager_Set(fieldSystem, 8802, NULL); | ||
return TRUE; | ||
} | ||
|
||
u16 *steps = sub_0203A788(SaveData_GetFieldOverworldState(fieldSystem->saveData)); | ||
u16 *steps = FieldOverworldState_GetSafariStepCount(SaveData_GetFieldOverworldState(fieldSystem->saveData)); | ||
(*steps)++; | ||
|
||
if (*steps >= 500) { | ||
|
@@ -1024,8 +1024,8 @@ static BOOL Field_MapConnection(const FieldSystem *fieldSystem, int playerX, int | |
|
||
static void Field_SetMapConnection(FieldSystem *fieldSystem, const int playerX, const int playerZ, const int playerDir) | ||
{ | ||
FieldOverworldState *v0 = SaveData_GetFieldOverworldState(fieldSystem->saveData); | ||
Location *nextMap = sub_0203A72C(v0); | ||
FieldOverworldState *fieldState = SaveData_GetFieldOverworldState(fieldSystem->saveData); | ||
Location *nextMap = FieldOverworldState_GetExitLocation(fieldState); | ||
|
||
(*nextMap) = *(fieldSystem->location); | ||
nextMap->faceDirection = playerDir; | ||
|
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.
thought: we're kind of all over the place with this in the repo at the moment - I'm seeing
task
,taskMan
, andtaskManager
. Maybe something we should look into, but doesn't need to be solved with this PR or anything.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.
It's being normalized to
task
forFieldTask
, because there's no "management" aspect to it. There is a light call-stack, but that doesn't totally qualify it as a "manager" to me.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.
should I change all of them to
task
then? I can just immediately do it in other files as well, if this is something that you want to normalize across the whole repoThere 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.
The ones in this PR would be nice, but I wouldn't sweat the whole repo unless you're just enthusiastic to do so. I'd probably do that as a follow-up PR if you did though.