Decompile manager33

This commit is contained in:
octorock
2021-09-18 11:30:41 +02:00
parent fe1e97f8ef
commit 7a70c65680
2 changed files with 31 additions and 86 deletions
+31 -1
View File
@@ -1,3 +1,33 @@
#include "manager.h"
#include "room.h"
#include "player.h"
#include "audio.h"
#include "object.h"
ASM_FUNC("asm/non_matching/manager33/Manager33_Main.inc", void Manager33_Main(Manager* this))
void Manager33_Main(Manager* this) {
RoomControls* roomControls = &gRoomControls;
u32 a = roomControls->roomOriginX + 0x1f8;
u32 x = (a - gPlayerEntity.x.HALF.HI) + 0x10;
u32 b = roomControls->roomOriginY + 0x140;
u32 y = (b - gPlayerEntity.y.HALF.HI) + 0x10;
if (this->action == 0) {
if (x < 0x20 &&
y < 0x20 &&
gPlayerEntity.height.HALF.HI < -0x18 &&
gPlayerState.field_0xa8 == 0x14) {
this->action += 1;
this->unk_0e = 0x5a;
SoundReq(SFX_10A);
}
} else {
if (--this->unk_0e == 0) {
Entity* object = CreateObject(OBJECT_96, 1, 0);
if (object != NULL) {
object->x.HALF.HI = roomControls->roomOriginX + 0x1f8;
object->y.HALF.HI = roomControls->roomOriginY + 0x140;
object->height.HALF.HI = 0xffe8;
}
DeleteThisEntity();
}
}
}