1#include "MapObj/LavaPan.h"
2
3#include "Library/Demo/DemoFunction.h"
4#include "Library/LiveActor/ActorActionFunction.h"
5#include "Library/LiveActor/ActorInitUtil.h"
6#include "Library/Nerve/NerveSetupUtil.h"
7#include "Library/Nerve/NerveUtil.h"
8#include "Library/Player/PlayerUtil.h"
9
10namespace {
11NERVE_IMPL(LavaPan, Wait)
12NERVE_IMPL(LavaPan, Rumble)
13
14NERVES_MAKE_NOSTRUCT(LavaPan, Wait, Rumble)
15} // namespace
16
17LavaPan::LavaPan(const char* name) : al::LiveActor(name) {}
18
19void LavaPan::init(const al::ActorInitInfo& info) {
20 al::initActorWithArchiveName(actor: this, initInfo: info, archiveName: "LavaWorldHomePan000", suffix: nullptr);
21 al::initNerve(actor: this, nerve: &Wait, maxStates: 0);
22 al::registActorToDemoInfo(actor: this, initInfo: info);
23 makeActorAlive();
24}
25
26void LavaPan::exeWait() {
27 if (al::isFirstStep(user: this))
28 al::startAction(actor: this, actionName: "Stop");
29 if (!al::isNearPlayer(this, 8000.0f))
30 al::setNerve(user: this, nerve: &Rumble);
31}
32
33void LavaPan::exeRumble() {
34 if (al::isFirstStep(user: this))
35 al::startAction(actor: this, actionName: "LavaWorldHomePan000");
36 if (al::isNearPlayer(this, 8000.0f))
37 al::setNerve(user: this, nerve: &Wait);
38}
39