- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired. - font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact against its assembly. - options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include Save's exact bytes. - platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first built-in shader (FUN_00a13fa0). - source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every address in a (a, b, c to d) list on a comment counts as taken over. - log.h: reconstruction_missing() for a taken-over class's methods that are not written yet. 206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager still use the old APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3225 lines
137 KiB
C++
3225 lines
137 KiB
C++
#include "classes.h"
|
|
|
|
// 00435fc0
|
|
uint8_t GridEntity_Door::IsOpen()
|
|
{
|
|
return *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2;
|
|
}
|
|
|
|
// 00435fd0
|
|
uint8_t GridEntity_Door::IsLocked()
|
|
{
|
|
int temp_5fc7b31e12;
|
|
|
|
temp_5fc7b31e12 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if ((((temp_5fc7b31e12 == 1) || (temp_5fc7b31e12 == 4)) || (temp_5fc7b31e12 == 3)) ||
|
|
((temp_5fc7b31e12 == 2 || (temp_5fc7b31e12 == 5)))) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 005cd5e0
|
|
int GridEntity_Door::Direction()
|
|
{
|
|
return this->_direction;
|
|
}
|
|
|
|
// 005cd5f0
|
|
uint8_t GridEntity_Door::IsRoomType(int roomType)
|
|
{
|
|
if ((this->_currentRoomType == roomType) || (this->_targetRoomType == roomType)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0060cfe0
|
|
int GridEntity_Door::TargetRoomIndex()
|
|
{
|
|
return this->_targetRoomIdx;
|
|
}
|
|
|
|
// 0060cff0
|
|
bool GridEntity_Door::IsKeyFamiliarTarget()
|
|
{
|
|
int in_ECX;
|
|
|
|
return *GHIDRA_CAST<int *>((in_ECX + 8)) == 5;
|
|
}
|
|
|
|
// 0070c5c0
|
|
void GridEntity_Door::Update()
|
|
{
|
|
void *pvVar1;
|
|
uint64_t qVar2;
|
|
uint8_t isChallengeOpen;
|
|
int iVar3;
|
|
uint32_t uVar4;
|
|
std_string *animName;
|
|
uint8_t *animNameCursor;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
Entity_Player *player;
|
|
RoomDescriptor *targetRoomDesc;
|
|
LayerState *layer;
|
|
char *expectedName;
|
|
int iVar5;
|
|
uint32_t uVar6;
|
|
bool isLess;
|
|
double dVar7;
|
|
uint32_t uVar8;
|
|
ColorMod *pCVar9;
|
|
uint8_t auStack_f4 [47];
|
|
uint8_t local_c5;
|
|
float local_c4;
|
|
float boxTop;
|
|
float local_bc;
|
|
float local_b8;
|
|
uint32_t auStack_b4 [8];
|
|
uint32_t uStack_94;
|
|
uint32_t uStack_90;
|
|
uint32_t uStack_8c;
|
|
ColorMod local_88;
|
|
uint32_t uStack_5c;
|
|
uint32_t local_58;
|
|
uint32_t uStack_54;
|
|
uint32_t uStack_50;
|
|
uint32_t uStack_4c;
|
|
uint32_t local_44;
|
|
uint8_t *animData;
|
|
AnimationState *animState;
|
|
uint32_t *flagsHigh;
|
|
Game *game;
|
|
Manager *manager;
|
|
float playerX;
|
|
float playerY;
|
|
int *roomConfig;
|
|
|
|
local_44 = __security_cookie ^ GHIDRA_UINT(auStack_f4);
|
|
this->_updateCount = this->_updateCount + 1;
|
|
game = g_game;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5) {
|
|
uVar6 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
if ((uVar6 & 0x20000) != 0) {
|
|
*GHIDRA_CAST<int *>(&g_game->_gameStateFlags) = GHIDRA_INT(g_game->_gameStateFlags);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&game->_gameStateFlags) + 4)) = uVar6 | 0x20000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
UpdateAnimation(this);
|
|
Open(this);
|
|
}
|
|
}
|
|
iVar3 = get_secret_exit_kind(this);
|
|
game = g_game;
|
|
if ((iVar3 == 4) && ((g_game->_gameStateFlags & 0x10000000000000) != 0)) {
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if ((iVar3 == 1) ||
|
|
((((iVar3 == 4 || (iVar3 == 3)) || (iVar3 == 2)) ||
|
|
((iVar3 == 5 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 2)))))) {
|
|
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) != 0) {
|
|
if (iVar3 != 4) {
|
|
if (iVar3 == 5) {
|
|
qVar2 = g_game->_gameStateFlags;
|
|
flagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x20000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar2);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
UpdateAnimation(this);
|
|
}
|
|
Open(this);
|
|
}
|
|
goto LAB_0070c6c5;
|
|
}
|
|
LAB_0070c6cb:
|
|
if ((this->_doorFlags & 0x10) != 0) goto LAB_0070c737;
|
|
if ((this->_targetRoomIdx == -7) || (g_game->_currentRoomIdx == -7)) {
|
|
LAB_0070c718:
|
|
if (((this->_sprite)._animState._animData == (void *)0x0) ||
|
|
((this->_sprite)._animState._isPlaying == 0)) {
|
|
LAB_0070c72b:
|
|
this->_collisionClass = 5;
|
|
}
|
|
}
|
|
else {
|
|
if (this->_targetRoomType != 5) {
|
|
if (this->_targetRoomType == 0x1b) {
|
|
isChallengeOpen = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasPhotoDoor();
|
|
if (isChallengeOpen != 0) goto LAB_0070c718;
|
|
}
|
|
goto LAB_0070c72b;
|
|
}
|
|
if (g_game->_stage == 9) goto LAB_0070c718;
|
|
this->_collisionClass = 5;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0070c6c5:
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2) goto LAB_0070c6cb;
|
|
LAB_0070c737:
|
|
animName = &this->_closeAnimation;
|
|
this->_collisionClass = 4;
|
|
if (0xf < (this->_closeAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
isChallengeOpen = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName));
|
|
if (((isChallengeOpen != 0) &&
|
|
(pvVar1 = (this->_sprite)._animState._animData, pvVar1 != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x34)) == '\0')) {
|
|
dVar7 = floor((double)(this->_sprite)._animState._animFrame);
|
|
manager = g_manager;
|
|
local_c4 = (float)dVar7;
|
|
if (GHIDRA_INT(dVar7) == 2) {
|
|
local_c4 = 6.44597e-44;
|
|
if ((this->_doorFlags & 8) == 0) {
|
|
local_c4 = 4.90454e-44;
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_c4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c4),1.0,10,0,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
uVar6 = this->_doorFlags;
|
|
uVar4 = uVar6 & 0xff;
|
|
if (((uVar6 & 8) != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2)) {
|
|
animName = &this->_openAnimation;
|
|
if (0xf < (this->_openAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
uVar8 = 0x70c823;
|
|
local_c5 = (uint8_t)uVar6;
|
|
isChallengeOpen = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName));
|
|
if (isChallengeOpen == 0) {
|
|
LAB_0070c871:
|
|
uVar4 = GHIDRA_UINT(local_c5);
|
|
}
|
|
else {
|
|
pvVar1 = (this->_sprite)._animState._animData;
|
|
if ((pvVar1 == (void *)0x0) ||
|
|
(uVar4 = this->_doorFlags & 0xff, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x34)) == '\0')) {
|
|
local_c5 = (uint8_t)this->_doorFlags;
|
|
iVar3 = ANM2::GetFrame(&this->_sprite);
|
|
if (iVar3 != 2) goto LAB_0070c871;
|
|
FUN_0070bfa0(0x2f,10,uVar8,0x3f800000);
|
|
uVar4 = GHIDRA_UINT((uint8_t)this->_doorFlags);
|
|
}
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 8) &&
|
|
((((uVar4 & 1) != 0 || (this->_targetRoomType == 0x17)) && (this->_currentRoomType == 1)))) &&
|
|
(((this->_sprite)._animState._animData == (void *)0x0 ||
|
|
((this->_sprite)._animState._isPlaying == 0)))) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2) {
|
|
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Opened"),0);
|
|
}
|
|
else if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 1) {
|
|
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Closed"),0);
|
|
}
|
|
}
|
|
else {
|
|
iVar3 = this->_currentRoomType;
|
|
if ((iVar3 == 7) ||
|
|
(((iVar5 = this->_targetRoomType, iVar5 == 7 || (iVar3 == 8)) ||
|
|
((iVar5 == 8 || ((iVar3 == 0x1d || (iVar5 == 0x1d)))))))) {
|
|
LAB_0070c926:
|
|
animName = &this->_openAnimation;
|
|
if (0xf < (this->_openAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
isChallengeOpen = ANM2::IsFinishedImpl(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName));
|
|
if (isChallengeOpen != 0) {
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameCursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = "Opened";
|
|
do {
|
|
isChallengeOpen = *animNameCursor;
|
|
isLess = isChallengeOpen < (uint8_t)*expectedName;
|
|
if (isChallengeOpen != *expectedName) {
|
|
LAB_0070c980:
|
|
uVar6 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0070c985;
|
|
}
|
|
if (isChallengeOpen == 0) break;
|
|
isChallengeOpen = animNameCursor[1];
|
|
isLess = isChallengeOpen < (uint8_t)expectedName[1];
|
|
if (isChallengeOpen != expectedName[1]) goto LAB_0070c980;
|
|
animNameCursor = animNameCursor + 2;
|
|
expectedName = expectedName + 2;
|
|
} while (isChallengeOpen != 0);
|
|
uVar6 = 0;
|
|
LAB_0070c985:
|
|
if ((uVar6 == 0) &&
|
|
((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_0070c9b8;
|
|
}
|
|
isChallengeOpen = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("Opened"),1);
|
|
if (isChallengeOpen != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
}
|
|
else if (iVar5 == 5) {
|
|
targetRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if ((targetRoomDesc->Flags & 1) == 0) goto LAB_0070c926;
|
|
}
|
|
}
|
|
LAB_0070c9b8:
|
|
uVar6 = g_game->_debugCurses;
|
|
uVar4 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if ((((~preventedCurses & (forcedCurses | uVar6 | uVar4) & 0x10) == 0) ||
|
|
(this->_targetRoomType != 1)) || (local_c5 = '\x01', this->_currentRoomType != 1)) {
|
|
local_c5 = '\0';
|
|
}
|
|
if ((((this->_doorFlags & 4) != 0) && (uVar6 = this->_direction, uVar6 < 4)) &&
|
|
(this->_varData == 0)) {
|
|
local_88._tint[0] = -43.0;
|
|
local_88._tint[1] = -20.0;
|
|
local_88._tint[2] = 15.0;
|
|
local_88._tint[3] = 20.0;
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
local_88._colorize[0] = -20.0;
|
|
local_88._colorize[1] = -43.0;
|
|
local_88._colorize[2] = 20.0;
|
|
local_88._colorize[3] = 15.0;
|
|
local_88._offset[0] = -15.0;
|
|
local_88._offset[1] = -20.0;
|
|
local_88._offset[2] = 43.0;
|
|
uStack_5c = 0x41a00000;
|
|
local_58 = 0xc1a00000;
|
|
uStack_54 = 0xc1700000;
|
|
uStack_50 = 0x41a00000;
|
|
uStack_4c = 0x422c0000;
|
|
local_bc = (float)(this->_gridIndex % iVar3) * 40.0 + 40.0;
|
|
local_b8 = (float)(this->_gridIndex / iVar3) * 40.0 + 120.0;
|
|
local_c4 = local_bc + local_88._tint[uVar6 * 4];
|
|
local_bc = local_bc + local_88._tint[uVar6 * 4 + 2];
|
|
boxTop = local_b8 + local_88._tint[uVar6 * 4 + 1];
|
|
local_b8 = local_b8 + local_88._tint[uVar6 * 4 + 3];
|
|
uVar6 = 0;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar6);
|
|
if (((player->_entityGridCollisionClass == 5) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 10))
|
|
|| (local_c5 != '\0')) {
|
|
playerX = (player->_pos).x;
|
|
playerY = (player->_pos).y;
|
|
if ((local_c4 <= playerX) && (boxTop <= playerY)) {
|
|
if (playerX <= local_bc) {
|
|
if (playerY <= local_b8) {
|
|
Game::save_rewind_state(this->_slot);
|
|
local_88._tint[0] = 0.0;
|
|
local_88._tint[1] = 0.0;
|
|
local_88._tint[2] = 0.0;
|
|
local_88._tint[3] = 0.0;
|
|
local_88._colorize[0] = g_vectorZero.x;
|
|
local_88._colorize[1] = g_vectorZero.y;
|
|
local_88._colorize[2] = g_vectorZero.x;
|
|
local_88._colorize[3] = g_vectorZero.y;
|
|
local_88._offset[0] = 0.0;
|
|
local_88._offset[1] = 0.0;
|
|
player->TakeDamage(0x3f800000,0x10010000,0,&local_88);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
}
|
|
if ((((((this->_targetRoomType == 0xb) && ((this->_doorFlags & 8) != 0)) && (this->_isBusted == 0)
|
|
) && ((this->_currentRoomType != 0x1d &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) >> 10 & 1) == 0)))) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 1)) && (this->_isUnlockedByPlayer == 0)) {
|
|
isChallengeOpen = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanOpenChallengeRoom(this->_targetRoomIdx);
|
|
if (isChallengeOpen == 0) {
|
|
Close(this,0);
|
|
}
|
|
}
|
|
animState = &(this->_sprite)._animState;
|
|
if ((this->_sprite)._loaded != 0) {
|
|
AnimationState::Update(animState);
|
|
AnimationState::Update(&(this->_sprite)._overlayAnimState);
|
|
}
|
|
if ((this->_extraSprite)._loaded != 0) {
|
|
AnimationState::Update(&(this->_extraSprite)._animState);
|
|
AnimationState::Update(&(this->_extraSprite)._overlayAnimState);
|
|
}
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
isChallengeOpen =
|
|
AnimationState::WasEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST<uint8_t *>("ScreenshakeStop"));
|
|
if (isChallengeOpen == 0) {
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
isChallengeOpen = AnimationState::WasEventTriggered(animState,GHIDRA_CAST<uint8_t *>("ScreenshakeStart"));
|
|
if (isChallengeOpen != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(4);
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
isChallengeOpen = AnimationState::IsEventTriggered(animState,GHIDRA_CAST<uint8_t *>("ScreenshakeStart"))
|
|
;
|
|
manager = g_manager;
|
|
if (isChallengeOpen != 0) {
|
|
local_c4 = 7.28675e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_c4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c4),1.0,2,0,0.33,0.0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(0);
|
|
}
|
|
}
|
|
if (this->_targetRoomType == 0x1b) {
|
|
iVar3 = get_secret_exit_kind(this);
|
|
if ((iVar3 == 3) && ((this->_sprite)._animState._animData != (void *)0x0)) {
|
|
isChallengeOpen = AnimationState::IsEventTriggered(animState,GHIDRA_CAST<uint8_t *>("Sound"));
|
|
if (isChallengeOpen != 0) {
|
|
isChallengeOpen = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasPhotoDoor();
|
|
manager = g_manager;
|
|
if (isChallengeOpen == 0) {
|
|
local_c4 = 9.52883e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_c4));
|
|
uVar8 = 0x3f800000;
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c4),1.0,2,0,1.0,0.0);
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 8) {
|
|
FUN_0070bfa0(0x9c,2,uVar8,0x3f800000);
|
|
}
|
|
}
|
|
else {
|
|
local_c4 = 7.28675e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_c4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c4),1.0,2,0,0.33,0.0);
|
|
}
|
|
}
|
|
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
|
isChallengeOpen = AnimationState::IsEventTriggered(animState,&DAT_00b64ba4);
|
|
if (isChallengeOpen != 0) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(8);
|
|
SpawnDust(this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
targetRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if ((targetRoomDesc->Flags & 0x40000U) != 0) {
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>("Background"));
|
|
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
uStack_94 = 0;
|
|
uStack_90 = 0;
|
|
uStack_8c = 0;
|
|
if (&layer->_color != GHIDRA_CAST<ColorMod *>(auStack_b4)) {
|
|
(layer->_color)._tint[0] = 1.0;
|
|
(layer->_color)._tint[1] = 1.0;
|
|
(layer->_color)._tint[2] = 1.0;
|
|
(layer->_color)._tint[3] = 1.0;
|
|
(layer->_color)._offset[0] = 0.0;
|
|
(layer->_color)._offset[1] = 0.0;
|
|
(layer->_color)._colorize[0] = 0.8;
|
|
(layer->_color)._colorize[1] = 1.1;
|
|
(layer->_color)._colorize[2] = 1.8;
|
|
(layer->_color)._colorize[3] = 0.8;
|
|
(layer->_color)._offset[2] = 0.0;
|
|
}
|
|
}
|
|
}
|
|
roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10));
|
|
if ((((roomConfig != GHIDRA_CAST<int *>(0x0)) && (*roomConfig == 0x23)) &&
|
|
(pvVar1 = targetRoomDesc->Data, pvVar1 != (void *)0x0)) &&
|
|
(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 8)) == 1 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x10)) == 3)) &&
|
|
(g_game->_stageType == 1)))) {
|
|
uVar6 = Random();
|
|
local_c4 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.5;
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
local_88._offset[0] = 0.0;
|
|
local_88._colorize[0] = 0.0;
|
|
local_88._colorize[1] = 0.0;
|
|
local_88._colorize[2] = 0.0;
|
|
local_88._colorize[3] = 0.0;
|
|
local_88._offset[1] = 0.0;
|
|
layer->_visible = 1;
|
|
pCVar9 = &local_88;
|
|
local_88._offset[2] = 0.0;
|
|
local_88._tint[0] = 0.9;
|
|
local_88._tint[1] = 0.93;
|
|
local_88._tint[2] = 1.0;
|
|
local_88._tint[3] = local_c4;
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(pCVar9);
|
|
pCVar9 = &local_88;
|
|
local_88._tint[0] = 1.0;
|
|
local_88._tint[1] = 1.0;
|
|
local_88._tint[2] = 1.0;
|
|
local_88._tint[3] = 1.0;
|
|
local_88._colorize[0] = 3.0;
|
|
local_88._colorize[1] = 3.0;
|
|
local_88._colorize[2] = 3.2;
|
|
local_88._colorize[3] = local_c4;
|
|
local_88._offset[0] = 0.0;
|
|
local_88._offset[1] = 0.0;
|
|
local_88._offset[2] = 0.0;
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(pCVar9);
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 2) {
|
|
iVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetTrinketMultiplier(0x3e);
|
|
if (1 < iVar3) {
|
|
if ((this->_currentRoomType != 7) && (this->_targetRoomType != 7)) {
|
|
iVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetTrinketMultiplier(0x3e);
|
|
if ((iVar3 < 3) || ((this->_currentRoomType != 8 && (this->_targetRoomType != 8))))
|
|
goto LAB_0070d1ab;
|
|
}
|
|
iVar5 = 300;
|
|
iVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetTrinketMultiplier(0x3e);
|
|
manager = g_manager;
|
|
if (2 < iVar3) {
|
|
iVar5 = 0x96;
|
|
}
|
|
if (*GHIDRA_CAST<char *>(g_game->_room) == '\0') {
|
|
iVar3 = -1;
|
|
}
|
|
else {
|
|
iVar3 = g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f0));
|
|
}
|
|
if ((iVar3 % iVar5 < 0xb) && (iVar3 % iVar5 == 0)) {
|
|
local_c4 = 1.42092e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_c4));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c4),1.0,2,0,1.0,0.0);
|
|
isChallengeOpen = ANM2::SetAnimation(&this->_sparkleSprite,GHIDRA_CAST<uint8_t *>("Sparkle"),1);
|
|
if (isChallengeOpen != 0) {
|
|
AnimationState::Rewind(&(this->_sparkleSprite)._animState);
|
|
(this->_sparkleSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_0070d1ab:
|
|
if ((this->_sparkleSprite)._loaded != 0) {
|
|
AnimationState::Update(&(this->_sparkleSprite)._animState);
|
|
AnimationState::Update(&(this->_sparkleSprite)._overlayAnimState);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0070d360
|
|
int GridEntity_Door::get_secret_exit_kind()
|
|
{
|
|
RoomDescriptor *roomDesc;
|
|
int roomData;
|
|
|
|
if (this->_targetRoomType == 0x1b) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if (roomDesc->Data != (void *)0x0) {
|
|
return *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 0x10));
|
|
}
|
|
}
|
|
else if (this->_currentRoomType == 0x1b) {
|
|
roomData = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10));
|
|
if (roomData != 0) {
|
|
return *GHIDRA_CAST<int *>((roomData + 0x10));
|
|
}
|
|
}
|
|
else {
|
|
if (this->_targetRoomType == 5) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
}
|
|
else {
|
|
if (this->_currentRoomType != 5) {
|
|
return 0;
|
|
}
|
|
roomDesc = *GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(g_game->_room) + 4));
|
|
}
|
|
if ((roomDesc->Data != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 0x10)) == 0x5a)) {
|
|
return 4;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0070d3f0
|
|
void GridEntity_Door::LoadSprite()
|
|
{
|
|
bool bVar1;
|
|
uint8_t *puVar2;
|
|
uint8_t bVar3;
|
|
int iVar4;
|
|
LayerState *layer;
|
|
RoomDescriptor *roomDesc;
|
|
RoomDescriptor *targetRoomDesc;
|
|
int iVar5;
|
|
ColorMod *extraout_EAX;
|
|
ColorMod *extraout_EAX_00;
|
|
Entity_Player *payToPlayOwner;
|
|
void *pvVar6;
|
|
uint8_t unk;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t extraout_CL_01;
|
|
uint8_t extraout_CL_02;
|
|
uint8_t extraout_CL_03;
|
|
uint8_t extraout_CL_04;
|
|
uint8_t extraout_CL_05;
|
|
uint8_t extraout_CL_06;
|
|
uint8_t extraout_CL_07;
|
|
uint8_t extraout_CL_08;
|
|
uint8_t extraout_CL_09;
|
|
uint8_t extraout_CL_10;
|
|
uint8_t extraout_CL_11;
|
|
uint8_t extraout_CL_12;
|
|
uint8_t unk_00;
|
|
std_string *pathString;
|
|
char *pcVar7;
|
|
Game *extraout_ECX;
|
|
uint8_t *pathEnd;
|
|
uint32_t uVar8;
|
|
uint32_t uVar9;
|
|
ANM2 *sprite;
|
|
float colorizeB;
|
|
ColorMod roomColor;
|
|
float offsetLength;
|
|
uint8_t *local_190;
|
|
std_string barDoorPath;
|
|
std_string devilTreasureDoorPath;
|
|
std_string devilRoomDoorPath;
|
|
std_string ambushDoorPath;
|
|
std_string bossAmbushDoorPath;
|
|
std_string momsHeartDoorPath;
|
|
std_string mausoleumDoorPath;
|
|
std_string secretExitPath;
|
|
uint8_t local_c8 [44];
|
|
std_string mineshaftDarkPath;
|
|
std_string mineshaftLightPath;
|
|
std_string anmPath;
|
|
std_string doorAnmPath;
|
|
std_string tmpString;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_18;
|
|
uint32_t ehState;
|
|
ColorMod *color;
|
|
float colorizeA;
|
|
float colorizeB;
|
|
float colorizeG;
|
|
float colorizeR;
|
|
Game *game;
|
|
int *roomData;
|
|
void *targetRoomData;
|
|
int targetRoomType;
|
|
float tintA;
|
|
float tintB;
|
|
float tintG;
|
|
float tintR;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
ehState = 0xffffffff;
|
|
puStack_18 = &LAB_00afc928;
|
|
savedExceptionList = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &savedExceptionList;
|
|
puVar2 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
if ((this->_extraSprite)._loaded != 0) {
|
|
ANM2::Reset(&this->_extraSprite);
|
|
puVar2 = puStack_20;
|
|
}
|
|
puStack_20 = puVar2;
|
|
bVar1 = true;
|
|
this->_doorFlags = 0;
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Close"),5);
|
|
offsetLength = 15.0;
|
|
if (this->_targetRoomIdx == -100) {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
tmpString._buf[0] = '\0';
|
|
tmpString._buf[1] = '\0';
|
|
tmpString._buf[2] = '\0';
|
|
tmpString._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
tmpString._size = 0x22;
|
|
tmpString._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0))),"gfx/grid/door_downpour_mirror.anm2",0x23);
|
|
ehState = 0;
|
|
ANM2::Load(&this->_sprite,&tmpString,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar8 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar8 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
LAB_0070d535:
|
|
ehState = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
this->_doorFlags = this->_doorFlags | 0x10;
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Break"),5);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Break"),5);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Closed"),6);
|
|
goto LAB_0070eb83;
|
|
}
|
|
if (this->_targetRoomIdx == -0x65) {
|
|
if (g_game->_currentDimensionIdx == 1) {
|
|
mineshaftLightPath._size = 0;
|
|
mineshaftLightPath._capacity = 0xf;
|
|
mineshaftLightPath._buf[0] = '\0';
|
|
mineshaftLightPath._buf[1] = '\0';
|
|
mineshaftLightPath._buf[2] = '\0';
|
|
mineshaftLightPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftLightPath._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
mineshaftLightPath._size = 0x28;
|
|
mineshaftLightPath._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(mineshaftLightPath._buf))) + 0x0))),
|
|
"gfx/grid/door_mines_mineshaft_light.anm2",0x29);
|
|
ehState = 1;
|
|
ANM2::Load(&this->_sprite,&mineshaftLightPath,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < mineshaftLightPath._capacity) {
|
|
uVar8 = mineshaftLightPath._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(mineshaftLightPath._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftLightPath._buf)) + 0x0))) + -4));
|
|
uVar8 = mineshaftLightPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftLightPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
mineshaftLightPath._size = 0;
|
|
mineshaftLightPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftLightPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftLightPath._buf)) + 0x0))) & 0xffffff00;
|
|
}
|
|
else {
|
|
mineshaftDarkPath._size = 0;
|
|
mineshaftDarkPath._capacity = 0xf;
|
|
mineshaftDarkPath._buf[0] = '\0';
|
|
mineshaftDarkPath._buf[1] = '\0';
|
|
mineshaftDarkPath._buf[2] = '\0';
|
|
mineshaftDarkPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftDarkPath._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
mineshaftDarkPath._size = 0x27;
|
|
mineshaftDarkPath._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(mineshaftDarkPath._buf))) + 0x0))),"gfx/grid/door_mines_mineshaft_dark.anm2"
|
|
,0x28);
|
|
ehState = 2;
|
|
ANM2::Load(&this->_sprite,&mineshaftDarkPath,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < mineshaftDarkPath._capacity) {
|
|
uVar8 = mineshaftDarkPath._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(mineshaftDarkPath._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftDarkPath._buf)) + 0x0))) + -4));
|
|
uVar8 = mineshaftDarkPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftDarkPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
mineshaftDarkPath._size = 0;
|
|
mineshaftDarkPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftDarkPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(mineshaftDarkPath._buf)) + 0x0))) & 0xffffff00;
|
|
}
|
|
this->_doorFlags = this->_doorFlags | 0x20;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 4) {
|
|
bVar1 = false;
|
|
(GHIDRA_CAST<msvc::string *>(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Collapse"),8);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Collapsed"),9);
|
|
}
|
|
goto LAB_0070eb83;
|
|
}
|
|
iVar4 = this->_currentRoomType;
|
|
if (iVar4 == 7) {
|
|
LAB_0070e8c5:
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
anmPath._buf[0] = '\0';
|
|
anmPath._buf[1] = '\0';
|
|
anmPath._buf[2] = '\0';
|
|
anmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anmPath._size = 0x15;
|
|
anmPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0))),"gfx/door_sparkle.anm2",0x16);
|
|
ehState = 3;
|
|
ANM2::Load(&this->_sparkleSprite,&anmPath,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < anmPath._capacity) {
|
|
uVar8 = anmPath._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + -4));
|
|
uVar8 = anmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) & 0xffffff00;
|
|
LAB_0070e980:
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
tmpString._buf[0] = '\0';
|
|
tmpString._buf[1] = '\0';
|
|
tmpString._buf[2] = '\0';
|
|
tmpString._buf[3] = '\0';
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1d18)) == 0x10) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
tmpString._size = 0x2a;
|
|
tmpString._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0))),"gfx/grid/door_08_holeinwall _darkroom.anm2",0x2b
|
|
);
|
|
ehState = 4;
|
|
ANM2::Load(&this->_sprite,&tmpString,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar8 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar8 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffff00;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
tmpString._size = 0x20;
|
|
tmpString._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0))),"gfx/grid/Door_08_HoleInWall.anm2",0x21);
|
|
ehState = 5;
|
|
ANM2::Load(&this->_sprite,&tmpString,0);
|
|
ehState = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar8 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar8 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffff00;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&this->_sprite),0,
|
|
(std_string *)
|
|
(GHIDRA_INT(g_game->_room) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1d18)) * 0x13c + 0x1e24));
|
|
ANM2::LoadGraphics(&this->_sprite,unk_00);
|
|
}
|
|
pvVar6 = g_game->_room;
|
|
tintR = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72d0));
|
|
tintG = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72d4));
|
|
tintB = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72d8));
|
|
tintA = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72dc));
|
|
colorizeB = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72f8));
|
|
colorizeR = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72e0));
|
|
colorizeG = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72e4));
|
|
colorizeB = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72e8));
|
|
colorizeA = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x72ec));
|
|
color = &(this->_sprite)._color;
|
|
if (color != &roomColor) {
|
|
*GHIDRA_CAST<uint64_t *>((this->_sprite)._color._offset) = *GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(pvVar6) + 0x72f0));
|
|
color->_tint[0] = tintR;
|
|
(this->_sprite)._color._tint[1] = tintG;
|
|
(this->_sprite)._color._tint[2] = tintB;
|
|
(this->_sprite)._color._tint[3] = tintA;
|
|
(this->_sprite)._color._offset[2] = colorizeB;
|
|
(this->_sprite)._color._colorize[0] = colorizeR;
|
|
(this->_sprite)._color._colorize[1] = colorizeG;
|
|
(this->_sprite)._color._colorize[2] = colorizeB;
|
|
(this->_sprite)._color._colorize[3] = colorizeA;
|
|
}
|
|
this->_doorFlags = this->_doorFlags | 2;
|
|
offsetLength = 0.0;
|
|
goto LAB_0070eb83;
|
|
}
|
|
targetRoomType = this->_targetRoomType;
|
|
if ((((targetRoomType == 7) || (iVar4 == 8)) || (targetRoomType == 8)) ||
|
|
((iVar4 == 0x1d || (targetRoomType == 0x1d)))) {
|
|
if ((this->_targetRoomType == 7) || ((iVar4 == 8 || (this->_targetRoomType == 8))))
|
|
goto LAB_0070e8c5;
|
|
goto LAB_0070e980;
|
|
}
|
|
iVar4 = get_secret_exit_kind(this);
|
|
if (iVar4 == 0) {
|
|
bVar3 = IsRoomType(this,10);
|
|
if ((bVar3 != 0) ||
|
|
(((uVar8 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurses(), (uVar8 & 0x10) != 0 &&
|
|
(this->_targetRoomType == 1)) && (this->_currentRoomType == 1)))) {
|
|
msvc::string::string_from_cstr
|
|
(local_c8 + 0x14,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_04_SelfSacrificeRoomDoor.anm2"));
|
|
ehState = 0xd;
|
|
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
bVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x97);
|
|
if ((bVar3 != 0) || (this->_varData == 1)) {
|
|
uVar8 = 0;
|
|
bVar3 = extraout_CL_10;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/grid/door_04_selfsacrificeroomdoor_nospikes.png"),0x33);
|
|
ehState = 0xe;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar8,&tmpString);
|
|
ehState = 0xffffffff;
|
|
bVar3 = extraout_CL_11;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar9 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar9 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7)))))
|
|
goto LAB_0070d535;
|
|
}
|
|
operator_delete(pcVar7,uVar9);
|
|
bVar3 = extraout_CL_12;
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
ANM2::LoadGraphics(&this->_sprite,bVar3);
|
|
this->_varData = 1;
|
|
}
|
|
this->_doorFlags = this->_doorFlags | 4;
|
|
goto LAB_0070eb83;
|
|
}
|
|
bVar3 = IsRoomType(this,9);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_05_ArcadeRoomDoor.anm2"))
|
|
;
|
|
ehState = 0xf;
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyClosed"),9);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyOpen"),7);
|
|
ANM2::LoadGraphics(&this->_sprite,unk);
|
|
this->_doorFlags = this->_doorFlags | 1;
|
|
goto LAB_0070eb83;
|
|
}
|
|
if (this->_targetRoomType == 0x17) {
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_32_ExitDoor.anm2"));
|
|
ehState = 0x10;
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
goto LAB_0070eb83;
|
|
}
|
|
bVar3 = IsRoomType(this,4);
|
|
game = g_game;
|
|
if (bVar3 != 0) {
|
|
bVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
if (((bVar3 == 0) || (game->_greedModeTreasureRoomIdx == this->_targetRoomIdx)) ||
|
|
(game->_greedModeTreasureRoomIdx == game->_currentRoomIdx)) {
|
|
roomDesc = (GHIDRA_CAST<Game *>((game)))->Game::GetCurrentRoomDesc();
|
|
if (((GHIDRA_UINT(roomDesc->Flags) >> 0xb & 1) == 0) &&
|
|
(roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1),
|
|
(GHIDRA_UINT(roomDesc->Flags) >> 0xb & 1) == 0)) {
|
|
msvc::string::string_from_cstr
|
|
(doorAnmPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_02_TreasureRoomDoor.anm2"));
|
|
ehState = 0x13;
|
|
}
|
|
else {
|
|
msvc::string::string_from_cstr
|
|
(doorAnmPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_02_TreasureRoomDoor_Devil.anm2"));
|
|
ehState = 0x12;
|
|
}
|
|
}
|
|
else {
|
|
msvc::string::string_from_cstr
|
|
(doorAnmPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_31_TreasureRoomDoorGreed.anm2"));
|
|
ehState = 0x11;
|
|
}
|
|
LAB_0070dd51:
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyOpen"),7);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyClosed"),9);
|
|
goto LAB_0070eb83;
|
|
}
|
|
bVar3 = IsRoomType(this,0x18);
|
|
if (bVar3 != 0) {
|
|
msvc::string::string_from_cstr
|
|
(doorAnmPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_00x_PlanetariumDoor.anm2"));
|
|
ehState = 0x14;
|
|
goto LAB_0070dd51;
|
|
}
|
|
bVar3 = IsRoomType(this,0x11);
|
|
game = g_game;
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_15_BossRushDoor.anm2"));
|
|
ehState = 0x15;
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
LAB_0070e789:
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Opened"),6);
|
|
goto LAB_0070eb83;
|
|
}
|
|
if ((this->_targetRoomIdx == -8) || (g_game->_currentRoomIdx == -8)) {
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/door_29_doortobluewomb.anm2"));
|
|
ehState = 0x16;
|
|
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),0);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
bVar3 = extraout_CL_07;
|
|
if ((g_game->_currentRoomIdx == -8) && (uVar8 = 0, (this->_sprite)._layerCount != 0)) {
|
|
do {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/grid/door_29_doortobluewomb_blue.png"),0x28);
|
|
ehState = 0x17;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar8,&tmpString);
|
|
ehState = 0xffffffff;
|
|
bVar3 = extraout_CL_08;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar9 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar9 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7)))))
|
|
goto LAB_0070d535;
|
|
}
|
|
operator_delete(pcVar7,uVar9);
|
|
bVar3 = extraout_CL_09;
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
ANM2::LoadGraphics(&this->_sprite,bVar3);
|
|
goto LAB_0070e789;
|
|
}
|
|
if ((this->_targetRoomIdx == -7) || (g_game->_currentRoomIdx == -7)) {
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_24_MegaSatanDoor.anm2"));
|
|
ehState = 0x18;
|
|
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Closed"),6);
|
|
goto LAB_0070eb83;
|
|
}
|
|
if (g_game->_stage == 9) {
|
|
bVar3 = IsRoomType(this,5);
|
|
if ((((bVar3 != 0) && (-1 < game->_currentRoomIdx)) && (-1 < this->_targetRoomIdx)) ||
|
|
((this->_targetRoomIdx == -9 || (game->_currentRoomIdx == -9)))) {
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/door_30_HushDoor.anm2"));
|
|
ehState = 0x19;
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Closed"),6);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Closed"),6);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Opening"),7);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Opening"),7);
|
|
goto LAB_0070eb83;
|
|
}
|
|
}
|
|
bVar3 = IsRoomType(this,5);
|
|
if (bVar3 == 0) {
|
|
bVar3 = IsRoomType(this,0xb);
|
|
if (bVar3 != 0) {
|
|
roomDesc = (GHIDRA_CAST<Game *>((game)))->Game::GetCurrentRoomDesc();
|
|
targetRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
pvVar6 = roomDesc->Data;
|
|
if (((pvVar6 == (void *)0x0) ||
|
|
(targetRoomData = targetRoomDesc->Data, targetRoomData == (void *)0x0)) ||
|
|
(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 8)) != 0xb || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x10)) != 1)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(targetRoomData) + 8)) != 0xb ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(targetRoomData) + 0x10)) != 1)))))) {
|
|
msvc::string::string_from_cstr
|
|
(ambushDoorPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_03_AmbushRoomDoor.anm2"));
|
|
ehState = 0x1c;
|
|
ANM2::Load(&this->_sprite,&ambushDoorPath,1);
|
|
pathString = &ambushDoorPath;
|
|
}
|
|
else {
|
|
msvc::string::string_from_cstr
|
|
(bossAmbushDoorPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_09_BossAmbushRoomDoor.anm2"));
|
|
ehState = 0x1b;
|
|
ANM2::Load(&this->_sprite,&bossAmbushDoorPath,1);
|
|
pathString = &bossAmbushDoorPath;
|
|
}
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((pathString->_buf)))->msvc::string::_Tidy_deallocate();
|
|
this->_doorFlags = this->_doorFlags | 8;
|
|
goto LAB_0070eb83;
|
|
}
|
|
bVar3 = IsRoomType(this,0xe);
|
|
if (bVar3 != 0) {
|
|
roomDesc = (GHIDRA_CAST<Game *>((game)))->Game::GetCurrentRoomDesc();
|
|
if (((GHIDRA_UINT(roomDesc->Flags) >> 0xb & 1) == 0) &&
|
|
(roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1),
|
|
(GHIDRA_UINT(roomDesc->Flags) >> 0xb & 1) == 0)) {
|
|
msvc::string::string_from_cstr
|
|
(devilRoomDoorPath._buf,GHIDRA_CAST<uint8_t *>("gfx/grid/Door_07_DevilRoomDoor.anm2"));
|
|
ehState = 0x1e;
|
|
ANM2::Load(&this->_sprite,&devilRoomDoorPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((devilRoomDoorPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
else {
|
|
msvc::string::string_from_cstr
|
|
(devilTreasureDoorPath._buf,
|
|
GHIDRA_CAST<uint8_t *>("gfx/grid/Door_02_TreasureRoomDoor_Devil.anm2"));
|
|
ehState = 0x1d;
|
|
ANM2::Load(&this->_sprite,&devilTreasureDoorPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((devilTreasureDoorPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
goto LAB_0070eb83;
|
|
}
|
|
bVar3 = IsRoomType(this,0xf);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_07_HolyRoomDoor.anm2"));
|
|
ehState = 0x1f;
|
|
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
goto LAB_0070eb83;
|
|
}
|
|
roomData = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x10));
|
|
if ((roomData != GHIDRA_CAST<int *>(0x0)) && (*roomData == 0x23)) {
|
|
sprite = &this->_sprite;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_House.anm2"));
|
|
ehState = 0x20;
|
|
ANM2::Load(sprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),0);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
layer = ANM2::GetLayer(sprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
layer->_visible = 0;
|
|
layer = ANM2::GetLayer(sprite,&DAT_00000004);
|
|
game = g_game;
|
|
layer->_visible = 0;
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4));
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if ((iVar4 == 0) ||
|
|
((targetRoomType = *GHIDRA_CAST<int *>((iVar4 + 0x10)), targetRoomType == 0 ||
|
|
(*GHIDRA_CAST<int *>((targetRoomType + 8)) != 1)))) {
|
|
targetRoomType = -1;
|
|
}
|
|
else {
|
|
targetRoomType = *GHIDRA_CAST<int *>((targetRoomType + 0x10));
|
|
}
|
|
if (((roomDesc == GHIDRA_CAST<RoomDescriptor *>(0x0)) || (pvVar6 = roomDesc->Data, pvVar6 == (void *)0x0)
|
|
) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 8)) != 1)) {
|
|
iVar5 = -1;
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x10));
|
|
}
|
|
if ((targetRoomType == 0) || (iVar5 == 0)) {
|
|
uVar8 = 0;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/grid/door_house_cracked.png"),0x1f);
|
|
ehState = 0x21;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar8,&tmpString);
|
|
ehState = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar9 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar9 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7)))))
|
|
goto LAB_0070d535;
|
|
}
|
|
operator_delete(pcVar7,uVar9);
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
}
|
|
else {
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>((iVar4 + 0x44));
|
|
if ((((uVar8 >> 10 & 1) != 0) || ((GHIDRA_UINT(roomDesc->Flags) >> 10 & 1) != 0)) ||
|
|
(g_game->_currentDimensionIdx == 2)) {
|
|
uVar9 = 0;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/grid/door_closet_red.png"),0x1c);
|
|
ehState = 0x22;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar9,&tmpString);
|
|
ehState = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar8 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar8 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7)))))
|
|
goto LAB_0070d535;
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
} while (uVar9 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
uVar8 = *GHIDRA_CAST<uint32_t *>((iVar4 + 0x44));
|
|
}
|
|
if ((((uVar8 >> 10 & 1) != 0) && ((GHIDRA_UINT(roomDesc->Flags) >> 10 & 1) == 0)) &&
|
|
(g_game->_stageType == 0)) {
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
layer->_visible = 1;
|
|
layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004);
|
|
layer->_visible = 1;
|
|
}
|
|
}
|
|
}
|
|
sprite = &this->_sprite;
|
|
if (iVar5 == 2) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::Color(0.9,0.7,1.0,1.0);
|
|
color = extraout_EAX;
|
|
layer = ANM2::GetLayer(sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(color);
|
|
}
|
|
if (g_game->_stageType == 1) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::Color();
|
|
color = extraout_EAX_00;
|
|
layer = ANM2::GetLayer(sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::__mul(color);
|
|
}
|
|
iVar4 = this->_direction;
|
|
(this->_sprite)._flipX = iVar4 == 3;
|
|
(this->_sprite)._flipY = iVar4 == 2;
|
|
ANM2::LoadGraphics(sprite,(uint8_t)iVar4);
|
|
goto LAB_0070eb83;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_01_NormalDoor.anm2"));
|
|
ehState = 0x23;
|
|
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),0);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
game = g_game;
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) >> 10 & 1) == 0) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
game = extraout_ECX;
|
|
if ((GHIDRA_UINT(roomDesc->Flags) >> 10 & 1) != 0) goto LAB_0070e564;
|
|
bVar3 = IsRoomType(this,2);
|
|
if (bVar3 != 0) {
|
|
local_190 = GHIDRA_CAST<uint8_t *>(0xb68c48);
|
|
bVar3 = extraout_CL;
|
|
goto LAB_0070e56f;
|
|
}
|
|
bVar3 = IsRoomType(this,0x14);
|
|
if (bVar3 != 0) {
|
|
local_190 = GHIDRA_CAST<uint8_t *>(0xb68c68);
|
|
bVar3 = extraout_CL_00;
|
|
goto LAB_0070e56f;
|
|
}
|
|
bVar3 = IsRoomType(this,0xc);
|
|
if (bVar3 != 0) {
|
|
local_190 = GHIDRA_CAST<uint8_t *>(0xb68c8c);
|
|
bVar3 = extraout_CL_01;
|
|
goto LAB_0070e56f;
|
|
}
|
|
bVar3 = IsRoomType(this,0x15);
|
|
if (bVar3 != 0) {
|
|
local_190 = GHIDRA_CAST<uint8_t *>(0xb68cb0);
|
|
bVar3 = extraout_CL_02;
|
|
goto LAB_0070e56f;
|
|
}
|
|
bVar3 = IsRoomType(this,0xd);
|
|
if (bVar3 != 0) {
|
|
local_190 = GHIDRA_CAST<uint8_t *>(0xb68da4);
|
|
bVar3 = extraout_CL_03;
|
|
goto LAB_0070e56f;
|
|
}
|
|
local_190 = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(g_game->_room) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1d18)) * 0x13c +
|
|
0x1e0c)))))->msvc::string::c_str();
|
|
bVar3 = extraout_CL_04;
|
|
if (local_190 != GHIDRA_CAST<uint8_t *>(0x0)) goto LAB_0070e56f;
|
|
}
|
|
else {
|
|
LAB_0070e564:
|
|
bVar3 = (uint8_t)game;
|
|
local_190 = GHIDRA_CAST<uint8_t *>(0xb68d30);
|
|
LAB_0070e56f:
|
|
uVar8 = 0;
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
|
|
pathEnd = local_190;
|
|
do {
|
|
bVar3 = *pathEnd;
|
|
pathEnd = pathEnd + 1;
|
|
} while (bVar3 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(local_190,GHIDRA_INT(pathEnd) - GHIDRA_INT((local_190 + 1)));
|
|
ehState = 0x24;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar8,&tmpString);
|
|
ehState = 0xffffffff;
|
|
bVar3 = extraout_CL_05;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar9 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar9) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar9 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7)))))
|
|
goto LAB_0070d535;
|
|
}
|
|
operator_delete(pcVar7,uVar9);
|
|
bVar3 = extraout_CL_06;
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount));
|
|
}
|
|
}
|
|
ANM2::LoadGraphics(&this->_sprite,bVar3);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyClosed"),9);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyOpen"),7);
|
|
goto LAB_0070eb83;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_10_BossRoomDoor.anm2"));
|
|
ehState = 0x1a;
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
layer = ANM2::GetLayer(&this->_sprite,&DAT_00b1ce2c);
|
|
if (this->_targetRoomType == 5) {
|
|
layer->_visible = 1;
|
|
goto LAB_0070eb83;
|
|
}
|
|
goto LAB_0070db6f;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyOpen"),7);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("KeyClosed"),9);
|
|
iVar4 = get_secret_exit_kind(this);
|
|
switch(iVar4) {
|
|
case 1:
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
anmPath._buf[0] = '\0';
|
|
anmPath._buf[1] = '\0';
|
|
anmPath._buf[2] = '\0';
|
|
anmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anmPath._size = 0x1b;
|
|
anmPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0))),"gfx/grid/Door_Downpour.anm2",0x1c);
|
|
ehState = 6;
|
|
ANM2::Load(&this->_sprite,&anmPath,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < anmPath._capacity) {
|
|
uVar8 = anmPath._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + -4));
|
|
uVar8 = anmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) & 0xffffff00;
|
|
break;
|
|
case 2:
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
tmpString._buf[0] = '\0';
|
|
tmpString._buf[1] = '\0';
|
|
tmpString._buf[2] = '\0';
|
|
tmpString._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
tmpString._size = 0x18;
|
|
tmpString._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0))),"gfx/grid/Door_Mines.anm2",0x19);
|
|
ehState = 7;
|
|
ANM2::Load(&this->_sprite,&tmpString,1);
|
|
ehState = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar8 = tmpString._capacity + 1;
|
|
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar8 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar7,uVar8);
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((secretExitPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_Mines_Planks.anm2"));
|
|
ehState = 8;
|
|
ANM2::Load(&this->_extraSprite,&secretExitPath,1);
|
|
pathString = &secretExitPath;
|
|
goto LAB_0070db14;
|
|
case 3:
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasPhotoDoor();
|
|
if (bVar3 == 0) {
|
|
(GHIDRA_CAST<msvc::string *>((mausoleumDoorPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_Mausoleum.anm2"));
|
|
ehState = 10;
|
|
ANM2::Load(&this->_sprite,&mausoleumDoorPath,1);
|
|
pathString = &mausoleumDoorPath;
|
|
goto LAB_0070db14;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((secretExitPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_Mausoleum_Alt.anm2"));
|
|
ehState = 9;
|
|
ANM2::Load(&this->_sprite,&secretExitPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((secretExitPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x1));
|
|
layer->_visible = 1;
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x2));
|
|
layer->_visible = 0;
|
|
layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004);
|
|
layer->_visible = 0;
|
|
this->_doorFlags = this->_doorFlags | 0x40;
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
break;
|
|
case 4:
|
|
(GHIDRA_CAST<msvc::string *>((momsHeartDoorPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_MomsHeart.anm2"));
|
|
ehState = 0xb;
|
|
ANM2::Load(&this->_sprite,&momsHeartDoorPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((momsHeartDoorPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
bVar1 = false;
|
|
if (g_game->_currentRoomIdx == -10) {
|
|
(GHIDRA_CAST<msvc::string *>(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Disappear"),9);
|
|
}
|
|
break;
|
|
default:
|
|
(GHIDRA_CAST<msvc::string *>((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/Door_01_NormalDoor.anm2"));
|
|
ehState = 0xc;
|
|
ANM2::Load(&this->_sprite,&doorAnmPath,1);
|
|
pathString = &doorAnmPath;
|
|
LAB_0070db14:
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((pathString->_buf)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
if (this->_targetRoomType != 0x1b) {
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>("Background"));
|
|
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
(layer->_color)._colorize[0] = 0.5;
|
|
(layer->_color)._colorize[1] = 0.5;
|
|
(layer->_color)._colorize[2] = 0.5;
|
|
(layer->_color)._colorize[3] = 0.6;
|
|
}
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>("Light"));
|
|
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
LAB_0070db6f:
|
|
layer->_visible = 0;
|
|
}
|
|
}
|
|
LAB_0070eb83:
|
|
payToPlayOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x17c,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((((payToPlayOwner != GHIDRA_CAST<Entity_Player *>(0x0)) || (g_game->_challenge == 0x18)) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2)))) &&
|
|
((this->_currentRoomType != 9 && (this->_targetRoomType != 9)))) {
|
|
pathString = &this->_openLockedAnimation;
|
|
if (0xf < (this->_openLockedAnimation)._capacity) {
|
|
pathString = *GHIDRA_CAST<std_string **>((this->_openLockedAnimation)._buf);
|
|
}
|
|
bVar3 = str_eq(GHIDRA_CAST<uint8_t *>(pathString),(this->_openLockedAnimation)._size,GHIDRA_CAST<uint8_t *>("KeyOpen"),7);
|
|
if ((bVar3 != 0) || (g_game->_challenge == 0x18)) {
|
|
pvVar6 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST<uint8_t *>("CoinClosed"));
|
|
if (pvVar6 != (void *)0x0) {
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("CoinClosed"),10);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("CoinOpen"),8);
|
|
}
|
|
this->_doorFlags = this->_doorFlags | 1;
|
|
}
|
|
}
|
|
colorizeB = ((this->_sprite)._rotation + 90.0) * 0.017453292;
|
|
tintR = sin(colorizeB);
|
|
colorizeB = cos(colorizeB);
|
|
(this->_sprite)._offset.x = colorizeB * offsetLength;
|
|
(this->_sprite)._offset.y = tintR * offsetLength;
|
|
bVar3 = (this->_extraSprite)._loaded;
|
|
(this->_extraSprite)._offset.x = colorizeB * offsetLength;
|
|
(this->_extraSprite)._offset.y = (this->_sprite)._offset.y;
|
|
if ((bVar3 == 0) && (bVar1)) {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (iVar4 == 2) {
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (void *)0x0;
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/grid/door_16_doublelock.anm2"),0x20);
|
|
ehState = 0x25;
|
|
ANM2::Load(&this->_extraSprite,&tmpString,1);
|
|
if (0xf < tmpString._capacity) {
|
|
uVar8 = tmpString._capacity + 1;
|
|
pvVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pvVar6 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
|
|
uVar8 = tmpString._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,uVar8);
|
|
}
|
|
}
|
|
else if (iVar4 == 3) {
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/door_18_crackeddoor.anm2"));
|
|
ehState = 0x26;
|
|
ANM2::Load(&this->_extraSprite,GHIDRA_CAST<std_string *>((local_c8 + 0x14)),1);
|
|
(GHIDRA_CAST<msvc::string *>((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
else if ((iVar4 == 4) || (iVar4 == 6)) {
|
|
(GHIDRA_CAST<msvc::string *>((barDoorPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>("gfx/grid/door_17_bardoor.anm2"));
|
|
ehState = 0x27;
|
|
ANM2::Load(&this->_extraSprite,&barDoorPath,1);
|
|
ehState = 0xffffffff;
|
|
(GHIDRA_CAST<msvc::string *>((barDoorPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Closed"),6);
|
|
}
|
|
}
|
|
this->_isExtraVisible = 0;
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 0070ee40
|
|
void GridEntity_Door::UpdateAnimation()
|
|
{
|
|
int iVar1;
|
|
uint8_t bVar2;
|
|
LayerState *layer;
|
|
Entity_Player *player;
|
|
uint8_t *animNameCursor;
|
|
uint32_t uVar3;
|
|
int iVar4;
|
|
char *pcVar5;
|
|
std_string *expectedName;
|
|
uint8_t *variantPtr;
|
|
std_string *animName;
|
|
GridEntity_Door *variantRef;
|
|
Sprite *sprite;
|
|
bool bVar6;
|
|
EntityList_EL familiars;
|
|
int roomAge;
|
|
int spawnAge;
|
|
GridEntity_Door *local_18;
|
|
GridEntity_Door *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint8_t *animData;
|
|
Game *game;
|
|
int variant;
|
|
|
|
game = g_game;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc96d;
|
|
local_10 = ExceptionList;
|
|
if ((this->_sprite)._loaded == 0) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_10;
|
|
this->_isExtraVisible = 0;
|
|
roomAge = game->_frameCount;
|
|
pcVar5 = game->_room;
|
|
spawnAge = roomAge - this->_spawnFrame;
|
|
if (*pcVar5 == '\0') {
|
|
roomAge = -1;
|
|
}
|
|
else {
|
|
roomAge = roomAge - *GHIDRA_CAST<int *>((pcVar5 + 0x11f0));
|
|
}
|
|
sprite = GHIDRA_CAST<Sprite *>(&this->_sprite);
|
|
local_18 = this;
|
|
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(sprite),GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 1;
|
|
iVar4 = this->_targetRoomType;
|
|
if (iVar4 == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
if ((((iVar1 == 1) || (iVar1 == 4)) || (iVar1 == 3)) || (iVar1 == 5)) {
|
|
iVar1 = this->_currentRoomType;
|
|
if (((((iVar1 == 7) || (iVar4 == 7)) || ((iVar1 == 8 || ((iVar4 == 8 || (iVar1 == 0x1d)))))) ||
|
|
(iVar4 == 0x1d)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 7)) {
|
|
ANM2::Play(GHIDRA_CAST<ANM2 *>(sprite),GHIDRA_CAST<uint8_t *>("Hidden"),0);
|
|
variantRef = GHIDRA_CAST<GridEntity_Door *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
}
|
|
else {
|
|
variantPtr = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)));
|
|
variant = *GHIDRA_CAST<int *>(variantPtr);
|
|
local_18 = GHIDRA_CAST<GridEntity_Door *>(variantPtr);
|
|
if (variant == 1) {
|
|
if ((((iVar1 == 0x1b) || (iVar4 == 0x1b)) &&
|
|
(iVar4 = get_secret_exit_kind(this), iVar4 == 3)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 3)) {
|
|
bVar2 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(sprite),&DAT_00b68d9c,1);
|
|
if (bVar2 != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
this->_previousState = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
this->_previousVariant = *GHIDRA_CAST<int *>(variantPtr);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
animName = &this->_lockedAnimation;
|
|
if (0xf < (this->_lockedAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0070f2ee:
|
|
bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar2 != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameCursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = animName;
|
|
do {
|
|
bVar2 = *animNameCursor;
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[0];
|
|
if (bVar2 != expectedName->_buf[0]) {
|
|
LAB_0070f2d0:
|
|
uVar3 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_0070f2d5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameCursor[1];
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[1];
|
|
if (bVar2 != expectedName->_buf[1]) goto LAB_0070f2d0;
|
|
animNameCursor = animNameCursor + 2;
|
|
expectedName = GHIDRA_CAST<std_string *>((expectedName->_buf + 2));
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0070f2d5:
|
|
if ((uVar3 != 0) ||
|
|
((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_0070f2ee;
|
|
}
|
|
variantRef = local_18;
|
|
LAB_0070f30b:
|
|
local_14 = variantRef;
|
|
}
|
|
else if ((((variant == 4) || (variant == 3)) || (variant == 2)) || (variant == 6)) {
|
|
animName = &this->_closeAnimation;
|
|
if (0xf < (this->_closeAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0070f4b6:
|
|
bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar2 != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameCursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = animName;
|
|
do {
|
|
bVar2 = *animNameCursor;
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[0];
|
|
if (bVar2 != expectedName->_buf[0]) {
|
|
LAB_0070f4a0:
|
|
uVar3 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_0070f4a5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameCursor[1];
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[1];
|
|
if (bVar2 != expectedName->_buf[1]) goto LAB_0070f4a0;
|
|
animNameCursor = animNameCursor + 2;
|
|
expectedName = GHIDRA_CAST<std_string *>((expectedName->_buf + 2));
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0070f4a5:
|
|
if ((uVar3 != 0) ||
|
|
((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_0070f4b6;
|
|
}
|
|
if ((this->_doorFlags & 0x20) == 0) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetLastFrame();
|
|
}
|
|
variantRef = local_18;
|
|
local_14 = local_18;
|
|
if ((this->_extraSprite)._loaded != 0) {
|
|
iVar4 = *GHIDRA_CAST<int *>(local_18);
|
|
this->_isExtraVisible = 1;
|
|
if (iVar4 == 2) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 3) {
|
|
ANM2::Play(&this->_extraSprite,GHIDRA_CAST<uint8_t *>("TwoChains"),0);
|
|
goto LAB_0070f311;
|
|
}
|
|
if (this->_previousState == 3) {
|
|
pcVar5 = "OneChain";
|
|
}
|
|
else {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
pcVar5 = "GoldenKeyOpenChain1";
|
|
if (player->_hasGoldenKey == 0) {
|
|
pcVar5 = "KeyOpenChain1";
|
|
}
|
|
}
|
|
ANM2::Play(&this->_extraSprite,GHIDRA_CAST<uint8_t *>(pcVar5),0);
|
|
local_14 = variantRef;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 4) {
|
|
pcVar5 = "Damaged";
|
|
}
|
|
else if (((iVar4 != 4) && (iVar4 != 6)) || (pcVar5 = "Appear", spawnAge < 0xb)) {
|
|
pcVar5 = GHIDRA_CAST<char *>(s_Idle);
|
|
}
|
|
ANM2::Play(&this->_extraSprite,GHIDRA_CAST<uint8_t *>(pcVar5),0);
|
|
if (((this->_currentRoomType == 0x1b) || (this->_targetRoomType == 0x1b)) &&
|
|
(iVar4 = get_secret_exit_kind(this), iVar4 == 2)) {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x2));
|
|
layer->_visible = iVar4 != 4;
|
|
variantRef = local_18;
|
|
}
|
|
local_14 = variantRef;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
local_14 = GHIDRA_CAST<GridEntity_Door *>(variantPtr);
|
|
if ((this->_closeAnimation)._size != 0) {
|
|
animName = &this->_closeAnimation;
|
|
if (0xf < (this->_closeAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0070f3fe:
|
|
bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar2 != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameCursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = animName;
|
|
do {
|
|
bVar2 = *animNameCursor;
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[0];
|
|
if (bVar2 != expectedName->_buf[0]) {
|
|
LAB_0070f3e0:
|
|
uVar3 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_0070f3e5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameCursor[1];
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[1];
|
|
if (bVar2 != expectedName->_buf[1]) goto LAB_0070f3e0;
|
|
animNameCursor = animNameCursor + 2;
|
|
expectedName = GHIDRA_CAST<std_string *>((expectedName->_buf + 2));
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0070f3e5:
|
|
if ((uVar3 != 0) ||
|
|
((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_0070f3fe;
|
|
}
|
|
variantRef = local_18;
|
|
local_14 = local_18;
|
|
if (((this->_extraSprite)._loaded == 0) || (local_14 = local_18, *GHIDRA_CAST<int *>(local_18) == 8))
|
|
goto LAB_0070f30e;
|
|
this->_isExtraVisible = 1;
|
|
ANM2::Play(&this->_extraSprite,GHIDRA_CAST<uint8_t *>("Appear"),0);
|
|
goto LAB_0070f30b;
|
|
}
|
|
}
|
|
LAB_0070f30e:
|
|
variantRef = local_14;
|
|
}
|
|
LAB_0070f311:
|
|
if (((spawnAge < roomAge) ||
|
|
((((this->_doorFlags & 8) != 0 && (this->_slot != g_game->_enterDoor)) && (spawnAge == 0))))
|
|
&& ((this->_sprite)._animState._animData != (void *)0x0)) {
|
|
AnimationState::AdvancePosition
|
|
(&(this->_sprite)._animState,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1);
|
|
}
|
|
goto LAB_0070f174;
|
|
}
|
|
if (((iVar4 == 5) && (-1 < this->_targetRoomIdx)) && (g_game->_stage == 9)) {
|
|
bVar6 = true;
|
|
}
|
|
else {
|
|
bVar6 = false;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
if (((player->_hasGoldenKey == 0) || (bVar2 = IsRoomType(this,9), bVar2 != 0)) ||
|
|
((bVar2 = IsRoomType(this,0xb), bVar2 != 0 ||
|
|
((player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x17c,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0) || (bVar6)))))) {
|
|
animName = &this->_openLockedAnimation;
|
|
if (0xf < (this->_openLockedAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameCursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = animName;
|
|
do {
|
|
bVar2 = *animNameCursor;
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[0];
|
|
if (bVar2 != expectedName->_buf[0]) {
|
|
LAB_0070efc2:
|
|
uVar3 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_0070efc7;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameCursor[1];
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[1];
|
|
if (bVar2 != expectedName->_buf[1]) goto LAB_0070efc2;
|
|
animNameCursor = animNameCursor + 2;
|
|
expectedName = GHIDRA_CAST<std_string *>((expectedName->_buf + 2));
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0070efc7:
|
|
if ((uVar3 == 0) &&
|
|
((sprite = GHIDRA_CAST<Sprite *>(&this->_sprite), animData[0x34] == 0 ||
|
|
((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0070f148;
|
|
}
|
|
sprite = GHIDRA_CAST<Sprite *>(&this->_sprite);
|
|
bVar2 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(sprite),GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar2 != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
goto LAB_0070f145;
|
|
}
|
|
}
|
|
else {
|
|
ANM2::Play(GHIDRA_CAST<ANM2 *>(sprite),GHIDRA_CAST<uint8_t *>("GoldenKeyOpen"),0);
|
|
}
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2) {
|
|
bVar2 = 0;
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
pcVar5 = "KeyOpenChain2";
|
|
if (player->_hasGoldenKey != 0) {
|
|
pcVar5 = "GoldenKeyOpenChain2";
|
|
}
|
|
ANM2::Play(&this->_extraSprite,GHIDRA_CAST<uint8_t *>(pcVar5),bVar2);
|
|
this->_isExtraVisible = 1;
|
|
}
|
|
animName = &this->_openAnimation;
|
|
if (0xf < (this->_openAnimation)._capacity) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
animData = (this->_sprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_0070f0a0:
|
|
bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar2 != 0) {
|
|
AnimationState::Rewind(&(this->_sprite)._animState);
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameCursor = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
animNameCursor = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
expectedName = animName;
|
|
do {
|
|
bVar2 = *animNameCursor;
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[0];
|
|
if (bVar2 != expectedName->_buf[0]) {
|
|
LAB_0070f085:
|
|
uVar3 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_0070f08a;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = animNameCursor[1];
|
|
bVar6 = bVar2 < (uint8_t)expectedName->_buf[1];
|
|
if (bVar2 != expectedName->_buf[1]) goto LAB_0070f085;
|
|
animNameCursor = animNameCursor + 2;
|
|
expectedName = GHIDRA_CAST<std_string *>((expectedName->_buf + 2));
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0070f08a:
|
|
if ((uVar3 != 0) || ((animData[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
|
|
goto LAB_0070f0a0;
|
|
}
|
|
sprite = GHIDRA_CAST<Sprite *>(&this->_sprite);
|
|
if (this->_targetRoomIdx == -7) {
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,-1,-1,0,0);
|
|
local_8 = 0;
|
|
uVar3 = 0;
|
|
if (familiars._size != 0) {
|
|
do {
|
|
iVar4 = __RTDynamicCast(*GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + uVar3 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0);
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x2c)) == 0xec) {
|
|
*GHIDRA_CAST<uint32_t *>((iVar4 + 0xd88)) = 1;
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < GHIDRA_UINT(familiars._size));
|
|
this = local_18;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<EntityList_Query *>((&familiars)))->EntityList_Query::~EntityList_Query();
|
|
LAB_0070f145:
|
|
sprite = GHIDRA_CAST<Sprite *>(&this->_sprite);
|
|
}
|
|
}
|
|
LAB_0070f148:
|
|
if ((roomAge <= spawnAge) &&
|
|
(((spawnAge < 10 && ((this->_doorFlags & 0x40) == 0)) || (spawnAge < 2)))) {
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetLastFrame();
|
|
this->_isExtraVisible = 0;
|
|
}
|
|
variantRef = GHIDRA_CAST<GridEntity_Door *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
LAB_0070f174:
|
|
iVar4 = *GHIDRA_CAST<int *>(variantRef);
|
|
if (((iVar4 != 4) && (iVar4 != 6)) &&
|
|
((this->_previousVariant == 4 || (this->_previousVariant == 6)))) {
|
|
ANM2::Play(&this->_extraSprite,GHIDRA_CAST<uint8_t *>("Vanish"),0);
|
|
iVar4 = *GHIDRA_CAST<int *>(variantRef);
|
|
this->_isExtraVisible = 1;
|
|
}
|
|
this->_previousState = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
this->_previousVariant = iVar4;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0070f670
|
|
uint8_t GridEntity_Door::CanTakeDamageFromTearEffects()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->_doorFlags) >> 0xc),~(uint8_t)(GHIDRA_UINT(this->_doorFlags) >> 4)) &
|
|
0xffffff01;
|
|
}
|
|
|
|
// 0070f680
|
|
uint32_t GridEntity_Door::CanBlowOpen()
|
|
{
|
|
uint8_t isCheck;
|
|
Entity_Player *padlockOwner;
|
|
int doorVariant;
|
|
int doorVariant;
|
|
Game *game;
|
|
void *room;
|
|
|
|
if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) &&
|
|
((g_game->_stage == 0xb || (g_game->_stage == 0xc)))) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) {
|
|
return 0;
|
|
}
|
|
if (this->_targetRoomType == 0) {
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2) {
|
|
return 0;
|
|
}
|
|
if (g_game->_stage == 0xd) {
|
|
return 0;
|
|
}
|
|
isCheck = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x88);
|
|
game = g_game;
|
|
if (isCheck != 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) {
|
|
return 1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2) {
|
|
return 1;
|
|
}
|
|
}
|
|
doorVariant = this->_currentRoomType;
|
|
if (doorVariant == 1) {
|
|
if (this->_targetRoomType == 1) {
|
|
doorVariant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if ((((doorVariant != 1) && (doorVariant != 4)) && (doorVariant != 2)) && (doorVariant != 5))
|
|
{
|
|
return 1;
|
|
}
|
|
LAB_0070f748:
|
|
isCheck = IsRoomType(this,8);
|
|
if ((isCheck == 0) && (isCheck = IsRoomType(this,0x1d), isCheck == 0)) goto LAB_0070f79f;
|
|
}
|
|
else {
|
|
LAB_0070f73f:
|
|
if (this->_targetRoomType != 7) goto LAB_0070f748;
|
|
}
|
|
if (doorVariant == 5) goto LAB_0070f79f;
|
|
}
|
|
else if (doorVariant != 7) goto LAB_0070f73f;
|
|
if ((this->_targetRoomType != 5) &&
|
|
(((room = game->_room, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(room) + 0x7228)) == '\0' && (doorVariant != 6)) ||
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x44)) & 1) != 0)))) {
|
|
if (doorVariant != 0xb) {
|
|
return 1;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x44)) >> 3 & 1) != 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
LAB_0070f79f:
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 3) {
|
|
return 1;
|
|
}
|
|
if (((((this->_doorFlags & 9) != 0) || (this->_targetRoomType == 5)) ||
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5)) &&
|
|
(padlockOwner = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x88),
|
|
padlockOwner != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
doorVariant = (GHIDRA_CAST<Entity_Player *>((padlockOwner)))->Entity_Player::GetTrinketMultiplier(0x88);
|
|
if (doorVariant == 2) {
|
|
if ((this->_doorFlags & 9) != 0) {
|
|
return 1;
|
|
}
|
|
doorVariant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
}
|
|
else {
|
|
if (doorVariant < 3) {
|
|
return 0;
|
|
}
|
|
doorVariant = this->_targetRoomType;
|
|
}
|
|
if (doorVariant == 5) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0070f810
|
|
void GridEntity_Door::SpawnDust()
|
|
{
|
|
Vector *doorDirection;
|
|
uint32_t rngResult;
|
|
uint32_t rngValue;
|
|
Entity *dustEntity;
|
|
int *dust;
|
|
int iVar1;
|
|
float fVar2;
|
|
float cosAngle;
|
|
float fVar3;
|
|
float negDirY;
|
|
uint8_t *sideSign;
|
|
int dustCount;
|
|
Vector dustVelocity;
|
|
Vector local_10;
|
|
float dirX;
|
|
int gridWidth;
|
|
|
|
doorDirection = Isaac::GetAxisAlignedUnitVectorFromDir(&local_10,this->_direction);
|
|
dirX = doorDirection->x;
|
|
negDirY = -doorDirection->y;
|
|
rngResult = Random();
|
|
dustCount = (rngResult & 3) + 3;
|
|
if (dustCount != 0) {
|
|
do {
|
|
rngResult = Random();
|
|
rngValue = Random();
|
|
fVar2 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0;
|
|
rngValue = Random();
|
|
iVar1 = this->_gridIndex;
|
|
fVar3 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0 - 2.5;
|
|
dustVelocity.y = fVar3 * dirX + fVar2 * negDirY;
|
|
dustVelocity.x = fVar3 * negDirY + fVar2 * -dirX;
|
|
gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
rngValue = Random();
|
|
fVar2 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
fVar2 = fVar2 + fVar2;
|
|
rngValue = Random();
|
|
fVar3 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 20.0;
|
|
cosAngle = cos(fVar2);
|
|
local_10.x = cosAngle * fVar3 + (float)(iVar1 % gridWidth) * 40.0 + 40.0;
|
|
fVar2 = sin(fVar2);
|
|
local_10.y = fVar2 * fVar3 + (float)(iVar1 / gridWidth) * 40.0 + 120.0;
|
|
dustEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x3b,&local_10,&dustVelocity,GHIDRA_CAST<Entity *>(0x0),0,rngResult,
|
|
0);
|
|
dust = GHIDRA_CAST<int *>(__RTDynamicCast(dustEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor,0));
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
sideSign = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
if (((float)dust[0xcf] - ((float)(this->_gridIndex % iVar1) * 40.0 + 40.0)) * negDirY +
|
|
((float)dust[0xd0] - ((float)(this->_gridIndex / iVar1) * 40.0 + 120.0)) * dirX < 0.0) {
|
|
sideSign = &DAT_bf800000;
|
|
}
|
|
rngResult = Random();
|
|
dust[0x11d] = GHIDRA_INT((((float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10
|
|
* 10.0 + 2.0) * (float)sideSign));
|
|
rngResult = Random();
|
|
iVar1 = rngResult % 0xf + 0xf;
|
|
dust[0x117] = iVar1;
|
|
dust[0x118] = iVar1;
|
|
(**(code **)(*dust + 0xc))();
|
|
dustCount = dustCount + -1;
|
|
} while (dustCount != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0070fb60
|
|
uint8_t GridEntity_Door::TryBlowOpen(uint8_t isFromExplosion, Entity *source)
|
|
{
|
|
uint32_t *puVar1;
|
|
uint64_t qVar2;
|
|
char cVar3;
|
|
uint8_t bVar4;
|
|
ChallengeParam *challengeParams;
|
|
Entity_Player *player;
|
|
int iVar5;
|
|
ColorMod *color;
|
|
uint32_t rngResult;
|
|
ColorMod *color_00;
|
|
Entity *poof;
|
|
RoomDescriptor *targetRoomDesc;
|
|
ColorMod *color_01;
|
|
Vector *pVVar6;
|
|
ColorMod *color_02;
|
|
ColorMod *color_03;
|
|
uint32_t uVar7;
|
|
char *pcVar8;
|
|
int soundId;
|
|
Vector doorPos;
|
|
Color particleColor;
|
|
uint32_t stackCookie;
|
|
Game *game;
|
|
Manager *manager;
|
|
void *room;
|
|
int variant;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(&soundId);
|
|
if (((isFromExplosion == 0) && (source == GHIDRA_CAST<Entity *>(0x0))) &&
|
|
(cVar3 = FUN_00711740(), cVar3 == '\0')) {
|
|
return 0;
|
|
}
|
|
if ((this->_doorFlags & 0x10) != 0) {
|
|
if (((g_game->_challenge != 0) || ((g_game->_dailyChallenge)._id != 0)) &&
|
|
(challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams(), challengeParams->_pathType == 2)) {
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2) {
|
|
return 0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
this->_isBusted = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 2;
|
|
UpdateAnimation(this);
|
|
manager = g_manager;
|
|
soundId = 0x262;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
g_game->_levelStateFlags = g_game->_levelStateFlags | 0x800000;
|
|
if (source == GHIDRA_CAST<Entity *>(0x0)) {
|
|
return 1;
|
|
}
|
|
player = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((source)))->Entity)::GetPlayerAncestor();
|
|
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
return 1;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::DonateLuck(-7);
|
|
return 1;
|
|
}
|
|
iVar5 = get_secret_exit_kind(this);
|
|
if (iVar5 == 4) {
|
|
if (source == GHIDRA_CAST<Entity *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (source->_type != 3) {
|
|
return 0;
|
|
}
|
|
if (source->_variant == 0xdf) {
|
|
(GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&doorPos);
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
rngResult = Random();
|
|
Game::SpawnParticles(g_game,&doorPos,4,rngResult % 5 + 6,8.0,color,100000.0,10);
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
rngResult = Random();
|
|
Game::SpawnParticles(g_game,&doorPos,5,rngResult % 6 + 9,8.0,color_00,100000.0,0);
|
|
rngResult = Random();
|
|
poof = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,&doorPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,rngResult,0);
|
|
ANM2::Play(&poof->_sprite,GHIDRA_CAST<uint8_t *>("Poof_Large1"),0);
|
|
poof->_renderDepthOffset = 5.0;
|
|
manager = g_manager;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
this->_isBusted = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 2;
|
|
soundId = 0x4d;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
manager = g_manager;
|
|
soundId = 0x1c;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
UpdateAnimation(this);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::UpdateVisibility();
|
|
game = g_game;
|
|
qVar2 = g_game->_gameStateFlags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 | 0x100000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar2);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
iVar5 = this->_targetRoomType;
|
|
if (((iVar5 == 7) || (iVar5 == 8)) || (iVar5 == 0x1d)) {
|
|
bVar4 = 0xff;
|
|
iVar5 = this->_targetRoomIdx;
|
|
targetRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(iVar5,-1);
|
|
if ((targetRoomDesc->VisitedCount == 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 7)) {
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::PlayJingle(0x55,iVar5,bVar4);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 7) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 0)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::UncoverHiddenDoor(g_game->_currentRoomIdx,this->_slot);
|
|
}
|
|
if (((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) &&
|
|
((g_game->_stage == 0xb || (g_game->_stage == 0xc)))) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) ||
|
|
(((this->_targetRoomType == 0 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2)) || (g_game->_stage == 0xd))))
|
|
goto LAB_00710310;
|
|
bVar4 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x88);
|
|
if ((bVar4 == 0) || ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 1 && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 2)))) {
|
|
iVar5 = this->_currentRoomType;
|
|
if (iVar5 == 1) {
|
|
if (this->_targetRoomType == 1) {
|
|
variant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (((variant != 1) && (variant != 4)) && ((variant != 2 && (variant != 5))))
|
|
goto LAB_00710063;
|
|
LAB_0070ff8f:
|
|
bVar4 = IsRoomType(this,8);
|
|
if ((bVar4 != 0) || (bVar4 = IsRoomType(this,0x1d), bVar4 != 0)) goto LAB_0070ffa9;
|
|
}
|
|
else {
|
|
LAB_0070ff86:
|
|
if (this->_targetRoomType != 7) goto LAB_0070ff8f;
|
|
LAB_0070ffa9:
|
|
if (iVar5 != 5) goto LAB_0070ffae;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 != 7) goto LAB_0070ff86;
|
|
LAB_0070ffae:
|
|
if ((this->_targetRoomType != 5) &&
|
|
((((room = g_game->_room, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(room) + 0x7228)) == '\0' && (iVar5 != 6)) ||
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x44)) & 1) != 0)) &&
|
|
((iVar5 != 0xb || ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x44)) >> 3 & 1) != 0))))))
|
|
goto LAB_00710063;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 3) {
|
|
if (((((this->_doorFlags & 9) != 0) || (this->_targetRoomType == 5)) ||
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5)) &&
|
|
(player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x88),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
iVar5 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x88);
|
|
if (iVar5 == 2) {
|
|
if ((this->_doorFlags & 9) != 0) goto LAB_00710063;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
}
|
|
else {
|
|
if (iVar5 < 3) goto LAB_00710310;
|
|
iVar5 = this->_targetRoomType;
|
|
}
|
|
if (iVar5 == 5) goto LAB_00710063;
|
|
}
|
|
LAB_00710310:
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 7) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 0)) {
|
|
return 0;
|
|
}
|
|
if ((this->_currentRoomType == 6) ||
|
|
(uVar7 = 8, *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 0x7228)) != '\0')) {
|
|
uVar7 = 4;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = uVar7;
|
|
if (isFromExplosion != 0) {
|
|
SpawnDust(this);
|
|
}
|
|
goto LAB_00710353;
|
|
}
|
|
}
|
|
LAB_00710063:
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2)) &&
|
|
(bVar4 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x88), bVar4 != 0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
}
|
|
if (((this->_currentRoomType == 1) && (this->_targetRoomType == 1)) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 3 &&
|
|
((GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Break"),5), isFromExplosion != 0))))
|
|
{
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
rngResult = Random();
|
|
pVVar6 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&doorPos);
|
|
Game::SpawnParticles(g_game,pVVar6,0x1b,rngResult % 5 + 6,8.0,color_01,100000.0,0);
|
|
SpawnDust(this);
|
|
}
|
|
if (((this->_currentRoomType == 7) || (this->_targetRoomType == 7)) ||
|
|
((this->_currentRoomType == 8 || (this->_targetRoomType == 8)))) {
|
|
LAB_00710147:
|
|
pcVar8 = "Opened";
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Opened"),6);
|
|
if (isFromExplosion != 0) {
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
rngResult = Random();
|
|
pVVar6 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&doorPos);
|
|
Game::SpawnParticles(g_game,pVVar6,4,rngResult % 5 + 6,8.0,color_02,100000.0,0);
|
|
SpawnDust(this);
|
|
manager = g_manager;
|
|
soundId = 0x89;
|
|
seed_fart_sound_override(&soundId);
|
|
pcVar8 = GHIDRA_CAST<char *>(0x3f800000);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
else {
|
|
pcVar8 = GHIDRA_CAST<char *>(0x71013f);
|
|
bVar4 = IsRoomType(this,0x1d);
|
|
if (bVar4 != 0) goto LAB_00710147;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 3) {
|
|
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
|
|
rngResult = Random();
|
|
pVVar6 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&doorPos);
|
|
pcVar8 = GHIDRA_CAST<char *>(0x47c35000);
|
|
Game::SpawnParticles(g_game,pVVar6,0x1b,rngResult % 5 + 6,8.0,color_03,100000.0,0);
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 1) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 4;
|
|
LAB_00710353:
|
|
UpdateAnimation(this);
|
|
return 0;
|
|
}
|
|
}
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (iVar5 != 1) {
|
|
if (((iVar5 == 7) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 6)) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 0x7228)) != '\0')) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 4;
|
|
}
|
|
else {
|
|
if (iVar5 == 3) {
|
|
FUN_0070bfa0(0x1e1,2,pcVar8,0x3f800000);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
this->_isBusted = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 2;
|
|
}
|
|
}
|
|
UpdateAnimation(this);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::UpdateVisibility();
|
|
if (isFromExplosion != 0) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(199,1);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00710480
|
|
uint8_t GridEntity_Door::TryUnlock(Entity_Player *player, uint8_t isForce)
|
|
{
|
|
uint8_t bVar1;
|
|
char isDamaged;
|
|
int iVar2;
|
|
Entity_Player *trinketHolder;
|
|
Vector *pVVar3;
|
|
uint32_t rngResult;
|
|
Entity *particle;
|
|
uint8_t *pbVar4;
|
|
uint32_t uVar5;
|
|
uint8_t *pbVar6;
|
|
LayerState *layer;
|
|
RoomDescriptor *targetRoomDesc;
|
|
Entity_Player *trinketHolder;
|
|
uint32_t extraout_ECX;
|
|
char *wantedAnimNameStr;
|
|
ANM2 *sprite;
|
|
bool bVar7;
|
|
uint32_t in_stack_ffffff80;
|
|
float local_64;
|
|
uint32_t local_60;
|
|
float cosSpread;
|
|
float negDirY;
|
|
uint32_t slowParticleCount;
|
|
int particleCount;
|
|
Vector particleVelocity;
|
|
Vector particlePos;
|
|
Vector VStack_3c;
|
|
ColorMod local_34;
|
|
float dirX;
|
|
Game *game;
|
|
uint64_t gameStateFlags;
|
|
uint32_t *gameStateFlagsHigh;
|
|
Manager *manager;
|
|
code *takeDamage;
|
|
|
|
game = g_game;
|
|
if ((this->_doorFlags & 0x10) != 0) {
|
|
return 0;
|
|
}
|
|
if (player->_isCoopGhost != 0) {
|
|
return 0;
|
|
}
|
|
if (isForce == 0) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) && (this->_targetRoomType == 0x1b)) &&
|
|
(iVar2 = get_secret_exit_kind(this), iVar2 == 3)) {
|
|
if ((this->_doorFlags & 0x40) != 0) {
|
|
local_64 = 0.0;
|
|
trinketHolder = GHIDRA_CAST<Entity_Player *>(FUN_007103c0(&local_64));
|
|
if (trinketHolder == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (local_64 != 0.0) {
|
|
(GHIDRA_CAST<Entity_Player *>((trinketHolder)))->Entity_Player::TryRemoveTrinket(GHIDRA_UINT(local_64));
|
|
}
|
|
manager = g_manager;
|
|
local_60 = 8;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_60));
|
|
bVar1 = 0;
|
|
iVar2 = 0x3f800000;
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_60,1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::PlayJingle(0x44,iVar2,bVar1);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 2;
|
|
UpdateAnimation(this);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
sprite = &this->_sprite;
|
|
layer = ANM2::GetLayer(sprite,GHIDRA_CAST<uint8_t *>(0x1));
|
|
layer->_visible = 0;
|
|
bVar7 = local_64 == 9.66896e-44;
|
|
layer = ANM2::GetLayer(sprite,GHIDRA_CAST<uint8_t *>(0x2));
|
|
layer->_visible = bVar7;
|
|
layer = ANM2::GetLayer(sprite,&DAT_00000004);
|
|
layer->_visible = 0;
|
|
return 1;
|
|
}
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
((this->_sprite)._animState._isPlaying != 0)) {
|
|
pbVar6 = (this->_sprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar6 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<uint8_t **>(pbVar6);
|
|
}
|
|
pbVar4 = &DAT_00b68d9c;
|
|
do {
|
|
bVar1 = *pbVar6;
|
|
bVar7 = bVar1 < *pbVar4;
|
|
if (bVar1 != *pbVar4) {
|
|
LAB_007106c0:
|
|
uVar5 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_007106c5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar6[1];
|
|
bVar7 = bVar1 < pbVar4[1];
|
|
if (bVar1 != pbVar4[1]) goto LAB_007106c0;
|
|
pbVar6 = pbVar6 + 2;
|
|
pbVar4 = pbVar4 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar5 = 0;
|
|
LAB_007106c5:
|
|
if (uVar5 == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetHealthType();
|
|
if ((iVar2 != 2) && (bVar1 = (GHIDRA_CAST<Entity_Player *>((trinketHolder)))->Entity_Player::HasInstantDeathCurse(), bVar1 == 0)) {
|
|
in_stack_ffffff80 = 0x7106fd;
|
|
bVar1 = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x49);
|
|
if (bVar1 == 0) {
|
|
(GHIDRA_CAST<EntityRef *>((GHIDRA_CAST<EntityRef *>(&local_34))))->EntityRef::EntityRef();
|
|
takeDamage = *(code **)(*GHIDRA_CAST<int *>(player) + 0x20);
|
|
local_34._tint[0] = 0.0;
|
|
local_34._tint[1] = 1.40172e-41;
|
|
player->_damageCooldown = 0;
|
|
isDamaged = (*takeDamage)(0x40000000,0x12002080,0,extraout_ECX,0x1e);
|
|
if (isDamaged == '\0') {
|
|
return 0;
|
|
}
|
|
pVVar3 = Isaac::GetAxisAlignedUnitVectorFromDir(&VStack_3c,this->_direction);
|
|
dirX = pVVar3->x;
|
|
negDirY = -pVVar3->y;
|
|
in_stack_ffffff80 = Random();
|
|
pVVar3 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&VStack_3c);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,2,pVVar3,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),3,in_stack_ffffff80,0);
|
|
uVar5 = Random();
|
|
slowParticleCount = (uVar5 & 1) + 2;
|
|
rngResult = Random();
|
|
particleCount = (uVar5 & 1) + 8 + rngResult % 10;
|
|
local_60 = 0;
|
|
if (particleCount != 0) {
|
|
do {
|
|
uVar5 = local_60;
|
|
rngResult = Random();
|
|
local_64 = ((float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10
|
|
* 30.0 - 15.0) * 0.017453292;
|
|
cosSpread = cos(local_64);
|
|
local_64 = sin(local_64);
|
|
rngResult = Random();
|
|
particleVelocity.y =
|
|
(float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 * 15.0
|
|
+ 5.0;
|
|
particleVelocity.x = (-dirX * cosSpread - negDirY * local_64) * particleVelocity.y;
|
|
particleVelocity.y = (negDirY * cosSpread + -dirX * local_64) * particleVelocity.y;
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
particlePos.x = (float)(this->_gridIndex % iVar2) * 40.0 + 40.0 + particleVelocity.x;
|
|
particlePos.y = (float)(this->_gridIndex / iVar2) * 40.0 + 120.0 + particleVelocity.y;
|
|
in_stack_ffffff80 = Random();
|
|
if (uVar5 < slowParticleCount) {
|
|
VStack_3c.x = particleVelocity.x * 0.2;
|
|
VStack_3c.y = particleVelocity.y * 0.2;
|
|
particle = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,5,&particlePos,&VStack_3c,GHIDRA_CAST<Entity *>(0x0),0,
|
|
in_stack_ffffff80,0);
|
|
particle->Update();
|
|
local_60 = uVar5;
|
|
}
|
|
else {
|
|
particle = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,5,&particlePos,&particleVelocity,GHIDRA_CAST<Entity *>(0x0),
|
|
99,in_stack_ffffff80,0);
|
|
particle->Update();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(particle[1])) + 0x4)))) = 0xc1000000;
|
|
}
|
|
local_60 = local_60 + 1;
|
|
} while (GHIDRA_INT(local_60) < particleCount);
|
|
}
|
|
goto LAB_007109b9;
|
|
}
|
|
}
|
|
this->_varData = 0;
|
|
LAB_007109b9:
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = (this->_varData != 0) + 2;
|
|
UpdateAnimation(this);
|
|
if (this->_varData < 1) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
}
|
|
else {
|
|
this->_varData = this->_varData + -1;
|
|
}
|
|
FUN_0070bfa0(0x48,2,in_stack_ffffff80,0x3f800000);
|
|
return 1;
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5) {
|
|
gameStateFlags = g_game->_gameStateFlags;
|
|
gameStateFlagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*gameStateFlagsHigh = *gameStateFlagsHigh | 0x20000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(gameStateFlags);
|
|
}
|
|
bVar7 = false;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2)) {
|
|
in_stack_ffffff80 = 0x96;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x96,0);
|
|
if (bVar1 != 0) {
|
|
isForce = 1;
|
|
bVar7 = true;
|
|
}
|
|
}
|
|
if (g_game->_stage == 9) {
|
|
in_stack_ffffff80 = 0x71051b;
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0xaf);
|
|
if (iVar2 < 2) goto LAB_00710a08;
|
|
isForce = 1;
|
|
}
|
|
else {
|
|
LAB_00710a08:
|
|
if (isForce == 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2) {
|
|
return 0;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 1) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 2)) {
|
|
return 0;
|
|
}
|
|
if ((this->_isExtraVisible != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 3)) {
|
|
bVar1 = ANM2::IsPlaying(&this->_extraSprite,GHIDRA_CAST<uint8_t *>("GoldenKeyOpenChain1"));
|
|
if (bVar1 != 0) {
|
|
return 0;
|
|
}
|
|
in_stack_ffffff80 = 0x710a68;
|
|
bVar1 = ANM2::IsPlaying(&this->_extraSprite,GHIDRA_CAST<uint8_t *>("KeyOpenChain1"));
|
|
if (bVar1 != 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
if ((this->_doorFlags & 1) == 0) {
|
|
if (this->_targetRoomType == 2) {
|
|
in_stack_ffffff80 = 0x53;
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x53,0);
|
|
if (bVar1 != 0) goto LAB_00710af5;
|
|
}
|
|
}
|
|
else if (0 < player->_numCoins) goto LAB_00710af5;
|
|
if (((this->_targetRoomType != 5) || (this->_targetRoomIdx < 0)) || (g_game->_stage != 9)) {
|
|
if ((this->_doorFlags & 1) != 0) {
|
|
return 0;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2)) {
|
|
in_stack_ffffff80 = 0x710ade;
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x13);
|
|
if (2 < iVar2) goto LAB_00710af5;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::TryUseKey();
|
|
if (bVar1 == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_00710af5:
|
|
if ((this->_doorFlags & 1) == 0) {
|
|
if (isForce == 0) goto LAB_00710b1b;
|
|
}
|
|
else if (isForce == 0) {
|
|
in_stack_ffffff80 = 0x710b0b;
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddCoins(-1);
|
|
goto LAB_00710b1b;
|
|
}
|
|
this->_isUnlockedByPlayer = 1;
|
|
LAB_00710b1b:
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 3)) && (isForce == 0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 3;
|
|
UpdateAnimation(this);
|
|
return 1;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 2;
|
|
UpdateAnimation(this);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
manager = g_manager;
|
|
if (((this->_targetRoomType == 5) && (-1 < this->_targetRoomIdx)) && (g_game->_stage == 9)) {
|
|
FUN_0070bfa0(0xe,2,in_stack_ffffff80,0x3e99999a);
|
|
}
|
|
else {
|
|
local_60 = 0x2d;
|
|
if ((this->_doorFlags & 1) == 0) {
|
|
local_60 = 0x9c;
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_60));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_60,1.0,2,0,1.0,0.0);
|
|
}
|
|
if (bVar7) {
|
|
pbVar6 = (this->_sprite)._animState._animData;
|
|
if (pbVar6 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if ((this->_sprite)._animState._isPlaying != 0) {
|
|
pbVar4 = pbVar6;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar6 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar6);
|
|
}
|
|
wantedAnimNameStr = "GoldenKeyOpen";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*wantedAnimNameStr;
|
|
if (bVar1 != *wantedAnimNameStr) {
|
|
LAB_00710c35:
|
|
uVar5 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_00710c3a;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)wantedAnimNameStr[1];
|
|
if (bVar1 != wantedAnimNameStr[1]) goto LAB_00710c35;
|
|
pbVar4 = pbVar4 + 2;
|
|
wantedAnimNameStr = wantedAnimNameStr + 2;
|
|
} while (bVar1 != 0);
|
|
uVar5 = 0;
|
|
LAB_00710c3a:
|
|
if (uVar5 == 0) {
|
|
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("KeyOpen"),0);
|
|
pbVar6 = (this->_sprite)._animState._animData;
|
|
}
|
|
}
|
|
if ((pbVar6 != GHIDRA_CAST<uint8_t *>(0x0)) && ((this->_sprite)._animState._isPlaying != 0)) {
|
|
pbVar6 = (this->_sprite)._animState._animData;
|
|
if (pbVar6 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar6 = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar6 + 0x14))) {
|
|
pbVar6 = *GHIDRA_CAST<uint8_t **>(pbVar6);
|
|
}
|
|
wantedAnimNameStr = "KeyOpen";
|
|
do {
|
|
bVar1 = *pbVar6;
|
|
bVar7 = bVar1 < (uint8_t)*wantedAnimNameStr;
|
|
if (bVar1 != *wantedAnimNameStr) {
|
|
LAB_00710ca0:
|
|
uVar5 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_00710ca5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar6[1];
|
|
bVar7 = bVar1 < (uint8_t)wantedAnimNameStr[1];
|
|
if (bVar1 != wantedAnimNameStr[1]) goto LAB_00710ca0;
|
|
pbVar6 = pbVar6 + 2;
|
|
wantedAnimNameStr = wantedAnimNameStr + 2;
|
|
} while (bVar1 != 0);
|
|
uVar5 = 0;
|
|
LAB_00710ca5:
|
|
if ((uVar5 == 0) &&
|
|
(layer = ANM2::GetLayer(&this->_sprite,&DAT_00b1ce2c), layer != GHIDRA_CAST<LayerState *>(0x0))) {
|
|
local_34._tint[0] = 1.0;
|
|
local_34._tint[1] = 1.0;
|
|
local_34._tint[2] = 1.0;
|
|
local_34._tint[3] = 1.0;
|
|
local_34._colorize[0] = 0.4;
|
|
local_34._colorize[1] = 0.6;
|
|
local_34._colorize[2] = 1.0;
|
|
local_34._colorize[3] = 1.0;
|
|
local_34._offset[0] = 0.0;
|
|
local_34._offset[1] = 0.0;
|
|
local_34._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&layer->_color))))->Color::operator_assign(&local_34);
|
|
}
|
|
}
|
|
}
|
|
targetRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if (targetRoomDesc->Data != (void *)0x0) {
|
|
targetRoomDesc->Flags = targetRoomDesc->Flags | 0x40000;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00710d30
|
|
void GridEntity_Door::Close(uint8_t isForce)
|
|
{
|
|
int currentRoomType;
|
|
int targetRoomType;
|
|
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 1) || (isForce != 0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 1;
|
|
UpdateAnimation(this);
|
|
currentRoomType = this->_currentRoomType;
|
|
if (((currentRoomType == 7) ||
|
|
(((targetRoomType = this->_targetRoomType, targetRoomType == 7 || (currentRoomType == 8)) ||
|
|
(targetRoomType == 8)))) || ((currentRoomType == 0x1d || (targetRoomType == 0x1d)))) {
|
|
(GHIDRA_CAST<msvc::string *>(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00710d90
|
|
void GridEntity_Door::Bar()
|
|
{
|
|
uint8_t isSpriteLoaded;
|
|
|
|
isSpriteLoaded = (this->_extraSprite)._loaded;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 4;
|
|
if ((isSpriteLoaded == 0) || ((this->_doorFlags & 0x20) != 0)) {
|
|
LoadSprite(this);
|
|
}
|
|
UpdateAnimation(this);
|
|
return;
|
|
}
|
|
|
|
// 00710dd0
|
|
void GridEntity_Door::Open()
|
|
{
|
|
uint32_t *puVar1;
|
|
uint64_t qVar2;
|
|
uint8_t isFromSecretRoom;
|
|
char cVar4;
|
|
int variant;
|
|
RoomDescriptor *targetRoom;
|
|
int currentRoomType;
|
|
Game *game;
|
|
bool isFromSecretRoom;
|
|
|
|
if (((this->_doorFlags & 0x10U) != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 8)) {
|
|
return;
|
|
}
|
|
if (((this->_doorFlags & 0x20U) != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 4)) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 2) {
|
|
return;
|
|
}
|
|
variant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (variant == 7) {
|
|
return;
|
|
}
|
|
currentRoomType = this->_currentRoomType;
|
|
if (this->_targetRoomType == 0xb) {
|
|
if ((currentRoomType == 7) || (currentRoomType == 8)) {
|
|
isFromSecretRoom = true;
|
|
}
|
|
else {
|
|
isFromSecretRoom = false;
|
|
}
|
|
isFromSecretRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanOpenChallengeRoom(this->_targetRoomIdx);
|
|
if (((isFromSecretRoom == 0) && (this->_isUnlockedByPlayer == 0)) && (!isFromSecretRoom)) {
|
|
return;
|
|
}
|
|
goto LAB_00710e57;
|
|
}
|
|
if (currentRoomType == 0xb) {
|
|
if (((g_game->_ambush)._isActive != 0) && (this->_isUnlockedByPlayer == 0)) {
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
isFromSecretRoom = IsRoomType(this,0);
|
|
if (isFromSecretRoom != 0) {
|
|
return;
|
|
}
|
|
if (variant != 4) {
|
|
if (variant == 6) {
|
|
cVar4 = FUN_00710f70(g_game->_greedModeWave);
|
|
if (cVar4 != '\0') {
|
|
LAB_00710f2b:
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 8) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else if ((variant != 1) ||
|
|
(targetRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1),
|
|
targetRoom->VisitedCount == 0)) goto LAB_00710f2b;
|
|
}
|
|
}
|
|
cVar4 = FUN_00711740();
|
|
if (cVar4 == '\0') {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 5;
|
|
return;
|
|
}
|
|
LAB_00710e57:
|
|
game = g_game;
|
|
variant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (variant == 5) {
|
|
qVar2 = g_game->_gameStateFlags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 | 0x20000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar2);
|
|
variant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
}
|
|
if (((variant == 6) && (this->_targetRoomType == 4)) &&
|
|
(this->_targetRoomIdx == g_game->_greedModeTreasureRoomIdx)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 1;
|
|
UpdateAnimation(this);
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 2;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
UpdateAnimation(this);
|
|
return;
|
|
}
|
|
|
|
// 00710fa0
|
|
void GridEntity_Door::SetRoomTypes(int CurrentRoomType, int TargetRoomType)
|
|
{
|
|
uint8_t bVar1;
|
|
RoomDescriptor *currentRoomDesc;
|
|
RoomDescriptor *targetRoomDesc;
|
|
RoomDescriptor *roomDesc;
|
|
void *roomData;
|
|
uint32_t roomSubtype;
|
|
Entity_Player *taintedKeeper;
|
|
int iVar2;
|
|
int iVar3;
|
|
Game *game;
|
|
bool isGreedMode;
|
|
bool isMirrorWorld;
|
|
int targetType;
|
|
|
|
game = g_game;
|
|
if ((g_game->_difficulty == 2) || (isGreedMode = false, g_game->_difficulty == 3)) {
|
|
isGreedMode = true;
|
|
}
|
|
this->_currentRoomType = CurrentRoomType;
|
|
this->_targetRoomType = TargetRoomType;
|
|
bVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::HasMirrorDimension();
|
|
if ((bVar1 == 0) || (isMirrorWorld = true, g_game->_currentDimensionIdx != 1)) {
|
|
isMirrorWorld = false;
|
|
}
|
|
currentRoomDesc =
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,g_game->_currentDimensionIdx);
|
|
targetRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if (((GHIDRA_UINT(currentRoomDesc->Flags) >> 10 & 1) != 0) ||
|
|
((GHIDRA_UINT(targetRoomDesc->Flags) >> 10 & 1) != 0)) {
|
|
if ((this->_currentRoomType == 7) || (this->_currentRoomType == 8)) {
|
|
this->_currentRoomType = 1;
|
|
}
|
|
if ((this->_targetRoomType == 7) || (this->_targetRoomType == 8)) {
|
|
this->_targetRoomType = 1;
|
|
}
|
|
}
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (iVar2 != 0) goto LAB_00711235;
|
|
iVar2 = g_game->_difficulty;
|
|
if ((iVar2 == 2) || (iVar2 == 3)) {
|
|
iVar3 = this->_targetRoomType;
|
|
if ((iVar3 == 0x17) && (g_game->_greedModeWave < GHIDRA_INT(((iVar2 == 3) + 10)))) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 6;
|
|
goto LAB_00711262;
|
|
}
|
|
}
|
|
else {
|
|
iVar3 = this->_targetRoomType;
|
|
}
|
|
iVar2 = this->_currentRoomType;
|
|
if ((((iVar2 != 7) && (iVar2 != 8)) && (iVar2 != 0x1d)) && (iVar2 != 10)) {
|
|
if (iVar3 == 0x1b) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
roomData = roomDesc->Data;
|
|
if (roomData != (void *)0x0) {
|
|
LAB_0071111e:
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomData) + 0x10)) != 0) {
|
|
LAB_007111ae:
|
|
game = g_game;
|
|
if (this->_targetRoomType == 0x1b) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
LAB_007111e8:
|
|
game = g_game;
|
|
if (roomDesc->Data == (void *)0x0) {
|
|
roomSubtype = 0;
|
|
}
|
|
else {
|
|
roomSubtype = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(roomDesc->Data) + 0x10));
|
|
}
|
|
switch(roomSubtype) {
|
|
case 2:
|
|
case 4:
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 3;
|
|
iVar2 = 3;
|
|
break;
|
|
case 3:
|
|
this->_varData = 1;
|
|
default:
|
|
switchD_007111fc_caseD_1:
|
|
iVar2 = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 1;
|
|
}
|
|
}
|
|
else {
|
|
if (this->_currentRoomType == 0x1b) {
|
|
roomDesc = *GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(g_game->_room) + 4));
|
|
goto LAB_007111e8;
|
|
}
|
|
if (this->_targetRoomType != 5) {
|
|
if (((this->_currentRoomType == 5) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10)), iVar2 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar2 + 0x10)) == 0x5a)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 3;
|
|
iVar2 = 3;
|
|
goto LAB_00711220;
|
|
}
|
|
goto switchD_007111fc_caseD_1;
|
|
}
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
game = g_game;
|
|
if ((roomDesc->Data == (void *)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 0x10)) != 0x5a))
|
|
goto switchD_007111fc_caseD_1;
|
|
iVar2 = 3;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 3;
|
|
}
|
|
LAB_00711220:
|
|
if (game->_currentRoomIdx == -10) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
iVar2 = 8;
|
|
}
|
|
goto LAB_00711235;
|
|
}
|
|
}
|
|
}
|
|
else if (iVar2 == 0x1b) {
|
|
roomData = *(void **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10);
|
|
if (roomData != (void *)0x0) goto LAB_0071111e;
|
|
}
|
|
else if (iVar3 == 5) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1);
|
|
if (roomDesc->Data != (void *)0x0) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 0x10));
|
|
goto joined_r0x007111a8;
|
|
}
|
|
}
|
|
else if ((iVar2 == 5) && (iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10)), iVar2 != 0)
|
|
) {
|
|
iVar2 = *GHIDRA_CAST<int *>((iVar2 + 0x10));
|
|
joined_r0x007111a8:
|
|
if (iVar2 == 0x5a) goto LAB_007111ae;
|
|
}
|
|
}
|
|
game = g_game;
|
|
if (g_game->_currentRoomIdx != -0x10) {
|
|
iVar2 = this->_targetRoomIdx;
|
|
if (iVar2 != -0x65) {
|
|
if (iVar2 != -100) goto LAB_0071132c;
|
|
goto LAB_007113a8;
|
|
}
|
|
if (g_game->_currentDimensionIdx == 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 3;
|
|
LAB_00711244:
|
|
if (((GHIDRA_UINT(currentRoomDesc->Flags) >> 10 & 1) == 0) ||
|
|
((GHIDRA_UINT(targetRoomDesc->Flags) >> 10 & 1) != 0)) goto LAB_00711262;
|
|
goto LAB_0071125b;
|
|
}
|
|
LAB_0071132c:
|
|
iVar3 = this->_currentRoomType;
|
|
if (((iVar3 == 7) || (iVar3 == 8)) || ((iVar3 == 0x1d || (iVar3 == 10)))) goto LAB_007113fb;
|
|
targetType = this->_targetRoomType;
|
|
if (targetType == 9) goto LAB_007113a8;
|
|
if (g_game->_challenge == 0x18) {
|
|
if (((targetType != 7) && (targetType != 8)) && (targetType != 0xb)) {
|
|
if (targetType != 0x1d) goto LAB_007113a8;
|
|
goto LAB_0071137e;
|
|
}
|
|
LAB_007113be:
|
|
if (targetType == 2) {
|
|
if (!isMirrorWorld) {
|
|
if ((((g_game->_stage != 1) || (bVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsAltPath(), bVar1 != 0)) &&
|
|
(bVar1 = (GHIDRA_CAST<Game *>((game)))->Game::IsGreedMode(), bVar1 == 0)) &&
|
|
(taintedKeeper = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::FirstPlayerByType(0x21),
|
|
taintedKeeper == GHIDRA_CAST<Entity_Player *>(0x0))) goto LAB_007113a8;
|
|
iVar2 = this->_targetRoomIdx;
|
|
}
|
|
}
|
|
else if (((targetType == 5) && (-1 < iVar2)) && (g_game->_stage == 9)) {
|
|
LAB_007113a8:
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 1;
|
|
goto LAB_00711244;
|
|
}
|
|
LAB_007113fb:
|
|
if (isGreedMode) goto LAB_00711401;
|
|
LAB_0071143f:
|
|
if ((iVar3 == 7) || (iVar3 == 8)) goto LAB_0071146d;
|
|
LAB_00711449:
|
|
if (iVar3 == 0x1d) goto LAB_0071146d;
|
|
targetType = this->_targetRoomType;
|
|
if ((targetType == 0x12) || (targetType == 0x13)) {
|
|
iVar2 = 3;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 3;
|
|
LAB_00711235:
|
|
if (((iVar2 != 1) && (iVar2 != 3)) && (iVar2 != 2)) goto LAB_00711262;
|
|
goto LAB_00711244;
|
|
}
|
|
if ((targetType == 0x15) || (targetType == 0x14)) {
|
|
iVar2 = 2;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 2;
|
|
goto LAB_00711235;
|
|
}
|
|
if (iVar3 != 6) goto LAB_0071146d;
|
|
LAB_0071147c:
|
|
if ((((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x44)) & 1) == 0) &&
|
|
(targetType = this->_targetRoomType, targetType != 7)) &&
|
|
((targetType != 8 && (targetType != 0x1d)))) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 4;
|
|
goto LAB_00711262;
|
|
}
|
|
}
|
|
else {
|
|
LAB_0071137e:
|
|
if (targetType != 4) {
|
|
if ((targetType == 0x18) || (targetType == 0xc)) goto LAB_007113a8;
|
|
goto LAB_007113be;
|
|
}
|
|
if (isMirrorWorld) goto LAB_007113fb;
|
|
if (g_game->_stage == 1) {
|
|
bVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsAltPath();
|
|
iVar2 = this->_targetRoomIdx;
|
|
if (bVar1 == 0) goto LAB_007113fb;
|
|
}
|
|
if (!isGreedMode) goto LAB_007113a8;
|
|
LAB_00711401:
|
|
if (this->_targetRoomType != 4) goto LAB_0071143f;
|
|
if ((iVar3 != 7) && (iVar3 != 8)) {
|
|
if (iVar2 == game->_greedModeTreasureRoomIdx) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 1;
|
|
goto LAB_00711244;
|
|
}
|
|
goto LAB_00711449;
|
|
}
|
|
LAB_0071146d:
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(game->_room) + 0x7228)) != '\0') goto LAB_0071147c;
|
|
}
|
|
if (iVar2 == -7) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 5;
|
|
goto LAB_00711262;
|
|
}
|
|
if (((((iVar3 == 7) || (iVar2 = this->_targetRoomType, iVar2 == 7)) || (iVar3 == 8)) ||
|
|
((iVar2 == 8 || (iVar3 == 0x1d)))) || (iVar2 == 0x1d)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 7;
|
|
goto LAB_00711262;
|
|
}
|
|
}
|
|
LAB_0071125b:
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 8;
|
|
LAB_00711262:
|
|
LoadSprite(this);
|
|
UpdateAnimation(this);
|
|
if (this->_targetRoomType == 0x1d) {
|
|
TryBlowOpen(this,0,GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
if (((this->_doorFlags & 0x20) != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) {
|
|
AnimationState::AdvancePosition
|
|
(&(this->_sprite)._animState,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00711590
|
|
void GridEntity_Door::BeginBatches()
|
|
{
|
|
int doorState;
|
|
|
|
doorState = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
if ((doorState == 0) || (doorState == 2)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 1;
|
|
doorState = 1;
|
|
}
|
|
this->_previousState = doorState;
|
|
this->_previousVariant = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
|
|
if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_game->_room) + this->_gridIndex * 4 + 0x76c)) = 1000;
|
|
}
|
|
this->_updateCount = 0;
|
|
this->_targetRoomType = 0;
|
|
this->_currentRoomType = 0;
|
|
this->_targetRoomIdx = -1;
|
|
this->_isExtraVisible = 0;
|
|
this->_isBusted = 0;
|
|
this->_isUnlockedByPlayer = 0;
|
|
this->_doorFlags = 0;
|
|
this->_direction = -1;
|
|
return;
|
|
}
|
|
|
|
// 00711630
|
|
void GridEntity_Door::SetLocked(uint8_t isLocked)
|
|
{
|
|
uint32_t doorVariant;
|
|
Game *game;
|
|
uint64_t stateFlags;
|
|
uint32_t *stateFlagsHigh;
|
|
|
|
game = g_game;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 4) {
|
|
if (isLocked == 0) {
|
|
return;
|
|
}
|
|
}
|
|
else if ((isLocked == 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 5)) {
|
|
stateFlags = g_game->_gameStateFlags;
|
|
stateFlagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*stateFlagsHigh = *stateFlagsHigh | 0x20000;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(stateFlags);
|
|
}
|
|
doorVariant = 8;
|
|
if (isLocked != 0) {
|
|
doorVariant = 1;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = doorVariant;
|
|
UpdateAnimation(this);
|
|
return;
|
|
}
|
|
|
|
// 00711690
|
|
uint32_t GridEntity_Door::IsTargetRoomArcade()
|
|
{
|
|
int iVar1;
|
|
Entity_Player *owner;
|
|
|
|
iVar1 = this->_targetRoomType;
|
|
if (iVar1 == 9) {
|
|
return 1;
|
|
}
|
|
if ((((((iVar1 == 2) || (iVar1 == 4)) || (iVar1 == 0x18)) || ((iVar1 == 0x14 || (iVar1 == 0x15))))
|
|
|| ((iVar1 = get_secret_exit_kind(this), iVar1 == 1 || (this->_targetRoomType == 0xc)))) &&
|
|
(owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x17c,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
owner != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
return 1;
|
|
}
|
|
if (((g_game->_challenge == 0x18) && (iVar1 = this->_targetRoomType, iVar1 != 7)) &&
|
|
((iVar1 != 8 && ((iVar1 != 0xb && (iVar1 != 0x1d)))))) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00738170
|
|
uint8_t GridEntity_Door::IsBusted()
|
|
{
|
|
return this->_isBusted;
|
|
}
|
|
|
|
// 00833290
|
|
int GridEntity_Door::Slot()
|
|
{
|
|
return this->_slot;
|
|
}
|
|
|
|
// 0085e0b0
|
|
Vector * GridEntity_Door::GetSpriteOffset()
|
|
{
|
|
return &(this->_sprite)._offset;
|
|
}
|