diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index 385162f99..0306f1ac2 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -385,25 +385,25 @@ Address,Quality,Size,Name 0x0000007100009cb8,U,000096,_ZNK12_GLOBAL__N_128ShopBgmPlayerNrvWaitOnSwitch7executeEPN2al11NerveKeeperE 0x0000007100009d18,U,000008,_ZNK12_GLOBAL__N_120ShopBgmPlayerNrvPlay7executeEPN2al11NerveKeeperE 0x0000007100009d20,U,000128, -0x0000007100009da0,U,000124,_ZN12BarrierFieldC2EPKc -0x0000007100009e1c,U,000136,_ZN12BarrierFieldC1EPKc -0x0000007100009ea4,U,000164,_ZN12BarrierField4initERKN2al13ActorInitInfoE -0x0000007100009f48,U,000116,_ZN12BarrierField6appearEv -0x0000007100009fbc,U,000056,_ZN12BarrierField4killEv -0x0000007100009ff4,U,000064,_ZN12BarrierField19disappearByShineGetEv -0x000000710000a034,U,000004,_ZN12BarrierField9exeAppearEv -0x000000710000a038,U,000004,_ZN12BarrierField24exeAppearBreedaMoonWorldEv -0x000000710000a03c,U,000004,_ZN12BarrierField7exeHideEv -0x000000710000a040,U,000012,_ZN12BarrierField12exeDisappearEv -0x000000710000a04c,U,000004,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide7executeEPN2al11NerveKeeperE -0x000000710000a050,U,000012,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide13getActionNameEv -0x000000710000a05c,U,000004,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear7executeEPN2al11NerveKeeperE -0x000000710000a060,U,000012,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear13getActionNameEv -0x000000710000a06c,U,000004,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld7executeEPN2al11NerveKeeperE -0x000000710000a070,U,000012,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld13getActionNameEv -0x000000710000a07c,U,000016,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear7executeEPN2al11NerveKeeperE -0x000000710000a08c,U,000012,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear13getActionNameEv -0x000000710000a098,U,000140, +0x0000007100009da0,O,000124,_ZN12BarrierFieldC2EPKc +0x0000007100009e1c,O,000136,_ZN12BarrierFieldC1EPKc +0x0000007100009ea4,O,000164,_ZN12BarrierField4initERKN2al13ActorInitInfoE +0x0000007100009f48,O,000116,_ZN12BarrierField6appearEv +0x0000007100009fbc,O,000056,_ZN12BarrierField4killEv +0x0000007100009ff4,O,000064,_ZN12BarrierField19disappearByShineGetEv +0x000000710000a034,O,000004,_ZN12BarrierField9exeAppearEv +0x000000710000a038,O,000004,_ZN12BarrierField24exeAppearBreedaMoonWorldEv +0x000000710000a03c,O,000004,_ZN12BarrierField7exeHideEv +0x000000710000a040,O,000012,_ZN12BarrierField12exeDisappearEv +0x000000710000a04c,O,000004,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide7executeEPN2al11NerveKeeperE +0x000000710000a050,O,000012,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide13getActionNameEv +0x000000710000a05c,O,000004,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear7executeEPN2al11NerveKeeperE +0x000000710000a060,O,000012,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear13getActionNameEv +0x000000710000a06c,O,000004,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld7executeEPN2al11NerveKeeperE +0x000000710000a070,O,000012,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld13getActionNameEv +0x000000710000a07c,O,000016,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear7executeEPN2al11NerveKeeperE +0x000000710000a08c,O,000012,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear13getActionNameEv +0x000000710000a098,O,000140,_GLOBAL__sub_I_BarrierField.cpp 0x000000710000a124,U,000244,_ZN8BombTailC2EPKcP22MultiGateKeeperWatcher 0x000000710000a218,U,000256,_ZN8BombTailC1EPKcP22MultiGateKeeperWatcher 0x000000710000a318,U,001936,_ZN8BombTail4initERKN2al13ActorInitInfoE diff --git a/lib/al/Library/Stage/StageSwitchKeeper.h b/lib/al/Library/Stage/StageSwitchKeeper.h index f4bdecaf0..8aae8369c 100755 --- a/lib/al/Library/Stage/StageSwitchKeeper.h +++ b/lib/al/Library/Stage/StageSwitchKeeper.h @@ -13,6 +13,7 @@ class StageSwitchAccesser; class StageSwitchDirector; class StageSwitchListener; class PlacementInfo; +class IUseStageSwitch; class StageSwitchKeeper { public: @@ -44,5 +45,7 @@ class StageSwitchDirector : public HioNode, public IUseExecutor { }; static_assert(sizeof(StageSwitchDirector) == 0x20); +bool tryOnStageSwitch(IUseStageSwitch*, const char*); +bool tryOffStageSwitch(IUseStageSwitch*, const char*); bool tryOnSwitchDeadOn(IUseStageSwitch* stageSwitch); } // namespace al diff --git a/src/Boss/BarrierField.cpp b/src/Boss/BarrierField.cpp new file mode 100644 index 000000000..4c9141563 --- /dev/null +++ b/src/Boss/BarrierField.cpp @@ -0,0 +1,69 @@ +#include "Boss/BarrierField.h" + +#include "Library/Effect/EffectSystemInfo.h" +#include "Library/LiveActor/ActorActionFunction.h" +#include "Library/LiveActor/ActorClippingFunction.h" +#include "Library/LiveActor/ActorInitInfo.h" +#include "Library/Nerve/NerveSetupUtil.h" +#include "Library/Placement/PlacementFunction.h" +#include "Library/Stage/StageSwitchKeeper.h" + +#include "System/GameDataFunction.h" +#include "System/GameDataHolderAccessor.h" +#include "Util/DemoUtil.h" + +namespace { +NERVE_ACTION_IMPL(BarrierField, Appear); +NERVE_ACTION_IMPL(BarrierField, AppearBreedaMoonWorld); +NERVE_ACTION_IMPL(BarrierField, Hide); +NERVE_ACTION_IMPL(BarrierField, Disappear); + +NERVE_ACTIONS_MAKE_STRUCT(BarrierField, Appear, AppearBreedaMoonWorld, Hide, Disappear); + +} // namespace + +BarrierField::BarrierField(const char* name) : al::LiveActor(name) {} + +void BarrierField::init(const al::ActorInitInfo& initInfo) { + al::initNerveAction(this, "Hide", &NrvBarrierField.mCollector, 0); + al::initMapPartsActor(this, initInfo, nullptr); + al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); + if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier") && + GameDataFunction::isWorldMoon(this)) + mIsMoon = true; + al::trySyncStageSwitchAppearAndKill(this); +} + +void BarrierField::appear() { + LiveActor::appear(); + + if (mIsMoon) + al::startNerveAction(this, "AppearBreedaMoonWorld"); + else + al::startNerveAction(this, "Appear"); + + al::tryOnStageSwitch(this, "SwitchExistOnOff"); + al::invalidateClipping(this); + if (mIsDisappearByShineGet) + rs::setBossBarrierField(this); +} + +void BarrierField::kill() { + al::tryOffStageSwitch(this, "SwitchExistOnOff"); + al::validateClipping(this); + al::LiveActor::kill(); +} + +void BarrierField::disappearByShineGet() { + if (getEffectKeeper()) + al::tryKillEmitterAndParticleAll(this); + kill(); +} + +void BarrierField::exeAppear() {} +void BarrierField::exeAppearBreedaMoonWorld() {} +void BarrierField::exeHide() {} + +void BarrierField::exeDisappear() { + kill(); +} diff --git a/src/Boss/BarrierField.h b/src/Boss/BarrierField.h new file mode 100644 index 000000000..2424e9599 --- /dev/null +++ b/src/Boss/BarrierField.h @@ -0,0 +1,25 @@ +#pragma once + +#include "Library/LiveActor/LiveActor.h" + +namespace al { +class ActorInitInfo; +} // namespace al + +class BarrierField : public al::LiveActor { +public: + BarrierField(const char*); + void init(const al::ActorInitInfo&) override; + void appear() override; + void kill() override; + void disappearByShineGet(); + + void exeAppear(); + void exeAppearBreedaMoonWorld(); + void exeHide(); + void exeDisappear(); + +private: + bool mIsDisappearByShineGet = false; + bool mIsMoon = false; +}; diff --git a/src/Util/DemoUtil.h b/src/Util/DemoUtil.h new file mode 100644 index 000000000..fe1534d2b --- /dev/null +++ b/src/Util/DemoUtil.h @@ -0,0 +1,7 @@ +#pragma once + +class BarrierField; + +namespace rs { +void setBossBarrierField(BarrierField*); +}