-
Notifications
You must be signed in to change notification settings - Fork 70
Some Koopa functions #1865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
SushiInYourFace
wants to merge
7
commits into
SMGCommunity:master
Choose a base branch
from
SushiInYourFace:koopa
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Some Koopa functions #1865
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a5a2d07
begin work on KoopaDemoPowerUp
SushiInYourFace 6be3db4
KoopaDemoPowerUp to 99%
SushiInYourFace 946499b
get as far into KoopaSequencer as I can before adding KoopaDemoJumpTo…
SushiInYourFace 889751b
Merge branch 'SMGCommunity:master' into koopa
SushiInYourFace f9d33d2
as much progress on jumpToPlanet before needing PlanetShadow
SushiInYourFace c572824
match KoopaPlanetShadow 97%
SushiInYourFace 33f66cb
Merge branch 'SMGCommunity:master' into koopa
SushiInYourFace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,18 @@ | ||
| #pragma once | ||
|
|
||
| #include "Game/Boss/Koopa.hpp" | ||
|
|
||
| class KoopaDemoJumpToPlanet : public NerveExecutor { | ||
| public: | ||
| KoopaDemoJumpToPlanet(Koopa*); | ||
|
|
||
| virtual void init(); | ||
| virtual void kill(); | ||
|
|
||
| void startReady(); | ||
| void exeStart(); | ||
| void exeFall(); | ||
|
|
||
| /* 0x8 */ bool _8; | ||
| /* 0C */ Koopa* mParent; | ||
| }; |
This file contains hidden or 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,18 @@ | ||
| #pragma once | ||
|
|
||
| #include "Game/Boss/Koopa.hpp" | ||
|
|
||
| class KoopaDemoPowerUp : public NerveExecutor { | ||
| public: | ||
| KoopaDemoPowerUp(Koopa*); | ||
|
|
||
| virtual void init(); | ||
| virtual void appear(); | ||
| virtual void kill(); | ||
|
|
||
| void exeWaitDemo(); | ||
| void exeDemo(); | ||
|
|
||
| /* 0x8 */ bool _8; | ||
| /* 0C */ Koopa* mParent; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing the |
||
| }; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,25 @@ | ||
| #pragma once | ||
|
|
||
| #include "Game/Boss/Koopa.hpp" | ||
| #include "Game/Map/KoopaBattleMapStair.hpp" | ||
| #include "JSystem/JGeometry/TVec.hpp" | ||
|
|
||
| namespace KoopaFunction { | ||
| s32 registerBattleMapStair(KoopaBattleMapStair*); | ||
| }; | ||
| void startRecoverKoopaArmor(Koopa*); | ||
| void startRecoverKoopaTailThorn(Koopa*); | ||
| void endFaceCtrl(Koopa*, s32); | ||
| void initKoopaCamera(Koopa*, const char*); | ||
| void endKoopaCamera(Koopa*, const char*, bool, s32); | ||
| void setKoopaPos(Koopa*, const char*); | ||
| void startKoopaCamera(Koopa*, const char*); | ||
| void startKoopaTargetCamera(Koopa*, const char*); | ||
| void startFaceCtrl(Koopa*); | ||
| bool isKoopaVs1(const Koopa*); | ||
| bool isKoopaVs2(const Koopa*); | ||
| bool isKoopaLv3(const Koopa*); | ||
| bool isKoopaVs3(const Koopa*); | ||
| void* getKoopaPlanetShadow(Koopa*); | ||
| LiveActor* getKoopaPowerUpSwitch(Koopa*); | ||
| TVec3f* getPlanetCenterPos(const Koopa*); | ||
| }; // namespace KoopaFunction |
This file contains hidden or 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,17 @@ | ||
| #pragma once | ||
|
|
||
| #include "Game/Boss/Koopa.hpp" | ||
| #include "Game/LiveActor/LiveActor.hpp" | ||
| #include "Game/Util/JMapInfo.hpp" | ||
| #include "revolution/mtx.h" | ||
| class KoopaPlanetShadow : public LiveActor { | ||
| public: | ||
| KoopaPlanetShadow(const Koopa*); | ||
|
|
||
| virtual void init(const JMapInfoIter&); | ||
| virtual void calcAndSetBaseMtx(); | ||
|
|
||
|
|
||
| /* 0x8c */ const Koopa* mParent; | ||
| /* 0x90 */ MtxPtr mParentJointMtx; | ||
| }; |
This file contains hidden or 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,21 @@ | ||
| #pragma once | ||
|
|
||
| #include "Game/Boss/Koopa.hpp" | ||
| #include "Game/Boss/KoopaDemoPowerUp.hpp" | ||
| #include "Game/System/NerveExecutor.hpp" | ||
| #include "Game/Util/JMapInfo.hpp" | ||
|
|
||
| class KoopaSequencer : public NerveExecutor { | ||
| public: | ||
| KoopaSequencer(const char*, s32); | ||
|
|
||
| virtual void init(Koopa*, const JMapInfoIter&); | ||
|
|
||
| Koopa* mParent; | ||
| KoopaDemoPowerUp* mDemoPowerUp; | ||
| s32 _10; | ||
| s32 _14; | ||
| s32 _18; | ||
| s32 _1C; | ||
| bool _20; | ||
| }; |
This file contains hidden or 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,49 @@ | ||
| #include "Game/Boss/KoopaDemoJumpToPlanet.hpp" | ||
| #include "Game/Boss/Koopa.hpp" | ||
| #include "Game/Boss/KoopaFunction.hpp" | ||
| #include "Game/LiveActor/Nerve.hpp" | ||
| #include "Game/Util/ActorSwitchUtil.hpp" | ||
| #include "Game/Util/LiveActorUtil.hpp" | ||
| #include "Game/Util/NerveUtil.hpp" | ||
| #include "Game/Util/PlayerUtil.hpp" | ||
|
|
||
| namespace NrvKoopaDemoJumpToPlanet { | ||
| NEW_NERVE(KoopaDemoJumpToPlanetNrvStart, KoopaDemoJumpToPlanet, Start); | ||
| NEW_NERVE(KoopaDemoJumpToPlanetNrvFall, KoopaDemoJumpToPlanet, Fall); | ||
| } | ||
|
|
||
| KoopaDemoJumpToPlanet::KoopaDemoJumpToPlanet(Koopa* pKoopa) : NerveExecutor("Demo[惑星までジャンプ]"), mParent(pKoopa) {} | ||
|
|
||
| void KoopaDemoJumpToPlanet::init() { | ||
| KoopaFunction::initKoopaCamera(mParent, "ウェイト(惑星までジャンプ)"); | ||
| KoopaFunction::initKoopaCamera(mParent, "落下(惑星までジャンプ)"); | ||
| KoopaFunction::initKoopaCamera(mParent, "ワープ後(惑星までジャンプ)"); | ||
| initNerve(&NrvKoopaDemoJumpToPlanet::KoopaDemoJumpToPlanetNrvStart::sInstance); | ||
| } | ||
|
|
||
| void KoopaDemoJumpToPlanet::kill() { | ||
| _8 = true; | ||
| KoopaFunction::endKoopaCamera(mParent, "ウェイト(惑星までジャンプ)", false, -1); | ||
| KoopaFunction::endKoopaCamera(mParent, "落下(惑星までジャンプ)", false, -1); | ||
| KoopaFunction::endKoopaCamera(mParent, "ワープ後(惑星までジャンプ)", false, -1); | ||
| } | ||
|
|
||
| void KoopaDemoJumpToPlanet::startReady() { | ||
| MR::onSwitchB(mParent); | ||
| } | ||
|
|
||
| void KoopaDemoJumpToPlanet::exeStart() { | ||
| if(MR::isFirstStep(this)) { | ||
| return; | ||
| } | ||
| KoopaFunction::setKoopaPos(mParent, "戦闘開始(クッパ)"); | ||
| MR::setPlayerPosAndWait("戦闘開始(マリオ)"); | ||
| KoopaFunction::startKoopaCamera(mParent, "落下(惑星までジャンプ)"); | ||
| MR::startAction(mParent, "JumpSoon"); | ||
| KoopaFunction::startFaceCtrl(mParent); | ||
| setNerve(&NrvKoopaDemoJumpToPlanet::KoopaDemoJumpToPlanetNrvFall::sInstance); | ||
| } | ||
|
|
||
| void KoopaDemoJumpToPlanet::exeFall() { | ||
|
|
||
| } |
This file contains hidden or 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,81 @@ | ||
| #include "Game/Boss/KoopaDemoPowerUp.hpp" | ||
| #include "Game/Boss/KoopaFunction.hpp" | ||
| namespace NrvKoopaDemoPowerUp { | ||
| NEW_NERVE(KoopaDemoPowerUpNrvWaitDemo, KoopaDemoPowerUp, WaitDemo); | ||
| NEW_NERVE(KoopaDemoPowerUpNrvDemo, KoopaDemoPowerUp, Demo); | ||
| } // namespace NrvKoopaDemoPowerUp | ||
|
|
||
| KoopaDemoPowerUp::KoopaDemoPowerUp(Koopa* pKoopa) : NerveExecutor("Demo[パワーアップ]"), mParent(pKoopa) {} | ||
|
|
||
| void KoopaDemoPowerUp::init() { | ||
| KoopaFunction::initKoopaCamera(mParent, "パワーアップデモ"); | ||
| KoopaFunction::initKoopaCamera(mParent, "最終パワーアップデモ"); | ||
| MR::createCenterScreenBlur(); | ||
| initNerve(&NrvKoopaDemoPowerUp::KoopaDemoPowerUpNrvWaitDemo::sInstance); | ||
| } | ||
|
|
||
| void KoopaDemoPowerUp::appear() { | ||
| _8 = false; | ||
| setNerve(&NrvKoopaDemoPowerUp::KoopaDemoPowerUpNrvWaitDemo::sInstance); | ||
| } | ||
|
|
||
| void KoopaDemoPowerUp::kill() { | ||
| _8 = true; | ||
| KoopaFunction::endKoopaCamera(mParent, "パワーアップデモ", false, -1); | ||
| KoopaFunction::endKoopaCamera(mParent, "最終パワーアップデモ", false, -1); | ||
| } | ||
|
|
||
| void KoopaDemoPowerUp::exeWaitDemo() { | ||
| bool v1 = MR::tryStartDemoMarioPuppetable(mParent, "パワーアップデモ"); | ||
| if (!v1) { | ||
| return; | ||
| } | ||
| if (KoopaFunction::isKoopaVs1(mParent) || KoopaFunction::isKoopaVs2(mParent)) { | ||
| KoopaFunction::setKoopaPos(mParent, "パワーアップデモ(クッパ)"); | ||
| MR::setPlayerPosAndWait("パワーアップデモ(マリオ)"); | ||
| if (KoopaFunction::isKoopaLv3(mParent)) { | ||
| MR::startAction(mParent, "DemoKoopaPowerUpFinal"); | ||
| KoopaFunction::startKoopaTargetCamera(mParent, "最終パワーアップデモ"); | ||
| MR::onSwitchB(KoopaFunction::getKoopaPowerUpSwitch(mParent)); | ||
| } else { | ||
| MR::startAction(mParent, "DemoKoopaPowerUp"); | ||
| KoopaFunction::startKoopaTargetCamera(mParent, "パワーアップデモ"); | ||
| MR::onSwitchA(KoopaFunction::getKoopaPowerUpSwitch(mParent)); | ||
| } | ||
| } else { | ||
| KoopaFunction::setKoopaPos(mParent, "パワーアップデモLv3(クッパ)"); | ||
| MR::setPlayerPosAndWait("パワーアップデモLv3(マリオ)"); | ||
| MR::startAction(mParent, "DemoKoopaPowerUpFinal"); | ||
| KoopaFunction::startKoopaTargetCamera(mParent, "最終パワーアップデモ"); | ||
| MR::onSwitchA(KoopaFunction::getKoopaPowerUpSwitch(mParent)); | ||
| } | ||
| MR::startBckPlayer("BattleWait", static_cast< const char* >(nullptr)); | ||
| KoopaFunction::startRecoverKoopaArmor(mParent); | ||
| KoopaFunction::startRecoverKoopaTailThorn(mParent); | ||
| KoopaFunction::endFaceCtrl(mParent, -1); | ||
| setNerve(&NrvKoopaDemoPowerUp::KoopaDemoPowerUpNrvDemo::sInstance); | ||
| } | ||
|
|
||
| void KoopaDemoPowerUp::exeDemo() { | ||
| if (KoopaFunction::isKoopaLv3(mParent)) { | ||
| if (MR::isStep(this, 2)) { | ||
| MR::startCenterScreenBlur(140, 15.0f, 80, 5, 30); | ||
| } | ||
| } else { | ||
| if (MR::isStep(this, 65)) { | ||
| MR::startCenterScreenBlur(135, 15.0f, 80, 5, 30); | ||
| } | ||
| } | ||
| if (MR::isActionEnd(mParent)) { | ||
| if (KoopaFunction::isKoopaVs3(mParent) || KoopaFunction::isKoopaLv3(mParent)) { | ||
| KoopaFunction::endKoopaCamera(mParent, "最終パワーアップデモ", false, -1); | ||
| } else { | ||
| KoopaFunction::endKoopaCamera(mParent, "パワーアップデモ", false, -1); | ||
| } | ||
| MR::endDemo(mParent, "パワーアップデモ"); | ||
| } | ||
| TVec3f v1 = mParent->mGravity.negateInline(); | ||
| MR::appearStarPieceToDirection(mParent, mParent->mPosition, v1, 10, 50.0f, 60.0f, false); | ||
| MR::startSound(mParent, "SE_OJ_STAR_PIECE_BURST", -1, -1); | ||
| kill(); | ||
| } |
This file contains hidden or 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,39 @@ | ||
| #include "Game/Boss/KoopaPlanetShadow.hpp" | ||
| #include "Game/Boss/KoopaFunction.hpp" | ||
| #include "Game/LiveActor/LiveActor.hpp" | ||
| #include "Game/Util/JMapInfo.hpp" | ||
| #include "Game/Util/JointUtil.hpp" | ||
| #include "Game/Util/LiveActorUtil.hpp" | ||
| #include "Game/Util/MathUtil.hpp" | ||
| #include "Game/Util/MtxUtil.hpp" | ||
| #include "Game/Util/ObjUtil.hpp" | ||
| #include "JSystem/JGeometry/TMatrix.hpp" | ||
| #include "JSystem/JGeometry/TVec.hpp" | ||
|
|
||
| #include <cstddef> | ||
|
|
||
| KoopaPlanetShadow::KoopaPlanetShadow(const Koopa* pKoopa) : LiveActor("惑星用の影"), mParent(pKoopa), mParentJointMtx(nullptr){}; | ||
|
|
||
| void KoopaPlanetShadow::init(const JMapInfoIter& pIter) { | ||
| initModelManagerWithAnm("KoopaPlanetShadow", nullptr, false); | ||
| MR::connectToSceneEnemyDecoration(this); | ||
| MR::invalidateClipping(this); | ||
| mParentJointMtx = MR::getJointMtx(mParent, "Hip1"); | ||
| makeActorDead(); | ||
| } | ||
|
|
||
| void KoopaPlanetShadow::calcAndSetBaseMtx() { | ||
| TVec3f v1(mParentJointMtx[0][3], mParentJointMtx[1][3], mParentJointMtx[2][3]); | ||
| TVec3f* centerPos = KoopaFunction::getPlanetCenterPos(mParent); | ||
| TVec3f v2(v1 - *centerPos); | ||
|
|
||
| if (MR::isNearZero(v2, 0.001f)) { | ||
| return; | ||
| } | ||
|
|
||
| MR::normalize(&v2); | ||
| TPos3f v3; | ||
| v3.identity(); | ||
| MR::makeMtxUpFrontPos(&v3, v2, mParent->_8C, *centerPos); | ||
| MR::setBaseTRMtx(this, v3); | ||
| } |
This file contains hidden or 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,15 @@ | ||
| #include "Game/Boss/KoopaSequencer.hpp" | ||
| #include "Game/Boss/Koopa.hpp" | ||
| #include "Game/Boss/KoopaDemoPowerUp.hpp" | ||
| #include "Game/System/NerveExecutor.hpp" | ||
| #include "Game/Util/JMapInfo.hpp" | ||
| #include "revolution/types.h" | ||
|
|
||
| KoopaSequencer::KoopaSequencer(const char* pName, s32 pNum) | ||
| : NerveExecutor(pName), mParent(nullptr), mDemoPowerUp(nullptr), _10(0), _14(0), _18(1), _1C(pNum), _20(false) {} | ||
|
|
||
| void KoopaSequencer::init(Koopa* pParent, const JMapInfoIter& pIter) { | ||
| mParent = pParent; | ||
| mDemoPowerUp = new KoopaDemoPowerUp(mParent); | ||
| mParent->init(pIter); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer forward declaration for types referred to by pointer or reference in header files.