-
Notifications
You must be signed in to change notification settings - Fork 27
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
5 changed files
with
153 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "Item/CoinCollectDummy.h" | ||
|
||
#include "Library/LiveActor/ActorActionFunction.h" | ||
#include "Library/LiveActor/ActorClippingFunction.h" | ||
#include "Library/LiveActor/ActorInitFunction.h" | ||
#include "Library/LiveActor/ActorMovementFunction.h" | ||
#include "Library/LiveActor/LiveActorUtil.h" | ||
#include "Library/Nerve/NerveSetupUtil.h" | ||
#include "Library/Nerve/NerveUtil.h" | ||
|
||
#include "Item/CoinCollectHintState.h" | ||
#include "Util/ItemUtil.h" | ||
|
||
namespace { | ||
NERVE_IMPL(CoinCollectDummy, Hint); | ||
|
||
struct { | ||
NERVE_MAKE(CoinCollectDummy, Hint); | ||
} NrvCoinCollectDummy; | ||
|
||
} // namespace | ||
|
||
CoinCollectDummy::CoinCollectDummy(const char* name) : al::LiveActor(name) {} | ||
|
||
void CoinCollectDummy::init(const al::ActorInitInfo& initInfo) { | ||
al::initActorSceneInfo(this, initInfo); | ||
al::initActorWithArchiveName(this, initInfo, rs::getStageCoinCollectArchiveName(this), nullptr); | ||
al::initNerve(this, &NrvCoinCollectDummy.Hint, 1); | ||
mHintState = new CoinCollectHintState(this); | ||
al::initNerveState(this, mHintState, &NrvCoinCollectDummy.Hint, "ヒント"); | ||
makeActorDead(); | ||
} | ||
|
||
void CoinCollectDummy::appear() { | ||
al::LiveActor::appear(); | ||
al::setNerve(this, &NrvCoinCollectDummy.Hint); | ||
} | ||
|
||
void CoinCollectDummy::appearHint(const sead::Vector3f& position) { | ||
appear(); | ||
al::resetPosition(this, position); | ||
al::hideModelIfShow(this); | ||
al::invalidateClipping(this); | ||
al::startHitReaction(this, "発光"); | ||
} | ||
|
||
void CoinCollectDummy::reappearHint() { | ||
mHintState->appearHintEffect(); | ||
} | ||
|
||
void CoinCollectDummy::deleteHint() { | ||
mHintState->deleteHintEffect(); | ||
} | ||
|
||
void CoinCollectDummy::exeHint() { | ||
if (al::updateNerveState(this)) | ||
makeActorDead(); | ||
} |
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,23 @@ | ||
#pragma once | ||
|
||
#include <math/seadVector.h> | ||
|
||
#include "Library/LiveActor/LiveActor.h" | ||
|
||
class CoinCollectHintState; | ||
|
||
class CoinCollectDummy : public al::LiveActor { | ||
public: | ||
CoinCollectDummy(const char*); | ||
|
||
void init(const al::ActorInitInfo&) override; | ||
void appear() override; | ||
|
||
void appearHint(const sead::Vector3f&); | ||
void reappearHint(); | ||
void deleteHint(); | ||
void exeHint(); | ||
|
||
private: | ||
CoinCollectHintState* mHintState = nullptr; | ||
}; |
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,41 @@ | ||
#include "Item/CoinCollectHintState.h" | ||
|
||
#include "Library/Nerve/NerveSetupUtil.h" | ||
#include "Library/Nerve/NerveUtil.h" | ||
|
||
namespace { | ||
NERVE_IMPL(CoinCollectHintState, Hint); | ||
|
||
struct { | ||
NERVE_MAKE(CoinCollectHintState, Hint); | ||
} NrvCoinCollectHintState; | ||
|
||
} // namespace | ||
|
||
CoinCollectHintState::CoinCollectHintState(al::LiveActor* actor) | ||
: al::ActorStateBase("ヒント状態", actor) {} | ||
|
||
CoinCollectHintState::~CoinCollectHintState() = default; | ||
|
||
void CoinCollectHintState::init() { | ||
initNerve(this, , 0); | ||
} | ||
|
||
void CoinCollectHintState::appear() { | ||
al::setNerve(this, &NrvCoinCollectHintState.Hint); | ||
al::emitEffect(this, "Emission", nullptr); | ||
} | ||
|
||
void CoinCollectHintState::kill() { | ||
al::deleteEffect(this, "Emission"); | ||
} | ||
|
||
void CoinCollectHintState::deleteHintEffect() { | ||
al::tryKillEmitterAndParticleAll(this); | ||
} | ||
|
||
void CoinCollectHintState::appearHintEffect() { | ||
al::emitEffect(this, "Emission", nullptr); | ||
} | ||
|
||
void CoinCollectHintState::exeHint() {} |
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,22 @@ | ||
#pragma once | ||
|
||
#include "Library/Nerve/NerveStateBase.h" | ||
|
||
namespace al { | ||
class LiveActor; | ||
} // namespace al | ||
|
||
class CoinCollectHintState : public al::ActorStateBase { | ||
public: | ||
CoinCollectHintState(al::LiveActor*); | ||
~CoinCollectHintState(); | ||
|
||
void init() override; | ||
void appear() override; | ||
void kill() override; | ||
|
||
void deleteHintEffect(); | ||
void appearHintEffect(); | ||
|
||
void exeWait(); | ||
}; |