Files
isaac-port/generated-src/grid_entity_poop.cpp
T
shweetandClaude Opus 5.5 28e2e48842 Curation round 2, wave B: ItemConfig, EntityConfig, mods, Manager and the KAGE platform on SDL3; boots to LuaEngine::Init
- item_config, entity_config and mod_manager take over their families as idiomatic classes (std containers,
  unique_ptr, bitset tear flags). Every big loader reads the imported JSON: entities2.xml gives 1349 entities.
- manager.h/.cpp take over Manager (g_manager) and IsaacStartup. Members are the curated subsystems by value.
- kage_graphics, kage_input and kage_sound take over KAGE's graphics (shaders, render targets, batches, PNG through
  stb_image), input (SDL3 keyboard, mouse, gamepads) and sound (SDL3 audio, wav and stb_vorbis ogg, pitch and volume).
- source_tree.py: classes inside a namespace block in src/ headers count as taken over, and a still-generated class's
  vtable slot keeps its stub unless src/ defines that exact method.
build/isaac opens the window, sets up GL 4.6, framebuffers and PulseAudio, logs the version, and stops at
LuaEngine::Init. 522 functions taken over, boot path 156/615.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:03:39 -05:00

1495 lines
58 KiB
C++

#include "classes.h"
// 00456870
void GridEntity_Poop::ReduceSpawnRate()
{
this->_varData = 1;
return;
}
// 00714770
void GridEntity_Poop::Update()
{
uint8_t bVar1;
uint32_t uVar2;
GridEntity_Poop *gigaPart;
RoomDescriptor *roomDesc;
void *pvVar3;
uint8_t *animNameCursor;
uint8_t *pbVar4;
char *expectedName;
uint64_t *allocCounter;
uint32_t *playerIt;
int iVar5;
PlayerManager *playerManager;
bool isLess;
float deltaX;
float fVar6;
ColorMod pulseColor;
Vector spawnPos;
Vector local_74;
float footprintR;
float fStack_68;
float fStack_64;
int iStack_60;
uint32_t local_5c;
float local_58;
float local_54;
GridEntity_Poop *local_50;
float local_4c;
uint8_t local_45;
uint8_t animName [32];
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
uint64_t allocBytesBefore;
Game *game;
Entity_Player *player;
int prevHolyAura;
ColorMod *spriteColor;
puStack_20 = animName + 0x40;
local_14 = 0xffffffff;
puStack_18 = &LAB_00afca70;
local_1c = ExceptionList;
uVar2 = __security_cookie ^ GHIDRA_UINT((animName + 0x34));
ExceptionList = &local_1c;
local_50 = this;
local_24 = uVar2;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) - 7U < 4) {
iVar5 = 7;
puStack_20 = animName + 0x40;
do {
if ((iVar5 != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))))) &&
(gigaPart = get_giga_part(this,iVar5,0), gigaPart == GHIDRA_CAST<GridEntity_Poop *>(0x0))) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 0;
this->BeginBatches(uVar2);
break;
}
iVar5 = iVar5 + 1;
} while (iVar5 < 0xb);
}
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) &&
(roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,
g_game->_currentDimensionIdx),
(GHIDRA_UINT(roomDesc->Flags) >> 1 & 1) != 0)) {
local_45 = (this->_sprite)._flipX;
this->_reviveTimer = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 0;
this->BeginBatches();
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 1000) {
local_54 = 4.2039e-45;
local_4c = 0.0;
local_58 = (float)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) / 0xfa);
}
sprintf_s(animName,0x1f,GHIDRA_CAST<uint8_t *>("State%d"));
pvVar3 = ANM2::GetAnimationData(&this->_sprite,animName);
local_58 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar3) + 0x30));
bVar1 = ANM2::SetAnimation(&this->_sprite,animName,1);
if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(local_58)),
(this->_sprite)._animState._animData != (void *)0x0)) {
(this->_sprite)._animState._isPlaying = 0;
}
(this->_sprite)._flipX = local_45;
uVar2 = Random();
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
spawnPos.x = (float)(local_50->_gridIndex % iVar5) * 40.0 + 40.0;
spawnPos.y = (float)(local_50->_gridIndex / iVar5) * 40.0 + 120.0;
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar2,0);
this = local_50;
}
if ((0 < this->_reviveTimer) &&
(iVar5 = this->_reviveTimer + -1, this->_reviveTimer = iVar5, iVar5 < 1)) {
pbVar4 = (this->_sprite)._animState._animData;
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
LAB_007149d5:
bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("Appear"),1);
if (bVar1 != 0) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
}
else {
animNameCursor = pbVar4;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar4);
}
expectedName = "Appear";
do {
bVar1 = *animNameCursor;
isLess = bVar1 < (uint8_t)*expectedName;
if (bVar1 != *expectedName) {
LAB_007149b7:
uVar2 = -GHIDRA_UINT(isLess) | 1;
goto LAB_007149bc;
}
if (bVar1 == 0) break;
bVar1 = animNameCursor[1];
isLess = bVar1 < (uint8_t)expectedName[1];
if (bVar1 != expectedName[1]) goto LAB_007149b7;
animNameCursor = animNameCursor + 2;
expectedName = expectedName + 2;
} while (bVar1 != 0);
uVar2 = 0;
LAB_007149bc:
if ((uVar2 != 0) || ((pbVar4[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
goto LAB_007149d5;
}
game = g_game;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 0;
if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(game->_room) + this->_gridIndex * 4 + 0x76c)) = 0x5dc;
}
}
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 1000) {
this->_collisionClass = 0;
}
else {
this->_collisionClass = 3;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) {
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
fVar6 = 16.0;
}
else {
fVar6 = 4.0;
}
GridEntity::hurt_surroundings(GHIDRA_CAST<GridEntity *>(this),22.5,18.5,fVar6,1,0x200,1);
fVar6 = sin((float)g_game->_frameCount * 0.25);
spriteColor = &(this->_sprite)._color;
pulseColor._offset[0] = 0.0;
pulseColor._offset[1] = 0.0;
pulseColor._offset[2] = 0.0;
pulseColor._tint[0] = 1.0 - fVar6 * 0.1;
pulseColor._tint[1] = 1.0;
pulseColor._tint[2] = 1.0;
pulseColor._tint[3] = 1.0;
if (spriteColor != &pulseColor) {
(this->_sprite)._color._colorize[0] = 0.0;
(this->_sprite)._color._colorize[1] = 0.0;
(this->_sprite)._color._colorize[2] = 0.0;
(this->_sprite)._color._colorize[3] = 0.0;
spriteColor->_tint[0] = pulseColor._tint[0];
(this->_sprite)._color._tint[1] = 1.0;
(this->_sprite)._color._tint[2] = 1.0;
(this->_sprite)._color._tint[3] = 1.0;
(this->_sprite)._color._offset[0] = 0.0;
(this->_sprite)._color._offset[1] = 0.0;
(this->_sprite)._color._offset[2] = 0.0;
}
}
}
if (((this->_sprite)._animState._animData == (void *)0x0) ||
((this->_sprite)._animState._isPlaying != 0)) goto LAB_00714c16;
pbVar4 = (this->_sprite)._animState._animData;
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar4 = &s_empty;
}
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
}
expectedName = "Appear";
do {
bVar1 = *pbVar4;
isLess = bVar1 < (uint8_t)*expectedName;
if (bVar1 != *expectedName) {
LAB_00714b81:
uVar2 = -GHIDRA_UINT(isLess) | 1;
goto LAB_00714b86;
}
if (bVar1 == 0) break;
bVar1 = pbVar4[1];
isLess = bVar1 < (uint8_t)expectedName[1];
if (bVar1 != expectedName[1]) goto LAB_00714b81;
pbVar4 = pbVar4 + 2;
expectedName = expectedName + 2;
} while (bVar1 != 0);
uVar2 = 0;
LAB_00714b86:
if (uVar2 != 0) goto LAB_00714c16;
pbVar4 = (this->_sprite)._animState._animData;
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
LAB_00714be2:
bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("State1"),1);
if (bVar1 != 0) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
}
else {
animNameCursor = pbVar4;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar4);
}
expectedName = "State1";
do {
bVar1 = *animNameCursor;
isLess = bVar1 < (uint8_t)*expectedName;
if (bVar1 != *expectedName) {
LAB_00714bc4:
uVar2 = -GHIDRA_UINT(isLess) | 1;
goto LAB_00714bc9;
}
if (bVar1 == 0) break;
bVar1 = animNameCursor[1];
isLess = bVar1 < (uint8_t)expectedName[1];
if (bVar1 != expectedName[1]) goto LAB_00714bc4;
animNameCursor = animNameCursor + 2;
expectedName = expectedName + 2;
} while (bVar1 != 0);
uVar2 = 0;
LAB_00714bc9:
if ((uVar2 != 0) || ((pbVar4[0x34] != 0 && ((this->_sprite)._animState._isPlaying == 0))))
goto LAB_00714be2;
}
if ((this->_sprite)._animState._animData != (void *)0x0) {
AnimationState::AdvancePosition
(&(this->_sprite)._animState,
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1);
}
LAB_00714c16:
playerManager = &g_game->_playerManager;
local_45 = '\0';
local_50 = GHIDRA_CAST<GridEntity_Poop *>(0x0);
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2
!= 0) {
do {
pvVar3 = (playerManager->_playerList)._end;
playerIt = (playerManager->_playerList)._begin;
if (GHIDRA_INT(pvVar3) - GHIDRA_INT(playerIt) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar3 = (playerManager->_playerList)._end;
playerIt = (playerManager->_playerList)._begin;
}
if (local_50 < GHIDRA_UINT((GHIDRA_INT(pvVar3) - GHIDRA_INT(playerIt) >> 2))) {
playerIt = playerIt + GHIDRA_INT(local_50);
}
player = GHIDRA_CAST<Entity_Player *>(*playerIt);
if (((((player->_variant == 0) && (iVar5 = player->_entityGridCollisionClass, iVar5 != 0)) &&
(iVar5 != 3)) && ((iVar5 != 1 && (iVar5 != 2)))) &&
(iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc)),
fVar6 = ((float)(this->_gridIndex / iVar5) * 40.0 + 120.0) - (player->_pos).y,
deltaX = ((float)(this->_gridIndex % iVar5) * 40.0 + 40.0) - (player->_pos).x,
local_74.y = sqrtf(fVar6 * fVar6 + deltaX * deltaX), local_74.y < 21.0)) {
footprintR = 0.15294118;
fStack_68 = 0.09803922;
fStack_64 = 0.08627451;
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))))) {
case 1:
footprintR = 0.5764706;
fStack_68 = 0.07058824;
fStack_64 = 0.10980392;
break;
default:
goto switchD_00714d3f_caseD_2;
case 3:
footprintR = 0.84705883;
fStack_68 = 0.5058824;
fStack_64 = 0.0;
break;
case 4:
local_58 = 0.0;
local_4c = 0.0;
local_54 = 0.0;
uVar2 = Random();
fStack_64 = local_58;
fStack_68 = local_4c;
switch(uVar2 % 6) {
case 0:
footprintR = 1.0;
fStack_68 = local_58;
local_54 = footprintR;
break;
case 1:
fStack_68 = 1.0;
footprintR = 1.0;
break;
case 2:
fStack_68 = 1.0;
footprintR = local_58;
local_4c = fStack_68;
break;
case 3:
fStack_68 = 1.0;
footprintR = local_54;
fStack_64 = 1.0;
break;
case 4:
footprintR = local_4c;
fStack_64 = 1.0;
break;
case 5:
footprintR = 1.0;
fStack_64 = 1.0;
break;
default:
footprintR = 1.0;
fStack_64 = 1.0;
fStack_68 = 1.0;
}
break;
case 5:
footprintR = 0.078431375;
fStack_68 = 0.078431375;
fStack_64 = 0.078431375;
break;
case 6:
footprintR = 0.44313726;
fStack_68 = 0.74509805;
fStack_64 = 0.8235294;
}
iStack_60 = 0x3f800000;
local_5c = 0;
switchD_00714d3f_caseD_2:
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_footstep_triggered(-1);
if ((bVar1 != 0) && (player->_canFly == 0)) {
bVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_footstep_triggered(0);
if (bVar1 == 0) {
(player->_footprintColor1)._offset[0] = footprintR;
(player->_footprintColor1)._offset[1] = fStack_68;
(player->_footprintColor1)._offset[2] = fStack_64;
}
else {
(player->_footprintColor2)._offset[0] = footprintR;
(player->_footprintColor2)._offset[1] = fStack_68;
(player->_footprintColor2)._offset[2] = fStack_64;
}
}
if ((this->_isUnderPlayer != 0) && (local_74.y < 20.0)) {
this->_collisionClass = 0;
local_45 = '\x01';
}
}
playerManager = &g_game->_playerManager;
local_50 = GHIDRA_CAST<GridEntity_Poop *>((GHIDRA_INT(local_50) + 1));
} while (local_50 <
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
}
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x171))) != '\0') {
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
local_74.x = (float)(this->_gridIndex % iVar5) * 40.0 + 40.0;
local_74.y = (float)(this->_gridIndex / iVar5) * 40.0 + 120.0;
EntityList::QueryRadius
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(&fStack_68),&local_74,
16.0,0xffffffff);
uVar2 = 0;
if (local_5c != 0) {
do {
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fStack_64) + uVar2 * 4));
if (((iVar5 != 0) &&
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 1)) ||
(*GHIDRA_CAST<int *>((iVar5 + 0x28)) - 10U < 0x3de)))) && (3 < *GHIDRA_CAST<int *>((iVar5 + 0x184)))) {
this->_collisionClass = 0;
goto LAB_00714fce;
}
uVar2 = uVar2 + 1;
} while (uVar2 < local_5c);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x171))) = 0;
LAB_00714fce:
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(fStack_68)) + 0x0))) == '\0') {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (fStack_64 != 0.0) {
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fStack_64) + -4));
allocBytesBefore = *allocCounter;
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocBytesBefore) < uVar2));
free((void *)(GHIDRA_INT(fStack_64) + -4));
}
local_14 = 0xffffffff;
}
}
if (local_45 == '\0') {
this->_isUnderPlayer = 0;
}
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 6) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 1000)) {
playerManager = &g_game->_playerManager;
local_50 = GHIDRA_CAST<GridEntity_Poop *>(0x0);
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
2 != 0) {
do {
pvVar3 = (playerManager->_playerList)._end;
playerIt = (playerManager->_playerList)._begin;
if (GHIDRA_INT(pvVar3) - GHIDRA_INT(playerIt) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar3 = (playerManager->_playerList)._end;
playerIt = (playerManager->_playerList)._begin;
}
if (local_50 < GHIDRA_UINT((GHIDRA_INT(pvVar3) - GHIDRA_INT(playerIt) >> 2))) {
playerIt = playerIt + GHIDRA_INT(local_50);
}
player = GHIDRA_CAST<Entity_Player *>(*playerIt);
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
fVar6 = ((float)(this->_gridIndex / iVar5) * 40.0 + 120.0) - (player->_pos).y;
deltaX = ((float)(this->_gridIndex % iVar5) * 40.0 + 40.0) - (player->_pos).x;
local_74.y = (float)player;
fVar6 = sqrtf(fVar6 * fVar6 + deltaX * deltaX);
if (fVar6 < player->_size + 70.0) {
prevHolyAura = player->_hallowedGroundCountdown;
iVar5 = prevHolyAura + 4;
if (4 < iVar5) {
iVar5 = 4;
}
player->_hallowedGroundCountdown = iVar5;
if (0 < prevHolyAura != 0 < iVar5) {
player->_cacheFlags = player->_cacheFlags | 99;
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::EvaluateItems();
}
}
playerManager = &g_game->_playerManager;
local_50 = GHIDRA_CAST<GridEntity_Poop *>((GHIDRA_INT(local_50) + 1));
} while (local_50 <
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
}
}
if ((this->_sprite)._loaded != 0) {
AnimationState::Update(&(this->_sprite)._animState);
AnimationState::Update(&(this->_sprite)._overlayAnimState);
}
ExceptionList = local_1c;
return;
}
// 00715940
void GridEntity_Poop::BeginBatches()
{
code *pcVar1;
uint8_t isSameSpritesheet;
uint8_t isSameSpritesheet;
int *playerSlot;
int iVar3;
uint32_t uVar4;
Entity *pEVar5;
EntityConfig_Entity *configEntry;
uint8_t *******pppppppbVar6;
uint8_t *pbVar7;
void *pvVar8;
LayerState *spawnLayer;
uint8_t *pbVar9;
uint8_t extraout_CL;
uint8_t extraout_CL_00;
uint8_t extraout_CL_01;
uint8_t *extraout_ECX;
uint8_t *this_00;
char *pcVar10;
uint8_t *idleAnimName;
int iVar11;
PlayerManager *playerManager;
Manager *manager;
EntityConfig *entityConfig;
uint8_t *******spritesheetHeapBuf;
bool isLess;
float offsetX;
float offsetY;
uint32_t uVar12;
uint8_t coinFindResult [8];
void *coinConfigNode;
uint8_t heartFindResult [8];
void *heartConfigNode;
uint8_t effect58FindResult [8];
void *effect58ConfigNode;
uint8_t effect43FindResult [8];
void *effect43ConfigNode;
Vector effectSpawnPos;
Vector flySpawnPos;
uint8_t *heartConfigKey;
GridEntity_Poop *savedPoop;
Entity *local_1ac;
Game *local_1a8;
EntityConfig *local_1a4;
uint8_t isUnderPlayer;
std_string anm2Path;
std_string giantAnm2Path;
uint8_t *******spritesheetPathString [4];
uint32_t spritesheetPathSize;
uint32_t spritesheetPathCapacity;
uint8_t spritesheetPath [256];
uint8_t stateAnimName [32];
uint8_t playStateAnimName [32];
uint32_t stackCookie;
void *prevExceptionList;
uint8_t *puStack_c;
uint32_t ehState;
uint32_t castIsReference;
TypeDescriptor *castSrcType;
TypeDescriptor *castTargetType;
local_1a8 = g_game;
ehState = 0xffffffff;
puStack_c = &LAB_00afcac6;
prevExceptionList = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((playStateAnimName + 0x30));
ExceptionList = &prevExceptionList;
this->_varData = 0;
*GHIDRA_CAST<uint16_t *>(&this->_isUnderPlayer) = 0;
isUnderPlayer = 0;
savedPoop = this;
if (*GHIDRA_CAST<char *>(local_1a8->_room) != '\0') {
playerManager = &local_1a8->_playerManager;
local_1a4 = GHIDRA_CAST<EntityConfig *>(0x0);
isUnderPlayer = 0;
if (GHIDRA_INT((local_1a8->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin)
>> 2 != 0) {
do {
pvVar8 = (playerManager->_playerList)._end;
if (GHIDRA_INT(pvVar8) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar8 = (playerManager->_playerList)._end;
local_1a8 = g_game;
}
playerSlot = (playerManager->_playerList)._begin;
if (local_1a4 < GHIDRA_CAST<EntityConfig *>((GHIDRA_INT(pvVar8) - GHIDRA_INT(playerSlot) >> 2))) {
playerSlot = playerSlot + GHIDRA_INT(local_1a4);
}
iVar3 = *playerSlot;
if (((((*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0) && (iVar11 = *GHIDRA_CAST<int *>((iVar3 + 0x184)), iVar11 != 0)) &&
(iVar11 != 3)) && ((iVar11 != 1 && (iVar11 != 2)))) &&
(iVar11 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1a8->_room) + 0xc)),
offsetY = *GHIDRA_CAST<float *>((iVar3 + 0x340)) - ((float)(this->_gridIndex / iVar11) * 40.0 + 120.0)
, offsetX = *GHIDRA_CAST<float *>((iVar3 + 0x33c)) -
((float)(this->_gridIndex % iVar11) * 40.0 + 40.0),
offsetY * offsetY + offsetX * offsetX < 400.0)) {
this->_isUnderPlayer = 1;
isUnderPlayer = 1;
goto LAB_00715af4;
}
local_1a4 = GHIDRA_CAST<EntityConfig *>((GHIDRA_INT(&(local_1a4->_entities)._head) + 1));
playerManager = &local_1a8->_playerManager;
} while (local_1a4 <
(EntityConfig *)
(GHIDRA_INT((local_1a8->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2));
isUnderPlayer = this->_isUnderPlayer;
}
}
LAB_00715af4:
iVar3 = 0;
if (isUnderPlayer == 0) {
iVar3 = 3;
}
this->_collisionClass = iVar3;
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))));
if (iVar3 == 2) {
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 1000) {
uVar4 = Random();
castIsReference = 0;
castTargetType = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor;
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar12 = 0;
flySpawnPos.x = (float)(savedPoop->_gridIndex % iVar3) * 40.0 + 40.0;
flySpawnPos.y = (float)(savedPoop->_gridIndex / iVar3) * 40.0 + 120.0;
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(0x60,0,&flySpawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
iVar3 = __RTDynamicCast(pEVar5,uVar12,castSrcType,castTargetType,castIsReference);
local_1a8 = g_game;
*GHIDRA_CAST<uint32_t *>((iVar3 + 0xb64)) = 0;
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedPoop)) + 0x8))));
this = savedPoop;
goto LAB_00715bc8;
}
}
else {
LAB_00715bc8:
if ((iVar3 == 1) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 1000)) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 0;
}
}
uVar12 = 0;
this->_reviveTimer = 0;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) != 1000) {
uVar12 = 0x5dc;
}
if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_1a8->_room) + this->_gridIndex * 4 + 0x76c)) = uVar12;
}
manager = g_manager;
local_1a4 = GHIDRA_CAST<EntityConfig *>(0x3e802b00);
local_1a8 = GHIDRA_CAST<Game *>(&g_manager->_entityConfig);
_Find_lower_bound<>(effect43FindResult,&local_1a4);
entityConfig = &manager->_entityConfig;
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(effect43ConfigNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(effect43ConfigNode) + 0x10)) < 0x3e802b01)) &&
(effect43ConfigNode != (entityConfig->_entities)._head)) {
configEntry = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(effect43ConfigNode) + 0x18));
}
else {
configEntry = EntityConfig::GetEntity(entityConfig,1000,0,0);
}
if (configEntry != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
EntityConfig::PreloadResources(GHIDRA_CAST<EntityConfig *>(local_1a8),configEntry);
manager = g_manager;
}
local_1a8 = GHIDRA_CAST<Game *>(0x3e803a00);
local_1a4 = &manager->_entityConfig;
_Find_lower_bound<>(effect58FindResult,&local_1a8);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(effect58ConfigNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(effect58ConfigNode) + 0x10)) < 0x3e803a01)) &&
(effect58ConfigNode != (manager->_entityConfig)._entities._head)) {
configEntry = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(effect58ConfigNode) + 0x18));
}
else {
configEntry = EntityConfig::GetEntity(&manager->_entityConfig,1000,0,0);
}
if (configEntry != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
EntityConfig::PreloadResources(local_1a4,configEntry);
manager = g_manager;
}
heartConfigKey = &DAT_00500a00;
local_1a4 = &manager->_entityConfig;
_Find_lower_bound<>(heartFindResult,&heartConfigKey);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(heartConfigNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(heartConfigNode) + 0x10)) <= &DAT_00500a00)) &&
(heartConfigNode != (manager->_entityConfig)._entities._head)) {
configEntry = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(heartConfigNode) + 0x18));
}
else {
configEntry = EntityConfig::GetEntity(&manager->_entityConfig,5,0,0);
}
if (configEntry != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
EntityConfig::PreloadResources(local_1a4,configEntry);
manager = g_manager;
}
local_1ac = GHIDRA_CAST<Entity *>(&DAT_00501400);
entityConfig = &manager->_entityConfig;
_Find_lower_bound<>(coinFindResult,&local_1ac);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(coinConfigNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(coinConfigNode) + 0x10)) <= &DAT_00501400)) &&
(coinConfigNode != (entityConfig->_entities)._head)) {
configEntry = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(coinConfigNode) + 0x18));
}
else {
configEntry = EntityConfig::GetEntity(entityConfig,5,0,0);
}
if (configEntry != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
EntityConfig::PreloadResources(entityConfig,configEntry);
}
(this->_rng)._seed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))));
(this->_rng)._shift1 = 5;
(this->_rng)._shift2 = 9;
(this->_rng)._shift3 = 7;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) - 7U < 4) {
giantAnm2Path._size = 0;
giantAnm2Path._capacity = 0xf;
giantAnm2Path._buf[0] = '\0';
giantAnm2Path._buf[1] = '\0';
giantAnm2Path._buf[2] = '\0';
giantAnm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(giantAnm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
giantAnm2Path._size = 0x1d;
giantAnm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(giantAnm2Path._buf))) + 0x0))),"gfx/grid/grid_poop_giant.anm2",0x1e);
ehState = 0;
ANM2::Load(&this->_sprite,&giantAnm2Path,1);
ehState = 0xffffffff;
if (0xf < giantAnm2Path._capacity) {
uVar4 = giantAnm2Path._capacity + 1;
pcVar10 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(giantAnm2Path._buf))) + 0x0)));
if (0xfff < uVar4) {
pcVar10 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(giantAnm2Path._buf)) + 0x0))) + -4));
uVar4 = giantAnm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(giantAnm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar10,uVar4);
}
giantAnm2Path._size = 0;
giantAnm2Path._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(giantAnm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(giantAnm2Path._buf)) + 0x0))) & 0xffffff00;
goto LAB_007162ed;
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x17;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/grid_poop.anm2",0x18);
ehState = 1;
ANM2::Load(&this->_sprite,&anm2Path,0);
ehState = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar4 = anm2Path._capacity + 1;
pcVar10 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar4) {
pcVar10 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar4 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar10,uVar4);
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) & 0xffffff00;
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))))) {
case 0:
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
}
uVar4 = uVar4 >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ uVar4;
uVar4 = uVar4 << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ uVar4;
(this->_rng)._seed = uVar4 >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ uVar4;
pcVar10 = "gfx/grid/grid_poop_%u.png";
goto LAB_00716065;
case 1:
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
}
uVar4 = uVar4 >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ uVar4;
uVar4 = uVar4 << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ uVar4;
(this->_rng)._seed = uVar4 >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ uVar4;
pcVar10 = "gfx/grid/grid_poop_red_%u.png";
goto LAB_00716065;
case 2:
strncpy(GHIDRA_CAST<char *>(spritesheetPath),"gfx/grid/grid_poop_corn.png",0xff);
break;
case 3:
strncpy(GHIDRA_CAST<char *>(spritesheetPath),"gfx/grid/grid_poop_gold.png",0xff);
break;
case 4:
strncpy(GHIDRA_CAST<char *>(spritesheetPath),"gfx/grid/grid_poop_rainbow.png",0xff);
break;
case 5:
strncpy(GHIDRA_CAST<char *>(spritesheetPath),"gfx/grid/grid_poop_black.png",0xff);
break;
case 6:
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
}
uVar4 = uVar4 >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ uVar4;
uVar4 = uVar4 << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ uVar4;
(this->_rng)._seed = uVar4 >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ uVar4;
pcVar10 = "gfx/grid/grid_poop_white_%u.png";
LAB_00716065:
sprintf_s(spritesheetPath,0xff,GHIDRA_CAST<uint8_t *>(pcVar10));
break;
default:
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Unknown poop variant: %d"));
break;
case 0xb:
strncpy(GHIDRA_CAST<char *>(spritesheetPath),"gfx/grid/grid_poop_charming.png",0xff);
}
pbVar7 = spritesheetPath;
spritesheetPathSize = 0;
spritesheetPathCapacity = 0xf;
spritesheetPathString[0] = GHIDRA_CAST<uint8_t *******>(0x0);
do {
isSameSpritesheet = *pbVar7;
pbVar7 = pbVar7 + 1;
} while (isSameSpritesheet != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(spritesheetPathString))))->msvc::string::assign(spritesheetPath,
GHIDRA_INT(pbVar7) - GHIDRA_INT((spritesheetPath + 1)));
spritesheetHeapBuf = spritesheetPathString[0];
ehState = 2;
if ((this->_sprite)._layerCount < 1) {
isSameSpritesheet = extraout_CL;
}
else {
local_1ac = (this->_sprite)._layerState;
pbVar7 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_1ac)) + 0x8)));
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&local_1ac->_pendingDamageFlags) + 4))) {
pbVar7 = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_1ac)) + 0x8))));
}
pppppppbVar6 = GHIDRA_CAST<uint8_t *******>(spritesheetPathString);
if (0xf < spritesheetPathCapacity) {
pppppppbVar6 = spritesheetPathString[0];
}
isSameSpritesheet =
str_eq(GHIDRA_CAST<uint8_t *>(pppppppbVar6),spritesheetPathSize,pbVar7,GHIDRA_UINT(local_1ac->_pendingDamageFlags)
);
isSameSpritesheet = extraout_CL_00;
if (isSameSpritesheet == 0) {
this_00 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_1ac)) + 0x8)));
pEVar5 = local_1ac;
if (GHIDRA_CAST<uint8_t ********>(this_00) != spritesheetPathString) {
pppppppbVar6 = GHIDRA_CAST<uint8_t *******>(spritesheetPathString);
if (0xf < spritesheetPathCapacity) {
pppppppbVar6 = spritesheetHeapBuf;
}
(GHIDRA_CAST<msvc::string *>((this_00)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(pppppppbVar6),spritesheetPathSize);
pEVar5 = (this->_sprite)._layerState;
this_00 = extraout_ECX;
spritesheetHeapBuf = spritesheetPathString[0];
}
isSameSpritesheet = (uint8_t)this_00;
*GHIDRA_CAST<uint8_t *>(&pEVar5->_subtype) = 0;
}
}
ehState = 0xffffffff;
if (0xf < spritesheetPathCapacity) {
uVar4 = spritesheetPathCapacity + 1;
pppppppbVar6 = spritesheetHeapBuf;
if (0xfff < uVar4) {
pppppppbVar6 = GHIDRA_CAST<uint8_t *******>(spritesheetHeapBuf[-1]);
uVar4 = spritesheetPathCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(spritesheetHeapBuf) + (-4 - GHIDRA_INT(pppppppbVar6))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pppppppbVar6,uVar4);
isSameSpritesheet = extraout_CL_01;
}
spritesheetPathSize = 0;
spritesheetPathCapacity = 0xf;
spritesheetPathString[0] = GHIDRA_CAST<uint8_t *******>((GHIDRA_UINT(spritesheetPathString[0]) & 0xffffff00));
ANM2::LoadGraphics(&this->_sprite,isSameSpritesheet);
LAB_007162ed:
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 1000) {
iVar3 = 4;
}
else {
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) / 0xfa;
iVar11 = 3;
if (iVar3 < 3) {
iVar11 = iVar3;
}
iVar3 = 0;
if (0 < iVar11) {
iVar3 = iVar11;
}
}
if (*GHIDRA_CAST<char *>(g_game->_room) == '\0') {
sprintf_s(stateAnimName,0x1f,GHIDRA_CAST<uint8_t *>("State%d"));
pvVar8 = ANM2::GetAnimationData(&this->_sprite,stateAnimName);
local_1ac = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(pvVar8) + 0x30));
isSameSpritesheet = ANM2::SetAnimation(&this->_sprite,stateAnimName,1);
if (((isSameSpritesheet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(local_1ac)),
(this->_sprite)._animState._animData != (void *)0x0)) {
(this->_sprite)._animState._isPlaying = 0;
}
}
else {
if (iVar3 == 0) {
pbVar7 = (this->_sprite)._animState._animData;
if (pbVar7 != GHIDRA_CAST<uint8_t *>(0x0)) {
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar7 + 0x14))) {
pbVar7 = *GHIDRA_CAST<uint8_t **>(pbVar7);
}
pcVar10 = "Appear";
do {
isSameSpritesheet = *pbVar7;
isLess = isSameSpritesheet < (uint8_t)*pcVar10;
if (isSameSpritesheet != *pcVar10) {
LAB_00716370:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_00716375;
}
if (isSameSpritesheet == 0) break;
isSameSpritesheet = pbVar7[1];
isLess = isSameSpritesheet < (uint8_t)pcVar10[1];
if (isSameSpritesheet != pcVar10[1]) goto LAB_00716370;
pbVar7 = pbVar7 + 2;
pcVar10 = pcVar10 + 2;
} while (isSameSpritesheet != 0);
uVar4 = 0;
LAB_00716375:
if ((uVar4 == 0) &&
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' ||
((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00716493;
}
pcVar10 = "Appear";
}
else {
sprintf_s(playStateAnimName,0x1f,GHIDRA_CAST<uint8_t *>("State%d"));
pbVar7 = (this->_sprite)._animState._animData;
if (pbVar7 != GHIDRA_CAST<uint8_t *>(0x0)) {
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar7 + 0x14))) {
pbVar7 = *GHIDRA_CAST<uint8_t **>(pbVar7);
}
pbVar9 = playStateAnimName;
do {
isSameSpritesheet = *pbVar7;
isLess = isSameSpritesheet < *pbVar9;
if (isSameSpritesheet != *pbVar9) {
LAB_007163e7:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_007163ec;
}
if (isSameSpritesheet == 0) break;
isSameSpritesheet = pbVar7[1];
isLess = isSameSpritesheet < pbVar9[1];
if (isSameSpritesheet != pbVar9[1]) goto LAB_007163e7;
pbVar7 = pbVar7 + 2;
pbVar9 = pbVar9 + 2;
} while (isSameSpritesheet != 0);
uVar4 = 0;
LAB_007163ec:
if ((uVar4 == 0) &&
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' ||
((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00716493;
}
pcVar10 = GHIDRA_CAST<char *>(playStateAnimName);
}
isSameSpritesheet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>(pcVar10),1);
if (isSameSpritesheet != 0) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
}
LAB_00716493:
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
uVar4 = (this->_rng)._seed;
if (uVar4 == 0) {
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
}
uVar4 = uVar4 >> ((uint8_t)(this->_rng)._shift1 & 0x1f) ^ uVar4;
uVar4 = uVar4 << ((uint8_t)(this->_rng)._shift2 & 0x1f) ^ uVar4;
uVar4 = uVar4 >> ((uint8_t)(this->_rng)._shift3 & 0x1f) ^ uVar4;
(this->_rng)._seed = uVar4;
(this->_sprite)._flipX = ~(uint8_t)uVar4 & 1;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) != 6) {
ExceptionList = prevExceptionList;
return;
}
spawnLayer = ANM2::GetLayer(&this->_sprite,s_Spawn);
if (spawnLayer != GHIDRA_CAST<LayerState *>(0x0)) {
(spawnLayer->_color)._colorize[0] = 1.9;
(spawnLayer->_color)._colorize[1] = 2.0;
(spawnLayer->_color)._colorize[2] = 2.0;
(spawnLayer->_color)._colorize[3] = 1.0;
(spawnLayer->_color)._offset[0] = 0.1;
(spawnLayer->_color)._offset[1] = 0.3;
(spawnLayer->_color)._offset[2] = 0.4;
}
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) == 1000) {
ExceptionList = prevExceptionList;
return;
}
uVar4 = Random();
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
effectSpawnPos.x = (float)(savedPoop->_gridIndex % iVar3) * 40.0 + 40.0;
effectSpawnPos.y = (float)(savedPoop->_gridIndex / iVar3) * 40.0 + 120.0;
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x70,&effectSpawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
local_1ac = pEVar5;
if (*GHIDRA_CAST<char *>(g_game->_room) == '\0') {
pbVar7 = (pEVar5->_sprite)._animState._animData;
if (pbVar7 != GHIDRA_CAST<uint8_t *>(0x0)) {
pbVar9 = pbVar7;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar7 + 0x14))) {
pbVar9 = *GHIDRA_CAST<uint8_t **>(pbVar7);
}
idleAnimName = s_Idle;
do {
isSameSpritesheet = *pbVar9;
isLess = isSameSpritesheet < *idleAnimName;
if (isSameSpritesheet != *idleAnimName) {
LAB_00716606:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_0071660b;
}
if (isSameSpritesheet == 0) break;
isSameSpritesheet = pbVar9[1];
isLess = isSameSpritesheet < idleAnimName[1];
if (isSameSpritesheet != idleAnimName[1]) goto LAB_00716606;
pbVar9 = pbVar9 + 2;
idleAnimName = idleAnimName + 2;
} while (isSameSpritesheet != 0);
uVar4 = 0;
LAB_0071660b:
if ((uVar4 == 0) && ((pbVar7[0x34] == 0 || ((pEVar5->_sprite)._animState._isPlaying != 0))))
goto LAB_00716637;
}
isSameSpritesheet = ANM2::SetAnimation(&pEVar5->_sprite,s_Idle,1);
if (isSameSpritesheet != 0) {
AnimationState::Rewind(&(pEVar5->_sprite)._animState);
(pEVar5->_sprite)._animState._isPlaying = 1;
}
}
LAB_00716637:
(local_1ac->_posOffset).x = 0.0;
(local_1ac->_posOffset).y = -4.0;
local_1ac->_renderZOffset = 10000;
ExceptionList = prevExceptionList;
return;
}
// 007166f0
void GridEntity_Poop::RespawnRedPoop()
{
uint8_t isAnimSet;
void *animData;
int frameCount;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = 1000;
this->_reviveTimer = 0x78;
this->_collisionClass = 0;
animData = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST<uint8_t *>("State5"));
frameCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x30));
isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("State5"),1);
if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) {
AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)frameCount);
if ((this->_sprite)._animState._animData != (void *)0x0) {
(this->_sprite)._animState._isPlaying = 0;
}
}
}
return;
}
// 00716760
void GridEntity_Poop::spawn_hit_gibs(Vector *position, int poopVariant, int maxGibs)
{
uint32_t rngResult;
uint32_t rngRoll;
Entity *pEVar1;
ColorMod *extraout_EAX;
ColorMod *extraout_EAX_00;
void *seedNode;
void *seedSetHead;
int count;
float fVar2;
double speedRoll;
int variant;
ColorMod *color;
uint8_t findResult [4];
Vector local_74;
float local_6c;
void **local_68;
Color defaultColor;
ColorMod gibColor;
uint32_t local_c;
uint8_t auStack_8 [4];
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
if (maxGibs < 1) {
rngResult = 0;
}
else {
rngResult = Random();
rngResult = rngResult % GHIDRA_UINT(maxGibs);
}
local_68 = &(g_game->_seedEffects)._seedEffects;
local_6c = 3.22299e-44;
msvc::set<int>::find_node(findResult,&local_6c);
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_74.y) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_74.y) + 0x10)) < 0x18)) {
seedNode = (void *)local_74.y;
seedSetHead = *local_68;
}
else {
seedNode = *local_68;
seedSetHead = seedNode;
}
gibColor._offset[0] = 0.0;
gibColor._offset[1] = 0.0;
gibColor._offset[2] = 0.0;
gibColor._tint[0] = 1.0;
gibColor._tint[1] = 1.0;
gibColor._tint[2] = 1.0;
gibColor._tint[3] = 1.0;
count = rngResult + 1;
if (seedNode != seedSetHead) {
count = (rngResult + 1) * 3;
}
gibColor._colorize[0] = 0.0;
gibColor._colorize[1] = 0.0;
gibColor._colorize[2] = 0.0;
gibColor._colorize[3] = 0.0;
if (poopVariant == 3) {
gibColor._tint[0] = 0.5;
gibColor._tint[1] = 0.5;
gibColor._tint[2] = 0.5;
gibColor._offset[0] = 0.55;
gibColor._offset[1] = 0.45;
LAB_00716828:
rngResult = Random();
speedRoll = (double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
color = &gibColor;
}
else {
if (poopVariant == 1) {
gibColor._colorize[0] = 1.0;
gibColor._colorize[3] = 0.9;
goto LAB_00716828;
}
if (poopVariant == 4) {
if (count < 1) {
return;
}
do {
rngResult = Random();
switch(rngResult % 5) {
case 0:
gibColor._colorize[0] = 1.0;
gibColor._colorize[1] = 0.0;
gibColor._colorize[2] = 0.0;
break;
case 1:
gibColor._colorize[0] = 0.0;
gibColor._colorize[1] = 1.0;
gibColor._colorize[2] = 0.0;
break;
case 2:
gibColor._colorize[0] = 0.5;
gibColor._colorize[1] = 0.5;
gibColor._colorize[2] = 1.0;
break;
case 3:
gibColor._colorize[0] = 1.0;
gibColor._colorize[1] = 0.0;
gibColor._colorize[2] = 1.0;
break;
case 4:
gibColor._colorize[0] = 1.0;
gibColor._colorize[1] = 1.0;
gibColor._colorize[2] = 0.0;
break;
default:
goto switchD_0071688e_default;
}
gibColor._colorize[3] = 1.0;
switchD_0071688e_default:
rngResult = Random();
rngRoll = Random();
fVar2 = (float)((double)GHIDRA_INT(rngRoll) + __uint_to_double_fixup[-(GHIDRA_INT(rngRoll) >> 0x1f)]) *
2.3283064e-10 * 3.14;
local_68 = (void **)(fVar2 + fVar2);
rngRoll = Random();
local_6c = (float)((double)GHIDRA_INT(rngRoll) + __uint_to_double_fixup[-(GHIDRA_INT(rngRoll) >> 0x1f)]) *
2.3283064e-10 + 2.0;
local_74.x = cos((float)local_68);
local_74.x = local_74.x * local_6c;
fVar2 = sin((float)local_68);
local_74.y = fVar2 * 0.5 * local_6c;
pEVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3a,position,&local_74,GHIDRA_CAST<Entity *>(0x0),0,rngResult);
pEVar1->SetColor(&gibColor,0xffffffff,0xff,0,1);
pEVar1->Update();
count = count + -1;
if (count == 0) {
return;
}
} while( true );
}
if (poopVariant == 5) {
gibColor._colorize[0] = 0.3;
gibColor._colorize[1] = 0.3;
gibColor._colorize[2] = 0.3;
gibColor._colorize[3] = 1.0;
goto LAB_00716828;
}
if (poopVariant == 6) {
gibColor._colorize[0] = 1.9;
gibColor._colorize[1] = 2.0;
gibColor._colorize[2] = 2.0;
gibColor._colorize[3] = 1.0;
gibColor._offset[0] = 0.1;
gibColor._offset[1] = 0.3;
gibColor._offset[2] = 0.4;
goto LAB_00716828;
}
if (poopVariant == 0xc) {
(GHIDRA_CAST<Color *>((&defaultColor)))->Color::Color();
rngResult = Random();
speedRoll = (double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
variant = 0x23;
color = extraout_EAX;
goto LAB_00716adb;
}
if (poopVariant == 0xd) {
gibColor._colorize[0] = 1.0;
gibColor._colorize[1] = 0.2;
gibColor._colorize[3] = 0.9;
goto LAB_00716828;
}
if (poopVariant == 0xe) {
gibColor._colorize[0] = 0.3;
gibColor._colorize[1] = 1.0;
gibColor._colorize[2] = 0.2;
gibColor._colorize[3] = 0.9;
goto LAB_00716828;
}
(GHIDRA_CAST<Color *>((&defaultColor)))->Color::Color();
rngResult = Random();
speedRoll = (double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)];
color = extraout_EAX_00;
}
variant = 0x3a;
LAB_00716adb:
Game::SpawnParticles
(g_game,position,variant,count,(float)speedRoll * 2.3283064e-10 + 2.0,color,100000.0,0);
return;
}
// 00716b10
void GridEntity_Poop::destroy_effects()
{
ColorMod *color;
uint32_t seed;
Vector *in_ECX;
int in_EDX;
int *extraout_EDX;
float scaleY;
int breakSoundId;
float local_64;
Color particleColor;
Color splatColor;
float local_8;
Manager *manager;
local_8 = (float)(__security_cookie ^ GHIDRA_UINT(((&splatColor)[1]._tint + 1)));
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(5,1);
manager = g_manager;
if (in_EDX == 0xc) {
local_64 = 1.91978e-43;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_64));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_64),1.0,2,0,1.0,0.0);
(GHIDRA_CAST<Color *>((&particleColor)))->Color::Color();
Game::SpawnParticles(g_game,in_ECX,4,3,4.0,color,100000.0,0x30001);
return;
}
local_64 = 1.0;
if (in_EDX - 7U < 4) {
local_64 = 0.5;
}
breakSoundId = 0xed;
seed_fart_sound_override(&breakSoundId);
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(breakSoundId,0.9,2,0,local_64,0.0);
seed = Random();
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2b,in_ECX,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed);
(GHIDRA_CAST<Color *>((&splatColor)))->Color::Color();
if (in_EDX == 6) {
splatColor._colorize[0] = 1.9;
splatColor._colorize[1] = 2.0;
splatColor._colorize[2] = 2.0;
splatColor._colorize[3] = 1.0;
splatColor._offset[0] = 0.1;
splatColor._offset[1] = 0.3;
splatColor._offset[2] = 0.4;
}
else if (in_EDX == 1) {
splatColor._colorize[0] = 1.0;
splatColor._colorize[1] = 0.0;
splatColor._colorize[2] = 0.0;
splatColor._colorize[3] = 0.9;
}
else if (in_EDX == 3) {
splatColor._tint[0] = 0.5;
splatColor._tint[1] = 0.5;
splatColor._tint[2] = 0.5;
splatColor._tint[3] = 1.0;
splatColor._offset[0] = 0.55;
splatColor._offset[1] = 0.45;
splatColor._offset[2] = 0.0;
}
else {
if (in_EDX == 5) {
splatColor._colorize[0] = 0.3;
splatColor._colorize[1] = 0.3;
splatColor._colorize[2] = 0.3;
splatColor._colorize[3] = 1.0;
(**(code **)(*extraout_EDX + 0x3c))(&splatColor,0xffffffff,0xff,0,1);
return;
}
if (in_EDX == 0xd) {
splatColor._colorize[0] = 1.0;
splatColor._colorize[1] = 0.2;
splatColor._colorize[2] = 0.0;
splatColor._colorize[3] = 1.0;
(**(code **)(*extraout_EDX + 0x3c))(&splatColor,0xffffffff,0xff,0,1);
return;
}
if (in_EDX != 0xe) {
if (in_EDX - 7U < 4) {
scaleY = g_vectorOne.y * 2.0;
extraout_EDX[0x39] = GHIDRA_INT((g_vectorOne.x * 2.0));
extraout_EDX[0x3a] = GHIDRA_INT(scaleY);
}
return;
}
splatColor._colorize[0] = 0.3;
splatColor._colorize[1] = 1.0;
splatColor._colorize[2] = 0.2;
splatColor._colorize[3] = 1.0;
}
(**(code **)(*extraout_EDX + 0x3c))(&splatColor,0xffffffff,0xff,0,1);
return;
}
// 00718ac0
GridEntity_Poop * GridEntity_Poop::get_giga_part(int variant, uint8_t isCreate)
{
Room *this_00;
GridEntity *pGVar1;
ANM2 *pAVar2;
uint32_t uVar3;
GridEntity_Poop *pGVar4;
GridEntity *newPoop;
uint32_t uVar5;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00afcb07;
local_10 = ExceptionList;
ExceptionList = &local_10;
uVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) - 7;
uVar5 = variant - 7;
if ((uVar3 < 4) && (uVar5 < 4)) {
this_00 = g_game->_room;
uVar3 = Room::GetGridIndexByTile
(this_00,(*GHIDRA_CAST<int *>((&DAT_00b690f0 + uVar5 * 8)) -
*GHIDRA_CAST<int *>((&DAT_00b690f0 + uVar3 * 8))) +
GHIDRA_UINT(this->_gridIndex) % GHIDRA_UINT(this_00->_gridWidth),
(*GHIDRA_CAST<int *>((&DAT_00b690f4 + uVar5 * 8)) - *GHIDRA_CAST<int *>((&DAT_00b690f4 + uVar3 * 8))) +
GHIDRA_UINT(this->_gridIndex) / GHIDRA_UINT(this_00->_gridWidth));
if (uVar3 < 0x1c0) {
pGVar4 = this_00->_gridEntities[uVar3];
if (((pGVar4 != GHIDRA_CAST<GridEntity_Poop *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar4)) + 0x4)))) == 0xe)) &&
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar4)) + 0x8)))) == variant)) {
ExceptionList = local_10;
return pGVar4;
}
}
else {
pGVar4 = GHIDRA_CAST<GridEntity_Poop *>(0x0);
}
if (isCreate != 0) {
if ((pGVar4 != GHIDRA_CAST<GridEntity_Poop *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar4)) + 0x4)))) == 0xe)) {
(GHIDRA_CAST<Room *>((this_00)))->Room::RemoveGridEntity(uVar3,0,1);
}
uVar5 = Random();
if ((GHIDRA_INT(uVar3) < 0) || (0x1bf < GHIDRA_INT(uVar3))) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
}
if ((uVar3 < 0x1c0) && (this_00->_gridPaths[uVar3] < 0x385)) {
newPoop = operator_new(0x19c);
local_8 = 7;
if (newPoop == GHIDRA_CAST<GridEntity *>(0x0)) {
newPoop = GHIDRA_CAST<GridEntity *>(0x0);
}
else {
(GHIDRA_CAST<GridEntity *>((newPoop)))->GridEntity::GridEntity();
*GHIDRA_CAST<uint8_t ***>(newPoop) = IsaacRepentancePlus::GridEntity_Poop::vftable;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newPoop[1])) + 0x4)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newPoop[1])) + 0x14)))) = 0;
newPoop[1]._varData = 0xf;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newPoop[1])) + 0x4))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newPoop[1])) + 0x20)))) = 0;
newPoop[1]._gridIndex = 0;
newPoop[1]._spawnFrame = 0;
newPoop[1]._rng._seed = 0;
newPoop[1]._rng._shift1 = GHIDRA_INT(g_vectorZero.x);
newPoop[1]._rng._shift2 = GHIDRA_INT(g_vectorZero.y);
newPoop[1]._rng._shift3 = GHIDRA_INT(g_vectorZero.x);
newPoop[1]._collisionClass = GHIDRA_INT(g_vectorZero.y);
pGVar1 = newPoop + 1;
(pGVar1->_sprite)._filename._buf[0] = '\0';
(pGVar1->_sprite)._filename._buf[1] = '\0';
(pGVar1->_sprite)._filename._buf[2] = '\0';
(pGVar1->_sprite)._filename._buf[3] = '\0';
pAVar2 = &newPoop[1]._sprite;
(pAVar2->_filename)._buf[4] = '\0';
(pAVar2->_filename)._buf[5] = '\0';
(pAVar2->_filename)._buf[6] = '\0';
(pAVar2->_filename)._buf[7] = '\0';
}
local_8 = 0xffffffff;
if (newPoop != GHIDRA_CAST<GridEntity *>(0x0)) {
newPoop->_gridIndex = uVar3;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((newPoop)) + 0x4)))) = 0xe;
if (this_00->_gridEntities[uVar3] != GHIDRA_CAST<uint32_t *>(0x0)) {
(*(code *)**GHIDRA_CAST<uint32_t **>(this_00->_gridEntities[uVar3]))(1);
}
this_00->_gridEntities[uVar3] = newPoop;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((newPoop)) + 0x8)))) = variant;
newPoop->_varData = 0;
(GHIDRA_CAST<GridEntity *>((newPoop)))->GridEntity::Init(uVar5);
pGVar4 = this_00->_gridEntities[uVar3];
if (((pGVar4 != GHIDRA_CAST<GridEntity_Poop *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar4)) + 0x4)))) == 0xe)) &&
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar4)) + 0x8)))) == variant)) {
ExceptionList = local_10;
return pGVar4;
}
}
}
}
}
ExceptionList = local_10;
return GHIDRA_CAST<GridEntity_Poop *>(0x0);
}
// 00718dd0
void GridEntity_Poop::guard_check_icall()
{
GridEntity_Poop *part;
GridEntity_Poop *secondPart;
uint32_t i;
GridEntity_Poop *gigaParts [3];
GridEntity_Poop *local_8;
local_8 = GHIDRA_CAST<GridEntity_Poop *>((__security_cookie ^ GHIDRA_UINT((gigaParts + 4))));
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 7) {
part = get_giga_part(this,8,1);
gigaParts[0] = part;
secondPart = get_giga_part(this,9,1);
gigaParts[1] = secondPart;
gigaParts[2] = get_giga_part(this,10,1);
if (((part != GHIDRA_CAST<GridEntity_Poop *>(0x0)) && (secondPart != GHIDRA_CAST<GridEntity_Poop *>(0x0))) &&
(gigaParts[2] != GHIDRA_CAST<GridEntity_Poop *>(0x0))) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((part)) + 0xc)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((secondPart)) + 0xc)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gigaParts[2])) + 0xc)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
return;
}
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 0;
this->BeginBatches();
i = 0;
do {
part = gigaParts[i];
if (part != GHIDRA_CAST<GridEntity_Poop *>(0x0)) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((part)) + 0x8)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((part)) + 0xc)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))));
part->BeginBatches();
}
i = i + 1;
} while (i < 3);
}
return;
}