-
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.
- Loading branch information
Showing
16 changed files
with
318 additions
and
197 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <SMS/MapObj/MapObjGeneral.hxx> | ||
#include <BetterSMS/module.hxx> | ||
|
||
class TJizoStone : public TMapObjGeneral { | ||
public: | ||
BETTER_SMS_FOR_CALLBACK static JDrama::TNameRef *instantiate() { | ||
return new TJizoStone("TJizoStone"); | ||
} | ||
|
||
TJizoStone(const char *name); | ||
~TJizoStone() override = default; | ||
|
||
void touchWater(THitActor *actor) override; | ||
void initMapCollisionData() override; | ||
void initMapObj() override; | ||
void setGroundCollision() override; | ||
|
||
protected: | ||
void playBoingAnim(); | ||
}; | ||
|
||
extern ObjData jizoStoneData; |
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,38 @@ | ||
#pragma once | ||
|
||
#include <BetterSMS/module.hxx> | ||
#include <SMS/MapObj/MapObjGeneral.hxx> | ||
|
||
class TPearlCracked : public TMapObjGeneral { | ||
protected: | ||
enum class State : u8 { | ||
STATE_NORMAL, | ||
STATE_BROKEN, | ||
STATE_RESTING, | ||
}; | ||
|
||
public: | ||
BETTER_SMS_FOR_CALLBACK static JDrama::TNameRef *instantiate() { | ||
return new TPearlCracked("TPearlCracked"); | ||
} | ||
|
||
TPearlCracked(const char *name); | ||
~TPearlCracked() override = default; | ||
|
||
void control() override; | ||
void initMapCollisionData() override; | ||
void initMapObj() override; | ||
void setGroundCollision() override; | ||
|
||
protected: | ||
bool checkMarioRiding(TMario *player); | ||
bool checkMarioPounding(TMario *player); | ||
void swapToCracked(); | ||
void playFractureAnim(); | ||
void spawnShine(); | ||
|
||
private: | ||
State mState; | ||
}; | ||
|
||
extern ObjData pearlData; |
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 was deleted.
Oops, something went wrong.
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,62 @@ | ||
#include "object/jizo_stone.hxx" | ||
|
||
#include <SMS/MSound/MSoundSESystem.hxx> | ||
|
||
TJizoStone::TJizoStone(const char *name) : TMapObjGeneral(name) {} | ||
|
||
void TJizoStone::touchWater(THitActor *actor) { playBoingAnim(); } | ||
|
||
void TJizoStone::initMapCollisionData() { | ||
mCollisionManager = new TMapCollisionManager(1, "mapObj", this); | ||
mCollisionManager->init("jizo_stone", 1, nullptr); | ||
} | ||
|
||
void TJizoStone::initMapObj() { | ||
TMapObjGeneral::initMapObj(); | ||
|
||
if (mCollisionManager) { | ||
mCollisionManager->changeCollision(0); | ||
mCollisionManager->mCurrentMapCollision->setAllActor(this); | ||
} | ||
} | ||
|
||
void TJizoStone::setGroundCollision() { | ||
auto *model = getModel(); | ||
if (mCollisionManager) { | ||
mCollisionManager->mCurrentMapCollision->_5C &= 0xFFFFFFFE; // Enable | ||
mCollisionManager->mCurrentMapCollision->moveMtx(*model->mJointArray); | ||
} | ||
} | ||
|
||
void TJizoStone::playBoingAnim() { | ||
if (!mActorData->isCurAnmAlreadyEnd(MActor::BCK)) { | ||
return; | ||
} | ||
|
||
if (gpMSound->gateCheck(MSD_SE_EN_SAMBOHEAD_W_HIT)) { | ||
MSoundSE::startSoundActor(MSD_SE_EN_SAMBOHEAD_W_HIT, reinterpret_cast<Vec *>(&mTranslation), | ||
0, nullptr, 0, 4); | ||
} | ||
|
||
mActorData->setBck("jizo_stone_boing"); | ||
auto *ctrl = mActorData->getFrameCtrl(MActor::BCK); | ||
ctrl->mAnimState = J3DFrameCtrl::ONCE; | ||
ctrl->mFrameRate = 1.5f; | ||
mModelLoadFlags &= ~0x100; | ||
} | ||
|
||
ObjData jizoStoneData{.mMdlName = "jizo_stone", | ||
.mObjectID = 0x40000F80 /*0x80000FFF*/, | ||
.mLiveManagerName = gLiveManagerName, // const_cast<char *>("木マネージャー") | ||
.mObjKey = gUnkManagerName, // const_cast<char *>("waterballoon"), | ||
.mAnimInfo = nullptr, | ||
.mObjCollisionData = nullptr, | ||
.mMapCollisionInfo = nullptr, | ||
.mSoundInfo = nullptr, | ||
.mPhysicalInfo = nullptr, | ||
.mSinkData = nullptr, | ||
._28 = nullptr, | ||
.mBckMoveData = nullptr, | ||
._30 = 50.0f, | ||
.mUnkFlags = 0x4 /*0x02130100*/, | ||
.mKeyCode = cexp_calcKeyCode("JizoStone")}; |
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.