Files
isaac-port/generated-src/entity_bomb.cpp
T
shweetandClaude Opus 5.5 780767f5e1 Curation round 2, wave A: anm2 (Anm2Ed JSON), text, config as idiomatic classes; SDL3 platform opens a window
- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents
  with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired.
- font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact
  against its assembly.
- options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include
  Save's exact bytes.
- platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first
  built-in shader (FUN_00a13fa0).
- source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every
  address in a (a, b, c to d) list on a comment counts as taken over.
- log.h: reconstruction_missing() for a taken-over class's methods that are not written yet.
206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager
still use the old APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 23:04:54 -05:00

2510 lines
115 KiB
C++

#include "classes.h"
// 004316a0
uint8_t Entity_Bomb::IsFetus()
{
return this->_isFetus;
}
// 00452c40
void Entity_Bomb::SetExplosionCountdown(int countdown)
{
this->_explosionCountdown1 = countdown;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x414)))) = countdown;
return;
}
// 005cd560
BitSet128 * Entity_Bomb::Flags(BitSet128 *outResult)
{
uint32_t uVar1;
uint32_t uVar2;
uint64_t qVar3;
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
qVar3 = (this->_tearFlags)._h;
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
*GHIDRA_CAST<int *>(&outResult->_l) = GHIDRA_INT((this->_tearFlags)._l);
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&outResult->_l) + 4)) = uVar1;
*GHIDRA_CAST<int *>(&outResult->_h) = GHIDRA_INT(qVar3);
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&outResult->_h) + 4)) = uVar2;
return outResult;
}
// 0060cdc0
long double Entity_Bomb::RadiusMultiplier()
{
return (long double)this->_radiusMultiplier;
}
// 006a2030
uint8_t Entity_Bomb::IsRocket()
{
if ((this->_variant == 0x13) || (this->_variant == 0x14)) {
return 1;
}
return 0;
}
// 006a2050
void Entity_Bomb::Init(int type, int variant, int subType, uint32_t initSeed)
{
code *pcVar1;
uint8_t bVar2;
uint32_t uVar3;
uint8_t *curAnimName;
LayerState *pLVar4;
uint8_t *expectedAnimName;
std_string *a;
uint32_t size;
void *ptr;
bool isLess;
uint8_t *pbVar5;
uint8_t *layerIndex;
ColorMod floorTint;
KColor floorColor;
std_string layerName;
uint32_t flagsHi;
int variantLocal;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Init(type,variant,subType,initSeed);
variantLocal = this->_variant;
this->_explosionDamage = 100.0;
this->_explosionCountdown1 = 0x2d;
this->_updateDelay = 0;
this->_scatterTimer = 0;
if ((((variantLocal == 3) || (variantLocal == 4)) || (variantLocal == 8)) ||
(variantLocal == 0x12)) {
uVar3 = (this->_dropRNG)._seed;
if (uVar3 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
uVar3 = (this->_dropRNG)._seed;
if (uVar3 == 0) {
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
}
uVar3 = uVar3 >> ((uint8_t)(this->_dropRNG)._shift1 & 0x1f) ^ uVar3;
uVar3 = uVar3 << ((uint8_t)(this->_dropRNG)._shift2 & 0x1f) ^ uVar3;
uVar3 = uVar3 >> ((uint8_t)(this->_dropRNG)._shift3 & 0x1f) ^ uVar3;
(this->_dropRNG)._seed = uVar3;
this->_explosionCountdown1 = this->_explosionCountdown1 + uVar3 % 0x1e;
}
variantLocal = this->_variant;
if (variantLocal == 0xf) {
this->_explosionCountdown1 = 0x5e;
this->_explosionDamage = 20.0;
}
else if ((variantLocal == 0x11) || (variantLocal == 0x14)) {
this->_explosionCountdown1 = 0x57;
this->_explosionDamage = 300.0;
}
this->_scale = 1.0;
this->_rocketSpeed = 0.0;
this->_fallAcceleration = 0.0;
this->_entityGridCollisionClass = 5;
this->_collisionCooldown = 4;
this->_parentCollisionCooldown = 4;
this->_isFetus = 0;
*GHIDRA_CAST<uint32_t *>(&(this->_tearFlags)._l) = 0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = 0;
*GHIDRA_CAST<uint32_t *>(&(this->_tearFlags)._h) = 0;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = 0;
this->_prismTouched = 0;
this->_bounceCount = 0;
this->_fallSpeed = 0.0;
this->_radiusMultiplier = 1.0;
this->_stickyTarget = 0;
if (this->_config != (void *)0x0) {
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
}
(this->_hitList)._end = (this->_hitList)._begin;
variantLocal = this->_variant;
this->_hasCostumes = 0;
this->_loadCostumes = 0;
if (variantLocal == 2) {
pbVar5 = (this->_sprite)._animState._animData;
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
curAnimName = pbVar5;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
curAnimName = *GHIDRA_CAST<uint8_t **>(pbVar5);
}
expectedAnimName = s_Idle;
do {
bVar2 = *curAnimName;
isLess = bVar2 < *expectedAnimName;
if (bVar2 != *expectedAnimName) {
LAB_006a2260:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_006a2265;
}
if (bVar2 == 0) break;
bVar2 = curAnimName[1];
isLess = bVar2 < expectedAnimName[1];
if (bVar2 != expectedAnimName[1]) goto LAB_006a2260;
curAnimName = curAnimName + 2;
expectedAnimName = expectedAnimName + 2;
} while (bVar2 != 0);
uVar3 = 0;
LAB_006a2265:
if ((uVar3 == 0) && ((pbVar5[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
goto LAB_006a2468;
}
pbVar5 = s_Idle;
}
else if (((variantLocal == 4) || (variantLocal == 3)) ||
((variantLocal == 8 || ((variantLocal == 0x11 || (variantLocal == 0x12)))))) {
if (this->_subtype == 1) {
bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("BombReturn"),1);
if (bVar2 != 0) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetFloorColorAt(&floorColor,&this->_pos,this->_size);
floorTint._tint[0] = floorColor._red * 2.0;
floorTint._offset[0] = 0.0;
floorTint._offset[1] = 0.0;
floorTint._offset[2] = 0.0;
floorTint._tint[1] = floorColor._green * 2.0;
floorTint._tint[3] = 1.0;
layerIndex = GHIDRA_CAST<uint8_t *>(0x0);
floorTint._tint[2] = floorColor._blue * 2.0;
if ((this->_sprite)._layerCount != 0) {
do {
pLVar4 = ANM2::GetLayer(&this->_sprite,layerIndex);
if (pLVar4->_layerData == (void *)0x0) {
layerName._buf[0] = '\0';
layerName._buf[1] = '\0';
layerName._buf[2] = '\0';
layerName._buf[3] = '\0';
layerName._capacity = 0xf;
layerName._size = 0;
}
else {
(GHIDRA_CAST<msvc::string *>((layerName._buf)))->msvc::string::string((void *)(GHIDRA_INT(pLVar4->_layerData) + 8));
}
uVar3 = layerName._capacity;
flagsHi = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(layerName._buf)) + 0x0)));
a = &layerName;
if (0xf < layerName._capacity) {
a = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(layerName._buf))) + 0x0)));
}
bVar2 = str_eq(GHIDRA_CAST<uint8_t *>(a),layerName._size,&DAT_00b1d57c,4);
if (0xf < uVar3) {
size = uVar3 + 1;
ptr = (void *)flagsHi;
if (0xfff < size) {
ptr = *(void **)(flagsHi + -4);
size = uVar3 + 0x24;
if (0x1f < (flagsHi - GHIDRA_INT(ptr)) - 4U) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,size);
}
if ((bVar2 != 0) && (&pLVar4->_color != &floorTint)) {
(pLVar4->_color)._tint[0] = floorTint._tint[0];
(pLVar4->_color)._tint[1] = floorTint._tint[1];
(pLVar4->_color)._tint[2] = floorTint._tint[2];
(pLVar4->_color)._tint[3] = floorTint._tint[3];
(pLVar4->_color)._colorize[0] = 0.0;
(pLVar4->_color)._colorize[1] = 0.0;
(pLVar4->_color)._colorize[2] = 0.0;
(pLVar4->_color)._colorize[3] = 0.0;
(pLVar4->_color)._offset[0] = floorTint._offset[0];
(pLVar4->_color)._offset[1] = floorTint._offset[1];
(pLVar4->_color)._offset[2] = floorTint._offset[2];
}
layerIndex = layerIndex + 1;
} while (layerIndex < GHIDRA_CAST<uint8_t *>((this->_sprite)._layerCount));
}
goto LAB_006a2468;
}
pbVar5 = GHIDRA_CAST<uint8_t *>("Appear");
}
else {
pbVar5 = GHIDRA_CAST<uint8_t *>("Pulse");
}
bVar2 = ANM2::SetAnimation(&this->_sprite,pbVar5,1);
if (bVar2 != 0) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
LAB_006a2468:
this->_rocketAngle = 0.0;
this->_isSkipNextUpdate = 0;
if ((this->_variant == 0x13) || (this->_variant == 0x14)) {
flagsHi = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&this->_flags) + 4));
*GHIDRA_CAST<uint32_t *>(&this->_flags) = GHIDRA_UINT(this->_flags) | 0x4000000;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&this->_flags) + 4)) = flagsHi;
(this->_posOffset).y = -14.0;
}
FUN_00861ea0(this);
return;
}
// 006a24d0
void Entity_Bomb::Update()
{
BitSet128 BVar1;
void *pvVar2;
uint8_t *puVar3;
uint8_t bVar4;
BitSet128 *pBVar5;
uint32_t uVar6;
Entity *spawned;
float *volumeScalePtr;
int iVar7;
BitSet128 *maskedFlags;
Vector *tmpVecPtr;
int *effect;
uint32_t rngResult;
RNG *trinketRng;
Entity_Player *pEVar8;
uint32_t extraout_EAX;
Entity_Bomb *trinketRng;
char extraout_DL;
char isBouncyReg;
int extraout_EDX;
int *extraout_EDX_00;
uint8_t *costumeLoaded;
float oldFallSpeed;
float fVar9;
uint8_t auVar10 [16];
float fallSpeed;
uint8_t auVar11 [12];
uint8_t auVar12 [16];
float fVar13;
float fVar14;
float height;
float fVar15;
float minBounceSpeed;
uint32_t uVar16;
TypeDescriptor *pTVar17;
TypeDescriptor *pTVar18;
uint32_t uVar19;
BitSet128 local_110;
BitSet128 local_100;
Vector scratchVec;
uint8_t local_e8 [8];
Vector local_e0;
Vector scratchVec2;
Entity_Bomb *bomb;
Vector local_cc;
float rocketAngle;
RNG local_c0;
Entity_Player *spawner;
Entity *local_ac;
char isBouncy;
float local_a4;
uint8_t local_a0 [8];
Vector VStack_98;
float local_8c;
Entity_Player *local_88;
uint8_t *local_84;
Entity_Player *local_80;
Color smokeColor;
EntityRef sourceRef;
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
uint32_t *entityFlagsHi;
uint64_t flagsHigh;
uint64_t flagsLow;
Game *game;
Manager *manager;
float *scalePtr;
int stickyTarget;
code *takeDamage;
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
local_14 = 0xffffffff;
puStack_18 = &LAB_00afa186;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
if (this->_isSkipNextUpdate != 0) {
this->_isSkipNextUpdate = 0;
return;
}
ExceptionList = &local_1c;
bomb = this;
puVar3 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
if (this->_loadCostumes != 0) {
update_sparks(this,local_24);
puVar3 = puStack_20;
}
puStack_20 = puVar3;
local_80 = GHIDRA_CAST<Entity_Player *>(&this->_tearFlags);
pBVar5 = BitSet128::operator_and
(GHIDRA_CAST<BitSet128 *>(&local_c0),GHIDRA_CAST<BitSet128 *>(local_80),&g_tearFlagHydrobounce);
if ((GHIDRA_INT(pBVar5->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) == 0) &&
(GHIDRA_INT(pBVar5->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) == 0)) {
isBouncy = '\0';
}
else {
isBouncy = '\x01';
}
rocketAngle = this->_rocketAngle;
if (g_game->_frameCount - this->_spawnFrame == 1) {
if (this->_spawnerType == 1) {
this->_bombIndex = DAT_00c7ec64;
DAT_00c7ec64 = DAT_00c7ec64 + 1;
}
if (isBouncy != '\0') {
this->_fallSpeed = -8.0;
(this->_posOffset).y = -3.0;
}
}
if (this->_dead != 0) {
(this->_velocity).x = g_vectorZero.x;
(this->_velocity).y = g_vectorZero.y;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
if (0 < this->_updateDelay) {
this->_updateDelay = this->_updateDelay + -1;
ExceptionList = local_1c;
return;
}
if ((((this->_sprite)._animState._animData == (void *)0x0) ||
((this->_sprite)._animState._isPlaying == 0)) || (this->_variant == 2)) {
this->Remove();
ExceptionList = local_1c;
return;
}
ExceptionList = local_1c;
return;
}
if (this->_pitfallState != 0) {
this->_friction = this->_friction * 0.6;
if (0 < this->_explosionCountdown1) {
this->_explosionCountdown1 = this->_explosionCountdown1 + 1;
}
if ((((this->_sprite)._animState._animData == (void *)0x0) ||
((this->_sprite)._animState._isPlaying == 0)) &&
((this->_pitfallState == 1 && (this->_pitfallState = 2, this->_parent == 0)))) {
this->Remove();
}
}
fVar9 = -3.0;
if ((this->_flags & 0x20) != 0) {
ANM2::SetFrame(&this->_sprite,GHIDRA_CAST<std_string *>(s_Idle),0);
if (this->_hasCostumes != 0) {
costumeLoaded = &this->_bombCostumesSprites[0]._loaded;
local_84 = &DAT_00000005;
do {
if (*costumeLoaded != 0) {
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xd9)));
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xb9)));
}
costumeLoaded = costumeLoaded + 0x114;
local_84 = local_84 + -1;
} while (local_84 != GHIDRA_CAST<uint8_t *>(0x0));
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
ExceptionList = local_1c;
return;
}
fVar13 = 0.0;
fVar14 = 1.0;
minBounceSpeed = 2.0;
fVar15 = 0.8;
if (((this->_visible != 0) && (this->_pitfallState == 0)) &&
((this->_dead == 0 &&
((height = (this->_posOffset).y, height < 0.0 ||
(this->_fallSpeed <= 0.0 && this->_fallSpeed != 0.0)))))) {
oldFallSpeed = this->_fallSpeed;
height = oldFallSpeed + height;
(this->_posOffset).y = height;
bVar4 = IsRocket(this);
if (bVar4 == 0) {
if (isBouncy == '\0') {
fallSpeed = this->_fallAcceleration;
if (this->_fallAcceleration == fVar13) {
fallSpeed = fVar15;
}
}
else {
fallSpeed = 2.5;
}
}
else if (isBouncy == '\0') {
fallSpeed = this->_fallAcceleration;
}
else {
fallSpeed = 1.6;
}
fallSpeed = fallSpeed + oldFallSpeed;
this->_fallSpeed = fallSpeed;
isBouncyReg = isBouncy;
if (-26.0 <= height) {
if ((fVar9 <= height) && (this->_isFetus == 0)) {
bVar4 = IsRocket(trinketRng);
isBouncyReg = extraout_DL;
if (bVar4 == 0) {
this->_entityGridCollisionClass = 5;
goto LAB_006a2829;
}
}
this->_entityGridCollisionClass = 6;
}
else {
this->_entityGridCollisionClass = 3;
}
LAB_006a2829:
if (fVar13 <= height) {
if (((isBouncyReg == '\0') || (fallSpeed <= minBounceSpeed)) || (3 < this->_bounceCount)) {
(this->_posOffset).y = 0.0;
this->_fallSpeed = 0.0;
this->_collisionDamage = 0.0;
bVar4 = IsRocket(this);
if (bVar4 == 0) {
scalePtr = &this->_scale;
local_80 = GHIDRA_CAST<Entity_Player *>(0x3f800000);
if (this->_variant == 0x12) {
stickyTarget = 0x1d2;
volumeScalePtr = GHIDRA_CAST<float *>(&local_80);
if (*scalePtr <= fVar14) {
volumeScalePtr = scalePtr;
}
fVar15 = *volumeScalePtr * fVar15;
}
else {
stickyTarget = 0x28;
volumeScalePtr = GHIDRA_CAST<float *>(&local_80);
if (*scalePtr <= fVar14) {
volumeScalePtr = scalePtr;
}
fVar15 = *volumeScalePtr;
}
SoundEffects::PlayWithFartOverride(stickyTarget,fVar15,2,0,1.0);
}
else {
this->_explosionCountdown1 = 0;
}
}
else {
this->_bounceCount = this->_bounceCount + 1;
(this->_posOffset).y = 0.0;
this->_fallSpeed = fallSpeed * -0.7;
uVar6 = Random();
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xe,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
spawned->SetColor(&(bomb->_sprite)._color,0xffffffff,0xff,0,1);
spawned->Update();
SoundEffects::PlayWithFartOverride(0x96,0.5,2,0,1.0);
BVar1._l = *GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_80)) + 0x0))));
BVar1._h = *GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_80)) + 0x8))));
tear_flags_area_apply(&this->_pos,GHIDRA_CAST<Entity *>(bomb),40.0,bomb->_explosionDamage * 0.25,BVar1);
this = bomb;
}
}
}
spawner = GHIDRA_CAST<Entity_Player *>(this->_spawnerEntity);
if ((spawner != GHIDRA_CAST<Entity_Player *>(0x0)) && (spawner->_type != 1)) {
spawner = GHIDRA_CAST<Entity_Player *>(0x0);
}
pEVar8 = spawner;
stickyTarget = this->_variant;
if ((stickyTarget == 0x13) || (stickyTarget == 0x14)) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x200000000000000);
if (bVar4 == 0) {
stickyTarget = this->_variant;
goto LAB_006a2a0d;
}
(this->_sprite)._rotation = 0.0;
ANM2::Play(&this->_sprite,s_Idle,0);
this->_rocketSpeed = 0.0;
}
else {
LAB_006a2a0d:
if (((this->_sprite)._animState._animData != (void *)0x0) &&
((this->_sprite)._animState._isPlaying != 0)) {
bVar4 = AnimationState::IsLoopingAnimation(&(this->_sprite)._animState);
stickyTarget = extraout_EDX;
if (bVar4 == 0) goto LAB_006a2a4a;
}
if ((stickyTarget != 2) && (this->_pitfallState == 0)) {
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Pulse"),0);
}
}
LAB_006a2a4a:
bVar4 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST<uint8_t *>("Pulse"));
if ((bVar4 != 0) && (bVar4 = IsRocket(this), bVar4 == 0)) {
if ((this->_isFetus == 0) &&
(((this->_spawnerType == 1 && (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0))) &&
(bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar8)))->Entity_Player::HasCollectible(0x89,0), bVar4 != 0)))) {
stickyTarget = ANM2::GetFrame(&this->_sprite);
if (0xe < stickyTarget) {
stickyTarget = 0;
goto LAB_006a2afe;
}
}
else {
local_80 = GHIDRA_CAST<Entity_Player *>(0x0);
stickyTarget = AnimationState::GetAnimationLength(&(this->_sprite)._animState);
stickyTarget = (stickyTarget - *extraout_EDX_00) + -1;
if (stickyTarget < 0) {
stickyTarget = stickyTarget + (stickyTarget / 0xf) * -0xf + 0xf;
}
iVar7 = ANM2::GetFrame(&this->_sprite);
if (stickyTarget != iVar7) {
LAB_006a2afe:
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(stickyTarget);
}
}
}
pBVar5 = &this->_tearFlags;
fVar9 = 90.0;
uVar6 = 0x80000000;
fVar15 = 0.017453292;
if (this->_isFetus != 0) {
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagSpectral);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
this->_entityGridCollisionClass = 3;
}
bVar4 = IsRocket(this);
if (bVar4 == 0) {
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagWiggle);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
VStack_98.x = (this->_velocity).y;
VStack_98.y = (float)(GHIDRA_UINT((this->_velocity).x) ^ uVar6);
(GHIDRA_CAST<Vector *>((&VStack_98)))->Vector::Normalize();
local_80 = (Entity_Player *)
sin((float)g_game->_frameCount * 0.7 +
(float)((double)this->_index +
__uint_to_double_fixup[-(this->_index >> 0x1f)]));
fVar9 = (this->_velocity).y;
fVar15 = (this->_velocity).x;
fVar9 = sqrtf(fVar15 * fVar15 + fVar9 * fVar9);
(this->_pos).x = VStack_98.x * fVar9 * (float)local_80 + (this->_pos).x;
(this->_pos).y = VStack_98.y * fVar9 * (float)local_80 + (this->_pos).y;
}
if (this->_collidesWithGrid != 0) {
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
this->_explosionCountdown1 = 0;
}
}
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagTractorBeam);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (((bVar4 != 0) && (stickyTarget = this->_parent, stickyTarget != 0)) &&
(*GHIDRA_CAST<int *>((stickyTarget + 0x28)) == 1)) {
local_84 = (uint8_t *)
__RTDynamicCast(stickyTarget,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
,&IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0);
stickyTarget = __RTDynamicCast();
if (stickyTarget != 0) {
local_a4 = (this->_pos).x - *GHIDRA_CAST<float *>((local_84 + 0x33c));
local_88 = GHIDRA_CAST<Entity_Player *>(((this->_pos).y - *GHIDRA_CAST<float *>((local_84 + 0x340))));
local_80 = GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<float *>((stickyTarget + 0x41c)) * 0.017453292));
local_8c = sin((float)local_80);
fVar9 = cos((float)local_80);
fVar15 = fVar9 * local_a4 + local_8c * (float)local_88;
if (0.0 < fVar15) {
local_80 = (Entity_Player *)
(((fVar15 * fVar9 + *GHIDRA_CAST<float *>((local_84 + 0x33c))) - (this->_pos).x) * 0.01);
local_a4 = ((fVar15 * local_8c + *GHIDRA_CAST<float *>((local_84 + 0x340))) - (this->_pos).y) * 0.01;
VStack_98.x = (float)local_80;
VStack_98.y = local_a4;
fVar9 = (float)local_80 * (float)local_80 + local_a4 * local_a4;
if ((4.0 < fVar9) && (fVar9 = sqrtf(fVar9), 0.0 < fVar9)) {
VStack_98.x = (float)local_80 * (2.0 / fVar9);
VStack_98.y = (2.0 / fVar9) * local_a4;
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity_divided(&VStack_98,0);
}
}
}
fVar9 = 0.0;
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (stickyTarget = this->_parent, stickyTarget != 0)) {
VStack_98.x = (this->_pos).x - (*GHIDRA_CAST<float *>((stickyTarget + 0x33c)) + fVar9);
VStack_98.y = (this->_pos).y - (*GHIDRA_CAST<float *>((stickyTarget + 0x340)) + 2.0);
tmpVecPtr = (GHIDRA_CAST<Vector *>((&VStack_98)))->Vector::Normalized(&local_cc);
fVar9 = tmpVecPtr->y;
(this->_velocity).x = (this->_velocity).x - tmpVecPtr->x * 0.6;
(this->_velocity).y = (this->_velocity).y - fVar9 * 0.6;
}
}
else {
local_ac = GHIDRA_CAST<Entity *>((this->_updateTime - 1.0));
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagWiggle);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_80 = GHIDRA_CAST<Entity_Player *>(((this->_rocketAngle + fVar9) * fVar15));
local_88 = GHIDRA_CAST<Entity_Player *>(sin((float)local_80));
fVar9 = cos((float)local_80);
local_80 = GHIDRA_CAST<Entity_Player *>((fVar9 * 6.0));
local_88 = GHIDRA_CAST<Entity_Player *>(((float)local_88 * 6.0));
local_ac = GHIDRA_CAST<Entity *>(((float)local_ac * 0.8));
fVar15 = sin((float)local_ac);
fVar9 = this->_speedMultiplier;
(this->_velocity).x = (float)local_80 * fVar15 * fVar9 + (this->_velocity).x;
(this->_velocity).y = (float)local_88 * fVar15 * fVar9 + (this->_velocity).y;
fVar9 = sin((float)local_ac - 0.5);
fVar15 = 0.017453292;
rocketAngle = fVar9 * 25.0 + this->_rocketAngle;
}
if (this->_fallAcceleration != 0.0) {
rocketAngle = rocketAngle * fVar15;
local_a4 = sin(rocketAngle);
fVar9 = (this->_velocity).y;
fVar15 = (this->_velocity).x;
local_80 = GHIDRA_CAST<Entity_Player *>(sqrtf(fVar15 * fVar15 + fVar9 * fVar9));
fVar9 = cos(rocketAngle);
rocketAngle = atan2f(this->_fallSpeed + local_a4 * (float)local_80,
fVar9 * (float)local_80 + 0.0);
rocketAngle = rocketAngle * 57.295776;
}
}
}
pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagBurn);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
if (this->_spawnerType == 1) {
EntityList::QueryRadius
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(&local_c0),&this->_pos,
this->_size,8);
local_14 = 0;
local_84 = GHIDRA_CAST<uint8_t *>(0x0);
if (GHIDRA_CAST<uint8_t *>(local_c0._shift3) != GHIDRA_CAST<uint8_t *>(0x0)) {
do {
pEVar8 = *GHIDRA_CAST<Entity_Player **>((local_c0._shift1 + GHIDRA_INT(local_84) * 4));
local_80 = pEVar8;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar8))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if ((bVar4 != 0) &&
(fVar15 = (pEVar8->_pos).y - (this->_pos).y, fVar9 = (pEVar8->_pos).x - (this->_pos).x,
fVar13 = pEVar8->_size + this->_size, fVar15 * fVar15 + fVar9 * fVar9 < fVar13 * fVar13
)) {
takeDamage = *(code **)(*GHIDRA_CAST<int *>(pEVar8) + 0x20);
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
(*takeDamage)(0x41800000,2,0,&sourceRef,0x1e);
}
local_84 = local_84 + 1;
} while (local_84 < GHIDRA_UINT(local_c0._shift3));
}
local_14 = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((&local_c0)))->EntityList_Query::~EntityList_Query();
}
else {
local_84 = GHIDRA_CAST<uint8_t *>(0x0);
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
do {
local_80 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(GHIDRA_UINT(local_84));
if ((local_80 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(fVar15 = (local_80->_pos).y - (this->_pos).y,
fVar9 = (local_80->_pos).x - (this->_pos).x,
fVar13 = local_80->_size + this->_size + 1.5,
fVar15 * fVar15 + fVar9 * fVar9 < fVar13 * fVar13)) {
takeDamage = *(code **)(*GHIDRA_CAST<int *>(local_80) + 0x20);
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(this));
(*takeDamage)(0x3f800000,2,0,&sourceRef,0x1e);
}
local_84 = local_84 + 1;
} while (local_84 <
(uint8_t *)
(GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2));
}
}
}
pBVar5 = &this->_tearFlags;
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagOccult);
if ((((GHIDRA_INT(maskedFlags->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) == 0) &&
(GHIDRA_INT(maskedFlags->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) == 0)) ||
(local_88 = GHIDRA_CAST<Entity_Player *>(this->_parent), local_88 == GHIDRA_CAST<Entity_Player *>(0x0))) ||
(local_88->_type != 1)) {
LAB_006a34c6:
fVar9 = 0.0;
}
else {
(GHIDRA_CAST<Entity_Player *>((local_88)))->Entity_Player::GetShootingJoystick(&VStack_98);
(GHIDRA_CAST<Entity_Player *>((local_88)))->Entity_Player::GetMouseAimTarget(&VStack_98,0);
pvVar2 = local_88->_markedTarget;
if (pvVar2 != (void *)0x0) {
fVar9 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x33c)) - (this->_pos).x) / 10.0;
fVar15 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar2) + 0x340)) - (this->_pos).y) / 10.0;
VStack_98.x = fVar9;
VStack_98.y = fVar15;
fVar9 = sqrtf(fVar9 * fVar9 + fVar15 * fVar15);
if (1.0 < fVar9) {
(GHIDRA_CAST<Vector *>((&VStack_98)))->Vector::Normalize();
}
}
pEVar8 = local_88;
local_88 = GHIDRA_CAST<Entity_Player *>((local_88->_shotspeed * 3.0));
bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar8)))->Entity_Player::HasCollectible(5,0);
if (bVar4 != 0) {
local_88 = GHIDRA_CAST<Entity_Player *>(((float)local_88 * 0.5));
}
auVar12 = ZEXT816(0);
if ((VStack_98.x != 0.0) || (VStack_98.y != 0.0)) {
(GHIDRA_CAST<Vector *>((&VStack_98)))->Vector::Normalize();
(this->_velocity).x = VStack_98.x * (float)local_88 + (this->_velocity).x;
(this->_velocity).y = VStack_98.y * (float)local_88 + (this->_velocity).y;
this->_friction = 0.8;
goto LAB_006a34c6;
}
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
fVar9 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0)));
if (bVar4 == 0) {
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagHoming);
bVar4 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
fVar9 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0)));
if (bVar4 == 0) {
this->_friction = 0.8;
}
else {
this->_friction = 0.9;
}
}
else {
this->_friction = 1.0;
}
}
stickyTarget = this->_variant;
if ((stickyTarget == 0x13) || (stickyTarget == 0x14)) {
fVar15 = this->_rocketSpeed - fVar9;
local_a4 = fVar15 * 0.0625;
if (local_a4 <= fVar9) {
local_a4 = fVar9;
}
if (1.0 <= local_a4) {
local_a4 = 1.0;
}
fVar13 = local_a4 * 0.19;
if (stickyTarget != 0x14) {
fVar15 = fVar15 * 0.125;
if (fVar15 <= fVar9) {
fVar15 = fVar9;
}
if (1.0 <= fVar15) {
fVar15 = 1.0;
}
local_a4 = fVar15 + fVar15;
}
local_a4 = local_a4 + fVar9;
this->_friction = fVar13 + 0.8;
this->_rocketSpeed = this->_rocketSpeed + this->_speedMultiplier;
local_80 = GHIDRA_CAST<Entity_Player *>((this->_rocketAngle * 0.017453292));
local_84 = GHIDRA_CAST<uint8_t *>(sin((float)local_80));
fVar9 = cos((float)local_80);
bVar4 = this->_collidesWithGrid;
fVar15 = fVar9 * local_a4 * this->_speedMultiplier + (this->_velocity).x;
fVar9 = (float)local_84 * local_a4 * this->_speedMultiplier + (this->_velocity).y;
(this->_velocity).x = fVar15;
(this->_velocity).y = fVar9;
if (bVar4 != 0) {
this->_explosionCountdown1 = 0;
fVar13 = this->_speedMultiplier;
(this->_pos).x = (this->_pos).x - fVar13 * fVar15;
(this->_pos).y = (this->_pos).y - fVar13 * fVar9;
}
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
if ((this->_variant == 0x13) || (this->_variant == 0x14)) {
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagBoomerang);
if (((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
(GHIDRA_INT(maskedFlags->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) != 0)) &&
(stickyTarget = this->_parent, stickyTarget != 0)) {
fVar9 = atan2f(*GHIDRA_CAST<float *>((stickyTarget + 0x340)) - (this->_pos).y,
*GHIDRA_CAST<float *>((stickyTarget + 0x33c)) - (this->_pos).x);
fVar9 = normalize_angle_degrees(fVar9 * 57.295776 - this->_rocketAngle);
fVar15 = (this->_rocketSpeed - 1.0) / 9.0;
auVar12 = ZEXT416(GHIDRA_UINT(fVar15));
if (fVar15 <= 0.0) {
auVar12 = ZEXT816(0);
}
if (1.0 <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0)))) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0))) = 0x3f800000;
}
this->_rocketAngle =
((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar12)) + 0x0))) * 0.5 + 0.0) * fVar9 * this->_speedMultiplier + this->_rocketAngle;
}
pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagHoming);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
(GHIDRA_CAST<RNG *>((&local_c0)))->RNG::game_constructor(this->_initSeed,0xe);
fVar9 = (GHIDRA_CAST<RNG *>((&local_c0)))->RNG::RandomFloat();
local_88 = GHIDRA_CAST<Entity_Player *>(this->_rocketSpeed);
local_84 = GHIDRA_CAST<uint8_t *>((fVar9 * 6.0 + 3.0));
local_80 = GHIDRA_CAST<Entity_Player *>(((float)local_84 + 10.0));
if ((float)local_84 == (float)local_80) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Start and End parameters cannot be the same!"));
}
fVar9 = ((float)local_88 - (float)local_84) / ((float)local_80 - (float)local_84);
if (fVar9 <= 0.0) {
fVar9 = 0.0;
}
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
local_88 = GHIDRA_CAST<Entity_Player *>((fVar9 + 0.0));
if ((this->_target == 0) || (*GHIDRA_CAST<char *>((this->_target + 0x173)) != '\0')) {
EntityList::QueryRadius
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(&local_c0),
&this->_pos,256.0,0xffffffff);
local_14 = 1;
local_ac = GHIDRA_CAST<Entity *>(0x0);
local_a4 = 1e+10;
local_80 = GHIDRA_CAST<Entity_Player *>(0x0);
if (GHIDRA_CAST<uint8_t *>(local_c0._shift3) != GHIDRA_CAST<uint8_t *>(0x0)) {
do {
spawned = *GHIDRA_CAST<Entity **>((local_c0._shift1 + GHIDRA_INT(local_80) * 4));
bVar4 = (GHIDRA_CAST<Entity *>((spawned)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if (bVar4 != 0) {
if (GHIDRA_CAST<Entity *>(this->_spawnerEntity) != GHIDRA_CAST<Entity *>(0x0)) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_spawnerEntity))))->Entity::IsDescendantOf(spawned);
if (bVar4 != 0) goto LAB_006a39af;
}
local_cc.y = (this->_pos).x;
local_8c = (spawned->_pos).x - local_cc.y;
VStack_98.y = (this->_pos).y;
local_84 = GHIDRA_CAST<uint8_t *>(((spawned->_pos).y - VStack_98.y));
fVar9 = sqrtf((float)local_84 * (float)local_84 + local_8c * local_8c);
if (0.0 < fVar9) {
local_8c = (1.0 / fVar9) * local_8c;
local_84 = GHIDRA_CAST<uint8_t *>(((float)local_84 * (1.0 / fVar9)));
}
scratchVec.y = this->_rocketAngle * 0.017453292;
local_e0.y = sin(scratchVec.y);
fVar9 = cos(scratchVec.y);
local_e0.y = fVar9 * local_8c + local_e0.y * (float)local_84;
if (0.2 < local_e0.y) {
fVar9 = VStack_98.y - (spawned->_pos).y;
fVar15 = local_cc.y - (spawned->_pos).x;
fVar9 = sqrtf(fVar9 * fVar9 + fVar15 * fVar15);
fVar9 = fVar9 * (1.0 - local_e0.y);
if (fVar9 < local_a4) {
local_ac = spawned;
local_a4 = fVar9;
}
}
}
LAB_006a39af:
spawned = local_ac;
local_80 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_80)) + 0x1))));
} while (local_80 < GHIDRA_UINT(local_c0._shift3));
if (local_ac != GHIDRA_CAST<Entity *>(0x0)) {
if (this->_target != 0) {
VStack_98.y = (float)&this->_target;
msvc::multiset<unsigned_int>::erase(&VStack_98.y);
}
this->_target = spawned;
msvc::multiset<unsigned_int>::insert(&this->_target);
}
}
if ((char)local_c0._seed == '\0') {
local_14 = 2;
tracked_alloc(1,(void *)local_c0._shift1,0);
}
local_14 = 0xffffffff;
}
stickyTarget = this->_target;
if ((stickyTarget != 0) && (0.0 < (float)local_88)) {
fVar9 = atan2f(*GHIDRA_CAST<float *>((stickyTarget + 0x340)) - (this->_pos).y,
*GHIDRA_CAST<float *>((stickyTarget + 0x33c)) - (this->_pos).x);
fVar9 = normalize_angle_degrees(fVar9 * 57.295776 - this->_rocketAngle);
this->_rocketAngle = (float)local_88 * this->_speedMultiplier * fVar9 + this->_rocketAngle;
}
}
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x0))) = ZEXT812(0xbf800000);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0xc))) = 0;
local_ac = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x0)));
if (((this->_isFetus != 0) && (this->_parent != 0)) &&
((pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),&this->_tearFlags,&g_tearFlagOrbit),
GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0 ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)))) {
bVar4 = IsRocket(this);
if (bVar4 == 0) {
local_88 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Player *>(auVar10))) + 0x0)));
if ((this->_bombIndex & 1) == 0) {
local_88 = GHIDRA_CAST<Entity_Player *>(0x3f800000);
}
local_8c = (this->_pos).y - *GHIDRA_CAST<float *>((this->_parent + 0x340));
local_84 = GHIDRA_CAST<uint8_t *>(((this->_pos).x - *GHIDRA_CAST<float *>((this->_parent + 0x33c))));
fVar9 = sqrtf(local_8c * local_8c + (float)local_84 * (float)local_84);
if (fVar9 == 0.0) {
fVar9 = 0.1;
}
local_84 = GHIDRA_CAST<uint8_t *>(((float)local_84 / fVar9));
local_8c = local_8c / fVar9;
local_cc.y = (110.0 - fVar9) * 0.05;
fVar15 = (float)local_88 * local_8c;
local_88 = GHIDRA_CAST<Entity_Player *>(((float)local_88 * -(float)local_84));
fVar9 = (this->_velocity).x;
VStack_98.y = fVar15;
fVar15 = (this->_velocity).y;
local_e0.y = sqrtf(fVar9 * fVar9 + fVar15 * fVar15);
VStack_98.x = local_e0.y * VStack_98.y + local_cc.y * (float)local_84;
VStack_98.y = local_e0.y * (float)local_88 + local_cc.y * local_8c;
tmpVecPtr = (GHIDRA_CAST<Vector *>((&VStack_98)))->Vector::Normalized(&local_cc);
fVar9 = tmpVecPtr->y;
(this->_velocity).x = local_e0.y * tmpVecPtr->x;
(this->_velocity).y = local_e0.y * fVar9;
}
}
fVar9 = 5.0;
if (this->_spawnerType == 1) {
pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),&this->_tearFlags,&g_tearFlagHoming);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
if (this->_target == 0) {
VStack_98.x = (this->_velocity).x * fVar9 + (this->_pos).x;
VStack_98.y = (this->_velocity).y * fVar9 + (this->_pos).y;
EntityList::QueryRadius
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_e8),&VStack_98,
150.0,8);
local_14 = 3;
local_84 = GHIDRA_CAST<uint8_t *>(0x0);
if (GHIDRA_CAST<uint8_t *>(local_e0.y) != GHIDRA_CAST<uint8_t *>(0x0)) {
do {
spawned = *GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_e8)) + 0x4))) + GHIDRA_INT(local_84) * 4));
bVar4 = (GHIDRA_CAST<Entity *>((spawned)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if (((bVar4 != 0) &&
(((GHIDRA_CAST<Entity *>(this->_spawnerEntity) == GHIDRA_CAST<Entity *>(0x0) ||
(bVar4 = Entity::IsDescendantOf
(GHIDRA_CAST<Entity *>(this->_spawnerEntity),
*GHIDRA_CAST<Entity **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_e8)) + 0x4))) + GHIDRA_INT(local_84) * 4))), bVar4 == 0)
) && ((spawned->_flags & 0x20000010) == 0)))) &&
((uVar6 = Random(), (uVar6 & 1) != 0 &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(5,this->_index), bVar4 != 0)))) {
local_cc.y = (spawned->_pos).y;
local_cc.x = (spawned->_pos).x;
bVar4 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&this->_pos,&local_cc,1,0,0,0,GHIDRA_CAST<Vector *>(0x0));
if (bVar4 != 0) {
if (this->_target != 0) {
VStack_98.y = (float)&this->_target;
msvc::multiset<unsigned_int>::erase(&VStack_98.y);
}
this->_target = spawned;
msvc::multiset<unsigned_int>::insert(&this->_target);
}
}
local_84 = local_84 + 1;
} while (local_84 < GHIDRA_UINT(local_e0.y));
}
local_14 = 0xffffffff;
if (local_e8[0] == '\0') {
local_14 = 4;
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_e8)) + 0x4))),0);
local_14 = 0xffffffff;
}
}
else {
bVar4 = IsRocket(this);
if ((bVar4 == 0) && (uVar6 = Random(), (uVar6 & 1) == 0)) {
VStack_98.x = (this->_pos).x - *GHIDRA_CAST<float *>((this->_target + 0x33c));
VStack_98.y = (this->_pos).y - *GHIDRA_CAST<float *>((this->_target + 0x340));
tmpVecPtr = (GHIDRA_CAST<Vector *>((&VStack_98)))->Vector::Normalized(&local_cc);
fVar9 = tmpVecPtr->y;
(this->_velocity).x = (this->_velocity).x - tmpVecPtr->x * 1.33;
(this->_velocity).y = (this->_velocity).y - fVar9 * 1.33;
}
}
}
if ((this->_dead == 0) &&
(((pBVar5 = BitSet128::operator_and
(GHIDRA_CAST<BitSet128 *>(&local_c0),&this->_tearFlags,&g_tearFlagCreepTrail),
GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0 ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(7,0), bVar4 != 0)))) {
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
auVar11 = ZEXT812(0x40c00000);
fVar9 = (this->_explosionDamage - 30.0) / 3.0;
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar11)) + 0x0))) <= fVar9) {
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auVar11)) + 0x4))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auVar11)) + 0x4)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar11)) + 0x0))) = fVar9;
}
local_80 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar11)) + 0x0)));
}
else {
local_80 = GHIDRA_CAST<Entity_Player *>(0x40a00000);
}
uVar6 = Random();
uVar19 = 0;
pTVar18 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar16 = 0;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,&this->_pos,&g_vectorZero,
GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,uVar6);
effect = GHIDRA_CAST<int *>(__RTDynamicCast(spawned,uVar16,pTVar17,pTVar18,uVar19));
uVar6 = Random();
fVar15 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 0.6 + 0.3;
fVar9 = fVar15 * g_vectorOne.x;
effect[0x3a] = GHIDRA_INT((fVar15 * g_vectorOne.y));
effect[0x39] = GHIDRA_INT(fVar9);
uVar16 = (GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0,100,0);
(**(code **)(*effect + 0x3c))(uVar16,0xffffffff,0xff,0,1);
(**(code **)(*effect + 0x40))(local_80);
pEVar8 = GHIDRA_CAST<Entity_Player *>(this->_spawnerEntity);
if (((pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0)) && (pEVar8->_type == 1)) &&
(stickyTarget = (GHIDRA_CAST<Entity_Player *>((pEVar8)))->Entity_Player::GetTrinketMultiplier(0x47), 1 < stickyTarget)) {
fVar9 = 1.5;
if (2 < stickyTarget) {
stickyTarget = effect[0x117];
fVar9 = 2.0;
effect[0x117] = GHIDRA_INT(((float)stickyTarget * 1.5));
effect[0x118] = GHIDRA_INT(((float)stickyTarget * 1.5));
}
effect[0x3a] = GHIDRA_INT((fVar9 * (float)effect[0x3a]));
effect[0x39] = GHIDRA_INT((fVar9 * (float)effect[0x39]));
}
effect[0xd] = this->_spawnerType;
effect[0xe] = this->_spawnerVariant;
(**(code **)(*effect + 0xc))();
}
}
if (((this->_variant != 0x13) && (this->_variant != 0x14)) &&
((0.0 <= (this->_posOffset).y || (this->_isFetus == 0)))) {
fVar15 = (this->_velocity).x * 0.95;
fVar9 = (this->_velocity).y * 0.95;
(this->_velocity).x = fVar15;
(this->_velocity).y = fVar9;
if (fVar15 * fVar15 + fVar9 * fVar9 < 1.0) {
(this->_velocity).x = fVar15 * 0.5;
(this->_velocity).y = (this->_velocity).y * 0.5;
}
}
pBVar5 = &this->_tearFlags;
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagSticky);
if (((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
(GHIDRA_INT(maskedFlags->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) != 0)) &&
(stickyTarget = this->_stickyTarget, stickyTarget != 0)) {
*GHIDRA_CAST<float *>((stickyTarget + 0x360)) = *GHIDRA_CAST<float *>((stickyTarget + 0x360)) * 0.9;
*GHIDRA_CAST<float *>((stickyTarget + 0x364)) = *GHIDRA_CAST<float *>((stickyTarget + 0x364)) * 0.9;
}
if (this->_explosionCountdown1 < 1) {
local_80 = GHIDRA_CAST<Entity_Player *>(&spawner->_temporaryeffects);
LAB_006a4412:
if (((this->_isFetus != 0) || (spawner == GHIDRA_CAST<Entity_Player *>(0x0))) ||
((bVar4 = (GHIDRA_CAST<Entity_Player *>((spawner)))->Entity_Player::HasCollectible(0x89,0), bVar4 == 0 ||
((bVar4 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(local_80))))->TemporaryEffects::HasCollectibleEffect(0x89),
bVar4 != 0 || (this->_spawnerType != 1)))))) {
BVar1 = *pBVar5;
if ((this->_variant == 0x11) || (_local_a0 = BVar1, this->_variant == 0x14)) {
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(BVar1._l)) + 0x0)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(BVar1._l)) + 0x4)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x4))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x4))) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagGigaBomb._l)) + 0x4)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a0)) + 0x0))) | GHIDRA_UINT(g_tearFlagGigaBomb._l);
VStack_98.x = (float)BVar1._h;
VStack_98.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(BVar1._h)) + 0x4)));
VStack_98.x = (float)(GHIDRA_UINT(VStack_98.x) | GHIDRA_UINT(g_tearFlagGigaBomb._h));
VStack_98.y = (float)(GHIDRA_UINT(VStack_98.y) | (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(g_tearFlagGigaBomb._h)) + 0x4))));
this->_updateDelay = 5;
}
uVar6 = 4;
if (this->_isFetus == 0) {
uVar6 = 0x40000004;
}
local_cc.y = (float)&this->_pos;
Game::BombExplosionEffects
(g_game,GHIDRA_CAST<Vector *>(local_cc.y),this->_explosionDamage,_local_a0,
&(this->_sprite)._color,GHIDRA_CAST<Entity *>(this),this->_radiusMultiplier,1,(uint64_t)uVar6,0
);
if (spawner == GHIDRA_CAST<Entity_Player *>(0x0)) {
local_88 = GHIDRA_CAST<Entity_Player *>(this->_variant);
}
else {
local_88 = GHIDRA_CAST<Entity_Player *>(0x0);
}
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagScatterBomb);
if ((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
(GHIDRA_INT(maskedFlags->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_h) + 4)) != 0)) {
uVar6 = Random();
local_84 = GHIDRA_CAST<uint8_t *>(((uVar6 & 1) + 4));
do {
uVar6 = Random();
fVar9 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 3.14;
fVar9 = fVar9 + fVar9;
VStack_98.y = fVar9;
local_80 = GHIDRA_CAST<Entity_Player *>(cos(fVar9));
local_a4 = sin(VStack_98.y);
uVar6 = Random();
spawned = GHIDRA_CAST<Entity *>(this->_spawnerEntity);
rngResult = Random();
scratchVec.x = (float)((double)GHIDRA_INT(rngResult) +
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 *
7.0 + 3.0;
scratchVec.y = scratchVec.x * local_a4;
scratchVec.x = scratchVec.x * (float)local_80;
rngResult = Random();
this = bomb;
uVar19 = 0;
pTVar18 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor;
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar16 = 0;
fVar9 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]
) * 2.3283064e-10 * 15.0;
scratchVec2.x = fVar9 * (float)local_80 + *GHIDRA_CAST<float *>(local_cc.y);
scratchVec2.y = fVar9 * local_a4 + (bomb->_pos).y;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(bomb->_type,GHIDRA_UINT(local_88),&scratchVec2,&scratchVec,spawned,0
,uVar6);
spawned = GHIDRA_CAST<Entity *>(__RTDynamicCast(spawned,uVar16,pTVar17,pTVar18,uVar19));
*GHIDRA_CAST<uint8_t *>(&spawned[1]._spawnerVariant) = this->_isFetus;
spawned->_spawnerType = this->_spawnerType;
spawned->_spawnerVariant = this->_spawnerVariant;
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagScatterBomb)))->BitSet128::__bnot(GHIDRA_CAST<BitSet128 *>(&local_c0));
pBVar5 = BitSet128::operator_and(&local_100,&this->_tearFlags,pBVar5);
flagsLow = pBVar5->_l;
stickyTarget = *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4));
flagsHigh = pBVar5->_h;
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4));
spawned[1]._sprite._filename._buf[0xb] = '\x01';
spawned[1]._type = GHIDRA_INT(flagsLow);
spawned[1]._variant = stickyTarget;
spawned[1]._subtype = GHIDRA_INT(flagsHigh);
spawned[1]._spawnerType = iVar7;
spawned[1]._collisionIndex = GHIDRA_INT((this->_scale * 0.5));
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x8)))) = this->_explosionDamage * 0.5;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x3c)))) = this->_radiusMultiplier * 0.65;
local_e0.y = (float)(GHIDRA_UINT(g_vectorOne.y) ^ 0x80000000);
local_e0.x = -g_vectorOne.x;
(GHIDRA_CAST<Entity *>((spawned)))->Entity::SetSize(spawned->_size * 0.5,
(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1);
if ((spawned->_variant == 0x13) || (spawned->_variant == 0x14)) {
uVar6 = Random();
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x10)))) = 0x3fa66666;
fVar9 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 10.0;
}
else {
uVar6 = Random();
fVar9 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 5.0;
}
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0xc)))) = -3.0 - fVar9;
(spawned->_posOffset).x = 0.0;
(spawned->_posOffset).y = -3.0;
uVar6 = (GHIDRA_CAST<RNG *>((&spawned->_dropRNG)))->RNG::RandomInt(0xe);
*GHIDRA_CAST<uint32_t *>(&spawned->_flags) = GHIDRA_UINT(spawned->_flags) | 0x4000000;
entityFlagsHi = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
*entityFlagsHi = *entityFlagsHi | 0x400;
local_84 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_84) + -1));
*GHIDRA_CAST<uint32_t *>((spawned + 1)) = uVar6 + 10;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x4)))) = uVar6 + 10;
} while (local_84 != GHIDRA_CAST<uint8_t *>(0x0));
pBVar5 = &this->_tearFlags;
local_84 = GHIDRA_CAST<uint8_t *>(0x0);
}
pBVar5 = BitSet128::operator_and(&local_100,pBVar5,&g_tearFlagGhostBomb);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
if (0.75 < this->_scale) {
uVar6 = Random();
manager = g_manager;
local_80 = GHIDRA_CAST<Entity_Player *>(&DAT_0000002c);
VStack_98.y = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)])
* 2.3283064e-10 * 0.4 + 2.0;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_80));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_80),0.7,2,0,VStack_98.y,0.0);
local_c0._seed = this->_initSeed;
local_c0._shift1 = 2;
local_c0._shift2 = 7;
local_c0._shift3 = 0x19;
uVar6 = (GHIDRA_CAST<RNG *>((&local_c0)))->RNG::Next();
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xba,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(spawner),1,uVar6);
uVar16 = 0x168;
if (this->_isFetus != 0) {
uVar16 = 0xb4;
}
fVar9 = spawned->_collisionDamage;
stickyTarget = *GHIDRA_CAST<int *>(spawned);
*GHIDRA_CAST<uint32_t *>((spawned[1]._sprite._filename._buf + 4)) = uVar16;
*GHIDRA_CAST<uint32_t *>((spawned[1]._sprite._filename._buf + 8)) = uVar16;
(**(code **)(stickyTarget + 0x40))(fVar9 * this->_scale);
VStack_98.x = -g_vectorOne.x;
VStack_98.y = -g_vectorOne.y;
(GHIDRA_CAST<Entity *>((spawned)))->Entity::SetSize(spawned->_size * this->_scale,
(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1);
fVar9 = this->_scale;
}
else {
local_c0._seed = this->_initSeed;
local_c0._shift1 = 2;
local_c0._shift2 = 7;
local_c0._shift3 = 0x19;
uVar6 = (GHIDRA_CAST<RNG *>((&local_c0)))->RNG::Next();
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xbd,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(spawner),1,uVar6);
if ((spawned->_sprite)._animState._animData != (void *)0x0) {
AnimationState::AdvancePosition
(&(spawned->_sprite)._animState,
*GHIDRA_CAST<int *>((GHIDRA_INT((spawned->_sprite)._animState._animData) + 0x30)) + -1);
}
fVar9 = this->_scale + this->_scale;
}
stickyTarget = *GHIDRA_CAST<int *>(spawned);
fVar15 = fVar9 * g_vectorOne.y;
(spawned->_sprite)._scale.x = fVar9 * g_vectorOne.x;
(spawned->_sprite)._scale.y = fVar15;
(**(code **)(stickyTarget + 0xc))();
}
this->_dead = 1;
if (this->_pitfallState == 0) {
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Explode"),0);
}
if (this->_isFetus == 0) {
pBVar5 = BitSet128::operator_and(&local_110,&this->_tearFlags,&g_tearFlagSticky);
pEVar8 = spawner;
if (((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) &&
(stickyTarget = this->_stickyTarget, stickyTarget != 0)) {
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x168)) = *GHIDRA_CAST<uint32_t *>((stickyTarget + 0x168)) | 0x400000;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x16c)) = *GHIDRA_CAST<uint32_t *>((stickyTarget + 0x16c));
}
if (((this->_variant != 0xd) && (spawner != GHIDRA_CAST<Entity_Player *>(0x0))) &&
(bVar4 = (GHIDRA_CAST<Entity_Player *>((spawner)))->Entity_Player::HasTrinket(0x49,0), bVar4 != 0)) {
trinketRng = (GHIDRA_CAST<Entity_Player *>((pEVar8)))->Entity_Player::GetTrinketRNG(0x49);
stickyTarget = (GHIDRA_CAST<Entity_Player *>((spawner)))->Entity_Player::GetTrinketMultiplier(0x49);
uVar6 = (GHIDRA_CAST<RNG *>((trinketRng)))->RNG::RandomInt(GHIDRA_UINT((10 / (int64_t)stickyTarget)));
if (uVar6 == 0) {
uVar6 = Random();
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x28,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar6);
}
}
}
else {
pBVar5 = BitSet128::operator_and(&local_100,&this->_tearFlags,&g_tearFlagPersistent);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
uVar6 = Random();
uVar19 = 0;
pTVar18 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor;
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar16 = 0;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,this->_variant,&this->_pos,&this->_velocity,
GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,uVar6);
stickyTarget = __RTDynamicCast(spawned,uVar16,pTVar17,pTVar18,uVar19);
*GHIDRA_CAST<int *>((stickyTarget + 0x34)) = this->_spawnerType;
*GHIDRA_CAST<int *>((stickyTarget + 0x38)) = this->_spawnerVariant;
*GHIDRA_CAST<uint8_t *>((stickyTarget + 0x448)) = 1;
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagPersistent)))->BitSet128::__bnot(&local_100);
pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),&this->_tearFlags,pBVar5);
BVar1 = *pBVar5;
*GHIDRA_CAST<uint8_t *>((stickyTarget + 0x463)) = 1;
*GHIDRA_CAST<BitSet128 *>((stickyTarget + 0x438)) = BVar1;
if ((*GHIDRA_CAST<int *>((stickyTarget + 0x2c)) == 0x13) || (*GHIDRA_CAST<int *>((stickyTarget + 0x2c)) == 0x14)) {
*GHIDRA_CAST<float *>((stickyTarget + 0x428)) = this->_rocketAngle;
uVar16 = 0x3c;
}
else {
uVar16 = 0x1e;
}
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x410)) = uVar16;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x414)) = uVar16;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x168)) = *GHIDRA_CAST<uint32_t *>((stickyTarget + 0x168)) | 0x4000000;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x16c)) = *GHIDRA_CAST<uint32_t *>((stickyTarget + 0x16c)) | 0x400;
}
pBVar5 = BitSet128::operator_and(&local_100,&this->_tearFlags,&g_tearFlagSplit);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
local_84 = GHIDRA_CAST<uint8_t *>((this->_velocity).y);
local_8c = -(this->_velocity).x;
fVar9 = sqrtf((float)local_84 * (float)local_84 + local_8c * local_8c);
if (0.0 < fVar9) {
local_84 = GHIDRA_CAST<uint8_t *>(((float)local_84 * (1.0 / fVar9)));
local_8c = local_8c * (1.0 / fVar9);
}
do {
uVar6 = Random();
uVar19 = 0;
pTVar18 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor;
scratchVec2.x = (float)local_ac * (float)local_84 * 5.0;
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar16 = 0;
scratchVec2.y = (float)local_ac * local_8c * 5.0;
VStack_98.x = this->_size * (float)local_84 * (float)local_ac + (this->_pos).x;
VStack_98.y = this->_size * local_8c * (float)local_ac + (this->_pos).y;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,GHIDRA_UINT(local_88),&VStack_98,&scratchVec2,
GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,uVar6);
stickyTarget = __RTDynamicCast(spawned,uVar16,pTVar17,pTVar18,uVar19);
*GHIDRA_CAST<int *>((stickyTarget + 0x34)) = this->_spawnerType;
*GHIDRA_CAST<int *>((stickyTarget + 0x38)) = this->_spawnerVariant;
*GHIDRA_CAST<uint8_t *>((stickyTarget + 0x448)) = 1;
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagSplit)))->BitSet128::__bnot(&local_100);
pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),&this->_tearFlags,pBVar5);
flagsLow = pBVar5->_l;
uVar16 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pBVar5->_l) + 4));
flagsHigh = pBVar5->_h;
uVar19 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pBVar5->_h) + 4));
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x168)) = *GHIDRA_CAST<uint32_t *>((stickyTarget + 0x168)) | 0x4000000;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x16c)) = *GHIDRA_CAST<uint32_t *>((stickyTarget + 0x16c)) | 0x400;
*GHIDRA_CAST<int *>((stickyTarget + 0x438)) = GHIDRA_INT(flagsLow);
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x43c)) = uVar16;
*GHIDRA_CAST<int *>((stickyTarget + 0x440)) = GHIDRA_INT(flagsHigh);
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x444)) = uVar19;
*GHIDRA_CAST<uint8_t *>((stickyTarget + 0x463)) = 1;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x410)) = 0xf;
*GHIDRA_CAST<uint32_t *>((stickyTarget + 0x414)) = 0xf;
*GHIDRA_CAST<float *>((stickyTarget + 0x418)) = *GHIDRA_CAST<float *>((stickyTarget + 0x418)) * 0.4;
local_ac = GHIDRA_CAST<Entity *>(((float)local_ac + 2.0));
} while ((float)local_ac <= 1.0);
}
pBVar5 = BitSet128::operator_and(&local_100,&this->_tearFlags,&g_tearFlagQuadsplit);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
uVar6 = Random();
fVar9 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 3.14;
fVar9 = fVar9 + fVar9;
VStack_98.y = fVar9;
local_84 = GHIDRA_CAST<uint8_t *>(cos(fVar9));
local_8c = sin(VStack_98.y);
local_cc.y = cos(1.5707964);
VStack_98.y = sin(1.5707964);
local_80 = GHIDRA_CAST<Entity_Player *>(0x4);
do {
uVar6 = Random();
scratchVec2.x = (float)local_84 * 6.5;
uVar19 = 0;
pTVar18 = &IsaacRepentancePlus::Entity_Bomb::RTTI_Type_Descriptor;
pTVar17 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
scratchVec2.y = local_8c * 6.5;
uVar16 = 0;
scratchVec.y = this->_size * local_8c + (this->_pos).y;
scratchVec.x = this->_size * (float)local_84 + (this->_pos).x;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(this->_type,GHIDRA_UINT(local_88),&scratchVec,&scratchVec2,
GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,uVar6);
spawned = GHIDRA_CAST<Entity *>(__RTDynamicCast(spawned,uVar16,pTVar17,pTVar18,uVar19));
spawned->_spawnerType = this->_spawnerType;
spawned->_spawnerVariant = this->_spawnerVariant;
*GHIDRA_CAST<uint8_t *>(&spawned[1]._spawnerVariant) = 1;
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagQuadsplit)))->BitSet128::__bnot(GHIDRA_CAST<BitSet128 *>(&local_c0));
pBVar5 = BitSet128::operator_and(&local_110,&this->_tearFlags,pBVar5);
flagsLow = pBVar5->_l;
stickyTarget = *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4));
flagsHigh = pBVar5->_h;
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4));
spawned[1]._sprite._filename._buf[0xb] = '\x01';
spawned[1]._type = GHIDRA_INT(flagsLow);
spawned[1]._variant = stickyTarget;
spawned[1]._subtype = GHIDRA_INT(flagsHigh);
spawned[1]._spawnerType = iVar7;
spawned[1]._collisionIndex = GHIDRA_INT((this->_scale * 0.5));
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x8)))) = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x8)))) * 0.35;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x3c)))) = this->_radiusMultiplier * 0.5;
local_e0.y = (float)(GHIDRA_UINT(g_vectorOne.y) ^ 0x80000000);
local_e0.x = -g_vectorOne.x;
(GHIDRA_CAST<Entity *>((spawned)))->Entity::SetSize(spawned->_size * 0.5,
(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1)
;
*GHIDRA_CAST<uint32_t *>(&spawned->_flags) = GHIDRA_UINT(spawned->_flags) | 0x4000000;
entityFlagsHi = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
*entityFlagsHi = *entityFlagsHi | 0x400;
*GHIDRA_CAST<uint32_t *>((spawned + 1)) = 7;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(spawned[1])) + 0x4)))) = 7;
local_80 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_80[-1])) + 0x2eff))));
fVar9 = VStack_98.y * (float)local_84;
local_84 = GHIDRA_CAST<uint8_t *>((local_cc.y * (float)local_84 - VStack_98.y * local_8c));
local_8c = local_cc.y * local_8c + fVar9;
} while (local_80 != GHIDRA_CAST<Entity_Player *>(0x0));
local_80 = GHIDRA_CAST<Entity_Player *>(0x0);
}
}
if (this->_variant == 0x12) {
this->_dead = 0;
uVar6 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(0x1e);
this->_explosionCountdown1 = uVar6 + 0x3c;
bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("Appear"),1);
if (bVar4 != 0) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
if ((this->_sprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat(&(this->_sprite)._animState,8.0);
}
uVar6 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
tmpVecPtr = RandomVector(&local_e0,uVar6);
(GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
stickyTarget = (this->_dropRNG)._seed;
fVar15 = (float)((double)stickyTarget + __uint_to_double_fixup[-(stickyTarget >> 0x1f)]) *
2.3283062e-10 * 5.0 + 5.0;
fVar9 = tmpVecPtr->x;
(this->_velocity).y = fVar15 * tmpVecPtr->y;
(this->_velocity).x = fVar15 * fVar9;
this->_scatterTimer = 0x5a;
}
pEVar8 = spawner;
if ((((((this->_flags & 0x40000000000) == 0) && (spawner != GHIDRA_CAST<Entity_Player *>(0x0))) &&
(GHIDRA_CAST<Entity_Player *>(this->_spawnerEntity) == spawner)) &&
((this->_isFetus == 0 &&
(bVar4 = (GHIDRA_CAST<TemporaryEffects *>((&spawner->_temporaryeffects)))->TemporaryEffects::HasCollectibleEffect(0x89),
bVar4 != 0)))) && (bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar8)))->Entity_Player::HasCollectible(0x248,0), bVar4 != 0)) {
Entity_Player::AddWisp(pEVar8,0x89,&this->_pos,0,0);
}
}
}
else {
if ((this->_spawnerType == 1) && (spawner != GHIDRA_CAST<Entity_Player *>(0x0))) {
local_80 = GHIDRA_CAST<Entity_Player *>(&spawner->_temporaryeffects);
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(local_80))))->TemporaryEffects::HasCollectibleEffect(0x89);
if (bVar4 != 0) goto LAB_006a4412;
}
if (((this->_variant != 0x13) && (this->_variant != 0x14)) ||
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x200000000000000), bVar4 == 0)) {
this->_explosionCountdown1 = this->_explosionCountdown1 + -1;
}
pBVar5 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(&local_c0),pBVar5,&g_tearFlagAttractor);
if ((GHIDRA_INT(pBVar5->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar5->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar5->_h) + 4)) != 0)) {
Game::AttractEntities(g_game,&this->_pos,(void *)0x0,(void *)0x0,10.0,250.0);
}
bVar4 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x3f);
if (((bVar4 != 0) && (this->_explosionCountdown1 == 0)) &&
(((stickyTarget = this->_variant, stickyTarget == 3 ||
(((stickyTarget == 4 || (stickyTarget == 8)) || (stickyTarget == 0x12)))) ||
(((stickyTarget == 0x11 && (this->_spawnerType != 1)) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x20000000), bVar4 == 0)))))) {
this->Remove();
SoundEffects::PlayWithFartOverride(900,1.0,2,0,1.0);
stickyTarget = this->_variant;
uVar6 = 1;
if (stickyTarget == 4) {
uVar6 = 2;
}
else if (stickyTarget == 0x12) {
uVar6 = 4;
}
else if (stickyTarget == 0x11) {
uVar6 = 7;
}
rngResult = Random();
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x28,&this->_pos,&this->_velocity,GHIDRA_CAST<Entity *>(0x0),uVar6,rngResult);
pvVar2 = (spawned->_sprite)._animState._animData;
if (pvVar2 != (void *)0x0) {
AnimationState::SetFrameFloat
(&(spawned->_sprite)._animState,(float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x30)) + -8));
}
uVar6 = Random();
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar6);
ExceptionList = local_1c;
return;
}
}
if (this->_variant == 4) {
tmpVecPtr = &this->_pos;
pEVar8 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNearestPlayer(tmpVecPtr);
VStack_98.y = (pEVar8->_pos).x;
local_cc.y = (pEVar8->_pos).y;
pEVar8 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetNearestPlayer(tmpVecPtr);
local_a4 = ((pEVar8->_velocity).y * 5.0 + local_cc.y) - (this->_pos).y;
local_80 = GHIDRA_CAST<Entity_Player *>((((pEVar8->_velocity).x * 5.0 + VStack_98.y) - tmpVecPtr->x));
fVar9 = local_a4 * local_a4 + (float)local_80 * (float)local_80;
if (fVar9 < 72900.0) {
fVar9 = sqrtf(fVar9);
if (fVar9 <= 0.0) {
pEVar8 = local_80;
fVar9 = local_a4;
}
else {
pEVar8 = GHIDRA_CAST<Entity_Player *>(((float)local_80 * (1.0 / fVar9)));
fVar9 = local_a4 * (1.0 / fVar9);
}
(this->_velocity).x = (float)pEVar8 * 1.5 + (this->_velocity).x;
(this->_velocity).y = fVar9 * 1.5 + (this->_velocity).y;
}
game = g_game;
(this->_velocity).x = (this->_velocity).x * 0.8;
(this->_velocity).y = (this->_velocity).y * 0.8;
if (game->_frameCount - this->_spawnFrame < 0x14) {
this->_friction = this->_friction * 0.8;
}
}
if (0 < this->_collisionCooldown) {
this->_collisionCooldown = this->_collisionCooldown + -1;
}
if (0 < this->_parentCollisionCooldown) {
this->_parentCollisionCooldown = this->_parentCollisionCooldown + -1;
}
if (0 < this->_scatterTimer) {
this->_scatterTimer = this->_scatterTimer + -1;
}
game = g_game;
stickyTarget = g_game->_frameCount;
if ((0xf < stickyTarget - this->_spawnFrame) && (this->_entityCollisionClass == 1)) {
this->_entityCollisionClass = 4;
stickyTarget = game->_frameCount;
}
if ((this->_explosionCountdown1 < stickyTarget - this->_spawnFrame) &&
(this->_entityCollisionClass == 0)) {
this->_entityCollisionClass = 4;
}
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x10) && (this->_variant != 0x13)) &&
(this->_variant != 0x14)) {
(this->_velocity).y = (this->_velocity).y + 0.9;
}
if (this->_variant == 0xf) {
if ((0.0 <= (this->_posOffset).y) && (0.0 <= this->_fallSpeed)) {
this->_friction = this->_friction * 0.8;
}
if ((this->_sprite)._animState._animData != (void *)0x0) {
bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b670d0);
manager = g_manager;
if (bVar4 != 0) {
local_80 = GHIDRA_CAST<Entity_Player *>(0xab);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_80));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_80),1.0,2,0,1.5,0.0);
}
}
}
stickyTarget = this->_stickyTarget;
if (stickyTarget == 0) {
if (this->_entityGridCollisionClass == 0) {
this->_entityGridCollisionClass = 5;
}
}
else {
fVar9 = *GHIDRA_CAST<float *>((stickyTarget + 0x364));
(this->_velocity).x = *GHIDRA_CAST<float *>((stickyTarget + 0x360));
(this->_velocity).y = fVar9;
fVar9 = *GHIDRA_CAST<float *>((stickyTarget + 0x340));
fVar15 = (this->_targetPosition).y;
(this->_pos).x = *GHIDRA_CAST<float *>((stickyTarget + 0x33c)) + (this->_targetPosition).x;
(this->_pos).y = fVar9 + fVar15;
this->_entityCollisionClass = 0;
this->_entityGridCollisionClass = 0;
}
if (this->_visible == 0) {
this->_entityCollisionClass = 0;
this->_entityGridCollisionClass = 0;
this->_collisionCooldown = 4;
}
if (((this->_sprite)._animState._animData != (void *)0x0) &&
(bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST<uint8_t *>("DropSound")),
bVar4 != 0)) {
if (this->_variant == 0x11) {
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x28,1.0,4,0,0.8,0.0);
(GHIDRA_CAST<Game *>((g_game)))->Game::ShakeScreen(6);
}
else {
fVar9 = this->_scale;
if (this->_variant == 0x12) {
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
fVar9 = fVar9 * 0.8;
stickyTarget = 0x1d2;
}
else {
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
stickyTarget = 0x28;
}
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(stickyTarget,fVar9,4,0,1.0,0.0);
}
}
if (this->_hasCostumes != 0) {
costumeLoaded = &this->_bombCostumesSprites[0]._loaded;
local_80 = GHIDRA_CAST<Entity_Player *>(&DAT_00000005);
do {
if (*costumeLoaded != 0) {
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xd9)));
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xb9)));
}
costumeLoaded = costumeLoaded + 0x114;
local_80 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_80[-1])) + 0x2eff))));
} while (local_80 != GHIDRA_CAST<Entity_Player *>(0x0));
}
if ((this->_variant == 0x13) || (this->_variant == 0x14)) {
fVar9 = rocketAngle;
if (360.0 < ABS(rocketAngle)) {
fVar9 = fmodf(rocketAngle,360.0);
}
if (fVar9 <= 180.0) {
if (fVar9 < -180.0) {
fVar9 = fVar9 + 360.0;
}
}
else {
fVar9 = fVar9 - 360.0;
}
if ((this->_flags & 0x200000000000000) == 0) {
if ((90.0 < fVar9) || (fVar9 < -90.0)) {
fVar9 = 180.0 - fVar9;
(this->_sprite)._flipX = 1;
}
else {
(this->_sprite)._flipX = 0;
}
}
else {
(this->_sprite)._flipX = 0;
fVar9 = 0.0;
}
(this->_sprite)._rotation = fVar9;
stickyTarget = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetIntervalTicks(2.0,0.0);
if ((stickyTarget != 0) && (this->_visible != 0)) {
uVar6 = Random();
scratchVec2.x = (this->_velocity).x * 0.14;
rocketAngle = rocketAngle * 0.017453292;
scratchVec2.y = (this->_velocity).y * 0.14;
fVar9 = cos(rocketAngle);
VStack_98.x = (this->_pos).x - fVar9 * 5.0 * this->_scale;
fVar9 = sin(rocketAngle);
VStack_98.y = (this->_pos).y - fVar9 * 5.0 * this->_scale;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&VStack_98,&scratchVec2,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
(GHIDRA_CAST<Color *>((&smokeColor)))->Color::Color(1.0,1.0,1.0,0.3);
spawned->SetColor(extraout_EAX,0xffffffff,0xff,0,1);
uVar6 = Random();
*GHIDRA_CAST<float *>((spawned[1]._sprite._animDefaultName._buf + 4)) =
(float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 10.0 + 2.0;
uVar6 = Random();
stickyTarget = uVar6 % 0xf + 0xf;
*GHIDRA_CAST<int *>((spawned[1]._sprite._filename._buf + 4)) = stickyTarget;
*GHIDRA_CAST<int *>((spawned[1]._sprite._filename._buf + 8)) = stickyTarget;
fVar9 = this->_scale * 0.4;
fVar15 = fVar9 * g_vectorOne.y;
fVar9 = fVar9 * g_vectorOne.x;
spawned->_renderDepthOffset = -18.0;
(spawned->_sprite)._scale.y = fVar15;
(spawned->_sprite)._scale.x = fVar9;
(spawned->_posOffset).x = (this->_posOffset).x;
(spawned->_posOffset).y = (this->_posOffset).y;
}
}
if ((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) &&
(stickyTarget = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_deathmatchManager))) + 0xc)))) + 4))(),
stickyTarget == 3)) {
this->_entityCollisionClass = 0;
}
FUN_00861f80(this);
ExceptionList = local_1c;
return;
}
// 006a5a60
void Entity_Bomb::Render(Vector *offset)
{
Vector *position;
float fVar1;
void *layerFrame;
ColorMod *costumeSpriteColor;
AnimationState *costumeAnimState;
AnimationState *pAVar2;
uint32_t costumeIndex;
float fVar3;
float fVar4;
float fVar5;
float cosRotation;
float fVar6;
double dVar7;
double dVar8;
float costumeOffsetY;
float costumeOffsetX;
Vector costumePos;
Color costumeColor;
float local_6c [26];
float spriteRotation;
if ((this->_exists != 0) && (this->_visible != 0)) {
if (this->_loadCostumes != 0) {
update_sparks();
}
fVar6 = g_displayPixelRatio * g_screenPointScale;
dVar7 = floor((double)(((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 +
(g_screenWidth - 338.0) * 0.5) * fVar6 + 0.5));
dVar8 = floor((double)(((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 +
(g_screenHeight - 182.0) * 0.5) * fVar6 + 0.5));
position = &this->_renderPosition;
fVar1 = offset->y;
position->x = (float)dVar7 / fVar6 + offset->x;
(this->_renderPosition).y = (float)dVar8 / fVar6 + fVar1;
if (this->_hasCostumes != 0) {
layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0);
fVar1 = (this->_sprite)._scale.x;
fVar3 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x10)) + (this->_sprite)._offset.x) * fVar1;
fVar6 = (this->_sprite)._scale.y;
fVar4 = ((this->_sprite)._offset.y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x14))) * fVar6;
spriteRotation = (this->_sprite)._rotation;
fVar5 = spriteRotation * 0.017453292;
cosRotation = cos(fVar5);
fVar5 = sin(fVar5);
costumeOffsetX = cosRotation * fVar3 - fVar5 * fVar4;
costumeOffsetY = cosRotation * fVar4 + fVar5 * fVar3;
if ((this->_sprite)._flipX != 0) {
costumeOffsetX = costumeOffsetX * -1.0;
}
if ((this->_sprite)._flipY != 0) {
costumeOffsetY = costumeOffsetY * -1.0;
}
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x5c));
costumeColor._offset[2] = (this->_sprite)._color._offset[2];
fVar4 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x18));
fVar5 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x1c));
costumeColor._tint[0] = (this->_sprite)._color._tint[0];
costumeColor._tint[1] = (this->_sprite)._color._tint[1];
costumeColor._tint[2] = (this->_sprite)._color._tint[2];
costumeColor._tint[3] = (this->_sprite)._color._tint[3];
costumeColor._colorize[0] = (this->_sprite)._color._colorize[0];
costumeColor._colorize[1] = (this->_sprite)._color._colorize[1];
costumeColor._colorize[2] = (this->_sprite)._color._colorize[2];
costumeColor._colorize[3] = (this->_sprite)._color._colorize[3];
costumeColor._offset[0] = (this->_sprite)._color._offset[0];
costumeColor._offset[1] = (this->_sprite)._color._offset[1];
(GHIDRA_CAST<Color *>((&costumeColor)))->Color::__mul(GHIDRA_CAST<ColorMod *>((GHIDRA_INT(layerFrame) + 0x30)));
costumeIndex = 0;
do {
if ((this->_bombCostumesSprites[costumeIndex]._loaded != 0) &&
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(layerFrame) + 0x2c)) != '\0')) {
this->_bombCostumesSprites[costumeIndex]._rotation = spriteRotation + fVar3;
costumeSpriteColor = &this->_bombCostumesSprites[costumeIndex]._color;
this->_bombCostumesSprites[costumeIndex]._scale.x = fVar1 * fVar4;
this->_bombCostumesSprites[costumeIndex]._scale.y = fVar6 * fVar5;
if (costumeSpriteColor != GHIDRA_CAST<ColorMod *>(local_6c)) {
*GHIDRA_CAST<uint64_t *>(costumeSpriteColor->_offset) =
CONCAT44(costumeColor._offset[1],costumeColor._offset[0]);
costumeSpriteColor->_tint[0] = costumeColor._tint[0];
costumeSpriteColor->_tint[1] = costumeColor._tint[1];
costumeSpriteColor->_tint[2] = costumeColor._tint[2];
costumeSpriteColor->_tint[3] = costumeColor._tint[3];
costumeSpriteColor->_offset[2] = costumeColor._offset[2];
costumeSpriteColor->_colorize[0] = costumeColor._colorize[0];
costumeSpriteColor->_colorize[1] = costumeColor._colorize[1];
costumeSpriteColor->_colorize[2] = costumeColor._colorize[2];
costumeSpriteColor->_colorize[3] = costumeColor._colorize[3];
}
costumePos.x = costumeOffsetX + position->x;
costumePos.y = costumeOffsetY + (this->_renderPosition).y;
if (this->_bombCostumesSprites[costumeIndex]._loaded != 0) {
costumeAnimState = &this->_bombCostumesSprites[costumeIndex]._animState;
pAVar2 = &this->_bombCostumesSprites[costumeIndex]._overlayAnimState;
if (this->_bombCostumesSprites[costumeIndex]._overlayRenderFirst == 0) {
AnimationState::Render(costumeAnimState,&costumePos,&g_vectorZero,&g_vectorZero);
}
else {
AnimationState::Render(pAVar2,&costumePos,&g_vectorZero,&g_vectorZero);
pAVar2 = costumeAnimState;
}
AnimationState::Render(pAVar2,&costumePos,&g_vectorZero,&g_vectorZero);
}
}
if ((costumeIndex == 0) && ((this->_sprite)._loaded != 0)) {
if ((this->_sprite)._overlayRenderFirst == 0) {
AnimationState::Render(&(this->_sprite)._animState,position,&g_vectorZero,&g_vectorZero)
;
pAVar2 = &(this->_sprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(this->_sprite)._overlayAnimState,position,&g_vectorZero,&g_vectorZero);
pAVar2 = &(this->_sprite)._animState;
}
AnimationState::Render(pAVar2,position,&g_vectorZero,&g_vectorZero);
}
costumeIndex = costumeIndex + 1;
} while (costumeIndex < 5);
FUN_00862060(this,offset);
return;
}
ANM2::Render(&this->_sprite,position,&g_vectorZero,&g_vectorZero);
FUN_00862060(this,offset);
}
return;
}
// 006a6f10
void Entity_Bomb::update_sparks()
{
int iVar1;
uint32_t uVar2;
uint8_t bVar3;
BitSet128 *pBVar4;
uint8_t ******ppppppbVar5;
uint32_t *appendResult;
uint8_t ******ppppppbVar6;
void *pvVar7;
BitSet128 *text;
std_string *psVar8;
LayerState *layer;
Entity_Bomb *pEVar9;
std_string *psVar10;
uint8_t extraout_CL;
uint8_t extraout_CL_00;
int costumeListBytes;
Entity_Bomb *extraout_ECX;
Entity_Bomb *pEVar11;
uint32_t uVar12;
uint8_t *layerIdx;
ANM2 *costumeSprite;
int costumeListBytes;
BitSet128 *pBVar14;
float fVar15;
float scaleY;
BitSet128 maskAnd;
uint32_t costumeEntryIdx;
ANM2 *costumeIter;
BitSet128 *costumeEntry;
uint32_t *entryPathCapacity;
uint8_t local_1e0 [8];
std_string *searchPathsEnd;
std_string *local_1d4;
Sprite *local_1cc;
uint32_t slot;
ANM2 *local_1c4;
float local_1c0;
std_string *local_1bc;
std_string *local_1b8;
uint32_t *local_1b4;
Entity_Bomb *bomb;
char isAnimPlaying;
void *nameWithSuffix;
uint32_t uStack_1a4;
uint32_t uStack_1a0;
uint32_t uStack_19c;
uint64_t nameWithSuffixSizeCapacity;
std_string tmpPath;
std_string joinedPath;
uint8_t ******savedAnimName [4];
int savedAnimNameSize;
uint32_t savedAnimNameCapacity;
void *spritePath;
char acStack_144 [4];
char acStack_140 [4];
char acStack_13c [4];
uint32_t spritePathSize;
uint32_t spritePathCapacity;
void *baseName [4];
uint32_t baseNameSize;
uint32_t baseNameCapacity;
uint8_t ******srcCopy;
uint32_t uStack_114;
uint32_t uStack_110;
uint32_t uStack_10c;
uint32_t *srcCopySize;
uint32_t srcCopyCapacity;
uint8_t ******sizeSuffix [4];
uint32_t sizeSuffixSize;
uint32_t sizeSuffixCapacity;
std_string tmpString;
std_string costumePaths [5];
BitSet128 searchDirs;
int searchDir0Size;
uint8_t searchDir1 [16];
int searchDir1Size;
uint32_t stackCookie;
uint8_t *puStack_20;
void *savedExceptionList;
uint8_t *puStack_18;
uint32_t ehState;
Manager *manager;
uint32_t *srcLength;
puStack_20 = searchDir1 + 0x38;
ehState = 0xffffffff;
puStack_18 = &LAB_00afa2e9;
savedExceptionList = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((searchDir1 + 0x2c));
ExceptionList = &savedExceptionList;
costumeSprite = this->_bombCostumesSprites;
this->_hasCostumes = 0;
this->_loadCostumes = 0;
costumeListBytes = 5;
costumeIter = costumeSprite;
bomb = this;
do {
if (costumeSprite->_loaded != 0) {
ANM2::Reset(costumeSprite);
}
manager = g_manager;
costumeSprite = costumeSprite + 1;
costumeListBytes = costumeListBytes + -1;
} while (costumeListBytes != 0);
fVar15 = (float)bomb->_variant;
local_1c0 = fVar15;
msvc::set<int>::find_node(local_1e0 + 4,&local_1c0);
pEVar9 = bomb;
if ((local_1d4->_buf[0xd] != '\0') || (psVar8 = local_1d4, GHIDRA_INT(fVar15) < GHIDRA_INT(local_1d4->_size))) {
psVar8 = *GHIDRA_CAST<std_string **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x2a514))));
}
if ((psVar8 == *GHIDRA_CAST<std_string **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x2a514))))) ||
(local_1cc = GHIDRA_CAST<Sprite *>(&psVar8->_capacity), local_1cc == GHIDRA_CAST<Sprite *>(0x0))) {
if ((fVar15 == 1.4013e-44) ||
(((fVar15 == 8.40779e-45 || (fVar15 == 1.4013e-45)) || (fVar15 == 2.8026e-45)))) {
fVar15 = bomb->_scale / 1.5;
}
else {
fVar15 = bomb->_scale;
}
scaleY = fVar15 * g_vectorOne.y;
(bomb->_sprite)._scale.x = fVar15 * g_vectorOne.x;
(bomb->_sprite)._scale.y = scaleY;
ExceptionList = savedExceptionList;
return;
}
pvVar7 = (bomb->_sprite)._animState._animData;
if (pvVar7 == (void *)0x0) {
savedAnimNameCapacity = 0xf;
savedAnimNameSize = 0;
savedAnimName[0] = GHIDRA_CAST<uint8_t ******>(0x0);
pvVar7 = (void *)0x0;
}
else {
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(savedAnimName))))->msvc::string::string(pvVar7);
pvVar7 = (pEVar9->_sprite)._animState._animData;
}
local_1c0 = (pEVar9->_sprite)._animState._animFrame;
if ((pvVar7 == (void *)0x0) ||
(isAnimPlaying = '\x01', (pEVar9->_sprite)._animState._isPlaying == 0)) {
isAnimPlaying = '\0';
}
sizeSuffixCapacity = 0xf;
fVar15 = pEVar9->_scale;
if (0.5 < fVar15) {
if (0.75 < fVar15) {
bVar3 = 0x32;
if (1.1 < fVar15) {
bVar3 = 0x33;
}
}
else {
bVar3 = 0x31;
}
sizeSuffix[0] = GHIDRA_CAST<uint8_t ******>(GHIDRA_UINT(bVar3));
}
else {
sizeSuffix[0] = GHIDRA_CAST<uint8_t ******>(0x30);
}
local_1c4 = &pEVar9->_sprite;
(pEVar9->_sprite)._scale.x = g_vectorOne.x;
sizeSuffixSize = 1;
(pEVar9->_sprite)._scale.y = g_vectorOne.y;
spritePathSize = 0;
spritePathCapacity = 0xf;
spritePath = (void *)0x0;
ehState = 2;
_eh_vector_constructor_iterator_(costumePaths,0x18,5,FUN_0040c380,msvc::string::_Tidy_deallocate);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 3;
_eh_vector_constructor_iterator_(&searchDirs,0x18,2,FUN_0040c380,msvc::string::_Tidy_deallocate);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 4;
costumeEntryIdx = 0;
costumeListBytes = *GHIDRA_CAST<int *>((local_1cc->_filename)._buf);
costumeListBytes = *GHIDRA_CAST<int *>(((local_1cc->_filename)._buf + 4)) - costumeListBytes;
iVar1 = costumeListBytes >> 0x1f;
if (costumeListBytes / 0xe0 + iVar1 != iVar1) {
local_1bc = GHIDRA_CAST<std_string *>(&pEVar9->_tearFlags);
do {
pBVar14 = GHIDRA_CAST<BitSet128 *>((costumeEntryIdx * 0xe0 + costumeListBytes));
costumeEntry = pBVar14;
pBVar4 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(local_1e0),GHIDRA_CAST<BitSet128 *>(local_1bc),pBVar14);
if (((GHIDRA_INT(pBVar4->_l) == GHIDRA_INT(pBVar14->_l)) &&
(*GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar4->_l) + 4)) == *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar14->_l) + 4)))) &&
((GHIDRA_INT(pBVar4->_h) == GHIDRA_INT(pBVar14->_h) &&
(((*GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar4->_h) + 4)) == *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar14->_h) + 4)) &&
(pBVar4 = BitSet128::operator_and(&maskAnd,GHIDRA_CAST<BitSet128 *>(local_1bc),pBVar14 + 1),
GHIDRA_INT(pBVar4->_l) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar4->_l) + 4)) == 0)) &&
(GHIDRA_INT(pBVar4->_h) == 0 && *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar4->_h) + 4)) == 0)))))) {
if (GHIDRA_INT(pBVar14[3]._l) != 0) {
local_1b8 = GHIDRA_CAST<std_string *>((pBVar14 + 2));
srcLength = *GHIDRA_CAST<uint32_t **>(&pBVar14[3]._l);
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pBVar14[3]._l) + 4))) {
local_1b8 = *GHIDRA_CAST<std_string **>(local_1b8->_buf);
}
if (&DAT_0000000f < srcLength) {
uVar12 = GHIDRA_UINT(srcLength) | 0xf;
if (0x7fffffff < uVar12) {
uVar12 = 0x7fffffff;
}
srcCopy = msvc::_Allocate(uVar12 + 1);
memcpy(srcCopy,local_1b8,(size_t)(GHIDRA_INT(srcLength) + 1));
}
else {
srcCopy = *GHIDRA_CAST<uint8_t *******>(local_1b8->_buf);
uStack_114 = *GHIDRA_CAST<uint32_t *>((local_1b8->_buf + 4));
uStack_110 = *GHIDRA_CAST<uint32_t *>((local_1b8->_buf + 8));
uStack_10c = *GHIDRA_CAST<uint32_t *>((local_1b8->_buf + 0xc));
uVar12 = 0xf;
}
ppppppbVar6 = srcCopy;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
local_1b4 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(srcLength) + -5));
tmpString._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (void *)0x0;
srcCopySize = srcLength;
srcCopyCapacity = uVar12;
if (srcLength < local_1b4) {
LAB_006a7eb2:
tmpString._capacity = 0xf;
tmpString._size = 0;
tmpString._buf[0] = '\0';
tmpString._buf[1] = '\0';
tmpString._buf[2] = '\0';
tmpString._buf[3] = '\0';
/* WARNING: Subroutine does not return */
FUN_00499950();
}
ppppppbVar5 = GHIDRA_CAST<uint8_t ******>(&srcCopy);
if (0xf < uVar12) {
ppppppbVar5 = srcCopy;
}
tmpString._size = 5;
memmove(&tmpString,GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_1b4) + GHIDRA_INT(ppppppbVar5))),5);
tmpString._buf[5] = '\0';
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 6;
ppppppbVar5 = GHIDRA_CAST<uint8_t ******>(&srcCopy);
if (0xf < uVar12) {
ppppppbVar5 = ppppppbVar6;
}
baseNameSize = 0;
baseNameCapacity = 0xf;
baseName[0] = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(baseName))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(ppppppbVar5),GHIDRA_UINT(local_1b4));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(sizeSuffix);
if (0xf < sizeSuffixCapacity) {
ppppppbVar6 = sizeSuffix[0];
}
appendResult = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(baseName))))->msvc::string::append(GHIDRA_CAST<uint8_t *>(ppppppbVar6),sizeSuffixSize);
nameWithSuffix = (void *)*appendResult;
uStack_1a4 = appendResult[1];
uStack_1a0 = appendResult[2];
uStack_19c = appendResult[3];
nameWithSuffixSizeCapacity = *GHIDRA_CAST<uint64_t *>((appendResult + 4));
appendResult[4] = 0;
appendResult[5] = 0xf;
*GHIDRA_CAST<uint8_t *>(appendResult) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 8;
(GHIDRA_CAST<msvc::string *>((joinedPath._buf)))->msvc::string::concat_move(GHIDRA_INT(local_1c0),&nameWithSuffix,&tmpString);
if (0xf < spritePathCapacity) {
uVar12 = spritePathCapacity + 1;
pvVar7 = spritePath;
if (0xfff < uVar12) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(spritePath) + -4);
uVar12 = spritePathCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(spritePath) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
spritePath = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)joinedPath._buf)) + 0x0)));
acStack_144[0] = joinedPath._buf[4];
acStack_144[1] = joinedPath._buf[5];
acStack_144[2] = joinedPath._buf[6];
acStack_144[3] = joinedPath._buf[7];
acStack_140[0] = joinedPath._buf[8];
acStack_140[1] = joinedPath._buf[9];
acStack_140[2] = joinedPath._buf[10];
acStack_140[3] = joinedPath._buf[0xb];
acStack_13c[0] = joinedPath._buf[0xc];
acStack_13c[1] = joinedPath._buf[0xd];
acStack_13c[2] = joinedPath._buf[0xe];
acStack_13c[3] = joinedPath._buf[0xf];
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
spritePathSize = joinedPath._size;
spritePathCapacity = joinedPath._capacity;
if (0xf < (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nameWithSuffixSizeCapacity)) + 0x4)))) {
uVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nameWithSuffixSizeCapacity)) + 0x4))) + 1;
pvVar7 = nameWithSuffix;
if (0xfff < uVar12) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(nameWithSuffix) + -4);
uVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(nameWithSuffixSizeCapacity)) + 0x4))) + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(nameWithSuffix) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 6;
if (0xf < baseNameCapacity) {
uVar12 = baseNameCapacity + 1;
pvVar7 = baseName[0];
if (0xfff < uVar12) {
pvVar7 = *(void **)(GHIDRA_INT(baseName[0]) + -4);
uVar12 = baseNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(baseName[0]) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
baseNameSize = 0;
baseNameCapacity = 0xf;
baseName[0] = (void *)(GHIDRA_UINT(baseName[0]) & 0xffffff00);
if (0xf < tmpString._capacity) {
uVar12 = tmpString._capacity + 1;
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar12 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 4;
if (0xf < srcCopyCapacity) {
uVar12 = srcCopyCapacity + 1;
ppppppbVar6 = srcCopy;
if (0xfff < uVar12) {
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(srcCopy[-1]);
uVar12 = srcCopyCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(srcCopy) + (-4 - GHIDRA_INT(ppppppbVar6)))))
goto LAB_006a7e25;
}
operator_delete(ppppppbVar6,uVar12);
}
pBVar14 = costumeEntry;
}
local_1b8 = costumePaths;
slot = 0;
entryPathCapacity = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pBVar14[4]._h) + 4));
do {
srcLength = GHIDRA_CAST<uint32_t *>(entryPathCapacity[-1]);
if (srcLength != GHIDRA_CAST<uint32_t *>(0x0)) {
local_1b4 = entryPathCapacity + -5;
if (0xf < *entryPathCapacity) {
local_1b4 = GHIDRA_CAST<uint32_t *>(*local_1b4);
}
if (&DAT_0000000f < srcLength) {
uVar12 = GHIDRA_UINT(srcLength) | 0xf;
if (0x7fffffff < uVar12) {
uVar12 = 0x7fffffff;
}
srcCopy = msvc::_Allocate(uVar12 + 1);
memcpy(srcCopy,local_1b4,(size_t)(GHIDRA_INT(srcLength) + 1));
}
else {
srcCopy = GHIDRA_CAST<uint8_t ******>(*local_1b4);
uStack_114 = local_1b4[1];
uStack_110 = local_1b4[2];
uStack_10c = local_1b4[3];
uVar12 = 0xf;
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 9;
tmpString._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (void *)0x0;
srcCopySize = srcLength;
srcCopyCapacity = uVar12;
if (srcLength < GHIDRA_CAST<uint32_t *>((GHIDRA_INT(srcLength) + -5))) goto LAB_006a7eb2;
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(&srcCopy);
if (0xf < uVar12) {
ppppppbVar6 = srcCopy;
}
tmpString._size = 5;
memmove(&tmpString,GHIDRA_CAST<uint8_t *>((GHIDRA_INT(srcLength) + -5 + GHIDRA_INT(ppppppbVar6))),5);
tmpString._buf[5] = '\0';
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 10;
baseNameSize = 0;
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(&srcCopy);
if (0xf < uVar12) {
ppppppbVar6 = srcCopy;
}
baseNameCapacity = 0xf;
baseName[0] = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(baseName))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(ppppppbVar6),GHIDRA_UINT((GHIDRA_INT(srcLength) + -5)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xb;
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(sizeSuffix);
if (0xf < sizeSuffixCapacity) {
ppppppbVar6 = sizeSuffix[0];
}
pvVar7 = (GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(baseName))))->msvc::string::append(GHIDRA_CAST<uint8_t *>(ppppppbVar6),sizeSuffixSize);
FUN_00417100(pvVar7);
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),0xc);
(GHIDRA_CAST<msvc::string *>((joinedPath._buf)))->msvc::string::concat_move(GHIDRA_INT(local_1c0),&tmpPath,&tmpString);
psVar8 = local_1b8;
if (local_1b8 != &joinedPath) {
(GHIDRA_CAST<msvc::string *>((local_1b8->_buf)))->msvc::string::_Tidy_deallocate();
uVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(joinedPath._buf)) + 0x0)));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(joinedPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(joinedPath._buf)) + 0x0))) & 0xffffff00;
*GHIDRA_CAST<uint32_t *>(psVar8->_buf) = uVar2;
*GHIDRA_CAST<uint32_t *>((psVar8->_buf + 4)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(joinedPath._buf)) + 0x4)));
*GHIDRA_CAST<uint32_t *>((psVar8->_buf + 8)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(joinedPath._buf)) + 0x8)));
*GHIDRA_CAST<uint32_t *>((psVar8->_buf + 0xc)) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(joinedPath._buf)) + 0xc)));
psVar8->_size = joinedPath._size;
psVar8->_capacity = joinedPath._capacity;
joinedPath._size = 0;
joinedPath._capacity = 0xf;
}
(GHIDRA_CAST<msvc::string *>((joinedPath._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 10;
if (0xf < baseNameCapacity) {
uVar12 = baseNameCapacity + 1;
pvVar7 = baseName[0];
if (0xfff < uVar12) {
pvVar7 = *(void **)(GHIDRA_INT(baseName[0]) + -4);
uVar12 = baseNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(baseName[0]) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 9;
baseNameSize = 0;
baseNameCapacity = 0xf;
baseName[0] = (void *)(GHIDRA_UINT(baseName[0]) & 0xffffff00);
if (0xf < tmpString._capacity) {
uVar12 = tmpString._capacity + 1;
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar12 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 4;
if (0xf < srcCopyCapacity) {
uVar12 = srcCopyCapacity + 1;
ppppppbVar6 = srcCopy;
if (0xfff < uVar12) {
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(srcCopy[-1]);
uVar12 = srcCopyCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(srcCopy) + (-4 - GHIDRA_INT(ppppppbVar6)))))
goto LAB_006a7e25;
}
operator_delete(ppppppbVar6,uVar12);
}
local_1b8 = psVar8;
}
slot = slot + 1;
entryPathCapacity = entryPathCapacity + 6;
local_1b8 = local_1b8 + 1;
} while (slot < 5);
pBVar14 = &searchDirs;
pBVar4 = costumeEntry + 0xb;
local_1b4 = GHIDRA_CAST<uint32_t *>(0x2);
do {
uVar12 = GHIDRA_UINT(pBVar4[1]._l);
if ((uVar12 != 0) && (pBVar14 != pBVar4)) {
text = pBVar4;
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pBVar4[1]._l) + 4))) {
text = *GHIDRA_CAST<BitSet128 **>(&pBVar4->_l);
}
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(pBVar14))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(text),uVar12);
}
pBVar4 = GHIDRA_CAST<BitSet128 *>(&pBVar4[1]._h);
pBVar14 = GHIDRA_CAST<BitSet128 *>(&pBVar14[1]._h);
local_1b4 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_1b4) + -1));
} while (local_1b4 != GHIDRA_CAST<uint32_t *>(0x0));
}
costumeEntryIdx = costumeEntryIdx + 1;
costumeListBytes = *GHIDRA_CAST<int *>((local_1cc->_filename)._buf);
} while (costumeEntryIdx < GHIDRA_UINT(((*GHIDRA_CAST<int *>(((local_1cc->_filename)._buf + 4)) - costumeListBytes) / 0xe0)));
}
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1e0)) + 0x4))) = 0;
searchPathsEnd = GHIDRA_CAST<std_string *>(0x0);
local_1d4 = GHIDRA_CAST<std_string *>(0x0);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd;
if (searchDir0Size == 0) {
LAB_006a794a:
psVar8 = local_1d4;
psVar10 = searchPathsEnd;
if (searchDir1Size != 0) {
if (searchPathsEnd == local_1d4) {
vector_string_emplace_reallocate(local_1e0 + 4,searchPathsEnd,searchDir1);
psVar8 = local_1d4;
}
else {
(GHIDRA_CAST<msvc::string *>((searchPathsEnd->_buf)))->msvc::string::string(searchDir1);
searchPathsEnd = psVar10 + 1;
}
}
}
else {
psVar8 = GHIDRA_CAST<std_string *>(0x0);
if (searchDir1Size != 0) {
psVar8 = GHIDRA_CAST<std_string *>(FUN_00694120(searchDir1));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xe;
vector_string_emplace_reallocate_move(local_1e0 + 4,GHIDRA_CAST<std_string *>(0x0),psVar8);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd;
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
goto LAB_006a794a;
}
}
psVar10 = searchPathsEnd;
if (searchDir0Size != 0) {
if (searchPathsEnd == psVar8) {
vector_string_emplace_reallocate(local_1e0 + 4,searchPathsEnd,&searchDirs);
}
else {
(GHIDRA_CAST<msvc::string *>((searchPathsEnd->_buf)))->msvc::string::string(&searchDirs);
searchPathsEnd = psVar10 + 1;
}
}
if (spritePathSize != 0) {
ANM2::Load(local_1c4,GHIDRA_CAST<std_string *>(&spritePath),0);
pEVar9 = bomb;
layerIdx = GHIDRA_CAST<uint8_t *>(0x0);
bVar3 = extraout_CL;
if ((bomb->_sprite)._layerCount != 0) {
do {
layer = ANM2::GetLayer(&pEVar9->_sprite,layerIdx);
if (layer->_layerData == (void *)0x0) {
tmpString._size = 0;
tmpString._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(&s_empty,0);
}
else {
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::string((void *)(GHIDRA_INT(layer->_layerData) + 0x20));
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xf;
resolve_resource_path(&tmpPath,&tmpString,local_1e0 + 4);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x11;
if (0xf < tmpString._capacity) {
uVar12 = tmpString._capacity + 1;
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar12 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pEVar9->_sprite))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(layerIdx),&tmpPath);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd;
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
layerIdx = layerIdx + 1;
bVar3 = extraout_CL_00;
} while (layerIdx < GHIDRA_CAST<uint8_t *>((pEVar9->_sprite)._layerCount));
}
ANM2::LoadGraphics(local_1c4,bVar3);
layer = ANM2::GetLayer(local_1c4,GHIDRA_CAST<uint8_t *>("sparks"));
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
layer->_bitflags = layer->_bitflags | 1;
}
}
local_1bc = costumePaths;
local_1c4 = GHIDRA_CAST<ANM2 *>(0x0);
do {
psVar8 = local_1bc;
costumeSprite = costumeIter;
if (local_1bc->_size != 0) {
ANM2::Load(costumeIter,local_1bc,0);
layerIdx = GHIDRA_CAST<uint8_t *>(0x0);
pEVar9 = bomb;
pEVar11 = extraout_ECX;
if (bomb->_bombCostumesSprites[0]._layerCount != 0) {
do {
local_1cc = GHIDRA_CAST<Sprite *>(pEVar9->_bombCostumesSprites);
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(local_1cc),layerIdx);
if (layer->_layerData == (void *)0x0) {
tmpString._size = 0;
tmpString._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::assign(&s_empty,0);
}
else {
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::string((void *)(GHIDRA_INT(layer->_layerData) + 0x20));
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x12;
resolve_resource_path(&tmpPath,&tmpString,local_1e0 + 4);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x14;
if (0xf < tmpString._capacity) {
uVar12 = tmpString._capacity + 1;
pvVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar12) {
pvVar7 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar12 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
(GHIDRA_CAST<Sprite *>((local_1cc)))->Sprite::ReplaceSpritesheet(GHIDRA_INT(layerIdx),&tmpPath);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd;
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
layerIdx = layerIdx + 1;
pEVar9 = GHIDRA_CAST<Entity_Bomb *>(((&bomb->_sprite)[GHIDRA_INT((layerIdx + -1))]._color._offset + 1));
} while (layerIdx < GHIDRA_CAST<uint8_t *>(pEVar9->_bombCostumesSprites[0]._layerCount));
pEVar11 = bomb;
psVar8 = local_1bc;
}
costumeSprite = costumeIter;
ANM2::LoadGraphics(costumeIter,(uint8_t)pEVar11);
psVar10 = &costumeSprite->_animDefaultName;
if (0xf < (costumeSprite->_animDefaultName)._capacity) {
psVar10 = *GHIDRA_CAST<std_string **>(psVar10->_buf);
}
bVar3 = ANM2::SetAnimation(costumeSprite,GHIDRA_CAST<uint8_t *>(psVar10),1);
if (bVar3 != 0) {
AnimationState::Rewind(&costumeSprite->_animState);
(costumeSprite->_animState)._isPlaying = 1;
}
bomb->_hasCostumes = 1;
}
pEVar9 = bomb;
local_1c4 = GHIDRA_CAST<ANM2 *>(((local_1c4->_filename)._buf + 1));
local_1bc = psVar8 + 1;
costumeIter = costumeSprite + 1;
} while (local_1c4 < GHIDRA_CAST<ANM2 *>(&DAT_00000005));
if (savedAnimNameSize != 0) {
if (isAnimPlaying == '\0') {
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(savedAnimName);
if (0xf < savedAnimNameCapacity) {
ppppppbVar6 = savedAnimName[0];
}
bVar3 = ANM2::SetAnimation(&bomb->_sprite,GHIDRA_CAST<uint8_t *>(ppppppbVar6),1);
if (((bVar3 != 0) && ((pEVar9->_sprite)._animState._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,local_1c0),
(pEVar9->_sprite)._animState._animData != (void *)0x0)) {
(pEVar9->_sprite)._animState._isPlaying = 0;
}
}
else {
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(savedAnimName);
if (0xf < savedAnimNameCapacity) {
ppppppbVar6 = savedAnimName[0];
}
bVar3 = ANM2::SetAnimation(&bomb->_sprite,GHIDRA_CAST<uint8_t *>(ppppppbVar6),1);
if (bVar3 != 0) {
AnimationState::Rewind(&(pEVar9->_sprite)._animState);
(pEVar9->_sprite)._animState._isPlaying = 1;
}
if ((pEVar9->_sprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,local_1c0);
}
}
}
msvc::vector<msvc::string>::_Tidy();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 3;
_eh_vector_destructor_iterator_(&searchDirs,0x18,2,msvc::string::_Tidy_deallocate);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 2;
_eh_vector_destructor_iterator_(costumePaths,0x18,5,msvc::string::_Tidy_deallocate);
if (0xf < spritePathCapacity) {
uVar12 = spritePathCapacity + 1;
pvVar7 = spritePath;
if (0xfff < uVar12) {
pvVar7 = *(void **)(GHIDRA_CAST<char *>(spritePath) + -4);
uVar12 = spritePathCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(spritePath) + (-4 - GHIDRA_INT(pvVar7))))) goto LAB_006a7e25;
}
operator_delete(pvVar7,uVar12);
}
spritePathSize = 0;
spritePathCapacity = 0xf;
spritePath = (void *)(GHIDRA_UINT(spritePath) & 0xffffff00);
if (0xf < sizeSuffixCapacity) {
uVar12 = sizeSuffixCapacity + 1;
ppppppbVar6 = sizeSuffix[0];
if (0xfff < uVar12) {
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(sizeSuffix[0][-1]);
uVar12 = sizeSuffixCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(sizeSuffix[0]) + (-4 - GHIDRA_INT(ppppppbVar6))))) goto LAB_006a7e25;
}
operator_delete(ppppppbVar6,uVar12);
}
if (0xf < savedAnimNameCapacity) {
uVar12 = savedAnimNameCapacity + 1;
ppppppbVar6 = savedAnimName[0];
if (0xfff < uVar12) {
ppppppbVar6 = GHIDRA_CAST<uint8_t ******>(savedAnimName[0][-1]);
uVar12 = savedAnimNameCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(savedAnimName[0]) + (-4 - GHIDRA_INT(ppppppbVar6))))) {
LAB_006a7e25:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ppppppbVar6,uVar12);
}
ExceptionList = savedExceptionList;
return;
}