#include "classes.h" // 00983330 void GridEntity_PressurePlate::Update() { uint32_t gridIndex; if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 2) { update_greed_button(this); } else { update_press(); } gridIndex = this->_gridIndex; if ((((0x1bf < gridIndex) || (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + gridIndex * 4 + 0x76c)) < 300)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0)) && (gridIndex < 0x1c0)) { *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + gridIndex * 4 + 0x76c)) = 300; } return; } // 009833c0 void GridEntity_PressurePlate::update_press() { uint8_t bVar1; uint8_t *pbVar2; uint8_t *animNameCursor; uint32_t uVar3; int iVar4; char *pcVar5; uint8_t *offNameCursor; uint64_t *allocCounter; bool bVar6; float dx; float dy; float pressRadiusSq; float gridOriginY; EntityList_EL nearbyEntities; Vector local_18; void *local_10; uint8_t *puStack_c; uint32_t local_8; Game *game; Manager *manager; uint64_t oldAllocated; Entity_Player *presser; local_8 = 0xffffffff; puStack_c = &LAB_00af245d; local_10 = ExceptionList; ExceptionList = &local_10; iVar4 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0xc)); local_18.x = (float)(this->_gridIndex % iVar4) * 40.0 + 40.0; local_18.y = (float)(this->_gridIndex / iVar4) * 40.0 + 120.0; EntityList::QueryRadius (GHIDRA_CAST((GHIDRA_INT(g_game->_room) + 0x1218)),&nearbyEntities,&local_18,60.0,0x28); local_8 = 0; local_18.y = 0.0; if ((float)nearbyEntities._size != 0.0) { pressRadiusSq = 900.0; gridOriginY = 120.0; do { presser = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x4))) + GHIDRA_INT(local_18.y) * 4)); iVar4 = presser->_type; if (((iVar4 == 1) && (presser->_isCoopGhost != 0)) || ((presser->_dead == 0 && ((((iVar4 == 1 && (presser->_isCoopGhost == 0)) && (bVar1 = (GHIDRA_CAST((presser)))->Entity_Player::IsHologram(), bVar1 == 0)) || (((*GHIDRA_CAST(&g_game->_deathmatchManager) < 2 || (iVar4 != 1)) && ((iVar4 - 10U < 0x3de && ((iVar4 == 0x36d || (iVar4 == 0x35)))))))))))) { manager = g_manager; iVar4 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0xc)); dy = ((float)(this->_gridIndex / iVar4) * 40.0 + gridOriginY) - (presser->_pos).y; dx = ((float)(this->_gridIndex % iVar4) * 40.0 + 40.0) - (presser->_pos).x; if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0) && (dy * dy + dx * dx < pressRadiusSq)) { if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) goto LAB_00983599; pbVar2 = (this->_sprite)._animState._animData; if (0xf < *GHIDRA_CAST((pbVar2 + 0x14))) { pbVar2 = *GHIDRA_CAST(pbVar2); } pcVar5 = "Switched"; goto LAB_00983570; } } local_18.y = (float)(GHIDRA_INT(local_18.y) + 1); } while (GHIDRA_UINT(local_18.y) < GHIDRA_UINT(nearbyEntities._size)); } goto LAB_00983648; while( true ) { bVar1 = pbVar2[1]; bVar6 = bVar1 < (uint8_t)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_00983590; pbVar2 = pbVar2 + 2; pcVar5 = pcVar5 + 2; if (bVar1 == 0) break; LAB_00983570: bVar1 = *pbVar2; bVar6 = bVar1 < (uint8_t)*pcVar5; if (bVar1 != *pcVar5) { LAB_00983590: uVar3 = -GHIDRA_UINT(bVar6) | 1; goto LAB_00983595; } if (bVar1 == 0) break; } uVar3 = 0; LAB_00983595: if (uVar3 != 0) { LAB_00983599: local_18.y = 6.57209e-43; seed_fart_sound_override(GHIDRA_CAST(&local_18.y)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_18.y),1.0,2,0,1.0,0.0); } pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 != GHIDRA_CAST(0x0)) { animNameCursor = pbVar2; if (0xf < *GHIDRA_CAST((pbVar2 + 0x14))) { animNameCursor = *GHIDRA_CAST(pbVar2); } pcVar5 = "Switched"; do { bVar1 = *animNameCursor; bVar6 = bVar1 < (uint8_t)*pcVar5; if (bVar1 != *pcVar5) { LAB_00983610: uVar3 = -GHIDRA_UINT(bVar6) | 1; goto LAB_00983615; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; bVar6 = bVar1 < (uint8_t)pcVar5[1]; if (bVar1 != pcVar5[1]) goto LAB_00983610; animNameCursor = animNameCursor + 2; pcVar5 = pcVar5 + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00983615: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00983648; } bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Switched"),1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00983648: if ((((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 3; pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 == GHIDRA_CAST(0x0)) { LAB_009836b8: bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b7cf1c,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { animNameCursor = pbVar2; if (0xf < *GHIDRA_CAST((pbVar2 + 0x14))) { animNameCursor = *GHIDRA_CAST(pbVar2); } offNameCursor = &DAT_00b7cf1c; do { bVar1 = *animNameCursor; bVar6 = bVar1 < *offNameCursor; if (bVar1 != *offNameCursor) { LAB_009836a2: uVar3 = -GHIDRA_UINT(bVar6) | 1; goto LAB_009836a7; } if (bVar1 == 0) break; bVar1 = animNameCursor[1]; bVar6 = bVar1 < offNameCursor[1]; if (bVar1 != offNameCursor[1]) goto LAB_009836a2; animNameCursor = animNameCursor + 2; offNameCursor = offNameCursor + 2; } while (bVar1 != 0); uVar3 = 0; LAB_009836a7: if ((uVar3 != 0) || ((pbVar2[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_009836b8; } Reward(this); } game = g_game; iVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); if (iVar4 == 0) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) != 0) goto LAB_00983750; *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x11ec)) = 10; iVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); } if (((iVar4 == 4) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 1)) && (pcVar5 = game->_room, *pcVar5 != '\0')) { iVar4 = game->_frameCount - *GHIDRA_CAST((pcVar5 + 0x11f0)); if (iVar4 == 4) { Reward(this); } else if ((4 < iVar4) && ((*GHIDRA_CAST((*GHIDRA_CAST((pcVar5 + 4)) + 0x44)) & 1) != 0)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 3; } } LAB_00983750: if ((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x0))) == '\0') { if (g_mainHeap == (void *)0x0) { allocCounter = &g_allocatedBytesNoHeap; } else { allocCounter = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); } if ((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x4))) != 0) { uVar3 = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x4))) + -4)); oldAllocated = *allocCounter; *GHIDRA_CAST(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar3; *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) = *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar3)); free((void *)((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x4))) + -4)); } } ExceptionList = local_10; return; } // 009837b0 void GridEntity_PressurePlate::update_greed_button_anim(uint8_t isRed) { uint8_t bVar1; char *animName; switch(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc))))) { case 0: break; case 1: case 2: if (isRed != 0) { this->_nextGreedAnimation = "SwitchedRed"; return; } bVar1 = Game::IsGreedFinalBoss(); if (bVar1 != 0) { this->_nextGreedAnimation = "SwitchedPentagram"; return; } bVar1 = Game::IsGreedBoss(); animName = "SwitchedSkull"; if (bVar1 == 0) { animName = "Switched"; } this->_nextGreedAnimation = animName; return; case 3: bVar1 = Game::IsGreedFinalBoss(); if (bVar1 != 0) { this->_nextGreedAnimation = "OnPentagram"; return; } bVar1 = Game::IsGreedBoss(); animName = "OnSkull"; if (bVar1 == 0) { animName = "On"; } this->_nextGreedAnimation = animName; default: return; } if (isRed != 0) { ANM2::Play(&this->_sprite,GHIDRA_CAST("OffRedStart"),0); this->_nextGreedAnimation = "OffRed"; return; } bVar1 = Game::IsGreedFinalBoss(); if (bVar1 != 0) { this->_nextGreedAnimation = "OffPentagram"; return; } bVar1 = Game::IsGreedBoss(); animName = "OffSkull"; if (bVar1 == 0) { animName = "Off"; } this->_nextGreedAnimation = animName; return; } // 009838c0 void GridEntity_PressurePlate::play_pending_animation() { uint8_t *currentName; uint32_t compareResult; uint8_t *currentAnim; uint8_t *targetName; char *offRedStart; bool isLess; uint8_t ch; currentAnim = (this->_sprite)._animState._animData; if (currentAnim == GHIDRA_CAST(0x0)) { currentName = &s_empty; } else { currentName = currentAnim; if (0xf < *GHIDRA_CAST((currentAnim + 0x14))) { currentName = *GHIDRA_CAST(currentAnim); } } targetName = this->_nextGreedAnimation; do { ch = *currentName; isLess = ch < *targetName; if (ch != *targetName) { LAB_00983903: compareResult = -GHIDRA_UINT(isLess) | 1; goto LAB_00983908; } if (ch == 0) break; ch = currentName[1]; isLess = ch < targetName[1]; if (ch != targetName[1]) goto LAB_00983903; currentName = currentName + 2; targetName = targetName + 2; } while (ch != 0); compareResult = 0; LAB_00983908: if (compareResult != 0) { if ((currentAnim != GHIDRA_CAST(0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { if (currentAnim == GHIDRA_CAST(0x0)) { currentAnim = &s_empty; } else if (0xf < *GHIDRA_CAST((currentAnim + 0x14))) { currentAnim = *GHIDRA_CAST(currentAnim); } offRedStart = "OffRedStart"; do { ch = *currentAnim; isLess = ch < (uint8_t)*offRedStart; if (ch != *offRedStart) { LAB_00983953: compareResult = -GHIDRA_UINT(isLess) | 1; goto LAB_00983958; } if (ch == 0) break; ch = currentAnim[1]; isLess = ch < (uint8_t)offRedStart[1]; if (ch != offRedStart[1]) goto LAB_00983953; currentAnim = currentAnim + 2; offRedStart = offRedStart + 2; } while (ch != 0); compareResult = 0; LAB_00983958: if (compareResult == 0) { return; } } ANM2::Play(&this->_sprite,this->_nextGreedAnimation,0); } return; } // 009839f0 void GridEntity_PressurePlate::update_greed_button() { bool bVar1; uint8_t bVar2; uint8_t bVar3; uint32_t *playerSlot; uint8_t *animNameChar; uint32_t uVar4; int iVar5; Entity_Player *this_00; char *switchedAnimChar; void *pvVar6; PlayerManager *playerManager; Game *game; bool isLess; float fVar7; float deltaY; uint32_t local_7c; bool isWaveActive; undefined3 uStack_77; int waveTimer; int effectEntry [3]; uint32_t uStack_64; EntityRef damageSource; ColorMod flashColor; Manager *manager; Entity_Player *player; int waveTimerNow; playerManager = &g_game->_playerManager; isLess = false; bVar1 = true; waveTimer = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x723c)); _isWaveActive = CONCAT31(uStack_77,0 < waveTimer); local_7c = 0; bVar2 = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 4)) + 0x44)) & 1; game = g_game; if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; if (GHIDRA_INT(pvVar6) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) { KAGE_LogMessage(0x10,GHIDRA_CAST("(GHIDRA_CAST(()))->PlayerManager::GetPlayer() : There are no players! \n")); pvVar6 = (playerManager->_playerList)._end; game = g_game; } playerSlot = (playerManager->_playerList)._begin; if (local_7c < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(playerSlot) >> 2))) { playerSlot = playerSlot + local_7c; } player = GHIDRA_CAST(*playerSlot); if ((player->_variant == 0) && (player->_isCoopGhost == 0)) { iVar5 = *GHIDRA_CAST((GHIDRA_CAST(game->_room) + 0xc)); deltaY = ((float)(this->_gridIndex / iVar5) * 40.0 + 120.0) - (player->_pos).y; fVar7 = ((float)(this->_gridIndex % iVar5) * 40.0 + 40.0) - (player->_pos).x; fVar7 = deltaY * deltaY + fVar7 * fVar7; if ((isLess) || (isLess = false, fVar7 < 625.0)) { isLess = true; } if ((!bVar1) || (bVar1 = true, fVar7 <= 900.0)) { bVar1 = false; } if ((fVar7 < 625.0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0)) { if (0 < waveTimer) { iVar5 = (GHIDRA_CAST((player)))->Entity_Player::GetHealthType(); if ((iVar5 == 2) || (bVar3 = (GHIDRA_CAST((this_00)))->Entity_Player::HasInstantDeathCurse(), bVar3 != 0)) { game->_levelStateFlags = game->_levelStateFlags | 0x800; } else { damageSource._type = 0; damageSource._variant = 0; damageSource._spawnerType = 0; damageSource._spawnerVariant = 0; damageSource._position.x = g_vectorZero.x; damageSource._position.y = g_vectorZero.y; damageSource._velocity.x = g_vectorZero.x; damageSource._velocity.y = g_vectorZero.y; damageSource._flags = 0; damageSource._entity = (void *)0x0; player->TakeDamage(0x3f800000,0x10000080,0,&damageSource,0x1e); game = g_game; } } break; } } playerManager = &game->_playerManager; local_7c = local_7c + 1; } while (local_7c < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2))); } iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); if ((iVar5 == 0) && (isLess)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 1; manager = g_manager; if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { LAB_00983c89: local_7c = 0x1d5; seed_fart_sound_override(GHIDRA_CAST(&local_7c)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(local_7c,1.0,2,0,1.0,0.0); } else { animNameChar = (this->_sprite)._animState._animData; if (0xf < *GHIDRA_CAST((animNameChar + 0x14))) { animNameChar = *GHIDRA_CAST(animNameChar); } switchedAnimChar = "Switched"; do { bVar3 = *animNameChar; isLess = bVar3 < (uint8_t)*switchedAnimChar; if (bVar3 != *switchedAnimChar) { LAB_00983c80: uVar4 = -GHIDRA_UINT(isLess) | 1; goto LAB_00983c85; } if (bVar3 == 0) break; bVar3 = animNameChar[1]; isLess = bVar3 < (uint8_t)switchedAnimChar[1]; if (bVar3 != switchedAnimChar[1]) goto LAB_00983c80; animNameChar = animNameChar + 2; switchedAnimChar = switchedAnimChar + 2; } while (bVar3 != 0); uVar4 = 0; LAB_00983c85: if (uVar4 != 0) goto LAB_00983c89; } update_greed_button_anim(this,(uint8_t)_isWaveActive); iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); game = g_game; } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { if (iVar5 == 1) { if (waveTimer < 1) { (GHIDRA_CAST((game->_room)))->Room::SpawnGreedModeWave(0); uVar4 = 0; playerManager = &g_game->_playerManager; if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) { do { pvVar6 = (playerManager->_playerList)._end; if (GHIDRA_INT(pvVar6) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) { KAGE_LogMessage(0x10,GHIDRA_CAST("(GHIDRA_CAST(()))->PlayerManager::GetPlayer() : There are no players! \n")); pvVar6 = (playerManager->_playerList)._end; } playerSlot = (playerManager->_playerList)._begin; if (uVar4 < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(playerSlot) >> 2))) { playerSlot = playerSlot + uVar4; } player = GHIDRA_CAST(*playerSlot); bVar3 = (GHIDRA_CAST((player)))->Entity_Player::HasCollectible(299,0); if (((bVar3 != 0) || (iVar5 = (GHIDRA_CAST((player)))->Entity_Player::GetZodiacEffect(), iVar5 == 299)) && (bVar3 = (GHIDRA_CAST((&player->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(299), bVar3 == 0)) { player->_taurusSpeedBonus = 0.0; flashColor._colorize[0] = 0.0; flashColor._colorize[1] = 0.0; flashColor._colorize[2] = 0.0; flashColor._colorize[3] = 0.0; flashColor._offset[0] = 0.0; flashColor._offset[1] = 0.0; flashColor._offset[2] = 0.0; flashColor._tint[0] = 1.0; flashColor._tint[1] = 1.0; flashColor._tint[2] = 1.0; flashColor._tint[3] = 1.0; player->SetColor(&flashColor,0xffffffff,0xff,0,1); pvVar6 = (g_manager->_itemConfig)._collectibles._begin; if ((0x4ac < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar6) & 0xfffffffcU))) && (iVar5 = *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x4ac)), iVar5 != 0) ) { effectEntry[2] = *GHIDRA_CAST((iVar5 + 0x78)); effectEntry[1] = 0; uStack_64 = 0; effectEntry[0] = iVar5; (GHIDRA_CAST((&player->_temporaryeffects)))->TemporaryEffects::AddEffect(effectEntry,1,1); } } uVar4 = uVar4 + 1; playerManager = &g_game->_playerManager; } while (uVar4 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2))); } } else { *GHIDRA_CAST((GHIDRA_CAST(game->_room) + 0x723c)) = 0xffffffff; } } else if (iVar5 != 2) goto LAB_00983ea2; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 3; update_greed_button_anim(this,(uint8_t)_isWaveActive); iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); game = g_game; } LAB_00983ea2: waveTimerNow = *GHIDRA_CAST((GHIDRA_CAST(game->_room) + 0x723c)); _isWaveActive = CONCAT31(uStack_77,0 < waveTimerNow); if (iVar5 == 3) { if (((!bVar1) || ((game->_difficulty == 3) + 0xb <= GHIDRA_UINT(game->_greedModeWave))) || ((waveTimerNow < 1 && (bVar2 == 0)))) goto LAB_00983f0b; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 0; } else { if (((iVar5 != 0) || (0 < waveTimerNow)) || (bVar2 != 0)) goto LAB_00983f0b; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 2; } update_greed_button_anim(this,0 < waveTimerNow); LAB_00983f0b: play_pending_animation(this); return; } // 00984550 void GridEntity_PressurePlate::Reward() { GridEntity_PressurePlate *door = this; code *pcVar1; Vector pos; Vector pos_00; Vector pos_01; Vector pos_02; Vector pos_03; Vector pos_04; Vector pos_05; Vector pos_06; GridEntity *pGVar2; ANM2 *pAVar3; uint8_t isTrapDoorAllowed; int targetRoomType; GridEntity *poop; Vector *tmpPos; uint32_t rngValue; float fVar5; Entity_Player *player; RoomDescriptor *roomDesc; Entity_Effect *timerEffect; void *pvVar6; int iVar7; uint32_t uVar8; Game *game; float *positionsEnd; float *positionsCapacity; float fVar9; RNG rng; float *spawnPositions; float *spawnPositionsEnd; float *spawnPositionsCapacity; Vector local_68; Vector local_60; Vector local_58; Vector local_4c; Vector local_44; float local_3c; void *local_38; float local_34; void *local_30; float *local_2c; uint32_t enemyVariant; uint32_t local_24; uint8_t *puStack_20; void *local_1c; uint8_t *puStack_18; uint32_t local_14; GridEntity_Door *door; Manager *manager; uint32_t *oldGridEntity; Room *room; uint32_t *roomFlags; int targetRoomType; manager = g_manager; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); local_14 = 0xffffffff; puStack_18 = &LAB_00b0ce51; local_1c = ExceptionList; uVar8 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((door)) + 0x8)))); local_58.y = (float)door; if (uVar8 != 1) { if (9 < uVar8) { if (uVar8 < 0xe) { ExceptionList = &local_1c; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); (GHIDRA_CAST((g_game->_room)))->Room::TriggerOutput(uVar8 - 10); ExceptionList = local_1c; return; } return; } if (uVar8 != 9) { if (uVar8 == 3) { ExceptionList = &local_1c; (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::raise_mineshaft_rail(); ExceptionList = local_1c; return; } return; } ExceptionList = &local_1c; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); tmpPos = (GHIDRA_CAST((GHIDRA_CAST(door))))->GridEntity::Position(&local_68); player = Game::GetNearestPlayerEx(tmpPos,1,0,0); if (player == GHIDRA_CAST(0x0)) { player = Game::GetPlayer(g_game,0); } iVar7 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x12c4)) + *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x12c0)); targetRoomType = 0; if (0 < iVar7) { targetRoomType = iVar7; } if (targetRoomType < 1) { ExceptionList = local_1c; return; } SoundEffects::PlayWithFartOverride(0x10b,1.0,0x14,0,1.0); SoundEffects::PlayWithFartOverride(0x21,1.0,0x14,0,1.0); Game::ShakeScreen(g_game,0xf); timerEffect = Entity_Effect::CreateTimer (pressure_plate_kill_enemies_timer_callback,1,0xffffffff,0); (GHIDRA_CAST((GHIDRA_CAST(timerEffect))))->Entity::SetParent(GHIDRA_CAST(player)); ExceptionList = local_1c; return; } uVar8 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((door)) + 0x14)))); rng._shift1 = 5; rng._shift2 = 9; local_2c = GHIDRA_CAST(0x7); rng._shift3 = 7; if (uVar8 == 0) { ExceptionList = &local_1c; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = uVar8 >> 5 ^ uVar8; uVar8 = uVar8 << 9 ^ uVar8; rng._seed = uVar8 >> 7 ^ uVar8; local_38 = (void *)rng._seed; if ((rng._seed & 1U) == 0) { local_30 = (void *)0x10c; ExceptionList = &local_1c; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); seed_fart_sound_override(GHIDRA_CAST(&local_30)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_30),1.0,2,0,1.0,0.0); targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; Room::FindFreePickupSpawnPosition(g_game->_room,&local_4c,&local_58,0.0,1,0,0); if (local_38 == (void *)0x0) { KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } uVar8 = GHIDRA_UINT(local_38) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_38); uVar8 = uVar8 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar8; rng._seed = uVar8 >> ((uint8_t)local_2c & 0x1f) ^ uVar8; uVar8 = GHIDRA_UINT(rng._seed) % 100; if (uVar8 < 5) { isTrapDoorAllowed = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::CanSpawnTrapDoor(); if (isTrapDoorAllowed != 0) { room = g_game->_room; uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); targetRoomType = (GHIDRA_CAST((g_game->_room)))->Room::GetGridIndex(&local_4c); (GHIDRA_CAST((room)))->Room::SpawnGridEntity(targetRoomType,0x11,0,uVar8,0); ExceptionList = local_1c; return; } } else if (9 < uVar8) { if (uVar8 < 0xb) { pvVar6 = g_game->_room; local_30 = pvVar6; local_38 = (void *)(GHIDRA_CAST((&rng)))->RNG::Next(); uVar8 = (GHIDRA_CAST((g_game->_room)))->Room::GetGridIndex(&local_4c); if ((GHIDRA_INT(uVar8) < 0) || (0x1bf < GHIDRA_INT(uVar8))) { KAGE_LogMessage(0x10,GHIDRA_CAST("SpawnGridEntity: Grid index invalid\n")); } if (0x1bf < uVar8) { ExceptionList = local_1c; return; } if (900 < *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + uVar8 * 4 + 0x76c))) { ExceptionList = local_1c; return; } poop = operator_new(0x19c); local_14 = 0x1e; local_58.y = (float)poop; if (poop == GHIDRA_CAST(0x0)) { poop = GHIDRA_CAST(0x0); } else { (GHIDRA_CAST((poop)))->GridEntity::GridEntity(); *GHIDRA_CAST(poop) = IsaacRepentancePlus::GridEntity_Poop::vftable; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x14)))) = 0; poop[1]._varData = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x4))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x20)))) = 0; poop[1]._gridIndex = 0; poop[1]._spawnFrame = 0; poop[1]._rng._seed = 0; fVar5 = g_vectorZero.y; poop[1]._rng._shift1 = GHIDRA_INT(g_vectorZero.x); poop[1]._rng._shift2 = GHIDRA_INT(fVar5); fVar5 = g_vectorZero.y; poop[1]._rng._shift3 = GHIDRA_INT(g_vectorZero.x); poop[1]._collisionClass = GHIDRA_INT(fVar5); pGVar2 = poop + 1; (pGVar2->_sprite)._filename._buf[0] = '\0'; (pGVar2->_sprite)._filename._buf[1] = '\0'; (pGVar2->_sprite)._filename._buf[2] = '\0'; (pGVar2->_sprite)._filename._buf[3] = '\0'; pAVar3 = &poop[1]._sprite; (pAVar3->_filename)._buf[4] = '\0'; (pAVar3->_filename)._buf[5] = '\0'; (pAVar3->_filename)._buf[6] = '\0'; (pAVar3->_filename)._buf[7] = '\0'; } local_14 = 0xffffffff; if (poop == GHIDRA_CAST(0x0)) { ExceptionList = local_1c; return; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((poop)) + 0x4)))) = 0xe; poop->_gridIndex = uVar8; oldGridEntity = *GHIDRA_CAST((GHIDRA_CAST(local_30) + uVar8 * 4 + 0x24)); if (oldGridEntity != GHIDRA_CAST(0x0)) { (**(code **)*oldGridEntity)(1); } *GHIDRA_CAST((GHIDRA_CAST(local_30) + uVar8 * 4 + 0x24)) = poop; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((poop)) + 0x8)))) = 0; goto LAB_009848ac; } if (uVar8 < 0xc) { uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); Game::Spawn(g_game,5,100,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar8); ExceptionList = local_1c; return; } if (uVar8 < 0x1e) { uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(3); local_30 = (void *)(uVar8 + 1); if (GHIDRA_INT(local_30) < 1) { ExceptionList = local_1c; return; } do { targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_58,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); Game::Spawn(g_game,5,0x14,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar8); local_30 = (void *)(GHIDRA_INT(local_30) + -1); } while (local_30 != (void *)0x0); ExceptionList = local_1c; return; } if (uVar8 < 0x32) { uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(2); local_30 = (void *)(uVar8 + 1); if (GHIDRA_INT(local_30) < 1) { ExceptionList = local_1c; return; } do { targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_58,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); Game::Spawn(g_game,5,10,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar8); local_30 = (void *)(GHIDRA_INT(local_30) + -1); } while (local_30 != (void *)0x0); ExceptionList = local_1c; return; } if (uVar8 < 0x46) { uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(2); local_30 = (void *)(uVar8 + 1); if (GHIDRA_INT(local_30) < 1) { ExceptionList = local_1c; return; } do { targetRoomType = g_game->_room->_gridWidth; local_58.x = (float)(door->_gridIndex % targetRoomType) * 40.0 + 40.0; local_58.y = (float)(door->_gridIndex / targetRoomType) * 40.0 + 120.0; tmpPos = Room::FindFreePickupSpawnPosition(g_game->_room,&local_60,&local_58,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); Game::Spawn(g_game,5,0x28,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar8); local_30 = (void *)(GHIDRA_INT(local_30) + -1); } while (local_30 != (void *)0x0); ExceptionList = local_1c; return; } if (uVar8 < 0x50) { uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); rngValue = (GHIDRA_CAST((&rng)))->RNG::RandomInt(4); Game::Spawn(g_game,5,*GHIDRA_CAST((&DAT_00b7cfa0 + rngValue * 4)),&local_4c,&g_vectorZero, GHIDRA_CAST(0x0),0,uVar8); ExceptionList = local_1c; return; } if (0x54 < uVar8) { if (0x59 < uVar8) { uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); Game::Spawn(g_game,4,3,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar8); ExceptionList = local_1c; return; } local_58.y = local_4c.y + 0.0; local_58.x = local_4c.x + 40.0; room = g_game->_room; pos_03.y = local_58.y; pos_03.x = local_58.x; local_38 = (void *)local_58.y; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_03); if (targetRoomType == 0) { LAB_00984f49: local_58.x = local_4c.x + 0.0; local_58.y = local_4c.y + 40.0; pos_05.y = local_58.y; pos_05.x = local_58.x; local_38 = (void *)local_58.x; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_05); if (targetRoomType == 0) goto LAB_00984fe7; local_58.y = local_4c.y - 40.0; local_58.x = (float)local_38; pos_06.y = local_58.y; pos_06.x = (float)local_38; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_06); if (targetRoomType == 0) goto LAB_00984fe7; } else { local_58.x = local_4c.x - 40.0; local_58.y = (float)local_38; pos_04.y = (float)local_38; pos_04.x = local_58.x; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_04); if (targetRoomType == 0) goto LAB_00984f49; } tmpPos = Room::GetCenterPos(&local_60); tmpPos = Room::FindFreePickupSpawnPosition(room,&local_58,tmpPos,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; LAB_00984fe7: uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); Game::Spawn(g_game,6,8,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar8); ExceptionList = local_1c; return; } local_58.y = local_4c.y + 0.0; local_58.x = local_4c.x + 40.0; room = g_game->_room; pos.y = local_58.y; pos.x = local_58.x; local_38 = (void *)local_58.y; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos); if (targetRoomType == 0) { LAB_00984de5: local_58.x = local_4c.x + 0.0; local_58.y = local_4c.y + 40.0; pos_01.y = local_58.y; pos_01.x = local_58.x; local_38 = (void *)local_58.x; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_01); if (targetRoomType == 0) goto LAB_00984e83; local_58.y = local_4c.y - 40.0; local_58.x = (float)local_38; pos_02.y = local_58.y; pos_02.x = (float)local_38; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_02); if (targetRoomType == 0) goto LAB_00984e83; } else { local_58.x = local_4c.x - 40.0; local_58.y = (float)local_38; pos_00.y = (float)local_38; pos_00.x = local_58.x; targetRoomType = (GHIDRA_CAST((room)))->Room::GetGridCollisionAtPos(pos_00); if (targetRoomType == 0) goto LAB_00984de5; } tmpPos = Room::GetCenterPos(&local_60); tmpPos = Room::FindFreePickupSpawnPosition(room,&local_58,tmpPos,0.0,1,0,0); local_4c.x = tmpPos->x; local_4c.y = tmpPos->y; LAB_00984e83: uVar8 = (GHIDRA_CAST((&rng)))->RNG::Next(); rngValue = (GHIDRA_CAST((&rng)))->RNG::RandomInt(2); Game::Spawn(g_game,6,(-GHIDRA_UINT((rngValue != 0)) & 2) + 1,&local_4c,&g_vectorZero,GHIDRA_CAST(0x0),0, uVar8); ExceptionList = local_1c; return; } pvVar6 = g_game->_room; local_30 = pvVar6; local_38 = (void *)(GHIDRA_CAST((&rng)))->RNG::Next(); uVar8 = (GHIDRA_CAST((g_game->_room)))->Room::GetGridIndex(&local_4c); if ((GHIDRA_INT(uVar8) < 0) || (0x1bf < GHIDRA_INT(uVar8))) { KAGE_LogMessage(0x10,GHIDRA_CAST("SpawnGridEntity: Grid index invalid\n")); } if (0x1bf < uVar8) { ExceptionList = local_1c; return; } if (900 < *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + uVar8 * 4 + 0x76c))) { ExceptionList = local_1c; return; } poop = operator_new(0x19c); local_14 = 7; local_58.y = (float)poop; if (poop == GHIDRA_CAST(0x0)) { poop = GHIDRA_CAST(0x0); } else { (GHIDRA_CAST((poop)))->GridEntity::GridEntity(); *GHIDRA_CAST(poop) = IsaacRepentancePlus::GridEntity_Poop::vftable; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x14)))) = 0; poop[1]._varData = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x4))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(poop[1])) + 0x20)))) = 0; poop[1]._gridIndex = 0; poop[1]._spawnFrame = 0; poop[1]._rng._seed = 0; fVar5 = g_vectorZero.y; poop[1]._rng._shift1 = GHIDRA_INT(g_vectorZero.x); poop[1]._rng._shift2 = GHIDRA_INT(fVar5); fVar5 = g_vectorZero.y; poop[1]._rng._shift3 = GHIDRA_INT(g_vectorZero.x); poop[1]._collisionClass = GHIDRA_INT(fVar5); pGVar2 = poop + 1; (pGVar2->_sprite)._filename._buf[0] = '\0'; (pGVar2->_sprite)._filename._buf[1] = '\0'; (pGVar2->_sprite)._filename._buf[2] = '\0'; (pGVar2->_sprite)._filename._buf[3] = '\0'; pAVar3 = &poop[1]._sprite; (pAVar3->_filename)._buf[4] = '\0'; (pAVar3->_filename)._buf[5] = '\0'; (pAVar3->_filename)._buf[6] = '\0'; (pAVar3->_filename)._buf[7] = '\0'; } local_14 = 0xffffffff; if (poop == GHIDRA_CAST(0x0)) { ExceptionList = local_1c; return; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((poop)) + 0x4)))) = 0xe; poop->_gridIndex = uVar8; oldGridEntity = *GHIDRA_CAST((GHIDRA_CAST(local_30) + uVar8 * 4 + 0x24)); if (oldGridEntity != GHIDRA_CAST(0x0)) { (**(code **)*oldGridEntity)(1); } *GHIDRA_CAST((GHIDRA_CAST(local_30) + uVar8 * 4 + 0x24)) = poop; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((poop)) + 0x8)))) = 3; LAB_009848ac: poop->_varData = 0; (GHIDRA_CAST((poop)))->GridEntity::Init(GHIDRA_UINT(local_38)); ExceptionList = local_1c; return; } ExceptionList = &local_1c; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((door)) + 0xc)))) != 4) { local_30 = (void *)0x10b; puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); seed_fart_sound_override(GHIDRA_CAST(&local_30)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_30),1.0,2,0,1.0,0.0); } fVar5 = (float)(*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x12c0)) + *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x12c4))); local_4c.y = 0.0; if (0 < GHIDRA_INT(fVar5)) { local_4c.y = fVar5; } local_24 = 0; enemyVariant = 0; uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(3); local_3c = (float)(uVar8 + 2); if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) { switch(g_game->_stage) { default: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_0; case 1: goto switchD_0098532f_caseD_1; case 2: goto switchD_0098532f_caseD_2; case 3: goto switchD_0098532f_caseD_3; case 4: goto switchD_0098532f_caseD_4; case 5: goto switchD_0098532f_caseD_5; default: break; } case 2: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_4; case 1: goto switchD_00985120_caseD_1; case 2: goto switchD_00985120_caseD_2; case 3: goto switchD_00985120_caseD_3; case 4: goto switchD_00985120_caseD_4; case 5: goto switchD_00985120_caseD_5; default: break; } case 3: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098513a_caseD_0; case 1: goto switchD_0098513a_caseD_1; case 2: goto switchD_0098513a_caseD_2; case 3: goto switchD_0098513a_caseD_3; case 4: goto switchD_0098513a_caseD_4; case 5: goto switchD_0098513a_caseD_5; default: break; } case 4: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(5); switch(uVar8) { case 0: goto switchD_00985154_caseD_0; case 1: goto switchD_00985154_caseD_1; case 2: goto switchD_00985154_caseD_2; case 3: goto switchD_00985154_caseD_3; case 4: goto switchD_00985154_caseD_4; default: break; } case 5: switchD_00985342_caseD_5: LAB_00985444: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(3); if (uVar8 != 0) { if (uVar8 == 1) { local_24 = 0x32; } else if (uVar8 == 2) { local_24 = 0x195; } break; } switchD_00985482_caseD_2: local_24 = 0x194; break; case 6: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(4); switch(uVar8) { case 0: goto switchD_00985482_caseD_0; case 1: goto switchD_00985482_caseD_1; case 2: goto switchD_00985482_caseD_2; case 3: switchD_00985482_caseD_3: local_24 = 0xfc; default: break; } case 7: local_24 = 0x66; } } else { switch(g_game->_stage) { default: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: switchD_0098532f_caseD_0: local_24 = 0x12; break; case 1: switchD_0098532f_caseD_1: local_24 = 0xde; break; case 2: switchD_0098532f_caseD_2: local_24 = 0x100; break; case 3: switchD_0098532f_caseD_3: local_24 = 0xc; break; case 4: switchD_0098532f_caseD_4: local_24 = 0x17; break; case 5: switchD_0098532f_caseD_5: local_24 = 0x55; default: break; } goto switchD_0098532f_default; case 3: case 4: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_4; case 1: switchD_00985120_caseD_1: local_24 = 0x19; goto switchD_0098532f_default; case 2: switchD_00985120_caseD_2: local_24 = 0x16; goto switchD_0098532f_default; case 3: switchD_00985120_caseD_3: local_24 = 0xcd; goto switchD_0098532f_default; case 4: switchD_00985120_caseD_4: local_24 = 0x1a; goto switchD_0098532f_default; case 5: switchD_00985120_caseD_5: local_24 = 0xea; default: goto switchD_0098532f_default; } case 5: case 6: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: switchD_0098513a_caseD_0: local_24 = 0x26; break; case 1: switchD_0098513a_caseD_1: local_24 = 0x18; break; case 2: switchD_0098513a_caseD_2: local_24 = 0xe3; break; case 3: switchD_0098513a_caseD_3: local_24 = 0x29; break; case 4: switchD_0098513a_caseD_4: local_24 = 0xd1; break; case 5: switchD_0098513a_caseD_5: local_24 = 0xed; default: break; } goto switchD_0098532f_default; case 7: case 8: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(5); switch(uVar8) { case 0: switchD_00985154_caseD_0: local_24 = 0x39; break; case 1: switchD_00985154_caseD_1: local_24 = 0xdf; break; case 2: switchD_00985154_caseD_2: local_24 = 0x38; break; case 3: switchD_00985154_caseD_3: local_24 = 0xd5; break; case 4: switchD_00985154_caseD_4: local_24 = 0xd8; default: break; } goto switchD_0098532f_default; case 9: switchD_00985106_caseD_9: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(2); if (uVar8 == 0) { local_24 = 0x17; enemyVariant = 1; } else if (uVar8 == 1) { enemyVariant = 1; local_24 = 0x101; } goto switchD_0098532f_default; case 10: if (g_game->_stageType == 0) goto LAB_00985444; LAB_0098519e: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(3); if (uVar8 != 0) { if (uVar8 == 1) { local_24 = 0x4f; } else if (uVar8 == 2) { local_24 = 0x43; } goto switchD_0098532f_default; } break; case 0xb: if (g_game->_stageType == 0) { LAB_009852f0: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(2); if (uVar8 != 0) { if (uVar8 != 1) goto switchD_0098532f_default; goto switchD_00985482_caseD_3; } goto switchD_00985482_caseD_2; } LAB_009851e5: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(2); if (uVar8 != 0) { if (uVar8 != 1) goto switchD_0098532f_default; switchD_00985482_caseD_1: local_24 = 0x33; enemyVariant = 1; goto switchD_0098532f_default; } break; case 0xc: switch(*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18))) { case 1: case 2: case 3: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_0; case 1: goto switchD_0098532f_caseD_1; case 2: goto switchD_0098532f_caseD_2; case 3: goto switchD_0098532f_caseD_3; case 4: goto switchD_0098532f_caseD_4; case 5: goto switchD_0098532f_caseD_5; default: goto switchD_0098532f_default; } case 4: case 5: case 6: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098532f_caseD_4; case 1: goto switchD_00985120_caseD_1; case 2: goto switchD_00985120_caseD_2; case 3: goto switchD_00985120_caseD_3; case 4: goto switchD_00985120_caseD_4; case 5: goto switchD_00985120_caseD_5; default: goto switchD_0098532f_default; } case 7: case 8: case 9: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(6); switch(uVar8) { case 0: goto switchD_0098513a_caseD_0; case 1: goto switchD_0098513a_caseD_1; case 2: goto switchD_0098513a_caseD_2; case 3: goto switchD_0098513a_caseD_3; case 4: goto switchD_0098513a_caseD_4; case 5: goto switchD_0098513a_caseD_5; default: goto switchD_0098532f_default; } case 10: case 0xb: case 0xc: uVar8 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(5); switch(uVar8) { case 0: goto switchD_00985154_caseD_0; case 1: goto switchD_00985154_caseD_1; case 2: goto switchD_00985154_caseD_2; case 3: goto switchD_00985154_caseD_3; case 4: goto switchD_00985154_caseD_4; default: goto switchD_0098532f_default; } case 0xd: goto switchD_00985106_caseD_9; case 0xe: goto switchD_00985342_caseD_5; case 0xf: goto LAB_0098519e; default: goto LAB_009852f0; case 0x11: goto LAB_009851e5; } } switchD_00985482_caseD_0: local_24 = 0x14; } switchD_0098532f_default: spawnPositions = GHIDRA_CAST(0x0); positionsEnd = GHIDRA_CAST(0x0); spawnPositionsEnd = GHIDRA_CAST(0x0); spawnPositionsCapacity = GHIDRA_CAST(0x0); local_14 = 0x2e; pvVar6 = (void *)(GHIDRA_INT(g_game->_room) + 0x724); local_2c = GHIDRA_CAST(0x0); positionsCapacity = GHIDRA_CAST(0x0); local_30 = pvVar6; do { targetRoomType = *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + GHIDRA_INT(local_2c) * 4)); if (targetRoomType != 0) { targetRoomType = *GHIDRA_CAST((targetRoomType + 0x24)); iVar7 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0xc)); local_44.x = (float)(targetRoomType % iVar7) * 40.0 + 40.0; local_44.y = (float)(targetRoomType / iVar7) * 40.0 + 120.0; local_38 = (void *)local_44.x; local_34 = local_44.y; player = Game::GetNearestPlayer(g_game,&local_44); fVar5 = local_34 - (player->_pos).y; fVar9 = (float)local_38 - (player->_pos).x; pvVar6 = local_30; if (6400.0 < fVar5 * fVar5 + fVar9 * fVar9) { targetRoomType = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(local_30) + GHIDRA_INT(local_2c) * 4)) + 0x24)); iVar7 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0xc)); local_60.x = (float)(targetRoomType % iVar7) * 40.0 + 40.0; local_60.y = (float)(targetRoomType / iVar7) * 40.0 + 120.0; if (positionsEnd == positionsCapacity) { msvc::vector::_Emplace_reallocate(positionsEnd,&local_60); positionsCapacity = spawnPositionsCapacity; } else { *positionsEnd = local_60.x; positionsEnd[1] = local_60.y; spawnPositionsEnd = positionsEnd + 2; } pvVar6 = local_30; positionsEnd = spawnPositionsEnd; } } uVar8 = local_24; local_2c = GHIDRA_CAST((GHIDRA_INT(local_2c) + 1)); } while (local_2c < 8); local_2c = positionsCapacity; if (spawnPositions == positionsEnd) { tmpPos = Room::GetCenterPos(&local_60); if (positionsEnd == local_2c) { msvc::vector::_Emplace_reallocate(positionsEnd,tmpPos); local_2c = spawnPositionsCapacity; positionsEnd = spawnPositionsEnd; } else { fVar5 = tmpPos->y; *positionsEnd = tmpPos->x; positionsEnd[1] = fVar5; spawnPositionsEnd = positionsEnd + 2; positionsEnd = spawnPositionsEnd; } } (GHIDRA_CAST((&rng)))->RNG::Next(); local_24 = rng._seed & 3; local_44.y = (float)(GHIDRA_INT(local_3c) + local_24); local_30 = (void *)rng._seed; if (GHIDRA_INT(local_24) < GHIDRA_INT(local_44.y)) { do { if (local_30 == (void *)0x0) { KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); pcVar1 = (code *)swi(3); (*pcVar1)(); return; } rngValue = GHIDRA_UINT(local_30) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_30); rngValue = rngValue << ((uint8_t)rng._shift2 & 0x1f) ^ rngValue; local_30 = (void *)(rngValue >> ((uint8_t)rng._shift3 & 0x1f) ^ rngValue); tmpPos = Room::FindFreePickupSpawnPosition (g_game->_room,&local_68, (Vector *) (spawnPositions + (local_24 % GHIDRA_UINT((GHIDRA_INT(positionsEnd) - GHIDRA_INT(spawnPositions) >> 3))) * 2),0.0 ,0,0,0); rngValue = Random(); local_34 = (float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) * 2.3283064e-10 * 3.14; local_34 = local_34 + local_34; rngValue = Random(); local_38 = (void *)((float)((double)GHIDRA_INT(rngValue) + __uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) * 2.3283064e-10); fVar5 = sin(local_34); local_3c = fVar5 * (float)local_38 * 20.0 + tmpPos->y; fVar5 = cos(local_34); local_60.x = fVar5 * (float)local_38 * 20.0 + tmpPos->x; local_60.y = local_3c; Game::Spawn(g_game,uVar8,enemyVariant,&local_60,&g_vectorZero,GHIDRA_CAST(0x0),0,GHIDRA_UINT(local_30)); local_24 = local_24 + 1; positionsEnd = spawnPositionsEnd; } while (GHIDRA_INT(local_24) < GHIDRA_INT(local_44.y)); } pvVar6 = g_game->_room; iVar7 = *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x12c4)) + *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x12c0)); targetRoomType = 0; if (0 < iVar7) { targetRoomType = iVar7; } if (GHIDRA_INT(local_4c.y) < targetRoomType) { local_30 = (void *)0x0; targetRoomType = 0x724; game = g_game; do { local_30 = (void *)(GHIDRA_INT(local_30) + 1); if (local_30 < (void *)0x9) { door = *GHIDRA_CAST((targetRoomType + GHIDRA_INT(game->_room))); if ((door != GHIDRA_CAST(0x0)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((door)) + 0xc)))) != 1)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((door)) + 0xc)))) = 1; (GHIDRA_CAST((door)))->GridEntity_Door::UpdateAnimation(); iVar7 = door->_currentRoomType; if (((iVar7 == 7) || (((targetRoomType = door->_targetRoomType, targetRoomType == 7 || (iVar7 == 8)) || (targetRoomType == 8)))) || ((iVar7 == 0x1d || (targetRoomType == 0x1d)))) { (GHIDRA_CAST(((door->_openAnimation)._buf)))->msvc::string::assign(s_Open,4); } game = g_game; } } targetRoomType = targetRoomType + 4; } while (targetRoomType < 0x744); if ((*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(game->_room) + 4)) + 0x44)) & 1) != 0) { roomDesc = (GHIDRA_CAST((GHIDRA_CAST(game))))->Level::GetRoomByIdx(game->_currentRoomIdx,-1); game = g_game; roomDesc->Flags = roomDesc->Flags | 0x80; } roomFlags = GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(game->_room) + 4)) + 0x44)); *roomFlags = *roomFlags & 0xfffffffe; pvVar6 = game->_room; } if ((*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 4)) + 0x44)) & 1) == 0) { *GHIDRA_CAST((GHIDRA_CAST(local_58.y) + 0xc)) = 4; } if (spawnPositions == GHIDRA_CAST(0x0)) { ExceptionList = local_1c; return; } deallocate(spawnPositions,GHIDRA_INT(local_2c) - GHIDRA_INT(spawnPositions) >> 3); ExceptionList = local_1c; return; } // 00985f00 void GridEntity_PressurePlate::BeginBatches() { uint8_t bVar1; int iVar2; uint8_t *curAnimName; 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; char *freeBlock; uint8_t *expectedAnimName; uint32_t uVar3; bool isLess; std_string gfxPath; uint32_t local_14; void *local_10; uint8_t *puStack_c; uint32_t local_8; uint8_t *animData; local_8 = 0xffffffff; puStack_c = &LAB_00b0cee5; local_10 = ExceptionList; local_14 = __security_cookie ^ GHIDRA_UINT(&(&gfxPath)[1]._size); ExceptionList = &local_10; gfxPath._size = 0; gfxPath._capacity = 0xf; gfxPath._buf[0] = '\0'; gfxPath._buf[1] = '\0'; gfxPath._buf[2] = '\0'; gfxPath._buf[3] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = msvc::_Allocate(0x30); gfxPath._size = 0x20; gfxPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/grid_pressureplate.anm2",0x21); local_8 = 0; ANM2::Load(&this->_sprite,&gfxPath,0); local_8 = 0xffffffff; bVar1 = extraout_CL; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))); if (0xfff < uVar3) { freeBlock = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + -4)); uVar3 = gfxPath._capacity + 0x24; if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_00; } this->_nextGreedAnimation = &s_empty; switch(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8))))) { case 0: (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = msvc::_Allocate(0x30); gfxPath._size = 0x26; gfxPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/grid_pressureplate_silver.png",0x27); local_8 = 1; (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,&gfxPath); local_8 = 0xffffffff; bVar1 = extraout_CL_01; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))); if (0xfff < uVar3) { freeBlock = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + -4)); uVar3 = gfxPath._capacity + 0x24; if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0098631e; } operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_02; } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0) { *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x11ec)) = 10; } break; case 2: gfxPath._size = 0; gfxPath._capacity = 0xf; gfxPath._buf[0] = '\0'; gfxPath._buf[1] = '\0'; gfxPath._buf[2] = '\0'; gfxPath._buf[3] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = msvc::_Allocate(0x20); gfxPath._size = 0x18; gfxPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/TimerPlate.anm2",0x19); local_8 = 2; ANM2::Load(&this->_timerPlate,&gfxPath,1); local_8 = 0xffffffff; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))); if (0xfff < uVar3) { freeBlock = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + -4)); uVar3 = gfxPath._capacity + 0x24; if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,uVar3); } ANM2::Play(&this->_timerPlate,s_Idle,0); bVar1 = extraout_CL_03; break; case 3: (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = msvc::_Allocate(0x20); builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/grid_button_rail.png",0x1e); local_8 = 3; goto LAB_009861b7; case 9: (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = msvc::_Allocate(0x20); builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/grid_button_kill.png",0x1e); local_8 = 4; LAB_009861b7: gfxPath._capacity = 0x1f; gfxPath._size = 0x1d; (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,&gfxPath); local_8 = 0xffffffff; bVar1 = extraout_CL_04; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; freeBlock = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))); if (0xfff < uVar3) { freeBlock = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + -4)); iVar2 = (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) - GHIDRA_INT(freeBlock); joined_r0x00986318: uVar3 = gfxPath._capacity + 0x24; if (0x1f < iVar2 - 4U) { LAB_0098631e: local_8 = 0xffffffff; /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } LAB_009861f6: local_8 = 0xffffffff; operator_delete(freeBlock,uVar3); bVar1 = extraout_CL_05; } break; case 10: case 0xb: case 0xc: case 0xd: (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = msvc::_Allocate(0x20); gfxPath._size = 0x1f; gfxPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/grid_button_output.png",0x20); local_8 = 5; (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,&gfxPath); local_8 = 0xffffffff; bVar1 = extraout_CL_06; if (gfxPath._capacity < 0x10) break; uVar3 = gfxPath._capacity + 1; freeBlock = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))); if (0xfff < uVar3) { freeBlock = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) + -4)); iVar2 = (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) - GHIDRA_INT(freeBlock); goto joined_r0x00986318; } goto LAB_009861f6; } ANM2::LoadGraphics(&this->_sprite,bVar1); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 2) { update_greed_button_anim(this,0); play_pending_animation(this); } else { iVar2 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); if (iVar2 == 0) { ANM2::Play(&this->_sprite,&DAT_00b7cf20,0); } else if ((iVar2 == 3) || (iVar2 == 4)) { animData = (this->_sprite)._animState._animData; if (animData != GHIDRA_CAST(0x0)) { curAnimName = animData; if (0xf < *GHIDRA_CAST((animData + 0x14))) { curAnimName = *GHIDRA_CAST(animData); } expectedAnimName = &DAT_00b7cf1c; do { bVar1 = *curAnimName; isLess = bVar1 < *expectedAnimName; if (bVar1 != *expectedAnimName) { LAB_00986374: uVar3 = -GHIDRA_UINT(isLess) | 1; goto LAB_00986379; } if (bVar1 == 0) break; bVar1 = curAnimName[1]; isLess = bVar1 < expectedAnimName[1]; if (bVar1 != expectedAnimName[1]) goto LAB_00986374; curAnimName = curAnimName + 2; expectedAnimName = expectedAnimName + 2; } while (bVar1 != 0); uVar3 = 0; LAB_00986379: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009863c1; } bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b7cf1c,1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } } LAB_009863c1: (this->_greedModeRNG)._seed = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))); (this->_greedModeRNG)._shift1 = 4; (this->_greedModeRNG)._shift2 = 3; (this->_greedModeRNG)._shift3 = 0x1b; ExceptionList = local_10; return; }