#include "classes.h" // 0071dfc0 void GridEntity_Spikes::BeginBatches() { int iVar1; code *pcVar2; uint8_t isDisabled; uint8_t *curAnim; std_string *psVar3; Entity *bloodSplat; uint8_t extraout_CL; uint8_t extraout_CL_00; uint8_t extraout_CL_01; uint8_t *expectedAnim; char *pcVar4; uint32_t uVar5; bool bVar6; float splatScaleY; Vector local_34; std_string local_2c; uint32_t local_14; void *local_10; uint8_t *puStack_c; uint32_t local_8; void *animData; Game *game; ANM2 *sprite; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afcc05; local_10 = ExceptionList; local_14 = __security_cookie ^ GHIDRA_UINT(&(&local_2c)[1]._size); ExceptionList = &local_10; this->_collisionClass = 0; if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) { *GHIDRA_CAST((GHIDRA_CAST(game->_room) + this->_gridIndex * 4 + 0x76c)) = 999; } sprite = &this->_sprite; local_2c._size = 0; local_2c._capacity = 0xf; local_2c._buf[0] = '\0'; local_2c._buf[1] = '\0'; local_2c._buf[2] = '\0'; local_2c._buf[3] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) = msvc::_Allocate(0x20); local_2c._size = 0x19; local_2c._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))),"gfx/grid/grid_spikes.anm2",0x1a); local_8 = 0; ANM2::Load(sprite,&local_2c,0); local_8 = 0xffffffff; isDisabled = extraout_CL; if (0xf < local_2c._capacity) { uVar5 = local_2c._capacity + 1; pcVar4 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))); if (0xfff < uVar5) { pcVar4 = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) + -4)); uVar5 = local_2c._capacity + 0x24; if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar4))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(pcVar4,uVar5); isDisabled = extraout_CL_00; } (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c)) + 0xc))) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c)) + 0xc))) & 0xffffffff; local_2c._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) & 0xffffff00; local_34.y = 0.0; if ((this->_sprite)._layerCount != 0) { do { Sprite::ReplaceSpritesheet (GHIDRA_CAST(sprite),GHIDRA_INT(local_34.y), (std_string *) (GHIDRA_INT(g_game->_room) + *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18)) * 0x13c + 0x1e3c)); local_34.y = (float)(GHIDRA_INT(local_34.y) + 1); isDisabled = extraout_CL_01; } while (GHIDRA_UINT(local_34.y) < GHIDRA_CAST((this->_sprite)._layerCount)); } ANM2::LoadGraphics(sprite,isDisabled); if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 8) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) % 100 == 0)) { uVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))); local_2c._buf[0xc] = '\x05'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 9; local_34.y = (float)&DAT_00000007; if (uVar5 == 0) { KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 9 ^ uVar5; uVar5 = uVar5 >> 7 ^ uVar5; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) = (uVar5 & 3) + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) + 1; if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1c))) == '\0') { if (uVar5 == 0) { KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> 5 ^ uVar5; uVar5 = uVar5 << 9 ^ uVar5; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))) = uVar5 >> 7 ^ uVar5; } } iVar1 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); (this->_rng)._seed = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))); (this->_rng)._shift1 = 5; (this->_rng)._shift2 = 9; (this->_rng)._shift3 = 7; this->_timeout = 0x1e; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 0; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) != 9) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 0x1c) { if (iVar1 == 1) { curAnim = (this->_sprite)._animState._animData; if (curAnim == GHIDRA_CAST(0x0)) { LAB_0071e528: isDisabled = ANM2::SetAnimation(sprite,GHIDRA_CAST("UnsummonPayment"),1); if (isDisabled != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } pcVar4 = "UnsummonPayment"; do { isDisabled = *curAnim; bVar6 = isDisabled < (uint8_t)*pcVar4; if (isDisabled != *pcVar4) { LAB_0071e510: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e515; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < (uint8_t)pcVar4[1]; if (isDisabled != pcVar4[1]) goto LAB_0071e510; curAnim = curAnim + 2; pcVar4 = pcVar4 + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e515: if ((uVar5 != 0) || ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0071e528; } animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { local_2c._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c)) + 0xc))) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c)) + 0xc))) & 0xffffffff; (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) = GHIDRA_CAST(0x0); } else { (GHIDRA_CAST((local_2c._buf)))->msvc::string::string(animData); } local_8 = 1; psVar3 = &local_2c; if (0xf < local_2c._capacity) { psVar3 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))); } isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(psVar3),1); if ((isDisabled != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar5 = local_2c._capacity + 1; psVar3 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))); if (0xfff < uVar5) { psVar3 = GHIDRA_CAST((GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) + -0x18)))->_capacity); uVar5 = local_2c._capacity + 0x24; if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar3))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(psVar3,uVar5); } (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c)) + 0xc))) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c)) + 0xc))) & 0xffffffff; local_2c._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) & 0xffffff00; if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1); } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 1; goto LAB_0071e7e6; } if ((*GHIDRA_CAST(g_game->_room) == '\0') || (g_game->_frameCount - *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x11f0)) < 1)) { curAnim = (this->_sprite)._animState._animData; if (curAnim != GHIDRA_CAST(0x0)) { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } pcVar4 = "PaymentSpike"; do { isDisabled = *curAnim; bVar6 = isDisabled < (uint8_t)*pcVar4; if (isDisabled != *pcVar4) { LAB_0071e6e2: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e6e7; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < (uint8_t)pcVar4[1]; if (isDisabled != pcVar4[1]) goto LAB_0071e6e2; curAnim = curAnim + 2; pcVar4 = pcVar4 + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e6e7: if ((uVar5 == 0) && ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } pcVar4 = "PaymentSpike"; } else { curAnim = (this->_sprite)._animState._animData; if (curAnim != GHIDRA_CAST(0x0)) { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } pcVar4 = "SummonPayment"; do { isDisabled = *curAnim; bVar6 = isDisabled < (uint8_t)*pcVar4; if (isDisabled != *pcVar4) { LAB_0071e680: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e685; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < (uint8_t)pcVar4[1]; if (isDisabled != pcVar4[1]) goto LAB_0071e680; curAnim = curAnim + 2; pcVar4 = pcVar4 + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e685: if ((uVar5 == 0) && ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } pcVar4 = "SummonPayment"; } } else { iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18)); if (((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || ((iVar1 == 0xd || (iVar1 == 0x22)))) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))) { bVar6 = true; } else { bVar6 = false; } pcVar4 = "Spikes%02u"; if (bVar6) { pcVar4 = "WombSpikes%02u"; } sprintf_s(&DAT_00c80fa8,0x20,GHIDRA_CAST(pcVar4)); curAnim = (this->_sprite)._animState._animData; if (curAnim != GHIDRA_CAST(0x0)) { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } expectedAnim = &DAT_00c80fa8; do { isDisabled = *curAnim; bVar6 = isDisabled < *expectedAnim; if (isDisabled != *expectedAnim) { LAB_0071e7b0: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e7b5; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < expectedAnim[1]; if (isDisabled != expectedAnim[1]) goto LAB_0071e7b0; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e7b5: if ((uVar5 == 0) && ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } pcVar4 = &DAT_00c80fa8; } isDisabled = ANM2::SetAnimation(sprite,GHIDRA_CAST(pcVar4),1); if (isDisabled != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0071e7e6; } uVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); if (uVar5 == 0) { iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18)); if ((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || (((iVar1 == 0xd || (iVar1 == 0x22)) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))))) { bVar6 = true; } else { bVar6 = false; } local_34.y = 1.6766631e-38; if (!bVar6) { local_34.y = (float)&DAT_00b69280; } curAnim = (this->_sprite)._animState._animData; if (curAnim != GHIDRA_CAST(0x0)) { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } expectedAnim = GHIDRA_CAST(local_34.y); do { isDisabled = *curAnim; bVar6 = isDisabled < *expectedAnim; if (isDisabled != *expectedAnim) { LAB_0071e477: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e47c; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < expectedAnim[1]; if (isDisabled != expectedAnim[1]) goto LAB_0071e477; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e47c: if ((uVar5 == 0) && ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.y),1); if (isDisabled != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0071e7e6; } if (5 < uVar5) { iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18)); if ((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || (((iVar1 == 0xd || (iVar1 == 0x22)) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))))) { bVar6 = true; } else { bVar6 = false; } local_34.y = 1.6766631e-38; if (!bVar6) { local_34.y = (float)&DAT_00b69280; } curAnim = (this->_sprite)._animState._animData; if (curAnim == GHIDRA_CAST(0x0)) { LAB_0071e3bb: isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.y),1); if (isDisabled != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } expectedAnim = GHIDRA_CAST(local_34.y); do { isDisabled = *curAnim; bVar6 = isDisabled < *expectedAnim; if (isDisabled != *expectedAnim) { LAB_0071e3a0: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e3a5; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < expectedAnim[1]; if (isDisabled != expectedAnim[1]) goto LAB_0071e3a0; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e3a5: if ((uVar5 != 0) || ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0071e3bb; } this->_timeout = (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) + -5) * 0xc; goto LAB_0071e7e6; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 1; this->_timeout = uVar5 * 0xc; iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18)); if (((((iVar1 == 10) || (iVar1 == 0xb)) || (iVar1 == 0xc)) || ((iVar1 == 0xd || (iVar1 == 0x22)))) || ((iVar1 == 0x2b || ((iVar1 == 0x2c || (iVar1 == 0x30)))))) { bVar6 = true; } else { bVar6 = false; } local_34.y = 1.6734441e-38; if (!bVar6) { local_34.y = 1.6766497e-38; } curAnim = (this->_sprite)._animState._animData; if (curAnim == GHIDRA_CAST(0x0)) { LAB_0071e2db: isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.y),1); if (isDisabled != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } else { if (0xf < *GHIDRA_CAST((curAnim + 0x14))) { curAnim = *GHIDRA_CAST(curAnim); } expectedAnim = GHIDRA_CAST(local_34.y); do { isDisabled = *curAnim; bVar6 = isDisabled < *expectedAnim; if (isDisabled != *expectedAnim) { LAB_0071e2c0: uVar5 = -GHIDRA_UINT(bVar6) | 1; goto LAB_0071e2c5; } if (isDisabled == 0) break; isDisabled = curAnim[1]; bVar6 = isDisabled < expectedAnim[1]; if (isDisabled != expectedAnim[1]) goto LAB_0071e2c0; curAnim = curAnim + 2; expectedAnim = expectedAnim + 2; } while (isDisabled != 0); uVar5 = 0; LAB_0071e2c5: if ((uVar5 != 0) || ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) goto LAB_0071e2db; } if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1); } LAB_0071e7e6: isDisabled = is_disabled(this); if (isDisabled != 0) { unsummon(this,1); } if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 8) && (99 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))) { uVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))); local_2c._buf[0xc] = '\x02'; local_2c._buf[0xd] = '\0'; local_2c._buf[0xe] = '\0'; local_2c._buf[0xf] = '\0'; local_2c._size = 7; if (uVar5 == 0) { KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); pcVar2 = (code *)swi(3); (*pcVar2)(); return; } uVar5 = uVar5 >> 2 ^ uVar5; uVar5 = uVar5 << 7 ^ uVar5; iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0xc)); local_34.x = (float)(this->_gridIndex % iVar1) * 40.0 + 40.0; local_34.y = (float)(this->_gridIndex / iVar1) * 40.0 + 120.0; bloodSplat = (GHIDRA_CAST((g_game)))->Game::Spawn(1000,7,&local_34,&g_vectorZero,GHIDRA_CAST(0x0),0, uVar5 >> 9 ^ uVar5); splatScaleY = g_vectorOne.y * 1.8; iVar1 = *GHIDRA_CAST(bloodSplat); (bloodSplat->_sprite)._scale.x = g_vectorOne.x * 1.8; (bloodSplat->_sprite)._scale.y = splatScaleY; (**(code **)(iVar1 + 0xc))(); } ExceptionList = local_10; return; } // 0071e920 uint8_t GridEntity_Spikes::is_disabled() { uint8_t isFlatFileHeld; RoomDescriptor *roomDesc; Entity_Player *sanguineBondOwner; if (1 < *GHIDRA_CAST(&g_game->_deathmatchManager)) { return 0; } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 0x1c) { return 0; } roomDesc = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx, g_game->_currentDimensionIdx); if (((GHIDRA_UINT(roomDesc->Flags) >> 1 & 1) != 0) || (isFlatFileHeld = (GHIDRA_CAST((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x97), isFlatFileHeld != 0)) { return 1; } if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) < 100) && ((*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) == 0xe && (sanguineBondOwner = PlayerManager::FirstCollectibleOwner (&g_game->_playerManager,0x2b4,GHIDRA_CAST(&g_game->_playerManager),1), sanguineBondOwner != GHIDRA_CAST(0x0))))) { return 1; } return 0; } // 0071e9b0 void GridEntity_Spikes::Update() { uint8_t isCheck; char isCheck; int iVar2; char *anim; uint32_t damageFlags; ANM2 *this_00; int extraout_EDX; char *summonAnim; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) != 0) { if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) { *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + this->_gridIndex * 4 + 0x76c)) = 500; } goto LAB_0071ea6f; } damageFlags = 0x80; iVar2 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)); if ((((iVar2 == 0xd) || (99 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))) || (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 0x1c)) && (damageFlags = 0x10000080, iVar2 == 0xd)) { LAB_0071ea00: isCheck = 1; } else { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) != 8) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) != 0x1c) goto LAB_0071ea4a; goto LAB_0071ea00; } if (99 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8))))) goto LAB_0071ea00; LAB_0071ea4a: isCheck = 0; } GridEntity::hurt_surroundings(GHIDRA_CAST(this),11.0,11.0,8.0,2,(uint64_t)damageFlags,isCheck); if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) { *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + this->_gridIndex * 4 + 0x76c)) = 999; } LAB_0071ea6f: isCheck = is_disabled(this); if (isCheck == 0) { if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 9) && (0 < this->_timeout)) { iVar2 = this->_timeout + -1; this->_timeout = iVar2; if (iVar2 < 1) { this->_timeout = 0x3c; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = GHIDRA_UINT((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0)); } else if (iVar2 == 5) { isCheck = FUN_0071df80(); if (isCheck == '\0') { anim = "Unsummon"; summonAnim = "Summon"; } else { anim = "UnsummonWomb"; summonAnim = "SummonWomb"; } if (extraout_EDX != 0) { anim = summonAnim; } ANM2::Play(this_00,GHIDRA_CAST(anim),0); } } } else if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 0) || (((this->_sprite)._animState._animData != (void *)0x0 && ((this->_sprite)._animState._isPlaying != 0)))) { unsummon(this,0); } if ((this->_sprite)._loaded != 0) { AnimationState::Update(&(this->_sprite)._animState); AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } // 0071eb30 void GridEntity_Spikes::unsummon(uint8_t isInstant) { void *other; char isWomb; uint8_t bVar1; uint8_t *curAnimChar; uint32_t uVar2; uint8_t *****curAnimNameData; char *animName; bool isLess; uint8_t *****curAnimName [4]; uint32_t curAnimNameSize; uint32_t curAnimNameCapacity; uint32_t securityCookie; void *local_10; uint8_t *puStack_c; uint8_t ****local_8; uint8_t *animData; local_8 = GHIDRA_CAST(0xffffffff); puStack_c = &LAB_00af18ad; local_10 = ExceptionList; securityCookie = __security_cookie ^ GHIDRA_UINT((curAnimName + 0xb)); ExceptionList = &local_10; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 1; this->_timeout = -1; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 0x1c) { animData = (this->_sprite)._animState._animData; if (animData != GHIDRA_CAST(0x0)) { curAnimChar = animData; if (0xf < *GHIDRA_CAST((animData + 0x14))) { curAnimChar = *GHIDRA_CAST(animData); } animName = "UnsummonPayment"; do { bVar1 = *curAnimChar; isLess = bVar1 < (uint8_t)*animName; if (bVar1 != *animName) { LAB_0071ebb0: uVar2 = -GHIDRA_UINT(isLess) | 1; goto LAB_0071ebb5; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (uint8_t)animName[1]; if (bVar1 != animName[1]) goto LAB_0071ebb0; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0071ebb5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071ecaa; } animName = "UnsummonPayment"; } else { isWomb = FUN_0071df80(securityCookie); animData = (this->_sprite)._animState._animData; if (isWomb == '\0') { if (animData != GHIDRA_CAST(0x0)) { curAnimChar = animData; if (0xf < *GHIDRA_CAST((animData + 0x14))) { curAnimChar = *GHIDRA_CAST(animData); } animName = "Unsummon"; do { bVar1 = *curAnimChar; isLess = bVar1 < (uint8_t)*animName; if (bVar1 != *animName) { LAB_0071ec72: uVar2 = -GHIDRA_UINT(isLess) | 1; goto LAB_0071ec77; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (uint8_t)animName[1]; if (bVar1 != animName[1]) goto LAB_0071ec72; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0071ec77: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071ecaa; } animName = "Unsummon"; } else { if (animData != GHIDRA_CAST(0x0)) { curAnimChar = animData; if (0xf < *GHIDRA_CAST((animData + 0x14))) { curAnimChar = *GHIDRA_CAST(animData); } animName = "UnsummonWomb"; do { bVar1 = *curAnimChar; isLess = bVar1 < (uint8_t)*animName; if (bVar1 != *animName) { LAB_0071ec20: uVar2 = -GHIDRA_UINT(isLess) | 1; goto LAB_0071ec25; } if (bVar1 == 0) break; bVar1 = curAnimChar[1]; isLess = bVar1 < (uint8_t)animName[1]; if (bVar1 != animName[1]) goto LAB_0071ec20; curAnimChar = curAnimChar + 2; animName = animName + 2; } while (bVar1 != 0); uVar2 = 0; LAB_0071ec25: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071ecaa; } animName = "UnsummonWomb"; } } bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar1 != 0) { AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0071ecaa: if (isInstant != 0) { other = (this->_sprite)._animState._animData; if (other == (void *)0x0) { curAnimNameCapacity = 0xf; curAnimNameSize = 0; curAnimName[0] = GHIDRA_CAST(0x0); } else { (GHIDRA_CAST((GHIDRA_CAST(curAnimName))))->msvc::string::string(other); } local_8 = GHIDRA_CAST(0x0); curAnimNameData = GHIDRA_CAST(curAnimName); if (0xf < curAnimNameCapacity) { curAnimNameData = curAnimName[0]; } bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(curAnimNameData),1); if ((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } } local_8 = GHIDRA_CAST(0xffffffff); if (0xf < curAnimNameCapacity) { uVar2 = curAnimNameCapacity + 1; curAnimNameData = curAnimName[0]; if (0xfff < uVar2) { curAnimNameData = GHIDRA_CAST(curAnimName[0][-1]); uVar2 = curAnimNameCapacity + 0x24; if (GHIDRA_CAST(0x1f) < GHIDRA_CAST((GHIDRA_INT(curAnimName[0]) + (-4 - GHIDRA_INT(curAnimNameData))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(curAnimNameData,uVar2); } curAnimNameSize = 0; curAnimNameCapacity = 0xf; curAnimName[0] = GHIDRA_CAST((GHIDRA_UINT(curAnimName[0]) & 0xffffff00)); if ((this->_sprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition (&(this->_sprite)._animState, *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1); } } ExceptionList = local_10; return; }