--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1170 lines
50 KiB
C++
1170 lines
50 KiB
C++
#include "classes.h"
|
|
|
|
// 0071f630
|
|
void GridEntity_TrapDoor::BeginBatches()
|
|
{
|
|
uint8_t bVar1;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
LayerState *layer;
|
|
Vector *position;
|
|
Entity *effect;
|
|
char *pcVar2;
|
|
ChallengeParam *challengeParams;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t unk;
|
|
uint8_t extraout_CL_01;
|
|
uint8_t extraout_CL_02;
|
|
uint8_t extraout_CL_03;
|
|
uint8_t extraout_CL_04;
|
|
char *freeBlock;
|
|
uint32_t uVar3;
|
|
int iVar4;
|
|
Vector local_54;
|
|
int local_4c;
|
|
char isHardMode;
|
|
char *tmpPath [4];
|
|
uint32_t tmpPathSize;
|
|
uint32_t tmpPathCapacity;
|
|
std_string anm2Path;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t curses;
|
|
void *room;
|
|
int *roomData;
|
|
ANM2 *sprite;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afcc85;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(&(&anm2Path)[1]._size);
|
|
ExceptionList = &local_10;
|
|
local_4c = g_game->_stage;
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
isHardMode = '\x01';
|
|
}
|
|
else {
|
|
isHardMode = '\0';
|
|
}
|
|
uVar3 = g_game->_debugCurses;
|
|
curses = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
iVar4 = local_4c;
|
|
if (((~preventedCurses & (forcedCurses | uVar3 | curses) & 2) != 0) && (isHardMode == '\0')) {
|
|
iVar4 = local_4c + 1;
|
|
}
|
|
local_4c = g_game->_currentRoomIdx;
|
|
if (((iVar4 == 9) && (local_4c == -9)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54.y) + 0x18)) == 1)) {
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x1a;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/VoidTrapdoor.anm2",0x1b);
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar3 = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar3 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar3);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_54.y) + 8)) = 1;
|
|
goto LAB_0071feb0;
|
|
}
|
|
room = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 8)) == 0x1b) {
|
|
sprite = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40));
|
|
iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x10));
|
|
if (iVar4 != 0) {
|
|
iVar4 = *GHIDRA_CAST<int *>((iVar4 + 0x10));
|
|
if (iVar4 == 1) {
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x1f;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/trapdoor_downpour.anm2",0x20);
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Load(&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (anm2Path._capacity < 0x10) goto LAB_0071feb0;
|
|
uVar3 = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar3 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
goto LAB_0071fb7a;
|
|
}
|
|
if (iVar4 == 2) {
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x1c;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/trapdoor_mines.anm2",0x1d);
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Load(&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar3 = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar3 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar3);
|
|
}
|
|
if (1 < GHIDRA_UINT((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))->_layerCount)) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x1));
|
|
layer->_visible = 0;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Closed"),0);
|
|
uVar3 = Random();
|
|
position = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_54.y))))->GridEntity::Position(&local_54);
|
|
effect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x8b,position,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3);
|
|
iVar4 = *GHIDRA_CAST<int *>(effect);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(effect[1])) + 0x40)))) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54.y) + 0x24));
|
|
(**(code **)(iVar4 + 0xc))();
|
|
goto LAB_0071feb0;
|
|
}
|
|
anm2Path._size = iVar4 - 3;
|
|
if (anm2Path._size == 0) {
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(iVar4 + 0x2d);
|
|
anm2Path._size = 0x20;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/trapdoor_mausoleum.anm2",0x21);
|
|
local_8 = 3;
|
|
goto LAB_0071f766;
|
|
}
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x1e;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/Door_11_TrapDoor.anm2",0x1f);
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Load(&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (anm2Path._capacity < 0x10) goto LAB_0071feb0;
|
|
uVar3 = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
uVar3 = anm2Path._capacity + 0x24;
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
if (GHIDRA_CAST<char *>(0x1f) <
|
|
GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(*GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4))))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 8)) != 5) ||
|
|
(roomData = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x10)), *roomData != 0)) ||
|
|
(roomData[4] != 0x58)) {
|
|
if (((1 < iVar4 - 6U) || (isHardMode != '\0')) &&
|
|
(((iVar4 != 3 || (isHardMode == '\0')) && (local_4c != -8)))) {
|
|
tmpPathSize = 0;
|
|
tmpPathCapacity = 0xf;
|
|
tmpPath[0] = GHIDRA_CAST<char *>(0x0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(tmpPath))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_11_TrapDoor.anm2"),0x1e);
|
|
local_8 = 9;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(GHIDRA_CAST<std_string *>(tmpPath),1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < tmpPathCapacity) {
|
|
uVar3 = tmpPathCapacity + 1;
|
|
freeBlock = tmpPath[0];
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>((tmpPath[0] + -4));
|
|
uVar3 = tmpPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < tmpPath[0] + (-4 - GHIDRA_INT(freeBlock))) goto LAB_0071f7a4;
|
|
}
|
|
operator_delete(freeBlock,uVar3);
|
|
}
|
|
tmpPathSize = 0;
|
|
tmpPathCapacity = 0xf;
|
|
tmpPath[0] = GHIDRA_CAST<char *>((GHIDRA_UINT(tmpPath[0]) & 0xffffff00));
|
|
goto LAB_0071feb0;
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x1e;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/Door_11_Wombhole.anm2",0x1f);
|
|
local_8 = 6;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(&anm2Path,0);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar3 = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar3 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock)))))
|
|
goto LAB_0071f7a4;
|
|
}
|
|
operator_delete(freeBlock,uVar3);
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) & 0xffffff00;
|
|
if (local_4c == -8) {
|
|
tmpPath[0] = msvc::_Allocate(0x30);
|
|
tmpPathSize = 0x22;
|
|
tmpPathCapacity = 0x2f;
|
|
builtin_strncpy(tmpPath[0],"gfx/grid/door_11_wombhole_blue.png",0x23);
|
|
local_8 = 7;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(local_54.y) + 0x40)))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(tmpPath));
|
|
local_8 = 0xffffffff;
|
|
bVar1 = extraout_CL;
|
|
if (0xf < tmpPathCapacity) {
|
|
uVar3 = tmpPathCapacity + 1;
|
|
freeBlock = tmpPath[0];
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>((tmpPath[0] + -4));
|
|
pcVar2 = tmpPath[0] + (-4 - GHIDRA_INT(freeBlock));
|
|
joined_r0x0071fe08:
|
|
uVar3 = tmpPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < pcVar2) {
|
|
LAB_0071f7a4:
|
|
local_8 = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
LAB_0071fe0e:
|
|
local_8 = 0xffffffff;
|
|
operator_delete(freeBlock,uVar3);
|
|
bVar1 = extraout_CL_04;
|
|
}
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage();
|
|
if (bVar1 == 0) {
|
|
if (iVar4 == 7) {
|
|
bVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsAltPath();
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::LoadGraphics(unk);
|
|
goto LAB_0071feb0;
|
|
}
|
|
}
|
|
else if (((iVar4 != 6) &&
|
|
((bVar1 = extraout_CL_00, iVar4 != 5 ||
|
|
(uVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(2), bVar1 = extraout_CL_01,
|
|
uVar3 == 0)))) ||
|
|
(challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams(), bVar1 = extraout_CL_02,
|
|
challengeParams->_pathType != 2)) goto LAB_0071fe18;
|
|
}
|
|
tmpPath[0] = msvc::_Allocate(0x20);
|
|
tmpPathSize = 0x1f;
|
|
tmpPathCapacity = 0x1f;
|
|
builtin_strncpy(tmpPath[0],"gfx/grid/door_11_corpsehole.png",0x20);
|
|
local_8 = 8;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(local_54.y) + 0x40)))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(tmpPath));
|
|
local_8 = 0xffffffff;
|
|
bVar1 = extraout_CL_03;
|
|
if (0xf < tmpPathCapacity) {
|
|
uVar3 = tmpPathCapacity + 1;
|
|
freeBlock = tmpPath[0];
|
|
if (0xfff < uVar3) {
|
|
freeBlock = *GHIDRA_CAST<char **>((tmpPath[0] + -4));
|
|
pcVar2 = tmpPath[0] + (-4 - GHIDRA_INT(freeBlock));
|
|
goto joined_r0x0071fe08;
|
|
}
|
|
goto LAB_0071fe0e;
|
|
}
|
|
}
|
|
LAB_0071fe18:
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::LoadGraphics(bVar1);
|
|
goto LAB_0071feb0;
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
anm2Path._size = 0x21;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/trapdoor_corpse_big.anm2",0x22);
|
|
local_8 = 5;
|
|
LAB_0071f766:
|
|
anm2Path._capacity = 0x2f;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (anm2Path._capacity < 0x10) goto LAB_0071feb0;
|
|
uVar3 = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
uVar3 = anm2Path._capacity + 0x24;
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
if (GHIDRA_CAST<char *>(0x1f) <
|
|
GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(*GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4)))))))
|
|
goto LAB_0071f7a4;
|
|
}
|
|
}
|
|
LAB_0071fb7a:
|
|
local_8 = 0xffffffff;
|
|
operator_delete(freeBlock,uVar3);
|
|
LAB_0071feb0:
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_54.y) + 0xc)) = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Closed"),0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0071fef0
|
|
void GridEntity_TrapDoor::Update()
|
|
{
|
|
uint32_t *puVar1;
|
|
char *pcVar2;
|
|
uint64_t qVar3;
|
|
undefined3 uVar4;
|
|
uint8_t bVar5;
|
|
Entity_Player *pEVar6;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
int iVar7;
|
|
uint8_t *animNameCursor;
|
|
uint8_t *pbVar8;
|
|
char *******pppppppcVar9;
|
|
uint32_t *playerSlot;
|
|
ChallengeParam *challengeParams;
|
|
uint32_t preventedCurses;
|
|
uint32_t uVar11;
|
|
int *piVar12;
|
|
char *pcVar13;
|
|
void *pvVar14;
|
|
Level *this_00;
|
|
Game *this_01;
|
|
undefined3 extraout_var;
|
|
uint32_t extraout_EDX;
|
|
int extraout_EDX_00;
|
|
int extraout_EDX_01;
|
|
uint64_t *allocatedBytes;
|
|
Game *game;
|
|
GridEntity_TrapDoor *trapDoor;
|
|
PlayerManager *playerManager;
|
|
int iVar15;
|
|
uint32_t uVar16;
|
|
bool bVar17;
|
|
float deltaY;
|
|
float deltaX;
|
|
double dVar18;
|
|
EntityList_EL nearbyEntities;
|
|
float local_58;
|
|
uint32_t local_54;
|
|
GridEntity_TrapDoor *savedTrapDoor;
|
|
Vector local_4c;
|
|
Entity_Player *local_44;
|
|
float local_40;
|
|
int *local_3c;
|
|
char local_35;
|
|
int *local_34;
|
|
char local_2d;
|
|
char *******spritePath [4];
|
|
uint32_t spritePathSize;
|
|
uint32_t spritePathCapacity;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
char ******local_8;
|
|
Manager *manager;
|
|
RoomDescriptor *roomDesc;
|
|
|
|
game = g_game;
|
|
local_8 = GHIDRA_CAST<char ******>(0xffffffff);
|
|
puStack_c = &LAB_00afccc9;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((spritePath + 10));
|
|
ExceptionList = &local_10;
|
|
local_54 = 0;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x154)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x154)))) + 1;
|
|
iVar15 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
local_4c.x = (float)(this->_gridIndex % iVar15) * 40.0 + 40.0;
|
|
local_4c.y = (float)(this->_gridIndex / iVar15) * 40.0 + 120.0;
|
|
savedTrapDoor = this;
|
|
local_44 = Game::GetNearestPlayerEx(&local_4c,1,0,0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = false;
|
|
local_40 = 1e+09;
|
|
local_58 = 21.0;
|
|
pvVar14 = g_game->_room;
|
|
if ((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar14) + 8)) == 5) &&
|
|
(piVar12 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar14) + 4)) + 0x10)), *piVar12 == 0)) &&
|
|
(piVar12[4] == 0x58)) && (this->_varData != 1)) {
|
|
local_35 = '\x01';
|
|
local_58 = 34.0;
|
|
}
|
|
else {
|
|
local_35 = '\0';
|
|
}
|
|
iVar15 = this->_gridIndex;
|
|
if (local_44 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_3c = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar14) + 0xc));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = extraout_var;
|
|
}
|
|
else {
|
|
local_3c = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar14) + 0xc));
|
|
deltaY = ((float)(iVar15 / GHIDRA_INT(local_3c)) * 40.0 + 120.0) - (local_44->_pos).y;
|
|
deltaX = ((float)(iVar15 % GHIDRA_INT(local_3c)) * 40.0 + 40.0) - (local_44->_pos).x;
|
|
local_40 = sqrtf(deltaY * deltaY + deltaX * deltaX);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = local_40 < 50.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = (undefined3)(GHIDRA_UINT(extraout_EDX) >> 8);
|
|
}
|
|
if (((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(1 < GHIDRA_UINT((*GHIDRA_CAST<int *>((g_manager + 1)) - g_manager->_netplayManager >> 2)))) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) < 2 && ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar14) + 8)) == 5 && (local_35 == '\0'))))))
|
|
{
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = (undefined3)(GHIDRA_UINT(this) >> 8);
|
|
if (((bool)(char)local_34 == false) && (0x95 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x154)))))) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = false;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = true;
|
|
}
|
|
}
|
|
uVar4 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1)));
|
|
bVar17 = (bool)(char)local_34;
|
|
local_4c.x = (float)(iVar15 % GHIDRA_INT(local_3c)) * 40.0 + 40.0;
|
|
local_4c.y = (float)(iVar15 / GHIDRA_INT(local_3c)) * 40.0 + 120.0;
|
|
EntityList::QueryRadius(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar14) + 0x1218)),&nearbyEntities,&local_4c,20.0,1);
|
|
preventedCurses = 0;
|
|
local_8 = GHIDRA_CAST<char ******>(0x0);
|
|
if (nearbyEntities._size != 0) {
|
|
do {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = uVar4;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = bVar17;
|
|
if ((bool)(char)local_34 != false) break;
|
|
iVar15 = *GHIDRA_CAST<int *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x4))) + preventedCurses * 4));
|
|
if (*GHIDRA_CAST<int *>((iVar15 + 0x28)) == 3) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = false;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = 0;
|
|
if (*GHIDRA_CAST<int *>((iVar15 + 0x2c)) == 900) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = true;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = 0;
|
|
}
|
|
}
|
|
preventedCurses = preventedCurses + 1;
|
|
bVar17 = (bool)(char)local_34;
|
|
uVar4 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1)));
|
|
} while (preventedCurses < GHIDRA_UINT(nearbyEntities._size));
|
|
}
|
|
if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) &&
|
|
(pEVar6 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x226,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
pEVar6 != GHIDRA_CAST<Entity_Player *>(0x0))) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) != 3)) {
|
|
iVar15 = g_game->_stage;
|
|
preventedCurses = g_game->_debugCurses;
|
|
uVar11 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
game = g_game;
|
|
iVar7 = iVar15 + 1;
|
|
if ((~preventedCurses & (forcedCurses | preventedCurses | uVar11) & 2) == 0) {
|
|
iVar7 = iVar15;
|
|
}
|
|
if (iVar7 == 6) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = GHIDRA_CAST<char ******>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8));
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
roomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(game->_currentDimensionIdx) < 3) {
|
|
roomDesc = game->_roomList + 0x1ff;
|
|
}
|
|
if ((GHIDRA_UINT(roomDesc->Flags) >> 3 & 1) == 0) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = '\x01';
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x1))) = 0;
|
|
}
|
|
}
|
|
game = g_game;
|
|
local_4c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 8));
|
|
if ((GHIDRA_CAST<Entity_Player *>(local_4c.y) == GHIDRA_CAST<Entity_Player *>(0x1b)) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = '\x01';
|
|
}
|
|
local_3c = GHIDRA_CAST<int *>(g_game->_stage);
|
|
if (((0 < GHIDRA_INT(local_3c)) && (GHIDRA_INT(local_3c) < 7)) &&
|
|
((g_game->_gameStateFlags & 0x1000000000000) != 0)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_34)) + 0x0))) = '\x01';
|
|
}
|
|
if ((g_game->_dailyChallenge)._id == 0) {
|
|
pvVar14 = (g_manager->_challengeParams)._begin;
|
|
uVar11 = (GHIDRA_INT((g_manager->_challengeParams)._end) - GHIDRA_INT(pvVar14)) / 0xa4 - 1;
|
|
preventedCurses = -GHIDRA_UINT((g_game->_challenge != 0)) & g_game->_challenge;
|
|
if (uVar11 <= preventedCurses) {
|
|
preventedCurses = uVar11;
|
|
}
|
|
challengeParams = GHIDRA_CAST<ChallengeParam *>((preventedCurses * 0xa4 + GHIDRA_INT(pvVar14)));
|
|
}
|
|
else {
|
|
challengeParams = &(g_game->_dailyChallenge)._params;
|
|
}
|
|
if (challengeParams->_pathType == 2) {
|
|
preventedCurses = g_game->_curses;
|
|
uVar11 = g_game->_debugCurses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
piVar12 = GHIDRA_CAST<int *>((GHIDRA_INT(local_3c) + 1));
|
|
if ((~preventedCurses & (forcedCurses | preventedCurses | uVar11) & 2) == 0) {
|
|
piVar12 = local_3c;
|
|
}
|
|
local_3c = piVar12;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x1b) {
|
|
preventedCurses = game->_curses;
|
|
uVar11 = game->_debugCurses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
preventedCurses = (~preventedCurses & (forcedCurses | preventedCurses | uVar11)) >> 1;
|
|
if ((local_3c == GHIDRA_CAST<int *>(0x2)) || (((preventedCurses & 1) != 0 && (local_3c == GHIDRA_CAST<int *>(0x1))))) {
|
|
bVar17 = true;
|
|
}
|
|
else {
|
|
bVar17 = false;
|
|
}
|
|
if ((local_3c == GHIDRA_CAST<int *>(&DAT_00000004)) || (((preventedCurses & 1) != 0 && (local_3c == GHIDRA_CAST<int *>(0x3))))) {
|
|
local_2d = '\x01';
|
|
}
|
|
else {
|
|
local_2d = '\0';
|
|
}
|
|
if ((bVar17) && ((game->_stageType == 4 || (game->_stageType == 5)))) {
|
|
pEVar6 = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x272,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if (pEVar6 == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_0072040a;
|
|
game = g_game;
|
|
}
|
|
if ((local_2d == '\0') ||
|
|
(((game->_stageType != 4 && (game->_stageType != 5)) ||
|
|
(pEVar6 = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x273,GHIDRA_CAST<RNG **>(&game->_playerManager),1),
|
|
pEVar6 != GHIDRA_CAST<Entity_Player *>(0x0))))) goto LAB_00720400;
|
|
}
|
|
else {
|
|
if (piVar12 != GHIDRA_CAST<int *>(&DAT_00000006)) {
|
|
preventedCurses = game->_curses;
|
|
uVar11 = game->_debugCurses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if (((~preventedCurses & (forcedCurses | preventedCurses | uVar11) & 2) == 0) ||
|
|
(local_3c != GHIDRA_CAST<int *>(&DAT_00000005))) goto LAB_00720400;
|
|
}
|
|
if (((game->_stageType != 4) && (game->_stageType != 5)) ||
|
|
(((bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsMausoleumHeartStage(), bVar5 != 0 ||
|
|
(GHIDRA_CAST<Entity_Player *>(local_4c.y) == GHIDRA_CAST<Entity_Player *>(0x12))) ||
|
|
(GHIDRA_CAST<Entity_Player *>(local_4c.y) == GHIDRA_CAST<Entity_Player *>(0x3))))) goto LAB_00720400;
|
|
}
|
|
LAB_0072040a:
|
|
trapDoor = savedTrapDoor;
|
|
piVar12 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedTrapDoor)) + 0xc))));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedTrapDoor)) + 0xc)))) != 0) goto LAB_00720515;
|
|
pbVar8 = (savedTrapDoor->_sprite)._animState._animData;
|
|
local_34 = piVar12;
|
|
if (pbVar8 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00720469:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&savedTrapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Closed"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind();
|
|
(trapDoor->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameCursor = pbVar8;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Closed";
|
|
do {
|
|
bVar5 = *animNameCursor;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_00720453:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto LAB_00720458;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameCursor[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_00720453;
|
|
animNameCursor = animNameCursor + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
LAB_00720458:
|
|
if ((preventedCurses != 0) ||
|
|
((pbVar8[0x34] != 0 && ((savedTrapDoor->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_00720469;
|
|
}
|
|
piVar12 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((trapDoor)) + 0xc))));
|
|
LAB_0072048e:
|
|
game = g_game;
|
|
}
|
|
else {
|
|
LAB_00720400:
|
|
if ((char)local_34 != '\0') goto LAB_0072040a;
|
|
piVar12 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedTrapDoor)) + 0xc))));
|
|
LAB_00720515:
|
|
trapDoor = savedTrapDoor;
|
|
local_3c = piVar12;
|
|
local_34 = piVar12;
|
|
if (*piVar12 == 1) goto LAB_0072048e;
|
|
game = g_game;
|
|
if (g_game->_challenge != 0x1f) {
|
|
if ((savedTrapDoor->_sprite)._animState._animData == (void *)0x0) {
|
|
LAB_007205c9:
|
|
pbVar8 = (savedTrapDoor->_sprite)._animState._animData;
|
|
if (pbVar8 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameCursor = pbVar8;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Open Animation";
|
|
do {
|
|
bVar5 = *animNameCursor;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_00720600:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto LAB_00720605;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameCursor[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_00720600;
|
|
animNameCursor = animNameCursor + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
LAB_00720605:
|
|
if ((preventedCurses == 0) &&
|
|
((pbVar8[0x34] == 0 || ((savedTrapDoor->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_00720642;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&savedTrapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Open Animation"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind();
|
|
(trapDoor->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar8 = (savedTrapDoor->_sprite)._animState._animData;
|
|
if ((savedTrapDoor->_sprite)._animState._isPlaying == 0) {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Open Animation";
|
|
do {
|
|
bVar5 = *pbVar8;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_007205c0:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto joined_r0x007205c7;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar8[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_007205c0;
|
|
pbVar8 = pbVar8 + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Open Animation";
|
|
do {
|
|
bVar5 = *pbVar8;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_00720580:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto joined_r0x007205c7;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar8[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_00720580;
|
|
pbVar8 = pbVar8 + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
}
|
|
joined_r0x007205c7:
|
|
if (preventedCurses != 0) goto LAB_007205c9;
|
|
}
|
|
LAB_00720642:
|
|
game = g_game;
|
|
if (((trapDoor->_sprite)._animState._animData == (void *)0x0) ||
|
|
((trapDoor->_sprite)._animState._isPlaying == 0)) {
|
|
LAB_00720701:
|
|
local_2d = '\0';
|
|
}
|
|
else {
|
|
pbVar8 = (trapDoor->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Open Animation";
|
|
do {
|
|
bVar5 = *pbVar8;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_00720690:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto LAB_00720695;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar8[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_00720690;
|
|
pbVar8 = pbVar8 + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
LAB_00720695:
|
|
if (preventedCurses != 0) goto LAB_00720701;
|
|
local_4c.y = (trapDoor->_sprite)._animState._animFrame;
|
|
dVar18 = floor((double)local_4c.y);
|
|
local_4c.y = (float)dVar18;
|
|
if (GHIDRA_INT(dVar18) != 1) goto LAB_00720701;
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(spritePath))))->msvc::string::string(&trapDoor->_sprite);
|
|
local_54 = 3;
|
|
pppppppcVar9 = GHIDRA_CAST<char *******>(spritePath);
|
|
if (0xf < spritePathCapacity) {
|
|
pppppppcVar9 = spritePath[0];
|
|
}
|
|
iVar15 = _strnicmp(GHIDRA_CAST<char *>(pppppppcVar9),"gfx/grid/Door_11_TrapDoor",0x19);
|
|
local_2d = '\x01';
|
|
game = g_game;
|
|
if (iVar15 != 0) goto LAB_00720701;
|
|
}
|
|
if ((local_54 & 1) != 0) {
|
|
if (0xf < spritePathCapacity) {
|
|
preventedCurses = spritePathCapacity + 1;
|
|
pppppppcVar9 = spritePath[0];
|
|
if (0xfff < preventedCurses) {
|
|
pppppppcVar9 = GHIDRA_CAST<char *******>(spritePath[0][-1]);
|
|
preventedCurses = spritePathCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(spritePath[0]) + (-4 - GHIDRA_INT(pppppppcVar9))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppppcVar9,preventedCurses);
|
|
game = g_game;
|
|
}
|
|
spritePathSize = 0;
|
|
spritePathCapacity = 0xf;
|
|
spritePath[0] = GHIDRA_CAST<char *******>((GHIDRA_UINT(spritePath[0]) & 0xffffff00));
|
|
}
|
|
manager = g_manager;
|
|
if (local_2d != '\0') {
|
|
local_54 = 0x395;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_54));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_54,1.0,2,0,1.0,0.0);
|
|
game = g_game;
|
|
}
|
|
piVar12 = local_3c;
|
|
if (((trapDoor->_sprite)._animState._animData == (void *)0x0) ||
|
|
((trapDoor->_sprite)._animState._isPlaying == 0)) {
|
|
local_34 = local_3c;
|
|
*local_3c = 1;
|
|
}
|
|
else {
|
|
local_34 = local_3c;
|
|
}
|
|
}
|
|
}
|
|
if ((game->_difficulty == 2) || (game->_difficulty == 3)) {
|
|
if (((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x44)) & 1) == 0) &&
|
|
(trapDoor->_spawnFrame <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x11f0)))) {
|
|
pbVar8 = (trapDoor->_sprite)._animState._animData;
|
|
if (pbVar8 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_007207ef:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&trapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Closed"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind();
|
|
(trapDoor->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
game = g_game;
|
|
}
|
|
else {
|
|
animNameCursor = pbVar8;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Closed";
|
|
do {
|
|
bVar5 = *animNameCursor;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_007207d1:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto LAB_007207d6;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameCursor[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_007207d1;
|
|
animNameCursor = animNameCursor + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
LAB_007207d6:
|
|
if ((preventedCurses != 0) ||
|
|
((pbVar8[0x34] != 0 && ((trapDoor->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_007207ef;
|
|
}
|
|
*local_34 = 0;
|
|
piVar12 = local_34;
|
|
}
|
|
}
|
|
if (*piVar12 == 1) {
|
|
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsMausoleumHeartStage();
|
|
if ((bVar5 == 0) || (trapDoor->_varData != 0)) {
|
|
pbVar8 = (trapDoor->_sprite)._animState._animData;
|
|
if (pbVar8 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameCursor = pbVar8;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar8 + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
pcVar13 = "Opened";
|
|
do {
|
|
bVar5 = *animNameCursor;
|
|
bVar17 = bVar5 < (uint8_t)*pcVar13;
|
|
if (bVar5 != *pcVar13) {
|
|
LAB_007208b0:
|
|
preventedCurses = -GHIDRA_UINT(bVar17) | 1;
|
|
goto LAB_007208b5;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameCursor[1];
|
|
bVar17 = bVar5 < (uint8_t)pcVar13[1];
|
|
if (bVar5 != pcVar13[1]) goto LAB_007208b0;
|
|
animNameCursor = animNameCursor + 2;
|
|
pcVar13 = pcVar13 + 2;
|
|
} while (bVar5 != 0);
|
|
preventedCurses = 0;
|
|
LAB_007208b5:
|
|
if ((preventedCurses == 0) &&
|
|
((pbVar8[0x34] == 0 || ((trapDoor->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_007208e8;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&trapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Opened"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind();
|
|
(trapDoor->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&trapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Opened"),1);
|
|
if (((bVar5 != 0) && ((trapDoor->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0),
|
|
(trapDoor->_sprite)._animState._animData != (void *)0x0)) {
|
|
(trapDoor->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
LAB_007208e8:
|
|
piVar12 = local_34;
|
|
game = g_game;
|
|
}
|
|
pEVar6 = local_44;
|
|
manager = g_manager;
|
|
if (((local_44 == GHIDRA_CAST<Entity_Player *>(0x0)) || (local_58 <= local_40)) || (*piVar12 != 1))
|
|
goto LAB_00720a92;
|
|
if ((local_44->_isPlayingExtraAnimation != 0) || (local_44->_isPlayingItemAnimation != 0)) {
|
|
if ((local_44->_heldEntity == (void *)0x0) ||
|
|
(local_44->_heldEntity != (void *)local_44->_twinPlayer)) goto LAB_00720a92;
|
|
}
|
|
if (local_35 != '\0') {
|
|
local_40 = 1.47417e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_40));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_40),1.0,2,0,1.0,0.0);
|
|
game = g_game;
|
|
g_game->_leaveDoor = -1;
|
|
Game::StartRoomTransition(game,-10,-1,0x16,local_44,-1);
|
|
preventedCurses = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
|
|
2 != 0) {
|
|
do {
|
|
pvVar14 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar14) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar14 = (playerManager->_playerList)._end;
|
|
game = g_game;
|
|
}
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (preventedCurses < GHIDRA_UINT((GHIDRA_INT(pvVar14) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + preventedCurses;
|
|
}
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
|
if (pEVar6->_variant == 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar6)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
|
game = g_game;
|
|
iVar15 = savedTrapDoor->_gridIndex;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
(pEVar6->_moveToTarget).x = (float)(iVar15 % iVar7) * 40.0 + 40.0;
|
|
(pEVar6->_moveToTarget).y = (float)(iVar15 / iVar7) * 40.0 + 120.0;
|
|
}
|
|
playerManager = &game->_playerManager;
|
|
preventedCurses = preventedCurses + 1;
|
|
} while (preventedCurses < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
goto LAB_00720a92;
|
|
}
|
|
if (game->_currentRoomIdx == -0x14) {
|
|
Game::StartRoomTransition(game,-2,-1,2,local_44,-1);
|
|
}
|
|
else {
|
|
local_40 = 1.47417e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_40));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_40),1.0,2,0,1.0,0.0);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x1b) ||
|
|
(bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage(), bVar5 != 0)) {
|
|
game = g_game;
|
|
qVar3 = g_game->_gameStateFlags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 | 0x1000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar3);
|
|
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::HasPhotoDoor();
|
|
game = g_game;
|
|
if (bVar5 == 0) goto LAB_00720c10;
|
|
qVar3 = g_game->_gameStateFlags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 | 0x8000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar3);
|
|
}
|
|
else {
|
|
LAB_00720c10:
|
|
game = g_game;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Game *>((game)))->Game::IsInTimedSet(0x10);
|
|
if (bVar5 == 0) {
|
|
if (10 < game->_stage) {
|
|
iVar15 = _get_index_plus_one_if_kind_4_5();
|
|
(GHIDRA_CAST<Seeds *>((&game->_seedEffects)))->Seeds::ForgetStageSeed(iVar15);
|
|
game = g_game;
|
|
}
|
|
if (trapDoor->_varData == 1) {
|
|
(GHIDRA_CAST<Game *>((game)))->Game::StartStageTransition(0,3,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
pEVar6 = local_44;
|
|
}
|
|
else {
|
|
preventedCurses = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::filter_curses(2);
|
|
game = g_game;
|
|
local_2d = preventedCurses != 0;
|
|
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsAltPath();
|
|
if ((bVar5 == 0) ||
|
|
((extraout_EDX_00 != 2 && ((extraout_EDX_00 != 1 || (local_2d == '\0')))))) {
|
|
local_35 = '\0';
|
|
}
|
|
else {
|
|
local_35 = '\x01';
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Level *>((this_00)))->Level::IsAltPath();
|
|
if ((bVar5 == 0) ||
|
|
((extraout_EDX_01 != 4 && ((extraout_EDX_01 != 3 || (local_2d == '\0')))))) {
|
|
local_2d = '\0';
|
|
}
|
|
else {
|
|
local_2d = '\x01';
|
|
}
|
|
challengeParams = (GHIDRA_CAST<Game *>((this_01)))->Game::GetChallengeParams();
|
|
if ((challengeParams->_pathType == 2) && (game->_challenge != 0x2c)) {
|
|
if (local_35 == '\0') {
|
|
LAB_00720d10:
|
|
if (local_2d != '\0') {
|
|
pEVar6 = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x273,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if (pEVar6 == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00720d35;
|
|
game = g_game;
|
|
}
|
|
goto LAB_00720e0b;
|
|
}
|
|
pEVar6 = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x272,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if (pEVar6 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
game = g_game;
|
|
goto LAB_00720d10;
|
|
}
|
|
LAB_00720d35:
|
|
Game::StartRoomTransition(g_game,g_game->_startingRoomIdx,-1,0x16,local_44,0);
|
|
preventedCurses = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
local_4c.y = (float)(GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(preventedCurses);
|
|
if ((GHIDRA_CAST<Entity_Player *>(local_4c.y))->_variant == 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_4c.y))))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
|
game = g_game;
|
|
iVar15 = trapDoor->_gridIndex;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_4c.y) + 0x1b1c)))->x = (float)(iVar15 % iVar7) * 40.0 + 40.0;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_4c.y) + 0x1b1c)))->y = (float)(iVar15 / iVar7) * 40.0 + 120.0;
|
|
}
|
|
else {
|
|
game = g_game;
|
|
}
|
|
preventedCurses = preventedCurses + 1;
|
|
} while (preventedCurses < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((game->_playerManager)._playerList._begin) >> 2)));
|
|
pEVar6 = local_44;
|
|
goto LAB_00720b0f;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00720e0b:
|
|
(GHIDRA_CAST<Game *>((game)))->Game::StartStageTransition(0,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
pEVar6 = local_44;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Game *>((game)))->Game::StartStageTransition(1,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
pEVar6 = local_44;
|
|
}
|
|
}
|
|
LAB_00720b0f:
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar6)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<uint8_t *>("Trapdoor"));
|
|
game = g_game;
|
|
iVar15 = trapDoor->_gridIndex;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
(pEVar6->_moveToTarget).x = (float)(iVar15 % iVar7) * 40.0 + 40.0;
|
|
(pEVar6->_moveToTarget).y = (float)(iVar15 / iVar7) * 40.0 + 120.0;
|
|
LAB_00720a92:
|
|
trapDoor = savedTrapDoor;
|
|
pcVar13 = game->_room;
|
|
local_4c.y = (float)pcVar13;
|
|
if (((*pcVar13 != '\0') &&
|
|
(iVar15 = game->_frameCount - *GHIDRA_CAST<int *>((pcVar13 + 0x11f0)), iVar15 == (iVar15 / 0xf) * 0xf)) &&
|
|
(((game->_stage == 9 && (game->_currentRoomIdx == -9)) || (savedTrapDoor->_varData == 1)))) {
|
|
bVar17 = game->_currentRoomIdx != -7;
|
|
if (bVar17) {
|
|
local_44 = GHIDRA_CAST<Entity_Player *>(0x3d4ccccd);
|
|
}
|
|
else {
|
|
local_44 = GHIDRA_CAST<Entity_Player *>(0x3cf5c28f);
|
|
}
|
|
uVar16 = 6;
|
|
if (bVar17) {
|
|
uVar16 = 0xd;
|
|
}
|
|
if (*local_34 != 1) {
|
|
local_44 = GHIDRA_CAST<Entity_Player *>(((float)local_44 * 0.2));
|
|
}
|
|
iVar15 = savedTrapDoor->_gridIndex;
|
|
*GHIDRA_CAST<int *>((pcVar13 + 0x70fc)) = *GHIDRA_CAST<int *>((pcVar13 + 0x70fc)) + 1;
|
|
local_4c.y = (float)(iVar15 % *GHIDRA_CAST<int *>((pcVar13 + 0xc))) * 40.0 + 40.0;
|
|
local_40 = (float)(iVar15 / *GHIDRA_CAST<int *>((pcVar13 + 0xc))) * 40.0 + 120.0;
|
|
local_58 = (float)(*GHIDRA_CAST<uint32_t *>((pcVar13 + 0x70fc)) & 0x80000001);
|
|
if (GHIDRA_INT(local_58) < 0) {
|
|
local_58 = (float)((GHIDRA_INT(local_58) - 1U | 0xfffffffe) + 1);
|
|
}
|
|
if (1 < GHIDRA_UINT(local_58)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Shockwave id is too large!"));
|
|
}
|
|
iVar15 = GHIDRA_INT(local_58) + 0x407;
|
|
*GHIDRA_CAST<float *>((pcVar13 + iVar15 * 0x1c)) = local_4c.y;
|
|
*GHIDRA_CAST<float *>((pcVar13 + iVar15 * 0x1c + 4)) = local_40;
|
|
pcVar2 = pcVar13 + iVar15 * 0x1c + 8;
|
|
pcVar2[0] = '\0';
|
|
pcVar2[1] = '\0';
|
|
pcVar2[2] = '\0';
|
|
pcVar2[3] = '\0';
|
|
*GHIDRA_CAST<Entity_Player **>((pcVar13 + iVar15 * 0x1c + 0xc)) = local_44;
|
|
pcVar2 = pcVar13 + iVar15 * 0x1c + 0x10;
|
|
pcVar2[0] = -0xc;
|
|
pcVar2[1] = -3;
|
|
pcVar2[2] = 'T';
|
|
pcVar2[3] = '<';
|
|
pcVar2 = pcVar13 + iVar15 * 0x1c + 0x14;
|
|
pcVar2[0] = '\0';
|
|
pcVar2[1] = '\0';
|
|
pcVar2[2] = '\0';
|
|
pcVar2[3] = '\0';
|
|
*GHIDRA_CAST<uint32_t *>((pcVar13 + iVar15 * 0x1c + 0x18)) = uVar16;
|
|
}
|
|
if ((trapDoor->_sprite)._loaded != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._animState)))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((&(trapDoor->_sprite)._overlayAnimState)))->AnimationState::Update();
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x4))) != 0) {
|
|
preventedCurses = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x4))) + -4));
|
|
qVar3 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - preventedCurses;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar3) < preventedCurses));
|
|
free((void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nearbyEntities)) + 0x4))) + -4));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|