diff --git a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt index 81df6ac8..00eb2edf 100644 --- a/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt +++ b/config/SOUE01/rels/d_t_gate_to_groundNP/symbols.txt @@ -2,15 +2,15 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dTgGateToGround_c_classInit__Fv = .text:0x00000070; // type:function size:0x5C -TgGateToGround__init = .text:0x000000D0; // type:function size:0x7C -fn_205_150 = .text:0x00000150; // type:function size:0x8 -TgGateToGround__update = .text:0x00000160; // type:function size:0x138 -TgGateToGround__updateInEvent = .text:0x000002A0; // type:function size:0x44 -fn_205_2F0 = .text:0x000002F0; // type:function size:0x8 +create__17dTgGateToGround_cFv = .text:0x000000D0; // type:function size:0x7C +doDelete__17dTgGateToGround_cFv = .text:0x00000150; // type:function size:0x8 +actorExecute__17dTgGateToGround_cFv = .text:0x00000160; // type:function size:0x138 +actorExecuteInEvent__17dTgGateToGround_cFv = .text:0x000002A0; // type:function size:0x44 +draw__17dTgGateToGround_cFv = .text:0x000002F0; // type:function size:0x8 __dt__17dTgGateToGround_cFv = .text:0x00000300; // type:function size:0x70 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_205_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float +@20562 = .rodata:0x00000000; // type:object size:0x4 data:float scope:local g_profile_GATE2GND_TAG = .data:0x00000000; // type:object size:0x10 -lbl_205_data_10 = .data:0x00000010; // type:object size:0xC -TgGateToGround__vtable = .data:0x0000001C; // type:object size:0x74 +@20583 = .data:0x00000010; // type:object size:0xC scope:local +__vt__17dTgGateToGround_c = .data:0x0000001C; // type:object size:0x74 diff --git a/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt b/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt index 7d232197..28561637 100644 --- a/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt +++ b/config/SOUE01/rels/d_t_heat_resistNP/symbols.txt @@ -9,6 +9,6 @@ draw__15dTgHeatResist_cFv = .text:0x000001B0; // type:function size:0x8 __dt__15dTgHeatResist_cFv = .text:0x000001C0; // type:function size:0x5C _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_444_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float +@19473 = .rodata:0x00000000; // type:object size:0x4 data:float g_profile_TAG_HEAT_RESIST = .data:0x00000000; // type:object size:0x10 -TgHeatResist__vtable = .data:0x00000010; // type:object size:0x74 +__vt__15dTgHeatResist_c = .data:0x00000010; // type:object size:0x74 diff --git a/configure.py b/configure.py index 9abbc2b9..fd6000f6 100644 --- a/configure.py +++ b/configure.py @@ -2470,7 +2470,7 @@ config.libs = [ Rel(NonMatching, "d_t_effect_gen", "REL/d/t/d_t_effect_gen.cpp"), Rel(Matching, "d_t_fairytag", "REL/d/t/d_t_fairytag.cpp"), Rel(NonMatching, "d_t_fence_synchronizer", "REL/d/t/d_t_fence_synchronizer.cpp"), - Rel(NonMatching, "d_t_gate_to_ground", "REL/d/t/d_t_gate_to_ground.cpp"), + Rel(Matching, "d_t_gate_to_ground", "REL/d/t/d_t_gate_to_ground.cpp"), Rel(Matching, "d_t_gekotag", "REL/d/t/d_t_gekotag.cpp"), Rel(Matching, "d_t_genki_dws_tgt", "REL/d/t/d_t_genki_dws_tgt.cpp"), Rel(NonMatching, "d_t_group_summon", "REL/d/t/d_t_group_summon.cpp"), diff --git a/include/d/d_camera.h b/include/d/d_camera.h index ad114811..d641e098 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -6,6 +6,7 @@ extern "C" bool fn_80081FE0(void *, const char *); extern "C" bool fn_800918E0(void *, s32, s16); +extern "C" void fn_80080960(void *, s32, s32, s8, s32); class dCamera_c : public dBase_c { public: diff --git a/include/d/t/d_t_gate_to_ground.h b/include/d/t/d_t_gate_to_ground.h index 5420b738..880417ea 100644 --- a/include/d/t/d_t_gate_to_ground.h +++ b/include/d/t/d_t_gate_to_ground.h @@ -1,14 +1,29 @@ #ifndef D_T_GATE_TO_GROUND_H #define D_T_GATE_TO_GROUND_H -#include "d/a/d_a_base.h" +#include "common.h" +#include "d/t/d_tg.h" +#include "m/m_mtx.h" +#include "toBeSorted/actor_event.h" -class dTgGateToGround_c : public dAcBase_c { +class dTgGateToGround_c : public dTg_c { public: - dTgGateToGround_c() {} + dTgGateToGround_c() : mEventRelated(*this, nullptr) {} virtual ~dTgGateToGround_c() {} + virtual int create() override; + virtual int doDelete() override; // fn_205_150 + virtual int actorExecute() override; + virtual int actorExecuteInEvent() override; + virtual int draw() override; // fn_205_2F0 + private: + /* 0xfc */ ActorEventRelated mEventRelated; + /* 0x14c */ mMtx_c matrix; + /* 0x17c */ s32 delayFrames; + /* 0x180 */ s16 params_FF_FF_00_00; + /* 0x182 */ s8 params_00_00_FF_00; + /* 0x183 */ s8 params_00_00_00_FF; }; #endif diff --git a/src/REL/d/t/d_t_gate_to_ground.cpp b/src/REL/d/t/d_t_gate_to_ground.cpp index 3be6d6da..fb2dfa6a 100644 --- a/src/REL/d/t/d_t_gate_to_ground.cpp +++ b/src/REL/d/t/d_t_gate_to_ground.cpp @@ -1,3 +1,81 @@ #include "d/t/d_t_gate_to_ground.h" +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/d_camera.h" +#include "d/d_sc_game.h" +#include "d/flag/storyflag_manager.h" +#include "f/f_base.h" +#include "toBeSorted/actor_event.h" +#include "toBeSorted/area_math.h" +#include "toBeSorted/event.h" + SPECIAL_ACTOR_PROFILE(GATE2GND_TAG, dTgGateToGround_c, fProfile::GATE2GND_TAG, 0x22, 0, 0); + +int dTgGateToGround_c::create() { + matrixCreateFromPosRotYScale(matrix, position, rotation.y, mScale, nullptr, 0.0f); + + delayFrames = 0; + + union { + u32 val; + struct { + u16 a; + u8 b; + u8 c; + }; + } v; + v.val = params; + params_FF_FF_00_00 = v.a; + params_00_00_FF_00 = v.b; + params_00_00_00_FF = v.c; + + return SUCCEEDED; +} + +int dTgGateToGround_c::doDelete() { + return SUCCEEDED; +} + +int dTgGateToGround_c::actorExecute() { + dAcPy_c *player; + dCamera_c *cam; + + if (params_FF_FF_00_00 != -1 && StoryflagManager::sInstance->getCounterOrFlag(params_FF_FF_00_00) == 0) { + return SUCCEEDED; + } + + player = dAcPy_c::LINK; + + if (checkIfVec3fInMatrix(matrix, player->position)) { + if (player->getRidingActorType() != dAcPy_c::RIDING_LOFTWING) { + if (delayFrames > 15) { + Event e("CloudHole", 100, 0, nullptr, nullptr); + mEventRelated.scheduleEvent(e, 0); + } else { + delayFrames++; + } + } else { + if (params_00_00_00_FF != -1) { + cam = dScGame_c::getCamera(0); + fn_80080960(cam->getField_0xD98(), params_00_00_00_FF, 0, roomid, 0); + } + delayFrames = 0; + } + } else { + delayFrames = 0; + } + + return SUCCEEDED; +} + +int dTgGateToGround_c::actorExecuteInEvent() { + if (mEventRelated.isThisActorInEvent() != 0) { + mEventRelated.advanceNext(); + } + return SUCCEEDED; +} + +int dTgGateToGround_c::draw() { + return SUCCEEDED; +}