Util: add several rs util headers (#197)
Some checks failed
Compile and verify functions / compile_verify (push) Has been cancelled
Copy headers to separate repo / copy_headers (push) Has been cancelled
lint / clang-format (push) Has been cancelled
lint / custom-lint (push) Has been cancelled
progress / publish_progress (push) Has been cancelled
testcompile / test_compile (push) Has been cancelled

This commit is contained in:
tetraxile 2024-11-25 11:00:50 +00:00 committed by GitHub
parent 546c59b2aa
commit eb5b90f430
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 787 additions and 149 deletions

View File

@ -34405,13 +34405,13 @@ Address,Quality,Size,Name
0x000000710054c4a4,U,000012,_ZN2rs9isHaveCapE22GameDataHolderAccessorPKc
0x000000710054c4b0,U,000012,_ZN2rs13isHaveStickerE22GameDataHolderAccessorPKc
0x000000710054c4bc,U,000012,_ZN2rs10isHaveGiftE22GameDataHolderAccessorPKc
0x000000710054c4c8,U,000008,_ZN2rs12getClothListE22GameDataHolderAccessor
0x000000710054c4c8,O,000008,_ZN2rs12getClothListE22GameDataHolderAccessor
0x000000710054c4d0,U,000008,_ZN2rs16getClothListSizeE22GameDataHolderAccessor
0x000000710054c4d8,U,000048,_ZN2rs11isHaveClothE22GameDataHolderAccessori
0x000000710054c508,U,000044,_ZN2rs19isHaveClothByFileIdE22GameDataHolderAccessorPKci
0x000000710054c534,U,000008,_ZN2rs16calcHaveClothNumE22GameDataHolderAccessor
0x000000710054c53c,U,000228,_ZN2rs8buyClothEPKN2al18IUseSceneObjHolderEPKc
0x000000710054c620,U,000008,_ZN2rs10getCapListE22GameDataHolderAccessor
0x000000710054c620,O,000008,_ZN2rs10getCapListE22GameDataHolderAccessor
0x000000710054c628,U,000008,_ZN2rs14getCapListSizeE22GameDataHolderAccessor
0x000000710054c630,U,000048,_ZN2rs9isHaveCapE22GameDataHolderAccessori
0x000000710054c660,U,000044,_ZN2rs17isHaveCapByFileIdE22GameDataHolderAccessorPKci
@ -34422,12 +34422,12 @@ Address,Quality,Size,Name
0x000000710054ca00,U,000204,_ZN2rs13isCompleteCapEPKN2al18IUseSceneObjHolderEi
0x000000710054cacc,U,000008,_ZN2rs14calcHaveCapNumE22GameDataHolderAccessor
0x000000710054cad4,U,000228,_ZN2rs6buyCapEPKN2al18IUseSceneObjHolderEPKc
0x000000710054cbb8,U,000008,_ZN2rs11getGiftListE22GameDataHolderAccessor
0x000000710054cbb8,O,000008,_ZN2rs11getGiftListE22GameDataHolderAccessor
0x000000710054cbc0,U,000008,_ZN2rs15getGiftListSizeE22GameDataHolderAccessor
0x000000710054cbc8,U,000048,_ZN2rs10isHaveGiftE22GameDataHolderAccessori
0x000000710054cbf8,U,000008,_ZN2rs15calcHaveGiftNumE22GameDataHolderAccessor
0x000000710054cc00,U,000048,_ZN2rs17checkCompleteGiftE22GameDataHolderAccessori
0x000000710054cc30,U,000008,_ZN2rs14getStickerListE22GameDataHolderAccessor
0x000000710054cc30,O,000008,_ZN2rs14getStickerListE22GameDataHolderAccessor
0x000000710054cc38,U,000008,_ZN2rs18getStickerListSizeE22GameDataHolderAccessor
0x000000710054cc40,U,000048,_ZN2rs13isHaveStickerE22GameDataHolderAccessori
0x000000710054cc70,U,000008,_ZN2rs18calcHaveStickerNumE22GameDataHolderAccessor

Can't render this file because it is too large.

View File

@ -19,8 +19,8 @@
#include "Player/HackerJudge.h"
#include "Player/PlayerHackStartShaderCtrl.h"
#include "Util/Hack.h"
#include "Util/JudgeUtil.h"
#include "Util/Sensor.h"
#include "Util/StageSceneFunction.h"
namespace {
NERVE_IMPL(AnagramAlphabetCharacter, Wait);

View File

@ -11,8 +11,9 @@
#include "Library/Nerve/NerveUtil.h"
#include "System/GameDataFunction.h"
#include "System/GameDataUtil.h"
#include "Util/Sensor.h"
#include "Util/StageSensorMsgFunction.h"
#include "Util/SensorMsgFunction.h"
namespace {
NERVE_IMPL(ChurchDoor, DemoEnterChurch);

View File

@ -1,7 +1,7 @@
#include "Npc/Achievement.h"
#include "Npc/AchievementInfoReader.h"
#include "Util/ResourceUtil.h"
#include "Util/AchievementUtil.h"
Achievement::Achievement(const AchievementInfo* info) : mInfo(info) {}

View File

@ -1,12 +1,13 @@
#include "Npc/AchievementHolder.h"
#include "Library/Base/StringUtil.h"
#include "Library/Resource/ResourceUtil.h"
#include "Npc/Achievement.h"
#include "Npc/AchievementInfoReader.h"
#include "System/GameDataFunction.h"
#include "Util/ResourceUtil.h"
#include "System/GameDataUtil.h"
#include "Util/AchievementUtil.h"
#include "Util/ClothUtil.h"
AchievementHolder::AchievementHolder() = default;
@ -75,65 +76,65 @@ s32 AchievementHolder::getAchievementProgressCurrentRow(s32 index,
if (al::isEqualString(*name, "Scenario_Ending"))
return 1;
if (al::isEqualString(*name, "Scenario_WorldAll"))
return rs::calcClearWorldNum(accessor);
return rs::calcClearWorldNum(accessor.mData);
if (al::isEqualString(*name, "Shine_Gather_1") || al::isEqualString(*name, "Shine_Gather_2") ||
al::isEqualString(*name, "Shine_Gather_3"))
return GameDataFunction::getTotalShineNum(accessor, -1);
if (al::isEqualString(*name, "Shine_CollectCoinShop"))
return rs::calcBuyItemNumForCoinCollectByWorld(accessor);
return rs::calcBuyItemNumForCoinCollectByWorld(accessor.mData);
if (al::isEqualString(*name, "Shine_Shine2D_1") || al::isEqualString(*name, "Shine_Shine2D_2"))
return rs::calcGetShineNumDot(accessor);
return rs::calcGetShineNumDot(accessor.mData);
if (al::isEqualString(*name, "Shine_TreasureBox_1") ||
al::isEqualString(*name, "Shine_TreasureBox_2"))
return rs::calcGetShineNumTreasureBox(accessor);
return rs::calcGetShineNumTreasureBox(accessor.mData);
if (al::isEqualString(*name, "Shine_MusicNote_1") ||
al::isEqualString(*name, "Shine_MusicNote_2"))
return rs::calcGetShineNumNoteObj(accessor);
return rs::calcGetShineNumNoteObj(accessor.mData);
if (al::isEqualString(*name, "Shine_TimerAthretic_1") ||
al::isEqualString(*name, "Shine_TimerAthretic_2"))
return rs::calcGetShineNumTimerAthletic(accessor);
return rs::calcGetShineNumTimerAthletic(accessor.mData);
if (al::isEqualString(*name, "Shine_CaptainKinopio_1") ||
al::isEqualString(*name, "Shine_CaptainKinopio_2"))
return rs::calcGetShineNumKinopioBrigade(accessor);
return rs::calcGetShineNumKinopioBrigade(accessor.mData);
if (al::isEqualString(*name, "Shine_TravelingPeach_1") ||
al::isEqualString(*name, "Shine_TravelingPeach_2"))
return rs::calcGetShineNumWorldTravelingPeach(accessor);
return rs::calcGetShineNumWorldTravelingPeach(accessor.mData);
if (al::isEqualString(*name, "Shine_CollectAnimalAll"))
return rs::calcGetShineNumCollectAnimal(accessor);
return rs::calcGetShineNumCollectAnimal(accessor.mData);
if (al::isEqualString(*name, "Shine_KuriboGirl"))
return rs::calcGetShineNumKuriboGirl(accessor);
return rs::calcGetShineNumKuriboGirl(accessor.mData);
if (al::isEqualString(*name, "Shine_Jugem"))
return rs::calcGetShineNumJugemFish(accessor);
return rs::calcGetShineNumJugemFish(accessor.mData);
if (al::isEqualString(*name, "Shine_Seed_1") || al::isEqualString(*name, "Shine_Seed_2"))
return rs::calcGetShineNumGrowPlant(accessor);
return rs::calcGetShineNumGrowPlant(accessor.mData);
if (al::isEqualString(*name, "Shine_Rabbit_1") || al::isEqualString(*name, "Shine_Rabbit_2"))
return rs::calcGetShineNumRabbit(accessor);
return rs::calcGetShineNumRabbit(accessor.mData);
if (al::isEqualString(*name, "Shine_DigPoint_1") ||
al::isEqualString(*name, "Shine_DigPoint_2"))
return rs::calcGetShineNumDigPoint(accessor);
return rs::calcGetShineNumDigPoint(accessor.mData);
if (al::isEqualString(*name, "Shine_CapHanger_1") ||
al::isEqualString(*name, "Shine_CapHanger_2"))
return rs::calcGetShineNumCapHanger(accessor);
return rs::calcGetShineNumCapHanger(accessor.mData);
if (al::isEqualString(*name, "Shine_Bird"))
return rs::calcGetShineNumBird(accessor);
return rs::calcGetShineNumBird(accessor.mData);
if (al::isEqualString(*name, "Shine_CostumeRoom_1") ||
al::isEqualString(*name, "Shine_CostumeRoom_2") ||
al::isEqualString(*name, "Shine_CostumeRoom_3"))
return rs::calcGetShineNumCostumeRoom(accessor);
return rs::calcGetShineNumCostumeRoom(accessor.mData);
if (al::isEqualString(*name, "Shine_CapThrottle"))
return rs::calcGetShineNumSlot(accessor);
return rs::calcGetShineNumSlot(accessor.mData);
if (al::isEqualString(*name, "Shine_HideAndSeekCapMan"))
return rs::calcGetShineNumHideAndSeekCapMan(accessor);
return rs::calcGetShineNumHideAndSeekCapMan(accessor.mData);
if (al::isEqualString(*name, "Shine_CollectBgm"))
return rs::calcGetShineNumCollectedBgm(accessor);
if (al::isEqualString(*name, "Shine_HintPhoto_1") ||
al::isEqualString(*name, "Shine_HintPhoto_2"))
return rs::calcGetShineNumHintPhoto(accessor);
return rs::calcGetShineNumHintPhoto(accessor.mData);
if (al::isEqualString(*name, "MiniGame_RaceMan_1") ||
al::isEqualString(*name, "MiniGame_RaceMan_2"))
return rs::calcGetShineNumRace(accessor);
return rs::calcGetShineNumRace(accessor.mData);
if (al::isEqualString(*name, "MiniGame_FigureWalker"))
return rs::calcGetShineNumFigureWalking(accessor);
return rs::calcGetShineNumFigureWalking(accessor.mData);
if (al::isEqualString(*name, "MiniGame_SphinxQuiz"))
return rs::calcSphinxQuizCompleteNum(accessor);
if (al::isEqualString(*name, "Souvenir_Count_1") ||
@ -151,17 +152,17 @@ s32 AchievementHolder::getAchievementProgressCurrentRow(s32 index,
if (al::isEqualString(*name, "Other_MoonStoneAll"))
return rs::calcUnlockMoonRockNum(accessor);
if (al::isEqualString(*name, "Other_WorldWarpHoleAll"))
return rs::calcWorldWarpHoleThroughNum(accessor);
return rs::calcWorldWarpHoleThroughNum(accessor.mData);
if (al::isEqualString(*name, "Other_CheckPoint_1") ||
al::isEqualString(*name, "Other_CheckPoint_2"))
return rs::calcGetCheckpointNum(accessor);
return rs::calcGetCheckpointNum(accessor.mData);
if (al::isEqualString(*name, "Other_Coin_1") || al::isEqualString(*name, "Other_Coin_2") ||
al::isEqualString(*name, "Other_Coin_3"))
return rs::getTotalCoinNum(accessor);
return rs::getTotalCoinNum(accessor.mData);
if (al::isEqualString(*name, "Other_Jump"))
return rs::getPlayerJumpCount(accessor);
return rs::getPlayerJumpCount(accessor.mData);
if (al::isEqualString(*name, "Other_CapThrow"))
return rs::getPlayerThrowCapCount(accessor);
return rs::getPlayerThrowCapCount(accessor.mData);
return 0;
}

View File

@ -5,8 +5,8 @@
#include "Library/LiveActor/LiveActor.h"
#include "Library/Nature/NatureUtil.h"
#include "System/GameDataHolderAccessor.h"
#include "Util/Area.h"
#include "System/GameDataUtil.h"
#include "Util/AreaUtil.h"
#include "Util/ObjUtil.h"
PlayerAreaChecker::PlayerAreaChecker(const al::LiveActor* player,

View File

@ -1,7 +1,7 @@
#include "Player/PlayerJudgeForceLand.h"
#include "Player/PlayerTrigger.h"
#include "Util/StageSceneFunction.h"
#include "Util/JudgeUtil.h"
PlayerJudgeForceLand::PlayerJudgeForceLand(const IJudge* judgeLongFall,
const PlayerTrigger* trigger)

View File

@ -2,8 +2,8 @@
#include <math/seadMathCalcCommon.h>
#include "Util/JudgeUtil.h"
#include "Util/PlayerCollisionUtil.h"
#include "Util/StageSceneFunction.h"
PlayerJudgeSpeedCheckFall::PlayerJudgeSpeedCheckFall(const al::LiveActor* player,
const IUsePlayerCollision* collision,

View File

@ -14,6 +14,20 @@ class PlacementId;
class GameDataFile;
class ChangeStageInfo;
struct ItemAmiiboInfo {
s32 mCharacterId;
s32 mNumberingId;
};
struct ItemListInfo {
s32 mIndex;
char mName[0x80];
s32 mType;
u32 mAmiiboCount;
ItemAmiiboInfo* mAmiiboInfo;
bool mIsAOC;
};
class GameDataHolder : public al::GameDataHolderBase {
public:
GameDataHolder(const al::MessageSystem*);
@ -89,6 +103,14 @@ public:
s32 findUseScenarioNo(const char*);
const sead::PtrArray<ItemListInfo>& getClothList() const { return mItemCloth; }
const sead::PtrArray<ItemListInfo>& getCapList() const { return mItemCap; }
const sead::PtrArray<ItemListInfo>& getGiftList() const { return mItemGift; }
const sead::PtrArray<ItemListInfo>& getStickerList() const { return mItemSticker; }
private:
s32 padding;
GameDataFile** mDataFileArr;
@ -108,6 +130,14 @@ private:
sead::Heap* field_90;
u8 gap_98[0x20];
u64* field_B8; // TempSaveData*
u8 gap_C0[0xD0];
u8 gap_C0[0x110 - 0xc0];
sead::PtrArray<ItemListInfo> mItemCloth;
sead::PtrArray<ItemListInfo> mItemCap;
sead::PtrArray<ItemListInfo> mItemGift;
sead::PtrArray<ItemListInfo> mItemSticker;
u8 gap_150[0x190 - 0x150];
WorldList* mWorldList;
u8 gap_198[0x268 - 0x198];
};
static_assert(sizeof(GameDataHolder) == 0x268);

View File

@ -1,6 +1,5 @@
#include "System/GameDataHolderAccessor.h"
#include "Library/Scene/ISceneObj.h"
#include "Library/Scene/SceneObjHolder.h"
#include "Library/Scene/SceneUtil.h"

View File

@ -11,17 +11,8 @@ class ActorInitInfo;
} // namespace al
class SaveObjInfo;
class GameDataHolderAccessor : public GameDataHolderWriter { // maybe extends GameDataHolderWriter?
class GameDataHolderAccessor : public GameDataHolderWriter {
public:
GameDataHolderAccessor(const al::IUseSceneObjHolder*);
GameDataHolderAccessor(const al::SceneObjHolder*);
};
namespace rs {
bool isInvalidChangeStage(const al::LiveActor* actor);
bool isKidsMode(const al::LiveActor* actor);
SaveObjInfo* createSaveObjInfoWriteSaveData(const al::ActorInitInfo&);
void onSaveObjInfo(SaveObjInfo*);
bool isOnSaveObjInfo(const SaveObjInfo*);
} // namespace rs

217
src/System/GameDataUtil.h Normal file
View File

@ -0,0 +1,217 @@
#pragma once
#include <basis/seadTypes.h>
namespace al {
class ActorInitInfo;
class PlacementInfo;
class PlacementId;
class LiveActor;
class Scene;
class LayoutActor;
class IUseSceneObjHolder;
} // namespace al
class SaveObjInfo;
class GameDataHolderAccessor;
class NpcEventDirector;
class KoopaShip;
class QuestInfo;
class ShineTowerRocket;
class WorldWarpHole;
class GameDataHolder;
class CapMessageBossData;
namespace rs {
SaveObjInfo* createSaveObjInfoWriteSaveData(const al::ActorInitInfo& actorInitInfo);
SaveObjInfo* createSaveObjInfoWriteSaveData(const al::ActorInitInfo& actorInitInfo,
const al::PlacementInfo& placementInfo);
SaveObjInfo* createSaveObjInfoNoWriteSaveDataInSameWorld(const al::ActorInitInfo& actorInitInfo);
SaveObjInfo* createSaveObjInfoNoWriteSaveDataInSameWorld(const al::ActorInitInfo& actorInitInfo,
const al::PlacementInfo& placementInfo);
SaveObjInfo*
createSaveObjInfoNoWriteSaveDataInSameWorldResetMiniGame(const al::ActorInitInfo& actorInitInfo);
SaveObjInfo*
createSaveObjInfoNoWriteSaveDataInSameWorldResetMiniGame(const al::ActorInitInfo& actorInitInfo,
const al::PlacementInfo& placementInfo);
SaveObjInfo* createSaveObjInfoNoWriteSaveDataInSameScenario(const al::ActorInitInfo& actorInitInfo);
SaveObjInfo* createSaveObjInfoNoWriteSaveDataInSameScenario(const al::ActorInitInfo& actorInitInfo,
const al::PlacementInfo& placementInfo);
SaveObjInfo* createSaveObjInfoWriteSaveData(const al::ActorInitInfo& actorInitInfo,
const al::PlacementId* placementId);
SaveObjInfo* createSaveObjInfoNoWriteSaveDataInSameWorld(const al::ActorInitInfo& actorInitInfo,
const al::PlacementId* placementId);
SaveObjInfo*
createSaveObjInfoNoWriteSaveDataInSameWorldResetMiniGame(const al::ActorInitInfo& actorInitInfo,
const al::PlacementId* placementId);
SaveObjInfo* createSaveObjInfoNoWriteSaveDataInSameScenario(const al::ActorInitInfo& actorInitInfo,
const al::PlacementId* placementId);
void onSaveObjInfo(SaveObjInfo* saveObjInfo);
void offSaveObjInfo(SaveObjInfo* saveObjInfo);
bool isOnSaveObjInfo(const SaveObjInfo* saveObjInfo);
void setGrowFlowerTime(const al::LiveActor* actor, const al::PlacementId*, const al::PlacementId*,
u64 time);
void setGrowFlowerTime(const al::LiveActor* actor, const al::PlacementId*, u64 time);
u64 getGrowFlowerTime(const al::LiveActor* actor, const al::PlacementId*);
bool isUsedGrowFlowerSeed(const al::LiveActor* actor, const al::PlacementId*);
void addGrowFlowerGrowLevel(const al::LiveActor* actor, const al::PlacementId*, u32 growLevel);
u32 getGrowFlowerGrowLevel(const al::LiveActor* actor, const al::PlacementId*);
const char* findGrowFlowerPotIdFromSeedId(const al::LiveActor* actor, const al::PlacementId*);
bool isPlayFirstTimeBalloon(const al::LiveActor* actor);
void playTimeBalloonFirst(const al::LiveActor* actor);
void onShortExplainGet(const al::LiveActor* actor);
void onShortExplainSet(const al::LiveActor* actor);
bool isShortExplainGet(const al::LiveActor* actor);
bool isShortExplainSet(const al::LiveActor* actor);
void onReactedLuigiCostume(const al::LiveActor* actor);
bool isReactedLuigiCostume(const al::LiveActor* actor);
s32 getPlayerRank(const al::LiveActor* actor);
s32 getPlayerRank(GameDataHolderAccessor accessor);
void setPlayerRank(const al::LiveActor* actor, s32 rank);
void setPlayerRank(GameDataHolderAccessor accessor, s32 rank);
u64 getPrincipalId(const al::LiveActor* actor);
void setPrincipalId(const al::LiveActor* actor, u64 principalId);
bool isAnswerCorrectSphinxQuiz(GameDataHolderAccessor accessor, const char* worldName);
void answerCorrectSphinxQuiz(const al::LiveActor* actor);
bool isAnswerCorrectSphinxQuizAll(GameDataHolderAccessor accessor, const char* worldName);
void answerCorrectSphinxQuizAll(const al::LiveActor* actor);
bool isTalkAlreadyLocalLanguage(const NpcEventDirector* npcEventDirector);
void talkLocalLanguage(const al::LiveActor* actor);
const char* getLocalLanguageName(const al::LiveActor* actor);
const char* getLocalLanguageName(const NpcEventDirector* npcEventDirector);
bool isOnFlagKinopioBrigadeNpcFirstTalk(const al::LiveActor* actor);
void onFlagKinopioBrigadeNpcFirstTalk(const al::LiveActor* actor);
bool isOnFlagHintNpcFirstTalk(const al::LiveActor* actor);
void onFlagHintNpcFirstTalk(const al::LiveActor* actor);
void playScenarioStartCamera(const al::LiveActor* actor, const QuestInfo* questInfo);
void playScenarioStartCamera(const al::LiveActor* actor, s32 idx);
void setExistKoopaShip(const KoopaShip* koopaShip);
void resetExistKoopaShip(const KoopaShip* koopaShip);
bool isExistKoopaShip(const ShineTowerRocket* shineTowerRocket);
bool isExistKoopaShipInSky(const ShineTowerRocket* shineTowerRocket);
bool tryUnlockShineName(const al::LiveActor* actor, s32 shineIdx);
void calcShineIndexTableNameAvailable(s32*, s32*, const al::LiveActor* actor);
void calcShineIndexTableNameUnlockable(s32*, s32*, const al::LiveActor* actor);
s32 calcWorldIdByWorldWarpHole(const WorldWarpHole* worldWarpHole, const char* changeStageId);
bool checkIsOpenWorldWarpHoleCurrentScenario(const WorldWarpHole* worldWarpHole);
bool isKidsMode(const al::LiveActor* actor);
bool isKidsMode(const al::LayoutActor* layout);
bool isKidsMode(const al::Scene* scene);
bool isKidsMode(const al::IUseSceneObjHolder* user);
bool isKidsMode(const GameDataHolder* holder);
bool isEnableCapMessageLifeOneKidsMode(const al::LiveActor* actor);
void disableCapMessageLifeOneKidsMode(const al::LiveActor* actor);
bool isInvalidChangeStage(const al::LiveActor* actor);
bool isSequenceTimeBalloonOrRace(const al::LiveActor* actor);
bool isSequenceTimeBalloonOrRace(const al::LiveActor* actor);
bool isTreasureBoxDeadStage(const al::LiveActor* actor);
void findRaceRecord(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::LiveActor* actor, const char* raceName);
void findRaceRecord(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::Scene* actor, const char* raceName);
void findRaceRecordRaceManRace(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::Scene* scene);
void findRaceRecordRaceManRace(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::LiveActor* actor);
void findRaceRecordRaceManRaceWithWorldId(bool* isExistRecord, bool*, s32* record, s32*,
s32* lapRecord, const al::Scene* scene, s32 worldId);
void findRaceRecordRaceManRaceWithWorldId(bool* isExistRecord, bool*, s32* record, s32*,
s32* lapRecord, const al::LiveActor* actor, s32 worldId);
void findRaceRecordRadicon(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::Scene* scene);
void findRaceRecordRadicon(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::LiveActor* actor);
void findRaceRecordYukimaru(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::Scene* scene, s32 level);
void findRaceRecordYukimaru(bool* isExistRecord, bool*, s32* record, s32*, s32* lapRecord,
const al::LiveActor* actor, s32 level);
void writeRaceRecord(const al::LiveActor* actor, const char* raceName, s32 record, s32,
s32 lapRecord);
void writeRaceRecord(const al::Scene* scene, const char* raceName, s32 record, s32, s32 lapRecord);
s32 getJumpingRopeBestCount(const al::LiveActor* actor);
s32 getJumpingRopeBestCount(const al::Scene* scene);
void setJumpingRopeBestCount(const al::LiveActor* actor, s32 count);
void setJumpingRopeBestCount(const al::Scene* scene, s32 count);
s32 getJumpingRopeDayCount(const al::LiveActor* actor);
void setJumpingRopeDayCount(const al::LiveActor* actor, s32 count);
void setJumpingRopeUpdateScoreFlag(const al::LiveActor* actor);
bool isExistRecordJumpingRope(const al::LiveActor* actor);
bool isExistRecordJumpingRope(const al::Scene* scene);
bool isExistRecordInDayJumpingRope(const al::LayoutActor* layout);
s32 getVolleyballBestCount(const al::LiveActor* actor);
s32 getVolleyballBestCount(const al::Scene* scene);
void setVolleyballBestCount(const al::LiveActor* actor, s32 count);
void setVolleyballBestCount(const al::Scene* scene, s32 count);
s32 getVolleyballDayCount(const al::LiveActor* actor);
void setVolleyballDayCount(const al::LiveActor* actor, s32 count);
void setVolleyballUpdateScoreFlag(const al::LiveActor* actor);
bool isExistRecordVolleyball(const al::LiveActor* actor);
bool isExistRecordVolleyball(const al::Scene* scene);
bool isExistRecordInDayVolleyball(const al::LayoutActor* layout);
void writeRaceRecordRaceManRace(const al::LiveActor* actor, s32 record);
bool isTalkFirstAmiiboNpc(const al::LiveActor* actor);
void offFlagTalkFirstAmiiboNpc(const al::LiveActor* actor);
bool checkGetShineForWorldTravelingPeach(GameDataHolderAccessor accessor, const char* worldName);
bool checkEnableAppearMoonWorldTravelingPeach(const al::LiveActor* actor);
bool isStartWorldTravelingPeach(const al::LiveActor* actor);
void startWorldTravelingPeach(const al::LiveActor* actor);
bool checkGetEnoughShine(const al::LiveActor* actor, s32 count);
bool checkGetEnoughShineInCurrentWorld(const al::LiveActor* actor);
void setFlagOnStartKoopaCapture(const al::LiveActor* actor);
bool isStartKoopaCapture(const al::LiveActor* actor);
bool isAlreadyTalkPrevWorldInWorldWarp(const al::LiveActor* actor, s32);
bool isAlreadyTalkNextWorldInWorldWarp(const al::LiveActor* actor, s32);
void setAlreadyTalkPrevWorldInWorldWarp(const al::LiveActor* actor, s32);
void setAlreadyTalkNextWorldInWorldWarp(const al::LiveActor* actor, s32);
bool checkNeedTalkPrevWorld(const al::LiveActor* actor);
s32 getTipsIdInWorldWarp(const al::LiveActor* actor);
void addTipsIdInWorldWarp(const al::LiveActor* actor);
void setTalkSpecialInWorldWarp(const al::LiveActor* actor, bool, bool);
bool isTalkFindKoopaInWorldWarp(const al::LiveActor* actor);
bool isTalkBossRaidInWorldWarp(const al::LiveActor* actor);
bool isClearMainScenario(const al::LiveActor* actor, s32 worldId);
bool checkAlreadyVisitStage(const GameDataHolder* holder, const char* stageName);
void visitStage(const GameDataHolder* holder, const char* stageName);
bool isSequenceGoToNextWorld(const al::IUseSceneObjHolder* user);
bool isSequenceCollectShineBeforeGameClear(const al::IUseSceneObjHolder* user);
bool isSequenceCollectShineForRepairHome(const al::IUseSceneObjHolder* user);
bool isSequenceCollectShine(const al::IUseSceneObjHolder* user);
bool isSequenceGoToMoonRock(const al::IUseSceneObjHolder* user);
bool isEnableExplainShopCoin(const al::LiveActor* actor);
void explainShopCoin(const al::LiveActor* actor);
bool checkShowNewItemAndPrepareSave(const al::LiveActor* actor);
bool isInNormalCoinShopFirst(const al::LiveActor* actor);
void offInNormalCoinShopFirst(const al::LiveActor* actor);
bool checkExistNewShopItem(const al::LiveActor* actor, s32, s32, bool);
CapMessageBossData* getCapMessageBossData(const al::LiveActor* actor);
void getYoshiFruit(SaveObjInfo* saveObjInfo);
bool isGetYoshiFruit(const SaveObjInfo* saveObjInfo);
bool isTalkKakku(const al::LiveActor* actor);
void talkKakku(const al::LiveActor* actor);
bool isTalkWorldTravelingPeach(const al::LiveActor* actor);
void talkWorldTravelingPeach(const al::LiveActor* actor);
bool isTalkCollectBgmNpc(const al::LiveActor* actor);
void talkCollectBgmNpc(const al::LiveActor* actor);
s32 getTokimekiMayorNpcFavorabilityRating(const al::LiveActor* actor);
void setTokimekiMayorNpcFavorabilityRating(const al::LiveActor* actor, s32 rating);
bool tryFindCoinStackSave(s32*, const al::LiveActor* actor, const al::PlacementId*);
void saveCoinStack(const al::LiveActor* actor, const al::PlacementId*, s32);
bool isCollectedBgmCityWorldCelemony(const al::LiveActor* actor);
bool isCollectedBgmCityWorldCelemony2D(const al::LiveActor* actor);
s32 calcGetShineNumCollectedBgm(GameDataHolderAccessor accessor);
bool checkGetShineCollectedBgmAll(const al::LiveActor* actor);
bool checkSavedHintPhoto(const al::LiveActor* actor, const char* name);
void saveHintPhoto(const al::LiveActor* actor, const char* name);
bool isRideSphinx(GameDataHolderAccessor accessor);
void rideSphinx(const al::LiveActor* actor);
bool isRideMotorcycle(GameDataHolderAccessor accessor);
void rideMotorcycle(const al::LiveActor* actor);
void setShowInformationPoleGrab(const al::IUseSceneObjHolder* user);
bool isNeedShowInformationPoleGrab(const al::IUseSceneObjHolder* user);
void setShowInformationPoleClimb(const al::IUseSceneObjHolder* user);
bool isNeedShowInformationPoleClimb(const al::IUseSceneObjHolder* user);
void setShowInformationPoleClimbTop(const al::IUseSceneObjHolder* user);
bool isNeedShowInformationPoleClimbTop(const al::IUseSceneObjHolder* user);
bool isNeedConfirmNetworkFirst(const al::IUseSceneObjHolder* user);
void saveConfirmNetworkFirst(const al::IUseSceneObjHolder* user);
} // namespace rs

View File

@ -0,0 +1,77 @@
#pragma once
#include <basis/seadTypes.h>
#include <math/seadVector.h>
#include <time/seadDateTime.h>
#include "System/GameDataHolderAccessor.h"
namespace al {
class IUseMessageSystem;
class LayoutActor;
class LiveActor;
} // namespace al
class AchievementHolder;
class AchievementNpc;
namespace rs {
const char16* getAchievementName(const al::IUseMessageSystem* user, const char* label);
const char16* getAchievementName(const al::LayoutActor* layout, s32 achievementIdx);
const char16* getAchievementHint(const al::IUseMessageSystem* user, const char* label);
const char16* getAchievementHint(const al::LayoutActor* layout, s32 achievementIdx);
AchievementHolder* getAchievementHolder(const al::LayoutActor* layout);
void unlockAchievementShineName(GameDataHolderAccessor accessor);
bool isUnlockAchievementShineName(GameDataHolderAccessor accessor);
bool checkGetAchievement(GameDataHolderAccessor accessor, const char* label);
bool checkGetAchievement(const al::LayoutActor* layout, s32 achievementIdx);
sead::DateTime findAchievementGetTime(const al::LayoutActor* layout, s32 achievementIdx);
sead::DateTime findAchievementGetTime(const al::LayoutActor* layout, const char* label);
sead::Vector3f* findAchievementTrans(const al::LayoutActor* layout, s32 achievementIdx);
s32 getAchievementNum(const al::LayoutActor* layout);
s32 calcReceivedAchievementNum(const GameDataHolder* holder);
s32 getTotalCoinNum(const GameDataHolder* holder);
s32 calcWorldWarpHoleThroughNum(const GameDataHolder* holder);
s32 getWorldWarpHoleThroughNumMax(const GameDataHolder* holder);
s32 calcGetCheckpointNum(const GameDataHolder* holder);
s32 calcBuyItemNumForCoinCollectByWorld(const GameDataHolder* holder);
s32 calcClearWorldNum(const GameDataHolder* holder);
void addPlayerJumpCount(const al::LiveActor* actor);
s32 getPlayerJumpCount(const GameDataHolder* holder);
void addPlayerThrowCapCount(const al::LiveActor* actor);
s32 getPlayerThrowCapCount(const GameDataHolder* holder);
bool checkGetCoinCollectAllInWorld(const al::LiveActor* actor, s32 worldId);
bool checkGetCoinCollectHalfInWorld(const AchievementNpc* achievementNpc, s32 worldId);
bool checkGetShineAllInWorld(const AchievementNpc* achievementNpc, s32 worldId);
bool checkGetClothAndCapNum(const AchievementNpc* achievementNpc, s32 num);
bool checkUnlockMoonRockAllWorld(GameDataHolderAccessor accessor);
s32 calcUnlockMoonRockNum(GameDataHolderAccessor accessor);
s32 calcHackObjNum(GameDataHolderAccessor accessor);
s32 calcSphinxQuizCompleteNum(GameDataHolderAccessor accessor);
s32 calcGetShineNumDot(const GameDataHolder* holder);
s32 calcGetShineNumTreasureBox(const GameDataHolder* holder);
s32 calcGetShineNumNoteObj(const GameDataHolder* holder);
s32 calcGetShineNumTimerAthletic(const GameDataHolder* holder);
s32 calcGetShineNumKinopioBrigade(const GameDataHolder* holder);
s32 calcGetShineNumWorldTravelingPeach(const GameDataHolder* holder);
s32 calcGetShineNumCollectAnimal(const GameDataHolder* holder);
s32 calcAllShineNumCollectAnimal(const GameDataHolder* holder);
s32 calcGetShineNumKuriboGirl(const GameDataHolder* holder);
s32 calcGetShineNumJugemFish(const GameDataHolder* holder);
s32 calcGetShineNumGrowPlant(const GameDataHolder* holder);
s32 calcGetShineNumRabbit(const GameDataHolder* holder);
s32 calcGetShineNumDigPoint(const GameDataHolder* holder);
s32 calcGetShineNumCapHanger(const GameDataHolder* holder);
s32 calcGetShineNumBird(const GameDataHolder* holder);
s32 calcGetShineNumCostumeRoom(const GameDataHolder* holder);
s32 calcGetShineNumSlot(const GameDataHolder* holder);
s32 calcGetShineNumRace(const GameDataHolder* holder);
s32 calcGetShineNumFigureWalking(const GameDataHolder* holder);
s32 calcGetShineNumHideAndSeekCapMan(const GameDataHolder* holder);
s32 calcAllShineNumHideAndSeekCapMan(const GameDataHolder* holder);
s32 calcGetShineNumCollectBgmNpc(const GameDataHolder* holder);
s32 calcAllShineNumCollectBgmNpc(const GameDataHolder* holder);
s32 calcGetShineNumHintPhoto(const GameDataHolder* holder);
} // namespace rs

34
src/Util/AmiiboUtil.h Normal file
View File

@ -0,0 +1,34 @@
#pragma once
#include <basis/seadTypes.h>
#include "Library/Base/StringUtil.h"
namespace al {
struct NfpCharacterId;
class NfpInfo;
class IUseMessageSystem;
class IUseSceneObjHolder;
} // namespace al
namespace ShopItem {
class ItemInfo;
}
class SearchAmiiboDataTable;
namespace rs {
void calcSearchAmiiboBit(s32*, s32*, s32*, s32);
s32 createCharacterIdS32(const al::NfpCharacterId& characterId);
bool isEnableUseStageSceneAmiibo(const al::NfpInfo& nfpInfo);
bool isExistAmiiboMstxtData(const al::IUseMessageSystem* user, const al::NfpInfo& nfpInfo);
al::StringTmp<64> getAmiiboMstxtLabel(bool*, const al::IUseMessageSystem* user, s32, s32, s32);
void tryFindAmiiboCostumeItemInfo(ShopItem::ItemInfo**, ShopItem::ItemInfo**,
const al::NfpCharacterId& characterId, s32,
al::IUseSceneObjHolder* user);
void resetHelpAmiibo(const al::IUseSceneObjHolder* user);
SearchAmiiboDataTable* getSearchAmiiboData(const al::IUseSceneObjHolder* user);
void appearCoinCollectHintEffect(const al::IUseSceneObjHolder* user);
void killCoinCollectHintEffect(const al::IUseSceneObjHolder* user);
} // namespace rs

View File

@ -1,16 +0,0 @@
#pragma once
#include <math/seadVector.h>
namespace al {
class LiveActor;
class AreaObj;
class IUseAreaObj;
} // namespace al
namespace rs {
bool isInChangeStageArea(const al::LiveActor* actor, const sead::Vector3f* pos);
bool tryFindForceRecoveryArea(sead::Vector3f* targetPos, sead::Vector3f* targetUp,
const al::AreaObj** area, const al::IUseAreaObj* obj,
const sead::Vector3f& pos);
} // namespace rs

49
src/Util/AreaUtil.h Normal file
View File

@ -0,0 +1,49 @@
#pragma once
#include <math/seadVector.h>
namespace al {
class LiveActor;
class AreaObj;
class IUseAreaObj;
} // namespace al
namespace rs {
al::AreaObj* tryFind2DAreaObj(const al::IUseAreaObj* user, const sead::Vector3f& trans);
al::AreaObj* tryFind2DAreaObj(const al::LiveActor* actor, sead::Vector3f*, sead::Vector3f*);
void calc2DAreaLockDir(sead::Vector3f* lockDir, const al::AreaObj* area,
const sead::Vector3f& trans);
void get2DAreaPos(sead::Vector3f* pos, const al::AreaObj* area);
bool isIn2DArea(const al::LiveActor* actor, sead::Vector3f*, sead::Vector3f*);
bool isInChangeStage(const al::LiveActor* actor, const sead::Vector3f* trans);
bool isInWarpArea(const al::LiveActor* actor);
bool isInLowGravityArea(const al::LiveActor* actor);
bool isInItemVanishArea(const al::LiveActor* actor);
bool tryFindStageMapAreaAndGetPlayerPoint(sead::Vector3f* playerPoint, const al::IUseAreaObj* user,
const sead::Vector3f& trans);
bool calcFindWaterAreaSurfaceNoWaveByArrow(const al::LiveActor* actor, sead::Vector3f*,
sead::Vector3f*, const sead::Vector3f&,
const sead::Vector3f&);
bool isPushOut2DAreaOpposite(const al::AreaObj* area);
bool isFaceTo2DAreaPushOutDir(const al::AreaObj* area);
void calc2DAreaFreeDir(sead::Vector3f* freeDir, const al::AreaObj* area,
const sead::Vector3f& trans);
bool calc2DAreaGravity(sead::Vector3f* gravity, const al::AreaObj* area,
const sead::Vector3f& trans);
bool calc2DAreaSnapPower(sead::Vector3f*, f32* snapPower, const al::AreaObj* area,
const sead::Vector3f& trans);
bool calc2DAreaDistanceGravity(sead::Vector3f*, const al::AreaObj* area,
const sead::Vector3f& trans);
f32 get2DAreaSurfaceDistance(const al::AreaObj* area);
bool calc2DAreaSnapPowerSurfaceDistance(sead::Vector3f*, f32* snapPower, const al::AreaObj* area,
const sead::Vector3f& trans, f32 surfaceDistance);
bool calcExtForceAreaVelocity(sead::Vector3f*, const al::IUseAreaObj* user,
const sead::Vector3f& trans, const sead::Vector3f&,
const sead::Vector3f& velocity);
bool tryFindRecoveryTargetPosArea(bool* isNoCollideGround, sead::Vector3f* targetPos,
sead::Vector3f* targetRotate, const al::AreaObj** area,
const al::IUseAreaObj* user, const sead::Vector3f& trans);
bool tryFindForceRecoveryArea(sead::Vector3f* targetPos, sead::Vector3f* targetRotate,
const al::AreaObj** area, const al::IUseAreaObj* user,
const sead::Vector3f& trans);
} // namespace rs

11
src/Util/BreakJudgeUtil.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
namespace al {
class SensorMsg;
}
namespace rs {
typedef bool (*break_judge_function_t)(const al::SensorMsg*);
break_judge_function_t getBreakJudgeFunction(const char* name);
} // namespace rs

54
src/Util/CameraUtil.h Normal file
View File

@ -0,0 +1,54 @@
#pragma once
#include <basis/seadTypes.h>
#include <gfx/seadCamera.h>
#include <math/seadVector.h>
namespace al {
class LiveActor;
class CameraTicket;
class IUseCamera;
struct ActorInitInfo;
struct CameraStartInfo;
class CameraDistanceCurve;
} // namespace al
namespace rs {
bool isEnableStartSubjectiveCamera(const al::LiveActor* actor);
al::CameraTicket* initFollowLimitCamera(const al::IUseCamera* user,
const al::ActorInitInfo& actorInitInfo, const char*);
al::CameraTicket* initParallel2DCamera(const al::IUseCamera* user,
const al::ActorInitInfo& actorInitInfo, const char*);
void invalidateFollowLimitCameraAutoResetLowAngleV(al::CameraTicket* ticket);
void updateCameraPosFromDistanceAndAngleHV(sead::Vector3f* newPos, const sead::Vector3f& cameraPos,
f32 distance, f32 angleY, f32 angleH);
bool isPreCameraFollowOrParallel(const al::CameraStartInfo& cameraStartInfo);
al::CameraTicket* initGetMoonCamera(const al::IUseCamera* user, const al::LiveActor* moon,
const al::ActorInitInfo& actorInitInfo, const char* name,
sead::Vector3f*, sead::Vector3f*, sead::Vector3f*,
sead::LookAtCamera* lookAtCamera);
al::CameraTicket* initWarpCheckpointCamera(const al::IUseCamera* user,
const al::LiveActor* checkpoint,
const al::ActorInitInfo& actorInitInfo, const char* name,
sead::Vector3f*, sead::Vector3f*, sead::Vector3f*);
bool requestSetCameraAngleV(const al::LiveActor* actor, f32 requestAngleV, s32 poseUpdaterIdx);
bool requestResetCameraPosition(const al::LiveActor* actor, s32 poseUpdaterIdx);
bool requestResetCameraAngleV(const al::LiveActor* actor, s32 poseUpdaterIdx);
bool requestDownToDefaultCameraAngleBySpeed(const al::LiveActor* actor, f32 requestAngleSpeed,
s32 poseUpdaterIdx);
bool requestUpToTargetCameraAngleBySpeed(const al::LiveActor* actor, f32 targetAngleV,
f32 requestAngleSpeed, s32 poseUpdaterIdx);
bool requestMoveDownCameraAngleV(const al::LiveActor* actor, s32 poseUpdaterIdx);
bool requestRiseCameraAngleByPlayerCollideJumpCode(const al::LiveActor* actor);
bool requestCameraTurnToFront(const al::LiveActor* actor, f32, f32, s32 poseUpdaterIdx);
bool requestCameraTurnToFront(const al::LiveActor* actor, const sead::Vector3f& trans, f32, f32,
s32 poseUpdaterIdx);
void setEquipmentCameraDistanceCurve(al::LiveActor* actor, const al::CameraDistanceCurve* curve);
void resetEquipmentCameraDistanceCurve(al::LiveActor* actor);
void setBossCameraDistanceCurve(al::LiveActor* actor, const al::CameraDistanceCurve* curve);
void resetBossCameraDistanceCurve(al::LiveActor* actor);
void setKoopaShellCameraDistanceCurve(al::LiveActor* actor);
void resetKoopaShellCameraDistanceCurve(al::LiveActor* actor);
void setTRexPatrolCameraDistanceCurve(al::LiveActor* actor);
void resetTRexPatrolCameraDistanceCurve(al::LiveActor* actor);
} // namespace rs

View File

@ -1,9 +0,0 @@
#pragma once
namespace al {
class IUseSceneObjHolder;
} // namespace al
namespace rs {
void buyCap(const al::IUseSceneObjHolder*, const char*);
} // namespace rs

19
src/Util/ClothUtil.cpp Normal file
View File

@ -0,0 +1,19 @@
#include "Util/ClothUtil.h"
#include "System/GameDataHolder.h"
const sead::PtrArray<ItemListInfo>& rs::getClothList(GameDataHolderAccessor accessor) {
return accessor.mData->getClothList();
}
const sead::PtrArray<ItemListInfo>& rs::getCapList(GameDataHolderAccessor accessor) {
return accessor.mData->getCapList();
}
const sead::PtrArray<ItemListInfo>& rs::getGiftList(GameDataHolderAccessor accessor) {
return accessor.mData->getGiftList();
}
const sead::PtrArray<ItemListInfo>& rs::getStickerList(GameDataHolderAccessor accessor) {
return accessor.mData->getStickerList();
}

67
src/Util/ClothUtil.h Normal file
View File

@ -0,0 +1,67 @@
#pragma once
#include <basis/seadTypes.h>
#include <container/seadPtrArray.h>
#include "System/GameDataHolderAccessor.h"
namespace al {
class IUseSceneObjHolder;
class IUseMessageSystem;
} // namespace al
namespace ShopItem {
class ItemInfo;
class ItemType;
class ShopItemInfo;
} // namespace ShopItem
struct ItemListInfo;
namespace rs {
void buyItemInShopItemList(const al::IUseSceneObjHolder* user, s32 itemIdx);
bool isBuyItemInShopItemList(const al::IUseSceneObjHolder* user, s32 itemIdx);
void buyItem(const al::IUseSceneObjHolder* user, const ShopItem::ItemInfo* itemInfo);
void buyItemAll(const al::IUseSceneObjHolder* user);
bool isBuyItem(GameDataHolderAccessor accessor, const ShopItem::ItemInfo* itemInfo);
bool isHaveCloth(GameDataHolderAccessor accessor, const char* name);
bool isHaveCap(GameDataHolderAccessor accessor, const char* name);
bool isHaveSticker(GameDataHolderAccessor accessor, const char* name);
bool isHaveGift(GameDataHolderAccessor accessor, const char* name);
const sead::PtrArray<ItemListInfo>& getClothList(GameDataHolderAccessor accessor);
s32 getClothListSize(GameDataHolderAccessor accessor);
bool isHaveCloth(GameDataHolderAccessor accessor, s32 clothIdx);
bool isHaveClothByFileId(GameDataHolderAccessor accessor, const char* clothName, s32 fileId);
s32 calcHaveClothNum(GameDataHolderAccessor accessor);
void buyCloth(const al::IUseSceneObjHolder* user, const char* clothName);
const sead::PtrArray<ItemListInfo>& getCapList(GameDataHolderAccessor accessor);
s32 getCapListSize(GameDataHolderAccessor accessor);
bool isHaveCap(GameDataHolderAccessor accessor, s32 capIdx);
bool isHaveCapByFileId(GameDataHolderAccessor accessor, const char* capName, s32 fileId);
bool isCompleteClothCap(const al::IUseSceneObjHolder* user);
bool isCompleteCloth(const al::IUseSceneObjHolder* user);
bool isCompleteCap(const al::IUseSceneObjHolder* user);
bool isCompleteCloth(const al::IUseSceneObjHolder* user, s32 fileId);
bool isCompleteCap(const al::IUseSceneObjHolder* user, s32 fileId);
s32 calcHaveCapNum(GameDataHolderAccessor accessor);
void buyCap(const al::IUseSceneObjHolder* user, const char* capName);
const sead::PtrArray<ItemListInfo>& getGiftList(GameDataHolderAccessor accessor);
s32 getGiftListSize(GameDataHolderAccessor accessor);
bool isHaveGift(GameDataHolderAccessor accessor, s32 giftIdx);
s32 calcHaveGiftNum(GameDataHolderAccessor accessor);
bool checkCompleteGift(GameDataHolderAccessor accessor, s32 fileId);
const sead::PtrArray<ItemListInfo>& getStickerList(GameDataHolderAccessor accessor);
s32 getStickerListSize(GameDataHolderAccessor accessor);
bool isHaveSticker(GameDataHolderAccessor accessor, s32 fileId);
s32 calcHaveStickerNum(GameDataHolderAccessor accessor);
bool checkCompleteSticker(GameDataHolderAccessor accessor, s32 fileId);
const char* getTestClothesName();
const char* getTestCapName();
const char* getTestGiftName();
const char* getTestStickerName();
const char* getTestItemName();
const char* getTestShineName();
const char* getMsTextName(const ShopItem::ItemType& itemType);
const char16* getDisplayName(const al::IUseMessageSystem* user, const ShopItem::ItemInfo& itemInfo);
bool isTypeWear(const ShopItem::ShopItemInfo* itemInfo);
} // namespace rs

View File

@ -1,4 +1,4 @@
#include "Util/StageSceneFunction.h"
#include "Util/JudgeUtil.h"
#include "Player/IJudge.h"

11
src/Util/JudgeUtil.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
class IJudge;
namespace rs {
void resetJudge(IJudge* judge);
void updateJudge(IJudge* judge);
bool isJudge(const IJudge* judge);
bool updateJudgeAndResult(IJudge* judge);
bool judgeAndResetReturnTrue(IJudge* judge);
} // namespace rs

13
src/Util/MoonRockUtil.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
namespace al {
class LiveActor;
}
namespace rs {
bool isEnableShowDemoAfterOpenMoonRockFirst(const al::LiveActor* actor);
bool isFirstDemoOpenMoonRock(const al::LiveActor* actor);
bool isEnableShowDemoMoonRockMapWorld(const al::LiveActor* actor);
void showDemoAfterOpenMoonRockFirst(const al::LiveActor* actor);
void showDemoMoonRockMapWorld(const al::LiveActor* actor);
} // namespace rs

12
src/Util/NetworkUtil.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#include <prim/seadSafeString.h>
namespace rs {
const char* getNetworkPrototypeDirectory();
void convertComputerNameToFullName(sead::BufferedSafeString* fullName, const char* computerName);
void convertComputerNameToSecondName(sead::BufferedSafeString* secondName,
const char* computerName);
void convertComputerNameToSecondKanaName(sead::BufferedSafeString* secondKanaName,
const char* computerName);
} // namespace rs

View File

@ -1,47 +0,0 @@
#pragma once
#include <basis/seadTypes.h>
#include "System/GameDataHolderAccessor.h"
namespace rs {
bool checkGetAchievement(GameDataHolderAccessor, const char*);
s32 calcClearWorldNum(GameDataHolderAccessor);
s32 calcBuyItemNumForCoinCollectByWorld(GameDataHolderAccessor);
s32 calcGetShineNumDot(GameDataHolderAccessor);
s32 calcGetShineNumTreasureBox(GameDataHolderAccessor);
s32 calcGetShineNumNoteObj(GameDataHolderAccessor);
s32 calcGetShineNumTimerAthletic(GameDataHolderAccessor);
s32 calcGetShineNumKinopioBrigade(GameDataHolderAccessor);
s32 calcGetShineNumWorldTravelingPeach(GameDataHolderAccessor);
s32 calcGetShineNumCollectAnimal(GameDataHolderAccessor);
s32 calcGetShineNumKuriboGirl(GameDataHolderAccessor);
s32 calcGetShineNumJugemFish(GameDataHolderAccessor);
s32 calcGetShineNumGrowPlant(GameDataHolderAccessor);
s32 calcGetShineNumRabbit(GameDataHolderAccessor);
s32 calcGetShineNumDigPoint(GameDataHolderAccessor);
s32 calcGetShineNumCapHanger(GameDataHolderAccessor);
s32 calcGetShineNumBird(GameDataHolderAccessor);
s32 calcGetShineNumCostumeRoom(GameDataHolderAccessor);
s32 calcGetShineNumSlot(GameDataHolderAccessor);
s32 calcGetShineNumHideAndSeekCapMan(GameDataHolderAccessor);
s32 calcGetShineNumCollectedBgm(GameDataHolderAccessor);
s32 calcGetShineNumHintPhoto(GameDataHolderAccessor);
s32 calcGetShineNumRace(GameDataHolderAccessor);
s32 calcGetShineNumFigureWalking(GameDataHolderAccessor);
s32 calcSphinxQuizCompleteNum(GameDataHolderAccessor);
s32 calcHaveStickerNum(GameDataHolderAccessor);
s32 calcHaveGiftNum(GameDataHolderAccessor);
s32 calcHackObjNum(GameDataHolderAccessor);
s32 calcHaveCapNum(GameDataHolderAccessor);
s32 calcHaveClothNum(GameDataHolderAccessor);
s32 calcUnlockMoonRockNum(GameDataHolderAccessor);
s32 calcWorldWarpHoleThroughNum(GameDataHolderAccessor);
s32 calcGetCheckpointNum(GameDataHolderAccessor);
s32 getTotalCoinNum(GameDataHolderAccessor);
s32 getPlayerJumpCount(GameDataHolderAccessor);
s32 getPlayerThrowCapCount(GameDataHolderAccessor);
} // namespace rs

View File

@ -0,0 +1,12 @@
#pragma once
#include <basis/seadTypes.h>
namespace al {
class LiveActor;
}
namespace Player2DDokanActionFunction {
bool isPlayer2DActionDokanInPlayingGreater(const al::LiveActor* actor, s32 frame);
bool isPlayer2DActionDokanOutPlayingLessEqual(const al::LiveActor* actor, s32 frame);
} // namespace Player2DDokanActionFunction

View File

@ -0,0 +1,36 @@
#pragma once
#include <math/seadVector.h>
namespace al {
class LiveActor;
class CameraTicket;
class AreaObj;
} // namespace al
class HackObjInfo;
namespace PlayerCameraFunction {
void calcCameraMoveInput(sead::Vector2f* input, const al::LiveActor* actor);
bool tryCalcCameraSubMoveInput(sead::Vector2f* input, const al::LiveActor* actor);
bool checkNoCollisionForPlayerSubjectiveCamera(const al::LiveActor* actor,
const al::CameraTicket* cameraTicket, bool);
bool isInvalidatePlayerInput(const al::LiveActor* actor);
bool isTriggerCameraReset(const al::LiveActor* actor);
bool isTriggerCameraSubjective(const al::LiveActor* actor);
bool isHoldCameraZoom(const al::LiveActor* actor);
bool isHoldCameraSnapShotZoomIn(const al::LiveActor* actor);
bool isHoldCameraSnapShotZoomOut(const al::LiveActor* actor);
bool isHoldCameraSnapShotRollLeft(const al::LiveActor* actor);
bool isHoldCameraSnapShotRollRight(const al::LiveActor* actor);
bool isCameraInWater(const al::LiveActor* actor);
bool isCameraClimbPole(const al::LiveActor* actor);
bool isCameraGrabCeil(const al::LiveActor* actor);
bool isCameraWallCatch(const al::LiveActor* actor);
bool isCameraMoonGravity(const al::LiveActor* actor);
bool isFailureCameraSubjective(const al::LiveActor* actor);
void setCameraHackName(al::LiveActor* hack, const HackObjInfo* hackObjInfo);
void resetCameraHackName(al::LiveActor* actor);
bool tryCalcPlayerRecoveryTarget(sead::Vector3f* targetPos, const al::AreaObj** safetyPointArea,
const al::LiveActor* actor);
} // namespace PlayerCameraFunction

View File

@ -0,0 +1,13 @@
#pragma once
namespace al {
class Scene;
}
namespace ScenePlayerFunction {
void forceShowPlayer(const al::Scene* scene);
void forceHidePlayer(const al::Scene* scene);
void startSnapShotMode(const al::Scene* scene);
void endSnapShotMode(const al::Scene* scene);
void updatePlayerDither(const al::Scene* scene);
} // namespace ScenePlayerFunction

View File

@ -0,0 +1,34 @@
#pragma once
#include <basis/seadTypes.h>
#include <math/seadVector.h>
class GameDataHolderAccessor;
class GameConfigData;
namespace rs {
bool trySavePrepoCompleteMainScenario(s32, s32, s64, s64, s64);
bool trySavePrepoStartStage(const char*, const sead::Vector3f&, s64, s64, s64);
bool trySavePrepoExitStage(const char*, const sead::Vector3f&, s64, s64, s64);
bool trySavePrepoMissEvent(const char*, const sead::Vector3f&, s64, s64, s64);
bool trySavePrepoShineGetEvent(const char*, s32, s32, s32, s64, s64, s64);
bool trySavePrepoReceiveAchievement(const char* s32, s64, s64, s64);
bool trySavePrepoAchievementProgress(GameDataHolderAccessor, s64, s64, s64);
bool trySavePrepoGetCapEvent(const char*, s32, s64, s64, s64);
bool trySavePrepoGetClothEvent(const char*, s32, s64, s64, s64);
bool trySavePrepoGetGiftEvent(const char*, s32, s64, s64, s64);
bool trySavePrepoGetStickerEvent(const char*, s32, s64, s64, s64);
bool trySavePrepoChangeCapEvent(const char*, s64, s64, s64);
bool trySavePrepoChangeClothEvent(const char*, s64, s64, s64);
bool trySavePrepoFirstHackEvent(const char*, s32, s64, s64, s64);
bool trySavePrepoGetCollectBgmEvent(const char*, const char*, bool, s32, s64, s64, s64);
bool trySavePrepoSettingsState(bool, const char*, const GameConfigData&, s64, s64);
bool trySavePrepoSeparatePlayMode(bool, s64, s64, s64);
namespace prepo {
void enableIsSavePrepo();
void disableIsSavePrepo();
s64 generateSaveDataId();
s32 calcPrepoHashCode(const char*);
} // namespace prepo
} // namespace rs

View File

@ -1,24 +0,0 @@
#pragma once
namespace al {
class LiveActor;
}
namespace StageSceneFunction {
void appearPlayerDeadCoin(al::LiveActor*);
}
class IJudge;
namespace rs {
void resetJudge(IJudge*);
void updateJudge(IJudge*);
bool isJudge(const IJudge*);
bool updateJudgeAndResult(IJudge*);
bool judgeAndResetReturnTrue(IJudge*);
void isEnableShowDemoAfterOpenMoonRockFirst(const al::LiveActor*);
void isFirstDemoOpenMoonRock(const al::LiveActor*);
void isEnableShowDemoMoonRockMapWorld(const al::LiveActor*);
void showDemoAfterOpenMoonRockFirst(const al::LiveActor*);
void showDemoMoonRockMapWorld(const al::LiveActor*);
} // namespace rs

11
src/Util/SwitchUtil.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
namespace al {
class LiveActor;
struct ActorInitInfo;
} // namespace al
namespace rs {
bool isOnSwitchLinkSave(const al::LiveActor* actor, const al::ActorInitInfo& actorInitInfo);
bool isSaveSwitch(const al::ActorInitInfo& actorInitInfo);
} // namespace rs

11
src/Util/TextureUtil.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
namespace al {
class IUseSceneObjHolder;
class LayoutTextureRenderObj;
} // namespace al
namespace rs {
void registerLayoutTextureRenderObj(al::IUseSceneObjHolder* user,
al::LayoutTextureRenderObj* renderObj);
}

7
src/Util/TimeUtil.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
#include <basis/seadTypes.h>
namespace rs {
bool checkTimeReverseAndRestore(u64*, u64);
}

24
src/Util/YoshiUtil.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#include <basis/seadTypes.h>
#include <math/seadQuat.h>
#include <math/seadVector.h>
namespace al {
class HitSensor;
class WaterSurfaceFinder;
class LiveActor;
} // namespace al
class PlayerConst;
class YoshiTongue;
namespace rs {
bool isSensorTypeYoshiEnableSendPush(const al::HitSensor* sensor);
bool isSensorTypeYoshiMsgReceivable(const al::HitSensor* sensor);
bool isInPuddleHeight(const al::WaterSurfaceFinder* surfaceFinder, const PlayerConst* playerConst);
bool tryCalcTonguePullPose(sead::Quatf* pose, const al::LiveActor* actor,
const YoshiTongue* yoshiTongue);
bool findClingGroundPos(sead::Vector3f* pos, const al::LiveActor* actor, const sead::Vector3f&,
f32);
} // namespace rs