From 8d10a87817e720b586508b353331c59eea975cd5 Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:55:09 +0300 Subject: [PATCH 1/8] Start implementing BarrierField --- data/odyssey_functions.csv | 6 +++--- src/MapObj/BarrierField.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/MapObj/BarrierField.h | 30 ++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 src/MapObj/BarrierField.cpp create mode 100644 src/MapObj/BarrierField.h diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index 385162f99..189a3857c 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -385,9 +385,9 @@ 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 +0x0000007100009da0,O,000124,_ZN12BarrierFieldC2EPKc +0x0000007100009e1c,O,000136,_ZN12BarrierFieldC1EPKc +0x0000007100009ea4,m,000164,_ZN12BarrierField4initERKN2al13ActorInitInfoE 0x0000007100009f48,U,000116,_ZN12BarrierField6appearEv 0x0000007100009fbc,U,000056,_ZN12BarrierField4killEv 0x0000007100009ff4,U,000064,_ZN12BarrierField19disappearByShineGetEv diff --git a/src/MapObj/BarrierField.cpp b/src/MapObj/BarrierField.cpp new file mode 100644 index 000000000..eff35942f --- /dev/null +++ b/src/MapObj/BarrierField.cpp @@ -0,0 +1,37 @@ +#include "MapObj/BarrierField.h" + +#include "Library/Nerve/NerveSetupUtil.h" +#include "Library/LiveActor/ActorInitInfo.h" +#include "Library/Placement/PlacementFunction.h" + +#include "System/GameDataHolderAccessor.h" +#include "System/GameDataFunction.h" + +static alNerveFunction::NerveActionCollector sBarrierFieldNerveCollector; + +BarrierField::BarrierField(const char* name) : al::LiveActor(name){} + +/* +void BarrierField::init(const al::ActorInitInfo& initInfo) { + al::initNerveAction(this, "Hide", &sBarrierFieldNerveCollector, 0); + al::initMapPartsActor(this, initInfo, nullptr); + al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); + mIsOnTheMoon = al::isObjectName(initInfo, "WaterfallWorldHomeBarrier") && GameDataFunction::isWorldMoon(GameDataHolderAccessor(this)); + al::trySyncStageSwitchAppearAndKill(this); +} +*/ + +// NON_MATCHING + +void BarrierField::init(const al::ActorInitInfo& initInfo) { + al::initNerveAction(this, "Hide", &sBarrierFieldNerveCollector, 0); + al::initMapPartsActor(this, initInfo, nullptr); + al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); + if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier")){ + GameDataHolderAccessor dataAccessor(this); + if(GameDataFunction::isWorldMoon(dataAccessor)){ + mIsOnTheMoon = true; + } + } + al::trySyncStageSwitchAppearAndKill(this); +} diff --git a/src/MapObj/BarrierField.h b/src/MapObj/BarrierField.h new file mode 100644 index 000000000..e02b0a6f4 --- /dev/null +++ b/src/MapObj/BarrierField.h @@ -0,0 +1,30 @@ +#pragma once + +#include "Library/LiveActor/LiveActor.h" + +namespace al { + class LiveActor; + class ActorInitInfo; +} + +namespace alNerveFunction { + class NerveActionCollector; +} + +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 mIsOnTheMoon = false; +}; From 4d172b4b6bbf6916567a838ee3763a03a1e1d29b Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:15:11 +0300 Subject: [PATCH 2/8] Implemented BarrierField --- data/odyssey_functions.csv | 14 ++--- lib/al/Library/Nerve/NerveSetupUtil.h | 2 + lib/al/Library/Stage/StageSwitchKeeper.h | 3 + src/MapObj/BarrierField.cpp | 75 +++++++++++++++++++++--- src/MapObj/BarrierField.h | 12 ++-- src/Util/StageSceneFunction.h | 2 + 6 files changed, 85 insertions(+), 23 deletions(-) diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index 189a3857c..cff84d043 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -388,13 +388,13 @@ Address,Quality,Size,Name 0x0000007100009da0,O,000124,_ZN12BarrierFieldC2EPKc 0x0000007100009e1c,O,000136,_ZN12BarrierFieldC1EPKc 0x0000007100009ea4,m,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 +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,U,000004,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide7executeEPN2al11NerveKeeperE 0x000000710000a050,U,000012,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide13getActionNameEv 0x000000710000a05c,U,000004,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear7executeEPN2al11NerveKeeperE diff --git a/lib/al/Library/Nerve/NerveSetupUtil.h b/lib/al/Library/Nerve/NerveSetupUtil.h index db41c01c4..0e661e773 100644 --- a/lib/al/Library/Nerve/NerveSetupUtil.h +++ b/lib/al/Library/Nerve/NerveSetupUtil.h @@ -48,6 +48,8 @@ al::initNerveAction(this, "Hide", &NrvExampleUseCase.mCollector, 0); void execute(al::NerveKeeper* keeper) const override { \ (keeper->getParent())->exe##ActionFunc(); \ } \ + \ + const char* getActionName() const { return #Action; } \ }; #define NERVE_IMPL(Class, Action) NERVE_IMPL_(Class, Action, Action) 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/MapObj/BarrierField.cpp b/src/MapObj/BarrierField.cpp index eff35942f..5dec126cf 100644 --- a/src/MapObj/BarrierField.cpp +++ b/src/MapObj/BarrierField.cpp @@ -1,22 +1,47 @@ #include "MapObj/BarrierField.h" -#include "Library/Nerve/NerveSetupUtil.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/GameDataHolderAccessor.h" #include "System/GameDataFunction.h" +#include "System/GameDataHolderAccessor.h" +#include "Util/StageSceneFunction.h" + +namespace alNerveFunction { +class NerveActionCollector; +} + +namespace { +NERVE_IMPL(BarrierField, Appear); +NERVE_IMPL(BarrierField, AppearBreedaMoonWorld); +NERVE_IMPL(BarrierField, Hide); +NERVE_IMPL(BarrierField, Disappear); + +struct { + NERVE_MAKE(BarrierField, Appear); + NERVE_MAKE(BarrierField, AppearBreedaMoonWorld); + NERVE_MAKE(BarrierField, Hide); + NERVE_MAKE(BarrierField, Disappear); +} NrvBarrierField; + +} // namespace static alNerveFunction::NerveActionCollector sBarrierFieldNerveCollector; -BarrierField::BarrierField(const char* name) : al::LiveActor(name){} +BarrierField::BarrierField(const char* name) : al::LiveActor(name) {} /* void BarrierField::init(const al::ActorInitInfo& initInfo) { al::initNerveAction(this, "Hide", &sBarrierFieldNerveCollector, 0); al::initMapPartsActor(this, initInfo, nullptr); al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); - mIsOnTheMoon = al::isObjectName(initInfo, "WaterfallWorldHomeBarrier") && GameDataFunction::isWorldMoon(GameDataHolderAccessor(this)); + mIsOnTheMoon = al::isObjectName(initInfo, "WaterfallWorldHomeBarrier") && +GameDataFunction::isWorldMoon(GameDataHolderAccessor(this)); al::trySyncStageSwitchAppearAndKill(this); } */ @@ -24,14 +49,48 @@ void BarrierField::init(const al::ActorInitInfo& initInfo) { // NON_MATCHING void BarrierField::init(const al::ActorInitInfo& initInfo) { - al::initNerveAction(this, "Hide", &sBarrierFieldNerveCollector, 0); + al::initNerveAction(this, NrvBarrierField.Hide.getActionName(), &sBarrierFieldNerveCollector, + 0); al::initMapPartsActor(this, initInfo, nullptr); al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); - if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier")){ + if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier")) { GameDataHolderAccessor dataAccessor(this); - if(GameDataFunction::isWorldMoon(dataAccessor)){ + if (GameDataFunction::isWorldMoon(dataAccessor)) mIsOnTheMoon = true; - } } al::trySyncStageSwitchAppearAndKill(this); } + +void BarrierField::appear() { + LiveActor::appear(); + + if (mIsOnTheMoon) + 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/MapObj/BarrierField.h b/src/MapObj/BarrierField.h index e02b0a6f4..a159d340a 100644 --- a/src/MapObj/BarrierField.h +++ b/src/MapObj/BarrierField.h @@ -3,15 +3,11 @@ #include "Library/LiveActor/LiveActor.h" namespace al { - class LiveActor; - class ActorInitInfo; -} +class LiveActor; +class ActorInitInfo; +} // namespace al -namespace alNerveFunction { - class NerveActionCollector; -} - -class BarrierField : public al::LiveActor{ +class BarrierField : public al::LiveActor { public: BarrierField(const char*); void init(const al::ActorInitInfo&) override; diff --git a/src/Util/StageSceneFunction.h b/src/Util/StageSceneFunction.h index 8da107d5d..70ba1410f 100644 --- a/src/Util/StageSceneFunction.h +++ b/src/Util/StageSceneFunction.h @@ -9,6 +9,7 @@ void appearPlayerDeadCoin(al::LiveActor*); } class IJudge; +class BarrierField; namespace rs { void resetJudge(IJudge*); @@ -21,4 +22,5 @@ void isFirstDemoOpenMoonRock(const al::LiveActor*); void isEnableShowDemoMoonRockMapWorld(const al::LiveActor*); void showDemoAfterOpenMoonRockFirst(const al::LiveActor*); void showDemoMoonRockMapWorld(const al::LiveActor*); +void setBossBarrierField(BarrierField*); } // namespace rs From 973d596d1ee3339e81142edce405f87dd0e3902a Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:42:45 +0300 Subject: [PATCH 3/8] init: Fixed mismatch --- data/odyssey_functions.csv | 10 +++++----- src/MapObj/BarrierField.cpp | 21 ++++----------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index cff84d043..53973462c 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -387,7 +387,7 @@ Address,Quality,Size,Name 0x0000007100009d20,U,000128, 0x0000007100009da0,O,000124,_ZN12BarrierFieldC2EPKc 0x0000007100009e1c,O,000136,_ZN12BarrierFieldC1EPKc -0x0000007100009ea4,m,000164,_ZN12BarrierField4initERKN2al13ActorInitInfoE +0x0000007100009ea4,O,000164,_ZN12BarrierField4initERKN2al13ActorInitInfoE 0x0000007100009f48,O,000116,_ZN12BarrierField6appearEv 0x0000007100009fbc,O,000056,_ZN12BarrierField4killEv 0x0000007100009ff4,O,000064,_ZN12BarrierField19disappearByShineGetEv @@ -395,13 +395,13 @@ Address,Quality,Size,Name 0x000000710000a038,O,000004,_ZN12BarrierField24exeAppearBreedaMoonWorldEv 0x000000710000a03c,O,000004,_ZN12BarrierField7exeHideEv 0x000000710000a040,O,000012,_ZN12BarrierField12exeDisappearEv -0x000000710000a04c,U,000004,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide7executeEPN2al11NerveKeeperE +0x000000710000a04c,O,000004,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide7executeEPN2al11NerveKeeperE 0x000000710000a050,U,000012,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide13getActionNameEv -0x000000710000a05c,U,000004,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear7executeEPN2al11NerveKeeperE +0x000000710000a05c,O,000004,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear7executeEPN2al11NerveKeeperE 0x000000710000a060,U,000012,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear13getActionNameEv -0x000000710000a06c,U,000004,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld7executeEPN2al11NerveKeeperE +0x000000710000a06c,O,000004,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld7executeEPN2al11NerveKeeperE 0x000000710000a070,U,000012,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld13getActionNameEv -0x000000710000a07c,U,000016,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear7executeEPN2al11NerveKeeperE +0x000000710000a07c,O,000016,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear7executeEPN2al11NerveKeeperE 0x000000710000a08c,U,000012,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear13getActionNameEv 0x000000710000a098,U,000140, 0x000000710000a124,U,000244,_ZN8BombTailC2EPKcP22MultiGateKeeperWatcher diff --git a/src/MapObj/BarrierField.cpp b/src/MapObj/BarrierField.cpp index 5dec126cf..bbb30ab63 100644 --- a/src/MapObj/BarrierField.cpp +++ b/src/MapObj/BarrierField.cpp @@ -27,30 +27,17 @@ struct { NERVE_MAKE(BarrierField, AppearBreedaMoonWorld); NERVE_MAKE(BarrierField, Hide); NERVE_MAKE(BarrierField, Disappear); + void* padding[4]; + + alNerveFunction::NerveActionCollector mCollector; } NrvBarrierField; } // namespace -static alNerveFunction::NerveActionCollector sBarrierFieldNerveCollector; - BarrierField::BarrierField(const char* name) : al::LiveActor(name) {} -/* -void BarrierField::init(const al::ActorInitInfo& initInfo) { - al::initNerveAction(this, "Hide", &sBarrierFieldNerveCollector, 0); - al::initMapPartsActor(this, initInfo, nullptr); - al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); - mIsOnTheMoon = al::isObjectName(initInfo, "WaterfallWorldHomeBarrier") && -GameDataFunction::isWorldMoon(GameDataHolderAccessor(this)); - al::trySyncStageSwitchAppearAndKill(this); -} -*/ - -// NON_MATCHING - void BarrierField::init(const al::ActorInitInfo& initInfo) { - al::initNerveAction(this, NrvBarrierField.Hide.getActionName(), &sBarrierFieldNerveCollector, - 0); + al::initNerveAction(this, "Hide", &NrvBarrierField.mCollector, 0); al::initMapPartsActor(this, initInfo, nullptr); al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier")) { From 0f7764acf975532bbe518c74554ad41e0978b69e Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:20:57 +0300 Subject: [PATCH 4/8] Moved setBossBarrierField --- src/MapObj/BarrierField.cpp | 2 +- src/Util/DemoUtil.h | 7 +++++++ src/Util/StageSceneFunction.h | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 src/Util/DemoUtil.h diff --git a/src/MapObj/BarrierField.cpp b/src/MapObj/BarrierField.cpp index bbb30ab63..cdb7ce454 100644 --- a/src/MapObj/BarrierField.cpp +++ b/src/MapObj/BarrierField.cpp @@ -10,7 +10,7 @@ #include "System/GameDataFunction.h" #include "System/GameDataHolderAccessor.h" -#include "Util/StageSceneFunction.h" +#include "Util/DemoUtil.h" namespace alNerveFunction { class NerveActionCollector; 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*); +} diff --git a/src/Util/StageSceneFunction.h b/src/Util/StageSceneFunction.h index 70ba1410f..92199e944 100644 --- a/src/Util/StageSceneFunction.h +++ b/src/Util/StageSceneFunction.h @@ -22,5 +22,4 @@ void isFirstDemoOpenMoonRock(const al::LiveActor*); void isEnableShowDemoMoonRockMapWorld(const al::LiveActor*); void showDemoAfterOpenMoonRockFirst(const al::LiveActor*); void showDemoMoonRockMapWorld(const al::LiveActor*); -void setBossBarrierField(BarrierField*); } // namespace rs From d229923843292da742e287921fa53eef04ae9a8b Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:47:14 +0300 Subject: [PATCH 5/8] PR:suggestions --- data/odyssey_functions.csv | 8 ++++---- lib/al/Library/Nerve/NerveSetupUtil.h | 2 +- src/MapObj/BarrierField.cpp | 7 +++---- src/MapObj/BarrierField.h | 2 +- src/Util/StageSceneFunction.h | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index 53973462c..ab68a2048 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -396,13 +396,13 @@ Address,Quality,Size,Name 0x000000710000a03c,O,000004,_ZN12BarrierField7exeHideEv 0x000000710000a040,O,000012,_ZN12BarrierField12exeDisappearEv 0x000000710000a04c,O,000004,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide7executeEPN2al11NerveKeeperE -0x000000710000a050,U,000012,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide13getActionNameEv +0x000000710000a050,O,000012,_ZNK12_GLOBAL__N_119BarrierFieldNrvHide13getActionNameEv 0x000000710000a05c,O,000004,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear7executeEPN2al11NerveKeeperE -0x000000710000a060,U,000012,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear13getActionNameEv +0x000000710000a060,O,000012,_ZNK12_GLOBAL__N_121BarrierFieldNrvAppear13getActionNameEv 0x000000710000a06c,O,000004,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld7executeEPN2al11NerveKeeperE -0x000000710000a070,U,000012,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld13getActionNameEv +0x000000710000a070,O,000012,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld13getActionNameEv 0x000000710000a07c,O,000016,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear7executeEPN2al11NerveKeeperE -0x000000710000a08c,U,000012,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear13getActionNameEv +0x000000710000a08c,O,000012,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear13getActionNameEv 0x000000710000a098,U,000140, 0x000000710000a124,U,000244,_ZN8BombTailC2EPKcP22MultiGateKeeperWatcher 0x000000710000a218,U,000256,_ZN8BombTailC1EPKcP22MultiGateKeeperWatcher diff --git a/lib/al/Library/Nerve/NerveSetupUtil.h b/lib/al/Library/Nerve/NerveSetupUtil.h index 0e661e773..6d1cd8f91 100644 --- a/lib/al/Library/Nerve/NerveSetupUtil.h +++ b/lib/al/Library/Nerve/NerveSetupUtil.h @@ -49,7 +49,7 @@ al::initNerveAction(this, "Hide", &NrvExampleUseCase.mCollector, 0); (keeper->getParent())->exe##ActionFunc(); \ } \ \ - const char* getActionName() const { return #Action; } \ + virtual const char* getActionName() const { return #Action; } \ }; #define NERVE_IMPL(Class, Action) NERVE_IMPL_(Class, Action, Action) diff --git a/src/MapObj/BarrierField.cpp b/src/MapObj/BarrierField.cpp index cdb7ce454..3c74d3770 100644 --- a/src/MapObj/BarrierField.cpp +++ b/src/MapObj/BarrierField.cpp @@ -41,9 +41,8 @@ void BarrierField::init(const al::ActorInitInfo& initInfo) { al::initMapPartsActor(this, initInfo, nullptr); al::tryGetArg(&mIsDisappearByShineGet, initInfo, "IsDisappearByShineGet"); if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier")) { - GameDataHolderAccessor dataAccessor(this); - if (GameDataFunction::isWorldMoon(dataAccessor)) - mIsOnTheMoon = true; + if (GameDataFunction::isWorldMoon(this)) + mIsMoon = true; } al::trySyncStageSwitchAppearAndKill(this); } @@ -51,7 +50,7 @@ void BarrierField::init(const al::ActorInitInfo& initInfo) { void BarrierField::appear() { LiveActor::appear(); - if (mIsOnTheMoon) + if (mIsMoon) al::startNerveAction(this, "AppearBreedaMoonWorld"); else al::startNerveAction(this, "Appear"); diff --git a/src/MapObj/BarrierField.h b/src/MapObj/BarrierField.h index a159d340a..d0e7e5722 100644 --- a/src/MapObj/BarrierField.h +++ b/src/MapObj/BarrierField.h @@ -22,5 +22,5 @@ class BarrierField : public al::LiveActor { private: bool mIsDisappearByShineGet = false; - bool mIsOnTheMoon = false; + bool mIsMoon = false; }; diff --git a/src/Util/StageSceneFunction.h b/src/Util/StageSceneFunction.h index 92199e944..8da107d5d 100644 --- a/src/Util/StageSceneFunction.h +++ b/src/Util/StageSceneFunction.h @@ -9,7 +9,6 @@ void appearPlayerDeadCoin(al::LiveActor*); } class IJudge; -class BarrierField; namespace rs { void resetJudge(IJudge*); From f22fa7dda621406fcbe38f13d69c419b39996535 Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:53:07 +0300 Subject: [PATCH 6/8] PR:clang-format --- lib/al/Library/Nerve/NerveSetupUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/al/Library/Nerve/NerveSetupUtil.h b/lib/al/Library/Nerve/NerveSetupUtil.h index 6d1cd8f91..119ccc9ea 100644 --- a/lib/al/Library/Nerve/NerveSetupUtil.h +++ b/lib/al/Library/Nerve/NerveSetupUtil.h @@ -49,7 +49,7 @@ al::initNerveAction(this, "Hide", &NrvExampleUseCase.mCollector, 0); (keeper->getParent())->exe##ActionFunc(); \ } \ \ - virtual const char* getActionName() const { return #Action; } \ + virtual const char* getActionName() const { return #Action; } \ }; #define NERVE_IMPL(Class, Action) NERVE_IMPL_(Class, Action, Action) From b716588ef7c63e2e583c96227052072f71d73c24 Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:29:31 +0300 Subject: [PATCH 7/8] Fixed NerveSetupUtil and switched to using new macros --- lib/al/Library/Nerve/NerveSetupUtil.h | 2 -- src/MapObj/BarrierField.cpp | 18 +++++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/al/Library/Nerve/NerveSetupUtil.h b/lib/al/Library/Nerve/NerveSetupUtil.h index 119ccc9ea..db41c01c4 100644 --- a/lib/al/Library/Nerve/NerveSetupUtil.h +++ b/lib/al/Library/Nerve/NerveSetupUtil.h @@ -48,8 +48,6 @@ al::initNerveAction(this, "Hide", &NrvExampleUseCase.mCollector, 0); void execute(al::NerveKeeper* keeper) const override { \ (keeper->getParent())->exe##ActionFunc(); \ } \ - \ - virtual const char* getActionName() const { return #Action; } \ }; #define NERVE_IMPL(Class, Action) NERVE_IMPL_(Class, Action, Action) diff --git a/src/MapObj/BarrierField.cpp b/src/MapObj/BarrierField.cpp index 3c74d3770..d516851e3 100644 --- a/src/MapObj/BarrierField.cpp +++ b/src/MapObj/BarrierField.cpp @@ -17,20 +17,12 @@ class NerveActionCollector; } namespace { -NERVE_IMPL(BarrierField, Appear); -NERVE_IMPL(BarrierField, AppearBreedaMoonWorld); -NERVE_IMPL(BarrierField, Hide); -NERVE_IMPL(BarrierField, Disappear); +NERVE_ACTION_IMPL(BarrierField, Appear); +NERVE_ACTION_IMPL(BarrierField, AppearBreedaMoonWorld); +NERVE_ACTION_IMPL(BarrierField, Hide); +NERVE_ACTION_IMPL(BarrierField, Disappear); -struct { - NERVE_MAKE(BarrierField, Appear); - NERVE_MAKE(BarrierField, AppearBreedaMoonWorld); - NERVE_MAKE(BarrierField, Hide); - NERVE_MAKE(BarrierField, Disappear); - void* padding[4]; - - alNerveFunction::NerveActionCollector mCollector; -} NrvBarrierField; +NERVE_ACTIONS_MAKE_STRUCT(BarrierField, Appear, AppearBreedaMoonWorld, Hide, Disappear); } // namespace From d235f7f3ecb6dc5fc446130a5d49c5c3f54db69e Mon Sep 17 00:00:00 2001 From: LynxDev2 <128722393+LynxDev2@users.noreply.github.com> Date: Sun, 16 Jun 2024 17:27:20 +0300 Subject: [PATCH 8/8] Moved to Boss folder and more PR suggestions --- data/odyssey_functions.csv | 2 +- src/{MapObj => Boss}/BarrierField.cpp | 13 ++++--------- src/{MapObj => Boss}/BarrierField.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) rename src/{MapObj => Boss}/BarrierField.cpp (88%) rename src/{MapObj => Boss}/BarrierField.h (96%) diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index ab68a2048..0306f1ac2 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -403,7 +403,7 @@ Address,Quality,Size,Name 0x000000710000a070,O,000012,_ZNK12_GLOBAL__N_136BarrierFieldNrvAppearBreedaMoonWorld13getActionNameEv 0x000000710000a07c,O,000016,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear7executeEPN2al11NerveKeeperE 0x000000710000a08c,O,000012,_ZNK12_GLOBAL__N_124BarrierFieldNrvDisappear13getActionNameEv -0x000000710000a098,U,000140, +0x000000710000a098,O,000140,_GLOBAL__sub_I_BarrierField.cpp 0x000000710000a124,U,000244,_ZN8BombTailC2EPKcP22MultiGateKeeperWatcher 0x000000710000a218,U,000256,_ZN8BombTailC1EPKcP22MultiGateKeeperWatcher 0x000000710000a318,U,001936,_ZN8BombTail4initERKN2al13ActorInitInfoE diff --git a/src/MapObj/BarrierField.cpp b/src/Boss/BarrierField.cpp similarity index 88% rename from src/MapObj/BarrierField.cpp rename to src/Boss/BarrierField.cpp index d516851e3..4c9141563 100644 --- a/src/MapObj/BarrierField.cpp +++ b/src/Boss/BarrierField.cpp @@ -1,4 +1,4 @@ -#include "MapObj/BarrierField.h" +#include "Boss/BarrierField.h" #include "Library/Effect/EffectSystemInfo.h" #include "Library/LiveActor/ActorActionFunction.h" @@ -12,10 +12,6 @@ #include "System/GameDataHolderAccessor.h" #include "Util/DemoUtil.h" -namespace alNerveFunction { -class NerveActionCollector; -} - namespace { NERVE_ACTION_IMPL(BarrierField, Appear); NERVE_ACTION_IMPL(BarrierField, AppearBreedaMoonWorld); @@ -32,10 +28,9 @@ 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")) { - if (GameDataFunction::isWorldMoon(this)) - mIsMoon = true; - } + if (al::isObjectName(initInfo, "WaterfallWorldHomeBarrier") && + GameDataFunction::isWorldMoon(this)) + mIsMoon = true; al::trySyncStageSwitchAppearAndKill(this); } diff --git a/src/MapObj/BarrierField.h b/src/Boss/BarrierField.h similarity index 96% rename from src/MapObj/BarrierField.h rename to src/Boss/BarrierField.h index d0e7e5722..2424e9599 100644 --- a/src/MapObj/BarrierField.h +++ b/src/Boss/BarrierField.h @@ -3,7 +3,6 @@ #include "Library/LiveActor/LiveActor.h" namespace al { -class LiveActor; class ActorInitInfo; } // namespace al