summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-05-25 21:36:15 +0200
committerGitHub <noreply@github.com>2025-05-25 21:36:15 +0200
commit018ef1971cd53aa8e78154789bcf6cac2f19b603 (patch)
tree1b0e38e71b0b78c20c122c708366efdf400e69aa /src
parentc1226361edfd15e1b96ae529512e0f30a974d8fa (diff)
parent2c23e69524ba5330c9add666aee12e772876ca3f (diff)
Merge pull request #179 from Orstedra/d_t_gate_to_ground
d_t_gate_to_ground OK
Diffstat (limited to 'src')
-rw-r--r--src/REL/d/t/d_t_gate_to_ground.cpp78
1 files changed, 78 insertions, 0 deletions
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;
+}