From 89b7f1961cdfce27ff7f1b7b3460962c58676835 Mon Sep 17 00:00:00 2001 From: Gabbo Date: Mon, 29 Apr 2024 15:04:24 +0200 Subject: [PATCH] BattleShipElevator `100%` --- csv/MapObj.csv | 26 ++++---- data/Game.json | 2 +- docs/PROGRESS.md | 2 +- docs/lib/MapObj.md | 4 +- docs/lib/MapObj/BattleShipElevator.md | 48 +++++++------- include/Game/MapObj/BattleShipElevator.hpp | 21 +++++++ include/Game/Util/DemoUtil.hpp | 2 + source/Game/MapObj/BattleShipElevator.cpp | 73 ++++++++++++++++++++++ 8 files changed, 137 insertions(+), 41 deletions(-) create mode 100644 include/Game/MapObj/BattleShipElevator.hpp create mode 100644 source/Game/MapObj/BattleShipElevator.cpp diff --git a/csv/MapObj.csv b/csv/MapObj.csv index 2dcedf58..ffb0a684 100644 --- a/csv/MapObj.csv +++ b/csv/MapObj.csv @@ -538,18 +538,18 @@ execute__Q211NrvBanekiti19BanekitiNrvDPDSwoonCFP5Spine,Banekiti.o,MapObj.a,false execute__Q211NrvBanekiti16BanekitiNrvRepelCFP5Spine,Banekiti.o,MapObj.a,false execute__Q211NrvBanekiti15BanekitiNrvWaitCFP5Spine,Banekiti.o,MapObj.a,false __ct__18BattleShipElevatorFPCc,BattleShipElevator.o,MapObj.a,true -init__18BattleShipElevatorFRC12JMapInfoIter,BattleShipElevator.o,MapObj.a,false -exeMove__18BattleShipElevatorFv,BattleShipElevator.o,MapObj.a,false -control__18BattleShipElevatorFv,BattleShipElevator.o,MapObj.a,false -receiveOtherMsg__18BattleShipElevatorFUlP9HitSensorP9HitSensor,BattleShipElevator.o,MapObj.a,false -__dt__18BattleShipElevatorFv,BattleShipElevator.o,MapObj.a,false -__sinit_\BattleShipElevator_cpp,BattleShipElevator.o,MapObj.a,false -__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitFv,BattleShipElevator.o,MapObj.a,false -__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveFv,BattleShipElevator.o,MapObj.a,false -__ct__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndFv,BattleShipElevator.o,MapObj.a,false -execute__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndCFP5Spine,BattleShipElevator.o,MapObj.a,false -execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveCFP5Spine,BattleShipElevator.o,MapObj.a,false -execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitCFP5Spine,BattleShipElevator.o,MapObj.a,false +init__18BattleShipElevatorFRC12JMapInfoIter,BattleShipElevator.o,MapObj.a,true +exeMove__18BattleShipElevatorFv,BattleShipElevator.o,MapObj.a,true +control__18BattleShipElevatorFv,BattleShipElevator.o,MapObj.a,true +receiveOtherMsg__18BattleShipElevatorFUlP9HitSensorP9HitSensor,BattleShipElevator.o,MapObj.a,true +__dt__18BattleShipElevatorFv,BattleShipElevator.o,MapObj.a,true +__sinit_\BattleShipElevator_cpp,BattleShipElevator.o,MapObj.a,true +__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitFv,BattleShipElevator.o,MapObj.a,true +__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveFv,BattleShipElevator.o,MapObj.a,true +__ct__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndFv,BattleShipElevator.o,MapObj.a,true +execute__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndCFP5Spine,BattleShipElevator.o,MapObj.a,true +execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveCFP5Spine,BattleShipElevator.o,MapObj.a,true +execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitCFP5Spine,BattleShipElevator.o,MapObj.a,true __ct__15BeamGoRoundBeamFPA4_f,BeamGoRoundPlanet.o,MapObj.a,false init__15BeamGoRoundBeamFRC12JMapInfoIter,BeamGoRoundPlanet.o,MapObj.a,false calcAndSetBaseMtx__15BeamGoRoundBeamFv,BeamGoRoundPlanet.o,MapObj.a,false @@ -4975,7 +4975,7 @@ exeNonActive__10SpinDriverFv,SpinDriver.o,MapObj.a,true exeAppear__10SpinDriverFv,SpinDriver.o,MapObj.a,true exeWait__10SpinDriverFv,SpinDriver.o,MapObj.a,true exeCapture__10SpinDriverFv,SpinDriver.o,MapObj.a,true -exeShootStart__10SpinDriverFv,SpinDriver.o,MapObj.a,true +exeShootStart__10SpinDriverFv,SpinDriver.o,MapObj.a,false exeShoot__10SpinDriverFv,SpinDriver.o,MapObj.a,true exeCoolDown__10SpinDriverFv,SpinDriver.o,MapObj.a,true startBind__10SpinDriverFP9HitSensor,SpinDriver.o,MapObj.a,true diff --git a/data/Game.json b/data/Game.json index c367ad50..cb9df3d0 100644 --- a/data/Game.json +++ b/data/Game.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, "label": "Game", - "message": "14.475%", + "message": "14.478%", "color": "blue" } \ No newline at end of file diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 459d7c42..d56fa728 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -12,7 +12,7 @@ | [Gravity](https://github.com/shibbo/Petari/blob/master/docs/lib/Gravity.md) | 73.07927450580803% | | [LiveActor](https://github.com/shibbo/Petari/blob/master/docs/lib/LiveActor.md) | 42.577224527431994% | | [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 17.65918333240488% | -| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 31.44546485142851% | +| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 31.46470582117339% | | [NameObj](https://github.com/shibbo/Petari/blob/master/docs/lib/NameObj.md) | 33.210237031947784% | | [NPC](https://github.com/shibbo/Petari/blob/master/docs/lib/NPC.md) | 2.155878467635403% | | [NWC24](https://github.com/shibbo/Petari/blob/master/docs/lib/NWC24.md) | 0.0% | diff --git a/docs/lib/MapObj.md b/docs/lib/MapObj.md index 2a5dc3e7..210bbbec 100644 --- a/docs/lib/MapObj.md +++ b/docs/lib/MapObj.md @@ -34,7 +34,7 @@ | [BallOpener.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BallOpener.md) | 56.747404844290664% | 15 / 17 | 88.23529411764706% | :eight_pointed_black_star: | [BallRail.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BallRail.md) | 100.0% | 19 / 19 | 100.0% | :white_check_mark: | [Banekiti.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/Banekiti.md) | 0.0% | 0 / 19 | 0.0% | :x: -| [BattleShipElevator.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BattleShipElevator.md) | 7.462686567164178% | 1 / 13 | 7.6923076923076925% | :eight_pointed_black_star: +| [BattleShipElevator.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BattleShipElevator.md) | 100.0% | 13 / 13 | 100.0% | :white_check_mark: | [BeamGoRoundPlanet.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BeamGoRoundPlanet.md) | 0.0% | 0 / 16 | 0.0% | :x: | [BeeFlowerHover.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BeeFlowerHover.md) | 82.1311475409836% | 20 / 21 | 95.23809523809523% | :eight_pointed_black_star: | [BenefitItemInvincible.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/BenefitItemInvincible.md) | 62.95454545454545% | 10 / 12 | 83.33333333333334% | :eight_pointed_black_star: @@ -256,7 +256,7 @@ | [SpiderThreadPoint.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpiderThreadPoint.md) | 0.0% | 0 / 10 | 0.0% | :x: | [SpiderThreadRadialLine.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpiderThreadRadialLine.md) | 0.0% | 0 / 4 | 0.0% | :x: | [SpiderThreadWindCtrl.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpiderThreadWindCtrl.md) | 0.0% | 0 / 7 | 0.0% | :x: -| [SpinDriver.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpinDriver.md) | 83.30125120307989% | 50 / 59 | 84.7457627118644% | :eight_pointed_black_star: +| [SpinDriver.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpinDriver.md) | 76.13089509143407% | 49 / 59 | 83.05084745762711% | :eight_pointed_black_star: | [SpinDriverCamera.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpinDriverCamera.md) | 73.97260273972603% | 13 / 14 | 92.85714285714286% | :eight_pointed_black_star: | [SpinDriverOperateRing.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpinDriverOperateRing.md) | 45.5535390199637% | 14 / 19 | 73.68421052631578% | :eight_pointed_black_star: | [SpinDriverPathDrawer.o](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj/SpinDriverPathDrawer.md) | 38.91752577319588% | 24 / 28 | 85.71428571428571% | :eight_pointed_black_star: diff --git a/docs/lib/MapObj/BattleShipElevator.md b/docs/lib/MapObj/BattleShipElevator.md index d0f62e2c..bcc87ebb 100644 --- a/docs/lib/MapObj/BattleShipElevator.md +++ b/docs/lib/MapObj/BattleShipElevator.md @@ -1,24 +1,24 @@ -# BattleShipElevator.o -| Symbol | Meaning -| ------------- | ------------- -| :x: | Function has not yet been started or is not matching. -| :white_check_mark: | Function is completed. - - -# 1 / 13 Completed -- (7.6923076923076925%) -# BattleShipElevator.o -| Symbol | Decompiled? | -| ------------- | ------------- | -| `__ct__18BattleShipElevatorFPCc` | :white_check_mark: | -| `init__18BattleShipElevatorFRC12JMapInfoIter` | :x: | -| `exeMove__18BattleShipElevatorFv` | :x: | -| `control__18BattleShipElevatorFv` | :x: | -| `receiveOtherMsg__18BattleShipElevatorFUlP9HitSensorP9HitSensor` | :x: | -| `__dt__18BattleShipElevatorFv` | :x: | -| `__sinit_\BattleShipElevator_cpp` | :x: | -| `__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitFv` | :x: | -| `__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveFv` | :x: | -| `__ct__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndFv` | :x: | -| `execute__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndCFP5Spine` | :x: | -| `execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveCFP5Spine` | :x: | -| `execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitCFP5Spine` | :x: | +# BattleShipElevator.o +| Symbol | Meaning +| ------------- | ------------- +| :x: | Function has not yet been started or is not matching. +| :white_check_mark: | Function is completed. + + +# 13 / 13 Completed -- (100.0%) +# BattleShipElevator.o +| Symbol | Decompiled? | +| ------------- | ------------- | +| `__ct__18BattleShipElevatorFPCc` | :white_check_mark: | +| `init__18BattleShipElevatorFRC12JMapInfoIter` | :white_check_mark: | +| `exeMove__18BattleShipElevatorFv` | :white_check_mark: | +| `control__18BattleShipElevatorFv` | :white_check_mark: | +| `receiveOtherMsg__18BattleShipElevatorFUlP9HitSensorP9HitSensor` | :white_check_mark: | +| `__dt__18BattleShipElevatorFv` | :white_check_mark: | +| `__sinit_\BattleShipElevator_cpp` | :white_check_mark: | +| `__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitFv` | :white_check_mark: | +| `__ct__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveFv` | :white_check_mark: | +| `__ct__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndFv` | :white_check_mark: | +| `execute__Q221NrvBattleShipElevator24BattleShipElevatorNrvEndCFP5Spine` | :white_check_mark: | +| `execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvMoveCFP5Spine` | :white_check_mark: | +| `execute__Q221NrvBattleShipElevator25BattleShipElevatorNrvWaitCFP5Spine` | :white_check_mark: | diff --git a/include/Game/MapObj/BattleShipElevator.hpp b/include/Game/MapObj/BattleShipElevator.hpp new file mode 100644 index 00000000..ee215217 --- /dev/null +++ b/include/Game/MapObj/BattleShipElevator.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include "Game/MapObj/MapObjActor.hpp" + +class BattleShipElevator : public MapObjActor { + public: + BattleShipElevator(const char *); + + virtual ~BattleShipElevator(); + virtual void init(const JMapInfoIter &); + virtual void control(); + virtual bool receiveOtherMsg(u32 msg, HitSensor *pSender, HitSensor *pReceiver); + + void exeMove(); +}; + +namespace NrvBattleShipElevator { + NERVE(BattleShipElevatorNrvWait); + NERVE(BattleShipElevatorNrvMove); + NERVE(BattleShipElevatorNrvEnd); +}; \ No newline at end of file diff --git a/include/Game/Util/DemoUtil.hpp b/include/Game/Util/DemoUtil.hpp index bf0d0994..7cd0bf75 100644 --- a/include/Game/Util/DemoUtil.hpp +++ b/include/Game/Util/DemoUtil.hpp @@ -42,6 +42,8 @@ namespace MR { void requestStartDemoMarioPuppetableWithoutCinmeaFrame(LiveActor *, const char *, const Nerve *, const Nerve *); void requestStartDemoWithoutCinemaFrame(LiveActor *, const char *, const Nerve *, const Nerve *); + void requestStartTimeKeepDemoMarioPuppetable(LiveActor *, const char *, const Nerve *, const Nerve *, const char *); + void requestStartTimeKeepDemo(LiveActor *, const char *, const Nerve *, const Nerve *, const char *); bool isDemoPartLastStep(const char *); diff --git a/source/Game/MapObj/BattleShipElevator.cpp b/source/Game/MapObj/BattleShipElevator.cpp new file mode 100644 index 00000000..20a9ec37 --- /dev/null +++ b/source/Game/MapObj/BattleShipElevator.cpp @@ -0,0 +1,73 @@ +#include "Game/MapObj/BattleShipElevator.hpp" +#include "Game/Map/CollisionParts.hpp" +#include "Game/Util/DemoUtil.hpp" + +BattleShipElevator::BattleShipElevator(const char *pName) : MapObjActor(pName) { + +} + +BattleShipElevator::~BattleShipElevator() { + +} + +void BattleShipElevator::init(const JMapInfoIter &rIter) { + MapObjActor::init(rIter); + MapObjActorInitInfo info; + info.setupHioNode("地形オブジェ"); + info.setupDefaultPos(); + info.setupConnectToScene(); + info.setupEffect(nullptr); + info.setupSound(4); + info.setupRailMover(); + info.setupNerve(&NrvBattleShipElevator::BattleShipElevatorNrvWait::sInstance); + MapObjActor::initialize(rIter, info); +} + +void BattleShipElevator::exeMove() { + if (MR::isFirstStep(this)) { + MR::startSound(this, "SE_OJ_B_SHIP_ELEV_START", -1, -1); + MapObjActor::startMapPartsFunctions(); + } + MR::startLevelSound(this, "SE_OJ_LV_B_SHIP_ELEV_MOVE", -1, -1, -1); + if (!MapObjActorUtil::isRailMoverWorking(this)) { + MR::startSound(this, "SE_OJ_B_SHIP_ELEV_STOP", -1, -1); + setNerve(&NrvBattleShipElevator::BattleShipElevatorNrvEnd::sInstance); + } +} + +void BattleShipElevator::control() { + if (!isNerve(&NrvBattleShipElevator::BattleShipElevatorNrvWait::sInstance)) { + MapObjActor::control(); + } +} + +bool BattleShipElevator::receiveOtherMsg(u32 msg, HitSensor *pSender, HitSensor *pReceiver) { + if (!isNerve(&NrvBattleShipElevator::BattleShipElevatorNrvWait::sInstance)) { + return false; + } + + if (MR::isMsgFloorTouch(msg)) { + if (MR::isOnPlayer(getSensor("body"))) { + MR::requestStartTimeKeepDemoMarioPuppetable(this, "エレベーター上昇", &NrvBattleShipElevator::BattleShipElevatorNrvMove::sInstance, nullptr, nullptr); + } + } + + return false; +} + +namespace NrvBattleShipElevator { + INIT_NERVE(BattleShipElevatorNrvWait); + INIT_NERVE(BattleShipElevatorNrvMove); + INIT_NERVE(BattleShipElevatorNrvEnd); + + void BattleShipElevatorNrvWait::execute(Spine *pSpine) const { + } + + void BattleShipElevatorNrvMove::execute(Spine *pSpine) const { + BattleShipElevator* planet = reinterpret_cast(pSpine->mExecutor); + planet->exeMove(); + } + + void BattleShipElevatorNrvEnd::execute(Spine *pSpine) const { + } +}; \ No newline at end of file