summaryrefslogtreecommitdiff
path: root/src/code/m_cockroach.c
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2024-05-30 17:00:57 -0400
committerGitHub <noreply@github.com>2024-05-30 14:00:57 -0700
commitfd0581121366309a56c648eda7a299537e355b28 (patch)
tree6fb8d8b167fecd8799748ccb1caab1a013c7e739 /src/code/m_cockroach.c
parent1f7fbf9b291d5685633e6e819b2579f36dc4ef2b (diff)
`m_trademark` OK (#192)
* C file * trademark_init * trademark_cancel, trademark_move, trademark_main * trademark_draw * trademark_goto_demo_scene and func_80805360_jp * set_npc_4_title_demo * func_80804C40_jp * trademark_cleanup * func_808052B8_jp * func_80805104_jp * func_80804F78_jp * func_80804EE0_jp * fix warnings * small cleanup * fix build * some fixes * stuff * some cleanups * Fix rebase * Import data * Migrate bss * cleanup * Save substruct * format * TrademarkState and some other stuff * remove fake match * stuff I missed * whoops * Stupid `-Wtype-limits` * Update src/overlays/gamestates/ovl_trademark/m_trademark.c Co-authored-by: Prakxo <87568477+Prakxo@users.noreply.github.com> * Review * Update src/overlays/gamestates/ovl_trademark/m_trademark.c Co-authored-by: emilybrooks <emilybrooksemilybrooks@gmail.com> * Update src/overlays/gamestates/ovl_trademark/m_trademark.c Co-authored-by: Prakxo <87568477+Prakxo@users.noreply.github.com> * clang-tidy changes??? * review --------- Co-authored-by: Prakxo <87568477+Prakxo@users.noreply.github.com> Co-authored-by: emilybrooks <emilybrooksemilybrooks@gmail.com>
Diffstat (limited to 'src/code/m_cockroach.c')
-rw-r--r--src/code/m_cockroach.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/code/m_cockroach.c b/src/code/m_cockroach.c
index b774da9..00b83e2 100644
--- a/src/code/m_cockroach.c
+++ b/src/code/m_cockroach.c
@@ -19,11 +19,11 @@ s32 mCkRh_GokiFamilyCount2Good(s32 count) {
}
s32 mCkRh_InitGokiSaveData_1Room(s32 player) {
- common_data.homes[player & 3].goki.num = 0;
- common_data.homes[player & 3].goki.pad = 0;
- common_data.homes[player & 3].goki.time.year = common_data.time.rtcTime.year;
- common_data.homes[player & 3].goki.time.month = common_data.time.rtcTime.month;
- common_data.homes[player & 3].goki.time.day = common_data.time.rtcTime.day;
+ common_data.save.homes[player & 3].goki.num = 0;
+ common_data.save.homes[player & 3].goki.pad = 0;
+ common_data.save.homes[player & 3].goki.time.year = common_data.time.rtcTime.year;
+ common_data.save.homes[player & 3].goki.time.month = common_data.time.rtcTime.month;
+ common_data.save.homes[player & 3].goki.time.day = common_data.time.rtcTime.day;
}
void mCkRh_InitGokiSaveData_1Room_ByHomeData(mHm_hs_c* home) {
@@ -47,9 +47,9 @@ void mCkRh_SavePlayTime(s32 player) {
if (player < PLAYER_NUM) {
home = mHS_get_arrange_idx(player) & 3;
- common_data.homes[home].goki.time.year = common_data.time.rtcTime.year;
- common_data.homes[home].goki.time.month = common_data.time.rtcTime.month;
- common_data.homes[home].goki.time.day = common_data.time.rtcTime.day;
+ common_data.save.homes[home].goki.time.year = common_data.time.rtcTime.year;
+ common_data.save.homes[home].goki.time.month = common_data.time.rtcTime.month;
+ common_data.save.homes[home].goki.time.day = common_data.time.rtcTime.day;
}
}
@@ -61,9 +61,9 @@ s32 mCkRh_DaysGapCompareWithSaveTime(s32 player) {
lbRTC_time_c gokiTime;
home = mHS_get_arrange_idx(player) & 3;
- gokiTime.year = common_data.homes[home].goki.time.year;
- gokiTime.month = common_data.homes[home].goki.time.month;
- gokiTime.day = common_data.homes[home].goki.time.day;
+ gokiTime.year = common_data.save.homes[home].goki.time.year;
+ gokiTime.month = common_data.save.homes[home].goki.time.month;
+ gokiTime.day = common_data.save.homes[home].goki.time.day;
gokiTime.weekday = lbRTC_Week(gokiTime.year, gokiTime.month, gokiTime.day);
gokiTime.hour = 1;
@@ -86,9 +86,9 @@ void mCkRh_DecideNowGokiFamilyCount(s32 player) {
if (dayGap > 6) {
s32 gokiNum;
s32 count;
- gokiNum = common_data.homes[home].goki.num;
+ gokiNum = common_data.save.homes[home].goki.num;
count = gokiNum > 0 ? dayGap : dayGap - 6;
- common_data.homes[home].goki.num = mCkRh_GokiFamilyCount2Good(count + gokiNum);
+ common_data.save.homes[home].goki.num = mCkRh_GokiFamilyCount2Good(count + gokiNum);
}
}
}
@@ -106,9 +106,9 @@ s32 mCkRh_PlussGokiN_NowRoom(s32 count) {
housefieldId = FI_GET_PLAYER_ROOM_NO(fieldId);
homeId = mHS_get_arrange_idx(player) & 3;
if ((player < PLAYER_NUM) && (housefieldId == homeId)) {
- num = common_data.homes[homeId].goki.num;
+ num = common_data.save.homes[homeId].goki.num;
- common_data.homes[homeId].goki.num = mCkRh_GokiFamilyCount2Good(count + num);
+ common_data.save.homes[homeId].goki.num = mCkRh_GokiFamilyCount2Good(count + num);
return TRUE;
}
}
@@ -128,8 +128,8 @@ s32 mCkRh_MinusGokiN_NowRoom(s32 count) {
housefieldId = FI_GET_PLAYER_ROOM_NO(fieldId);
homeId = mHS_get_arrange_idx(player) & 3;
if ((player < PLAYER_NUM) && (housefieldId == homeId)) {
- num = common_data.homes[homeId].goki.num;
- common_data.homes[homeId].goki.num = mCkRh_GokiFamilyCount2Good(num - count);
+ num = common_data.save.homes[homeId].goki.num;
+ common_data.save.homes[homeId].goki.num = mCkRh_GokiFamilyCount2Good(num - count);
return TRUE;
}
}
@@ -140,7 +140,7 @@ s32 mCkRh_NowSceneGokiFamilyCount() {
u16 fieldid = mFI_GetFieldId();
if (FI_IS_PLAYER_ROOM(fieldid)) {
- return common_data.homes[FI_GET_PLAYER_ROOM_NO(fieldid)].goki.num;
+ return common_data.save.homes[FI_GET_PLAYER_ROOM_NO(fieldid)].goki.num;
} else {
return 0;
}