forked from CraftyBoss/SuperMarioOdysseyOnline
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional sardine mode + new menu option
- Loading branch information
1 parent
f2f3282
commit a9b2c87
Showing
18 changed files
with
659 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
#include "al/layout/LayoutActor.h" | ||
#include "al/layout/LayoutInitInfo.h" | ||
#include "al/util/NerveUtil.h" | ||
|
||
#include "logger.hpp" | ||
#include "server/gamemode/GameModeTimer.hpp" | ||
|
||
// TODO: kill layout if going through loading zone or paused | ||
|
||
class SardineIcon : public al::LayoutActor { | ||
public: | ||
SardineIcon(const char* name, const al::LayoutInitInfo& initInfo); | ||
|
||
void appear() override; | ||
|
||
bool tryStart(); | ||
bool tryEnd(); | ||
|
||
void showSolo(); | ||
void showPack(); | ||
|
||
void exeAppear(); | ||
void exeWait(); | ||
void exeEnd(); | ||
|
||
private: | ||
struct SardineInfo* mInfo; | ||
}; | ||
|
||
namespace { | ||
NERVE_HEADER(SardineIcon, Appear) | ||
NERVE_HEADER(SardineIcon, Wait) | ||
NERVE_HEADER(SardineIcon, End) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "server/gamemode/GameModeConfigMenu.hpp" | ||
#include "game/Layouts/CommonVerticalList.h" | ||
#include "server/gamemode/GameModeBase.hpp" | ||
|
||
class SardineConfigMenu : public GameModeConfigMenu { | ||
public: | ||
SardineConfigMenu(); | ||
|
||
void initMenu(const al::LayoutInitInfo &initInfo) override; | ||
const sead::WFixedSafeString<0x200> *getStringData() override; | ||
bool updateMenu(int selectIndex) override; | ||
|
||
const int getMenuSize() override { return mItemCount; } | ||
|
||
private: | ||
static constexpr int mItemCount = 4; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include "al/camera/CameraTicket.h" | ||
#include "server/gamemode/GameModeBase.hpp" | ||
#include "server/gamemode/GameModeConfigMenu.hpp" | ||
#include "server/gamemode/GameModeInfoBase.hpp" | ||
#include "server/gamemode/GameModeTimer.hpp" | ||
#include "server/snh/SardineConfigMenu.hpp" | ||
#include "layouts/SardineIcon.h" | ||
#include <math.h> | ||
|
||
struct SardineInfo : GameModeInfoBase { | ||
SardineInfo() { mMode = GameMode::SARDINE; } | ||
bool mIsIt = false; | ||
bool mIsUseGravity = false; | ||
bool mIsUseGravityCam = false; | ||
bool mIsTether = true; | ||
|
||
GameTime mHidingTime; | ||
}; | ||
|
||
class SardineMode : public GameModeBase { | ||
public: | ||
SardineMode(const char* name); | ||
|
||
void init(GameModeInitInfo const& info) override; | ||
|
||
virtual void begin() override; | ||
virtual void update() override; | ||
virtual void end() override; | ||
|
||
bool isPlayerIt() const { return mInfo->mIsIt; }; | ||
|
||
void setPlayerTagState(bool state) { mInfo->mIsIt = state; } | ||
|
||
void enableGravityMode() { mInfo->mIsUseGravity = true; } | ||
void disableGravityMode() { mInfo->mIsUseGravity = false; } | ||
bool isUseGravity() const { return mInfo->mIsUseGravity; } | ||
|
||
void setCameraTicket(al::CameraTicket* ticket) { mTicket = ticket; } | ||
|
||
private: | ||
GameModeTimer* mModeTimer = nullptr; | ||
SardineIcon* mModeLayout = nullptr; | ||
SardineInfo* mInfo = nullptr; | ||
al::CameraTicket* mTicket = nullptr; | ||
|
||
float pullDistanceMax = 2250.f; | ||
float pullDistanceMin = 1000.f; | ||
float pullPowerRate = 75.f; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.