d_t_sword_battle_game OK - function order issue

This commit is contained in:
elijah-thomas774
2025-11-28 04:36:54 -05:00
parent 74e2548051
commit b568957bb4
8 changed files with 602 additions and 93 deletions
+5 -5
View File
@@ -2883,7 +2883,7 @@ enum StoryFlags_e {
/** [In Boss Rush mode (can be unset)]
* Story Flag #572 (0x023C) - JP 805ACD98 0x08 / US 805A9B18 0x08
*/
STORYFLAG_572,
STORYFLAG_BOSSRUSH_ACTIVE,
/** [In redoing slient realm mode?]
* Story Flag #573 (0x023D) - JP 805ACD98 0x10 / US 805A9B18 0x10
@@ -3538,17 +3538,17 @@ enum StoryFlags_e {
/** [Sets when you refight imp 1 (Sealed Grounds layer 2)]
* Story Flag #703 (0x02BF) - JP 805ACDA2 0x08 / US 805A9B22 0x08
*/
STORYFLAG_703,
STORYFLAG_IMPRISONED1_BOSSRUSH,
/** [Sets when you refight imp 2 (Sealed Grounds layer 3)]
* Story Flag #704 (0x02C0) - JP 805ACDA2 0x10 / US 805A9B22 0x10
*/
STORYFLAG_704,
STORYFLAG_IMPRISONED2_BOSSRUSH,
/** [Sets when you refight imp3 (Sealed Grounds layer 4)]
* Story Flag #705 (0x02C1) - JP 805ACDA2 0x20 / US 805A9B22 0x20
*/
STORYFLAG_705,
STORYFLAG_IMPRISONED3_BOSSRUSH,
/** [Minecart Escort done (Lanayru Gorge layer 2)]
* Story Flag #706 (0x02C2) - JP 805ACDA2 0x40 / US 805A9B22 0x40
@@ -3653,7 +3653,7 @@ enum StoryFlags_e {
/** [[Gets Set in a refight](Hylia's Realm layer 4)]
* Story Flag #726 (0x02D6) - JP 805ACDA4 0x40 / US 805A9B24 0x40
*/
STORYFLAG_726,
STORYFLAG_DEMISE_BOSSRUSH,
/** [Talking to Fi after filling Wallet]
* Story Flag #727 (0x02D7) - JP 805ACDA4 0x80 / US 805A9B24 0x80
+22
View File
@@ -9,6 +9,20 @@ public:
return sInstance;
}
/** Updates some window */
void fn_80295940();
/** ??? */
void fn_80295980();
/** Checks to see if in BAMBOO_CUTTING .. BOSS_RUSH and returns some boolean (start?) */
bool fn_80295AB0();
/** Checks to see if in BAMBOO_CUTTING .. BOSS_RUSH and returns some boolean (end?) */
bool fn_80295AD0();
void setHighscore(s32 time);
/** GUESS: sets the start for the high score? */
void fn_80295CB0(bool);
void timeRelatedExecute();
void scoreRelatedExecute();
@@ -18,7 +32,15 @@ public:
void timeRelated();
void scoreRelated();
/** GUESS: Assumption based on function caller */
void setComplete() {
field_0x3866 = true;
}
private:
u8 _0x0000[0x3866 - 0x0000];
bool field_0x3866;
static dLytMiniGame_c *sInstance;
};
+78 -5
View File
@@ -1,17 +1,90 @@
#ifndef D_T_SWORD_BATTLE_GAME_H
#define D_T_SWORD_BATTLE_GAME_H
#include "d/a/d_a_base.h"
#include "d/flag/storyflag_manager.h"
#include "d/t/d_tg.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
#include "toBeSorted/actor_event.h"
#include "toBeSorted/timekeeper.h"
class dTgSwordBattleGame_c : public dAcBase_c {
class dTgSwordBattleGame_c : public dTg_c {
public:
dTgSwordBattleGame_c() : mStateMgr(*this, sStateID::null) {}
dTgSwordBattleGame_c() : mStateMgr(*this, sStateID::null), mEventRelated(*this, 0) {}
virtual ~dTgSwordBattleGame_c() {}
virtual int create() override;
virtual int doDelete() override;
virtual int draw() override;
virtual int actorExecute() override;
virtual int actorExecuteInEvent() override;
/* vt 0x74-0x80*/ STATE_VIRTUAL_FUNC_DECLARE(dTgSwordBattleGame_c, Wait);
/* vt 0x80-0x88*/ STATE_VIRTUAL_FUNC_DECLARE(dTgSwordBattleGame_c, Manage);
void init();
bool checkInEvent(const char *eventName);
static bool checkInBossRushFlag();
void unsetInBossRushFlag();
void setInBossRushFlag();
static bool checkInBossRushMinigame();
void unsetEarlyFightFlags() const;
void unsetImprisonedFightFlags() const;
void unsetDemiseFightFlag() const;
s32 getCurrentTime() const;
void saveCurrentTime(s32 time) const;
s32 getBossIdx() const;
s32 getBossHighscore() const;
/** Index 0 */
s32 getGhirahim1Highscore() const;
/** Index 1 */
s32 getScalderaHighscore() const;
/** Index 2 */
s32 getMolderachHighscore() const;
/** Index 3 */
s32 getImprisoned1Highscore() const;
/** Index 4 */
s32 getKoloktosHighscore() const;
/** Index 5 */
s32 getTentalusHighscore() const;
/** Index 6 */
s32 getGhirahim2Highscore() const;
/** Index 7 */
s32 getImprisoned2Highscore() const;
/** Index 8 */
s32 getImprisoned3Highscore() const;
/** Index 9 */
s32 getHordeHighscore() const;
/** Index 10 */
s32 getGhirahim3Highscore() const;
/** Index 11 */
s32 getDemiseHighscore() const;
s32 getCurrentBossNumber() const;
void setCurrentBossNumber(s32 num);
void notifyBossDeath(bool ghirahim_related = false);
bool checkFightStarted() const;
private:
/* 0x??? */ STATE_MGR_DECLARE(dTgSwordBattleGame_c);
/* 0x0FC */ STATE_MGR_DECLARE(dTgSwordBattleGame_c);
/* 0x138 */ ActorEventRelated mEventRelated;
/* 0x188 */ Timekeeper mTimer;
/* 0x1A8 */ bool field_0x1A8;
/* 0x1A9 */ bool field_0x1A9;
/* 0x1AA */ bool field_0x1AA;
/* 0x1AB */ bool field_0x1AB; ///< set if current boss is complete
/* 0x1AC */ bool field_0x1AC;
/* 0x1AD */ u8 field_0x1AD;
/* 0x1AE */ u8 field_0x1AE;
/* 0x1B0 */ u32 mBossNumber;
// Note: Gets padded to 0x1B8 due to Timekeepers 8-byte alignment
};
#endif
+3
View File
@@ -19,8 +19,11 @@ public:
HARP_PLAYING,
};
static bool isInMinigameState(Minigame game);
static bool isInAnyMinigame();
static bool endMinigame(Minigame game);
static void create();
static void destroy();
static void execute();
+17
View File
@@ -3,9 +3,26 @@
#include "common.h"
#define TIME_CONVERT(min, sec, msec) ((min * 60 * 1000) + (sec * 1000) + (msec * 10))
class Timekeeper {
public:
Timekeeper();
virtual ~Timekeeper();
virtual s32 vt_0x0C(); ///< Init
virtual s32 vt_0x10(); ///< Delete
virtual s32 vt_0x14();
virtual s32 doCount();
virtual s32 vt_0x1C();
s32 getTime() const;
void initUpCounter();
/* 0x08 */ s64 mTime;
/* 0x10 */ u32 mCountingUp;
/* 0x14 */ u32 mCountingDown;
/* 0x1C */ bool field_0x1C;
};
#endif