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